XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
velocity_grid.hpp
Go to the documentation of this file.
1 #ifndef VELOCITY_GRID_HPP
2 #define VELOCITY_GRID_HPP
3 
4 // Specifies the dimensions of the velocity grid
5 struct VelocityGrid{
6  int nvp;
7  double vp_max;
8  double dvp;
9 
10  int nmu;
11  double smu_max;
12  double dsmu;
13 
14  double inv_mu0_factor = 1.0/3.0;
15 
16  int nvr;
17  int nvz;
18 
20 
22 
24  // Read in basic velocity grid inputs
25  nlr.use_namelist("f0_param");
26  nvp = nlr.get<int>("f0_nvp", 15);
27  nmu = nlr.get<int>("f0_nmu", 31);
28  vp_max = nlr.get<double>("f0_vp_max", 3.0);
29  smu_max = nlr.get<double>("f0_smu_max", 3.0);
30 
31  // Derived values
32  dvp = vp_max/nvp;
33  dsmu = smu_max/nmu;
34  nvr = nmu+1;
35  nvz = nvp*2+1;
36 
37  // Pseudo inverse
38  pseudo_inv_on = nlr.get<bool>("f0_velocity_interp_use_pseudo_inv", false);
39  if (pseudo_inv_on){
40  element_order = nlr.get<int>("f0_velocity_interp_pseudo_inv_order", 2);
41 #ifdef NO_PETSC
42  exit_XGC("\nError: Cannot run with f0_velocity_interp_use_pseudo_inv = true without using PETSc.\n");
43 #endif
44  }else{
45  element_order = 1;
46  }
47  }
48 };
49 #endif
int element_order
velocity grid finite element order: 1 (linear) or 2 (quadratic)
Definition: velocity_grid.hpp:19
double smu_max
max mu
Definition: velocity_grid.hpp:11
int nmu
n points in mu (not including zero)
Definition: velocity_grid.hpp:10
int nvp
n points in parallel velocity (not including zero)
Definition: velocity_grid.hpp:6
T get(const string &param, const T default_val, int val_ind=0)
Definition: NamelistReader.hpp:353
bool pseudo_inv_on
Whether pseudo-inverse interpolation is used in velocity space.
Definition: velocity_grid.hpp:21
Definition: velocity_grid.hpp:5
Definition: NamelistReader.hpp:163
int nvr
full grid size (including zero)
Definition: velocity_grid.hpp:16
void use_namelist(const string &namelist)
Definition: NamelistReader.hpp:322
double vp_max
max parallel velocity
Definition: velocity_grid.hpp:7
void exit_XGC(std::string msg)
Definition: globals.hpp:26
VelocityGrid(NLReader::NamelistReader &nlr)
Definition: velocity_grid.hpp:23
double dsmu
grid spacing in mu
Definition: velocity_grid.hpp:12
double inv_mu0_factor
Set value of lowest mu in grid –&gt; 1/mu0_factor.
Definition: velocity_grid.hpp:14
int nvz
full grid size (including negative and zero)
Definition: velocity_grid.hpp:17
double dvp
grid spacing in parallel velocity
Definition: velocity_grid.hpp:8