Stellarator-Tools
|
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"
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. | |
Contains the main rotutines for LGRID.
enum limiter_type |
Keyword token types.
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.
[in,out] | file | Input file stream to seach for next keyword. |
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.
[in] | argc | Number of command line arguments. |
[in] | argv | Arrays of argument strings. |
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.
[in,out] | file | Input file stream read limiter from. |
[in,out] | limiters | Limiter vertex data. |
[in] | type | Limiter type. |
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.
[in] | file_name | Limiter type. |
const std::string new_limiter_deg = "new_limiter_deg" |
Limiter plane keyword specified in degrees.
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.