XGC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
magnetic_equil_files.hpp
Go to the documentation of this file.
1 #ifndef MAGNETIC_EQUIL_FILES_HPP
2 #define MAGNETIC_EQUIL_FILES_HPP
3 
4 #include "space_settings.hpp"
5 #include "NamelistReader.hpp"
6 #include "globals.hpp"
7 #include "rz_bounds.hpp"
8 #include "file_reader.hpp"
9 
11  using Ptr = std::shared_ptr<MagneticEquilFiles>;
12 
13  virtual ~MagneticEquilFiles() = default;
14 
16 };
17 
21  int mp;
22  View<double*, HostType> rgrid;
23  View<double*, HostType> zgrid;
24  View<double*, HostType> phigrid;
25  View<double***, CLayout, HostType> psi;
26  View<double***, CLayout, HostType> VMEC_angle;
27  View<double***, CLayout, HostType> PEST_angle;
28  View<double***, CLayout, HostType> Br;
29  View<double***, CLayout, HostType> Bz;
30  View<double***, CLayout, HostType> Bphi;
31 
32  void read_eq_dims(FileReader& file_reader, int& mr, int& mz, int& mphi, int& wedge_n);
33 
34  void read_eq(FileReader& file_reader, int iphi);
35 
36  MagneticEquilFiles3D(const std::string& eq_filebase);
37 
39 };
40 
43  double axis_r;
44  double axis_z;
45  double axis_b;
46  double x_psi;
47  double x_r;
48  double x_z;
49  View<double*, CLayout, HostType> rgrid;
50  View<double*, CLayout, HostType> zgrid;
51  View<double*, CLayout, HostType> psi_grid;
52  View<double*, CLayout, HostType> I;
53  View<double**, CLayout, HostType> psi_rz;
54 
55  void read_eq_dims(FileReader& file_reader, int& mr, int& mz, int& mpsi);
56 
57  void read_eq(FileReader& file_reader);
58 
59  MagneticEquilFiles2D(bool read_m3dc1, const std::string& eq_filename);
60 
62 
64 };
65 
66 #endif
int mp
Number of planes (not used but written to the output for diagnostics)
Definition: magnetic_equil_files.hpp:21
Definition: magnetic_equil_files.hpp:10
View< double *, HostType > phigrid
Uniform grid in phi.
Definition: magnetic_equil_files.hpp:24
View< double ***, CLayout, HostType > Bphi
phi magnetic field component on phi-z-r grid
Definition: magnetic_equil_files.hpp:30
View< double ***, CLayout, HostType > Bz
z magnetic field component on phi-z-r grid
Definition: magnetic_equil_files.hpp:29
virtual ~MagneticEquilFiles()=default
int periodicity
Toroidal periodicity or torus wedge number for a tokamak (not used but written to the output for diag...
Definition: magnetic_equil_files.hpp:20
View< double *, HostType > zgrid
Uniform grid in z.
Definition: magnetic_equil_files.hpp:23
double axis_z
Definition: magnetic_equil_files.hpp:44
Definition: rz_bounds.hpp:4
Definition: NamelistReader.hpp:193
Definition: magnetic_equil_files.hpp:41
double x_r
Definition: magnetic_equil_files.hpp:47
View< double ***, CLayout, HostType > Br
r magnetic field component on phi-z-r grid
Definition: magnetic_equil_files.hpp:28
MagneticEquilFiles2D(bool read_m3dc1, const std::string &eq_filename)
Definition: magnetic_equil_files.cpp:192
View< double *, CLayout, HostType > rgrid
Definition: magnetic_equil_files.hpp:49
View< double ***, CLayout, HostType > PEST_angle
PEST angle on phi-z-r grid (not used but written to the output for diagnostics)
Definition: magnetic_equil_files.hpp:27
View< double *, HostType > rgrid
Uniform grid in r.
Definition: magnetic_equil_files.hpp:22
View< double *, CLayout, HostType > zgrid
Definition: magnetic_equil_files.hpp:50
double x_psi
Definition: magnetic_equil_files.hpp:46
void read_eq_dims(FileReader &file_reader, int &mr, int &mz, int &mphi, int &wedge_n)
Definition: magnetic_equil_files.cpp:11
Definition: file_reader.hpp:6
double axis_b
Definition: magnetic_equil_files.hpp:45
static MagneticEquilFiles2D eq_files_from_namelist(NLReader::NamelistReader &nlr)
Definition: magnetic_equil_files.cpp:297
View< double *, CLayout, HostType > psi_grid
Definition: magnetic_equil_files.hpp:51
View< double *, CLayout, HostType > I
Definition: magnetic_equil_files.hpp:52
void read_eq_dims(FileReader &file_reader, int &mr, int &mz, int &mpsi)
Definition: magnetic_equil_files.cpp:160
double x_z
Definition: magnetic_equil_files.hpp:48
RZBounds bounds
Min and max for r and z (the same for all planes)
Definition: magnetic_equil_files.hpp:19
View< double ***, CLayout, HostType > VMEC_angle
VMEC angle on phi-z-r grid (not used but written to the output for diagnostics)
Definition: magnetic_equil_files.hpp:26
static Ptr eq_files_ptr_from_namelist(NLReader::NamelistReader &nlr, bool is_3D)
Definition: magnetic_equil_files.cpp:337
double axis_r
Definition: magnetic_equil_files.hpp:43
Definition: magnetic_equil_files.hpp:18
static MagneticEquilFiles3D eq_files_from_namelist(NLReader::NamelistReader &nlr)
Definition: magnetic_equil_files.cpp:124
void read_eq(FileReader &file_reader)
Definition: magnetic_equil_files.cpp:172
void read_eq(FileReader &file_reader, int iphi)
Definition: magnetic_equil_files.cpp:26
MagneticEquilFiles3D(const std::string &eq_filebase)
Definition: magnetic_equil_files.cpp:42
View< double **, CLayout, HostType > psi_rz
Definition: magnetic_equil_files.hpp:53
RZBounds bounds
Definition: magnetic_equil_files.hpp:42
View< double ***, CLayout, HostType > psi
Normalized poloidal flux on phi-z-r grid.
Definition: magnetic_equil_files.hpp:25
std::shared_ptr< MagneticEquilFiles > Ptr
Definition: magnetic_equil_files.hpp:11