XGCa
neutrals.hpp
Go to the documentation of this file.
1 #ifndef NEUTRALS_HPP
2 #define NEUTRALS_HPP
3 
4 #include "view_arithmetic.hpp"
5 #include "xgc_io.hpp"
6 #include "NamelistReader.hpp"
7 #include "grid.hpp"
8 #include "plasma.hpp"
9 #include "vgrid_distribution.hpp"
10 #include "diag_f0_df.hpp"
11 #include "step_trigger.hpp"
12 
13 // Neutrals class
14 template<class Device>
15 class Neutrals {
16 public:
17 
18  // Neutrals variables
19  bool use_ion_loss;
20  int nebins;
22  double ebin_min;
23  double ebin_max;
24  double ebin_delta;
25  bool ebin_log;
26 
27  // Step trigger for the neutral background update
29  //
30  View<double*,CLayout,Device> weight_sum_lost;
31  View<double**,CLayout,Device> weight_wall_lost;
32  View<double***,CLayout,Device> weight_lost_ebin;
33 
34  View<double*,CLayout,HostType> weight_sum_lost_h;
35  View<double*,CLayout,HostType> weight_wall_lost_h;
36  View<double**,CLayout,HostType> weight_lost_ebin_h;
37  View<double*,CLayout,HostType> node_dens_h;
38  View<double*,CLayout,HostType> node_temp_h;
39 
40  // Constructor
41  Neutrals( int nthreads, int nbins, int nnode, NLReader::NamelistReader& nlr);
42 
43  // "Null constructor"
45 
46  void write_checkpoint_files(const XGC_IO_Stream& stream) const;
47 
48  void read_checkpoint_files(const XGC_IO_Stream& stream);
49 
50  void copy_to_host() const;
51 
52  void clear_device_views() const;
53 
54  void clear_host_views() const;
55 
56  void apply(const Grid<DeviceType>& grid, const DomainDecomposition<DeviceType>& pol_decomp, const VelocityGrid& vgrid, Plasma& plasma, const VGridDistribution<DeviceType>& f0_f, const VGridDistribution<HostType>& f0_f_h, VGridDistribution<DeviceType>& f0_df0g_cumul, const int axisym_parallelization_int, int gstep, DiagF0DF& diag_f0_df, double dt) const;
57 };
58 #endif
Definition: diag_f0_df.hpp:9
Definition: NamelistReader.hpp:193
Definition: neutrals.hpp:15
void clear_device_views() const
View< double *, CLayout, HostType > weight_sum_lost_h
Array to store how much was lost in total at the sheath.
Definition: neutrals.hpp:34
int background_period
Definition: neutrals.hpp:21
bool ebin_log
Definition: neutrals.hpp:25
double ebin_min
Definition: neutrals.hpp:22
View< double *, CLayout, HostType > weight_wall_lost_h
Array to store how much was lost at the sheath, binned by wall index.
Definition: neutrals.hpp:35
View< double *, CLayout, HostType > node_dens_h
Definition: neutrals.hpp:37
StepTrigger trigger_neutral_update
Definition: neutrals.hpp:28
void copy_to_host() const
View< double ***, CLayout, Device > weight_lost_ebin
Array to store how much was lost at the sheath, binned by wall index.
Definition: neutrals.hpp:32
View< double **, CLayout, Device > weight_wall_lost
Array to store how much was lost at the sheath, binned by wall index.
Definition: neutrals.hpp:31
View< double *, CLayout, HostType > node_temp_h
Definition: neutrals.hpp:38
View< double **, CLayout, HostType > weight_lost_ebin_h
Array to store how much was lost at the sheath, binned by wall and energy index.
Definition: neutrals.hpp:36
double ebin_delta
Definition: neutrals.hpp:24
View< double *, CLayout, Device > weight_sum_lost
Array to store how much was lost in total at the sheath.
Definition: neutrals.hpp:30
double ebin_max
Definition: neutrals.hpp:23
Neutrals(int nthreads, int nbins, int nnode, NLReader::NamelistReader &nlr)
void apply(const Grid< DeviceType > &grid, const DomainDecomposition< DeviceType > &pol_decomp, const VelocityGrid &vgrid, Plasma &plasma, const VGridDistribution< DeviceType > &f0_f, const VGridDistribution< HostType > &f0_f_h, VGridDistribution< DeviceType > &f0_df0g_cumul, const int axisym_parallelization_int, int gstep, DiagF0DF &diag_f0_df, double dt) const
int nebins
Definition: neutrals.hpp:20
void read_checkpoint_files(const XGC_IO_Stream &stream)
void write_checkpoint_files(const XGC_IO_Stream &stream) const
void clear_host_views() const
Neutrals()
Definition: neutrals.hpp:44
bool use_ion_loss
Whether to use ONLY ion loss (i.e. dont track electron contribution)
Definition: neutrals.hpp:19
Definition: plasma.hpp:13
Definition: step_trigger.hpp:4
Definition: vgrid_distribution.hpp:18
Definition: xgc_io.hpp:24
subroutine plasma(grid, itr, p, dene_out, deni_out, Te_out, Ti_out, Vparai_out, ignore_vacuum)
Calculate the plasma density, temperature, and parallel velocity for a point in triangle itr using pl...
Definition: neutral_totalf.F90:1548
Definition: velocity_grid.hpp:8