XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
diag_3d_f0_f.hpp
Go to the documentation of this file.
1 #ifndef DIAG_3D_F0_F_HPP
2 #define DIAG_3D_F0_F_HPP
3 
4 #include "diagnostic.hpp"
5 #include "grid.hpp"
7 #include "electric_field.hpp"
8 #include "vgrid_distribution.hpp"
9 #include "plasma.hpp"
10 #include "moments.hpp"
11 
12 class Diag3DF0F : public Diagnostic{
13  enum VarNames{
32  };
33 
34  std::vector<std::string> var_names;
35 
36  struct Drifts{
37  View<double*****,CLayout,HostType> v_exb;
38  View<double*****,CLayout,HostType> v_mag;
39  View<double*****,CLayout,HostType> v_par;
40  View<double***,CLayout,HostType> boltz_fac;
41  View<double***,CLayout,HostType> dpot;
42 
43  Drifts(){}
44 
46  : v_exb(NoInit("v_exb"), f0_f.n_species(), f0_f.n_vr(), f0_f.n_nodes(), f0_f.n_vz(),3),
47  v_mag(NoInit("v_mag"), v_exb.layout()),
48  v_par(NoInit("v_par"), v_exb.layout()),
49  boltz_fac(NoInit("boltz_fac"), f0_f.n_species(), f0_f.n_vr(), f0_f.n_nodes()),
50  dpot(NoInit("dpot"), boltz_fac.layout())
51  {}
52  };
53 
54  public:
55 
57 
59 
60  void init(NLReader::NamelistReader& nlr, int default_period);
61 
62  KOKKOS_INLINE_FUNCTION void get_diag_vals(double mass, double charge, double angular_conv_fac, double vp, double en, double* v_mag, double* v_exb, double* v_par,
63  double dpot0, double dpot1, double v_exb_n0_r, double v_exb_turb_r, double v_mag_tot_r, double v_pardrift_tot_r, bool include_vpar,
64  double* v);
65 
66 
67  Drifts get_drift_velocities(const DomainDecomposition<DeviceType>& pol_decomp, const VelocityGrid& vgrid, ElectricField<DeviceType>& electric_field, Plasma& plasma,
68  const VGridDistribution<HostType>& f0_f, const View<double**,CLayout,HostType>& T0, bool use_turb);
69 
70  Drifts copy_drift_velocities(const Drifts& d_in);
71 
72  void calculate_diagnostics(const Simulation<DeviceType>& sml, const MagneticField<DeviceType>& magnetic_field, const Grid<DeviceType>& grid, const DomainDecomposition<DeviceType>& pol_decomp, Plasma& plasma, const VelocityGrid& vgrid, ElectricField<DeviceType>& electric_field, const View<double****,CLayout,HostType>& ftot_n0, const VGridDistribution<HostType>& f0_f, const Drifts& d, const Drifts& dn0,
73  const View<double**,CLayout,HostType>& T0, const View<double**,CLayout,HostType>& n0,
74  const View<double**,CLayout,HostType>& n,
75  const View<double***,CLayout,HostType>& moments_adia_n0,
76  const View<double***,CLayout,HostType>& moments_nonadia_n0,
77  const View<double***,CLayout,HostType>& moments_adia_turb,
78  const View<double***,CLayout,HostType>& moments_nonadia_turb,
79  const View<double****,CLayout,HostType>& moments_nonadia_turb_en);
80 
82  const VGridDistribution<HostType>& f0_f, const Moments& moments);
83 };
84 
85 #endif
Definition: diag_3d_f0_f.hpp:26
Definition: diag_3d_f0_f.hpp:17
Definition: diag_3d_f0_f.hpp:30
Definition: diag_3d_f0_f.hpp:14
Definition: diag_3d_f0_f.hpp:21
Definition: diag_3d_f0_f.hpp:12
Definition: velocity_grid.hpp:8
Definition: sml.hpp:8
Definition: diag_3d_f0_f.hpp:18
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, HostType > v_mag
Definition: diag_3d_f0_f.hpp:38
Definition: NamelistReader.hpp:193
Definition: magnetic_field.hpp:12
Definition: moments.hpp:13
Definition: electric_field.hpp:42
Definition: diag_3d_f0_f.hpp:27
std::vector< std::string > var_names
Definition: diag_3d_f0_f.hpp:34
View< double *****, CLayout, HostType > v_exb
Definition: diag_3d_f0_f.hpp:37
Definition: diag_3d_f0_f.hpp:29
View< double *****, CLayout, HostType > v_par
Definition: diag_3d_f0_f.hpp:39
Drifts copy_drift_velocities(const Drifts &d_in)
Definition: diag_3d_f0_f.cpp:138
Drifts(const VGridDistribution< HostType > &f0_f)
Definition: diag_3d_f0_f.hpp:45
Definition: diag_3d_f0_f.hpp:24
void write(const Simulation< DeviceType > &sml, const MagneticField< DeviceType > &magnetic_field, const Grid< DeviceType > &grid, const DomainDecomposition< DeviceType > &pol_decomp, Plasma &plasma, const VelocityGrid &vgrid, ElectricField< DeviceType > &electric_field, const VGridDistribution< HostType > &f0_f, const Moments &moments)
Definition: diag_3d_f0_f.cpp:421
Definition: diag_3d_f0_f.hpp:28
VarNames
Definition: diag_3d_f0_f.hpp:13
Definition: diag_3d_f0_f.hpp:16
Definition: diag_3d_f0_f.hpp:31
Drifts()
Definition: diag_3d_f0_f.hpp:43
void calculate_diagnostics(const Simulation< DeviceType > &sml, const MagneticField< DeviceType > &magnetic_field, const Grid< DeviceType > &grid, const DomainDecomposition< DeviceType > &pol_decomp, Plasma &plasma, const VelocityGrid &vgrid, ElectricField< DeviceType > &electric_field, const View< double ****, CLayout, HostType > &ftot_n0, const VGridDistribution< HostType > &f0_f, const Drifts &d, const Drifts &dn0, const View< double **, CLayout, HostType > &T0, const View< double **, CLayout, HostType > &n0, const View< double **, CLayout, HostType > &n, const View< double ***, CLayout, HostType > &moments_adia_n0, const View< double ***, CLayout, HostType > &moments_nonadia_n0, const View< double ***, CLayout, HostType > &moments_adia_turb, const View< double ***, CLayout, HostType > &moments_nonadia_turb, const View< double ****, CLayout, HostType > &moments_nonadia_turb_en)
Definition: diag_3d_f0_f.cpp:189
Drifts get_drift_velocities(const DomainDecomposition< DeviceType > &pol_decomp, const VelocityGrid &vgrid, ElectricField< DeviceType > &electric_field, Plasma &plasma, const VGridDistribution< HostType > &f0_f, const View< double **, CLayout, HostType > &T0, bool use_turb)
Definition: diag_3d_f0_f.cpp:86
KOKKOS_INLINE_FUNCTION void get_diag_vals(double mass, double charge, double angular_conv_fac, double vp, double en, double *v_mag, double *v_exb, double *v_par, double dpot0, double dpot1, double v_exb_n0_r, double v_exb_turb_r, double v_mag_tot_r, double v_pardrift_tot_r, bool include_vpar, double *v)
Definition: diag_3d_f0_f.cpp:153
Definition: magnetic_field.F90:1
Diag3DF0F()
Definition: diag_3d_f0_f.hpp:58
Definition: diag_3d_f0_f.hpp:19
void init(NLReader::NamelistReader &nlr, int default_period)
Definition: diag_3d_f0_f.cpp:8
Definition: plasma.hpp:13
View< double ***, CLayout, HostType > boltz_fac
Definition: diag_3d_f0_f.hpp:40
Definition: diag_3d_f0_f.hpp:15
Definition: diag_3d_f0_f.hpp:23
Definition: diag_3d_f0_f.hpp:25
Definition: diagnostic.hpp:10
Definition: diag_3d_f0_f.hpp:22
Definition: diag_3d_f0_f.hpp:36
Definition: diag_3d_f0_f.hpp:20
Kokkos::ViewAllocateWithoutInitializing NoInit
Definition: space_settings.hpp:68
View< double ***, CLayout, HostType > dpot
Definition: diag_3d_f0_f.hpp:41
bool adios_stage
Definition: diag_3d_f0_f.hpp:56