XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
heat_diagnostics.hpp
Go to the documentation of this file.
1 #ifndef HEAT_DIAGNOSTICS_HPP
2 #define HEAT_DIAGNOSTICS_HPP
3 
4 #include "grid.hpp"
5 #include "plasma.hpp"
6 #include "diagnostic.hpp"
7 
8 namespace HeatDiag{
9  enum HEAT_DIAG{
10  NUMBER=0,
16  };
17 }
18 
19 // Heat Diagnostics class
20 template<class Device>
21 class HeatDiagnostics : public Diagnostic {
22  public:
23 
24  // Null constructor
26 
27  void init(NLReader::NamelistReader& nlr, const MagneticField<Device>& magnetic_field, const Grid<Device>& grid, int nspecies);
28 
30 
31  // Used in port (in pushe)
32  int mode;
33 
34  // Used in Mode 1
35  int nsection;
36  int npsi;
37  int nr;
38  int nz;
39  View<double*,CLayout,Device> rmin;
40  View<double*,CLayout,Device> rmax;
41  View<double*,CLayout,Device> dr;
42  View<double*,CLayout,Device> zmin;
43  View<double*,CLayout,Device> zmax;
44  View<double*,CLayout,Device> dz;
45  View<double*,CLayout,Device> pmin;
46  View<double*,CLayout,Device> dp;
47 
48  View<double******,CLayout,Device> pv;
49  View<double*****,CLayout,Device> pv_psi;
50 
51  // Used in Mode 2
52  int nseg;
53  int nphi;
54  double delta_phi;
55  View<RZPair*,CLayout,Device> x;
56  View<double*,CLayout,HostType> psi2; // Could be removed, calculated in first write
57  View<double*,CLayout,HostType> ds2; // Could be removed, calculated in first write
58  View<double*,CLayout,HostType> strike_angle2; // Could be removed, calculated in first write
59  View<double*****,CLayout,Device> pv_psi2;
60 
61  int get_nspecies() const;
62 
63  void write(Plasma& plasma, double time, int gstep);
64 
65  // Sheath heat diagnostic
66  KOKKOS_INLINE_FUNCTION void port(const Grid<Device> &grid, const MagneticField<Device> &magnetic_field, const Simd<bool>& just_left_the_grid, const Simd<double>& w, const Simd<double>& pot, const Simd<double>& epara, const Simd<double>& eperp, const SimdConstants &ct, const SimdPhase &old_ph, const SimdVector2D &xff_old, const SimdPhase &new_ph, int stype) const;
67 
68  // Routine used in heat diagnostics - should be elsewhere?
69  KOKKOS_INLINE_FUNCTION int wall_cross2(double r1, double z1, double r2, double z2) const;
70 
71 };
72 
73 #include "heat_diagnostics.tpp"
74 #endif
Definition: heat_diagnostics.hpp:21
View< double ******, CLayout, Device > pv
Array for the heat diagnostic in (r,z)
Definition: heat_diagnostics.hpp:48
View< RZPair *, CLayout, Device > x
Definition: heat_diagnostics.hpp:55
int nphi
Number of phi bins.
Definition: heat_diagnostics.hpp:53
View< double *, CLayout, Device > dz
dz
Definition: heat_diagnostics.hpp:44
int get_nspecies() const
View< double *, CLayout, HostType > psi2
Definition: heat_diagnostics.hpp:56
void init(NLReader::NamelistReader &nlr, const MagneticField< Device > &magnetic_field, const Grid< Device > &grid, int nspecies)
subroutine plasma(grid, itr, p, dene_out, deni_out, Te_out, Ti_out, Vparai_out)
Calculate the plasma density, temperature, and parallel velocity for a point in triangle itr using pl...
Definition: neutral_totalf.F90:1224
View< double *, CLayout, Device > pmin
First psi min.
Definition: heat_diagnostics.hpp:45
Definition: NamelistReader.hpp:193
Definition: magnetic_field.hpp:13
View< double *, CLayout, Device > rmin
First r bin.
Definition: heat_diagnostics.hpp:39
Definition: grid.hpp:21
View< double *, CLayout, HostType > ds2
Definition: heat_diagnostics.hpp:57
View< double *, CLayout, Device > rmax
End of last r bin.
Definition: heat_diagnostics.hpp:40
View< double *****, CLayout, Device > pv_psi2
Array for the heat diagnostic in (psi^2)
Definition: heat_diagnostics.hpp:59
Definition: heat_diagnostics.hpp:13
View< double *, CLayout, Device > zmax
End of last z bin.
Definition: heat_diagnostics.hpp:43
int nseg
Number of segments.
Definition: heat_diagnostics.hpp:52
View< double *****, CLayout, Device > pv_psi
Array for the heat diagnostic in (psi)
Definition: heat_diagnostics.hpp:49
Definition: heat_diagnostics.hpp:12
Definition: heat_diagnostics.hpp:10
int nr
Number of r bins.
Definition: heat_diagnostics.hpp:37
int npsi
Number of psi bins.
Definition: heat_diagnostics.hpp:36
Definition: heat_diagnostics.hpp:11
Definition: heat_diagnostics.hpp:15
Definition: particles.hpp:51
double delta_phi
dphi
Definition: heat_diagnostics.hpp:54
int nsection
Number of sections.
Definition: heat_diagnostics.hpp:35
KOKKOS_INLINE_FUNCTION int wall_cross2(double r1, double z1, double r2, double z2) const
Definition: heat_diagnostics.tpp:23
Definition: magnetic_field.F90:1
Definition: particles.hpp:17
HEAT_DIAG
Definition: heat_diagnostics.hpp:9
Definition: simd.hpp:18
KOKKOS_INLINE_FUNCTION void port(const Grid< Device > &grid, const MagneticField< Device > &magnetic_field, const Simd< bool > &just_left_the_grid, const Simd< double > &w, const Simd< double > &pot, const Simd< double > &epara, const Simd< double > &eperp, const SimdConstants &ct, const SimdPhase &old_ph, const SimdVector2D &xff_old, const SimdPhase &new_ph, int stype) const
Definition: heat_diagnostics.tpp:110
Definition: simd.hpp:139
View< double *, CLayout, Device > dp
dpsi
Definition: heat_diagnostics.hpp:46
Definition: plasma.hpp:14
Definition: diagnostic.hpp:10
View< double *, CLayout, HostType > strike_angle2
Definition: heat_diagnostics.hpp:58
HeatDiagnostics()
Definition: heat_diagnostics.hpp:25
int mode
Using mode 1 or mode 2.
Definition: heat_diagnostics.hpp:32
View< double *, CLayout, Device > zmin
First z bin.
Definition: heat_diagnostics.hpp:42
View< double *, CLayout, Device > dr
dr
Definition: heat_diagnostics.hpp:41
int nz
Number of z bins.
Definition: heat_diagnostics.hpp:38
Definition: heat_diagnostics.hpp:14
void write(Plasma &plasma, double time, int gstep)