V3FIT
Enumerations | Functions | Variables
main.cpp File Reference

Contains the main rotutines for LGRID. More...

#include <algorithm>
#include <array>
#include <cmath>
#include <fstream>
#include <iostream>
#include <map>
#include <netcdf.h>
#include <vector>
#include "vertex.hpp"

Go to the source code of this file.

Enumerations

enum  limiter_type { degrees, radians, eof }
 

Functions

const limiter_type get_next_keyword (std::ifstream &file)
 Finds the next keyword. More...
 
void parse_limiter (std::ifstream &file, std::map< const double, std::vector< vertex * > > &limiters, const limiter_type type)
 Parses a limiter specification. More...
 
std::map< const double, std::vector< vertex * > > parse_limiter_file (const std::string &file_name)
 Parses a limiter specification. More...
 
int main (int argc, const char *argv[])
 Main program. More...
 

Variables

const std::string new_limiter_deg = "new_limiter_deg"
 Limiter plane keyword specified in degrees. More...
 
const std::string new_limiter_rad = "new_limiter_rad"
 Limiter plane keyword specified in radians.
 

Detailed Description

Contains the main rotutines for LGRID.

Definition in file main.cpp.

Enumeration Type Documentation

◆ limiter_type

Keyword token types.

  • degrees Limiter defined in degrees.
  • radians Limiter defined in radians.
  • eof End of file reached.

Definition at line 99 of file main.cpp.

Function Documentation

◆ get_next_keyword()

const limiter_type get_next_keyword ( std::ifstream &  file)

Finds the next keyword.

Reads the input file one file at a time searching for the next keyword until the end of the file is reached.

Parameters
[in,out]fileInput file stream to seach for next keyword.
Returns
An limiter_type token.

Definition at line 114 of file main.cpp.

◆ main()

int main ( int  argc,
const char *  argv[] 
)

Main program.

Parses the limter file. Computes distances to the nearest limiter element. Creates the lgrid netcdf file. This program expects 7 arguments in the following order.

  • Filename to parse define the limiter.
  • Starting radial position to define the radial grid.
  • Radial grid spacing.
  • Number of radial grid points.
  • Starting vertical position to define the vertical grid.
  • Vertical grid spacing.
  • Number of vertical grid points.
Parameters
[in]argcNumber of command line arguments.
[in]argvArrays of argument strings.
Returns
0 if completed.

Definition at line 220 of file main.cpp.

◆ parse_limiter()

void parse_limiter ( std::ifstream &  file,
std::map< const double, std::vector< vertex * > > &  limiters,
const limiter_type  type 
)

Parses a limiter specification.

Limiters are defined by the number of phi planes this plasma facing component is asscoiated with. This is followed by a list of each phi. A collection of R, Z values defing the crossection is read until two doubles could not be read or the file ends.

Parameters
[in,out]fileInput file stream read limiter from.
[in,out]limitersLimiter vertex data.
[in]typeLimiter type.

Definition at line 139 of file main.cpp.

◆ parse_limiter_file()

std::map<const double, std::vector<vertex *> > parse_limiter_file ( const std::string &  file_name)

Parses a limiter specification.

Opens a file, loops through all the keywords and parses the limiter file.

Parameters
[in]file_nameLimiter type.
Returns
An limiter_type token.

Definition at line 186 of file main.cpp.

Variable Documentation

◆ new_limiter_deg

const std::string new_limiter_deg = "new_limiter_deg"

Limiter plane keyword specified in degrees.

Author
Mark Cianciosa on 10/12/15.

LGRID is code for generating responce files for any arbitary shaped limiter structure. This creates a grid a distances to the nearest plasma facing component in a specified phi plane.

Definition at line 91 of file main.cpp.