XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
col_grid.hpp
Go to the documentation of this file.
1 #ifndef COL_GRID_HPP
2 #define COL_GRID_HPP
3 
4 #include <vector>
5 #include <stdio.h>
6 #include <Kokkos_Core.hpp>
7 #include <Kokkos_DualView.hpp>
8 
10 #include "velocity_grid.hpp"
11 #include "vgrid_distribution.hpp"
12 
13 #include "col_grid_matrix.hpp"
14 #include "col_species.hpp"
15 #include "col_vgrids.hpp"
16 
17 extern "C" int get_col_range_setup(int inode);
18 
19 //> XGC's multi-species Fokker-Planck-Landau collision operator
20 // see R. Hager et al., Journal of Computational Physics 315 (2016), pp. 644-660
21 // E. S. Yoon et al., Physics of Plasmas 21 (2014), 032503
22 //
23 // The headers of the subroutines in this module refer to the corresponding parts of Hager et al.
24 // where applicable in order to make the source code easier to understand.
25 
26 
27 // Enum for derivatives of ED array
28 namespace ED{
29 enum{
30  RR=0,
31  RZ,
32  ZZ,
33  ER,
34  EZ,
35  N
36 };
37 }
38 
39 // <SOLVER-related>
40 const int vpic_inner_iter_max=20;
41 
42 // set use_superlu = .true. to use sparse direct SuperLU solver
43 // set use_superlu = .false. to use lapack band solver
44 const bool use_superlu=false;
45 
46 namespace Convergence{
53  Normal=1,
54 
55 };
56 
57 inline bool is_okay(int convergence_status){
58  return (convergence_status!=Convergence::MaxedIter && convergence_status!=Convergence::NaNOrInfFound);
59 }
60 
61 class Moments{
62  // Values
63  double w_sum; //> sum of energy over species
64  double p_sum; //> sum of momentum over species
65  double min_p_thres; //> momentum error criterion
66 
67  // Deltas
68  double dw_sum; //> sum of energy change over species (i.e. error in energy)
69  double dp_sum; //> sum of momentum change over species (i.e. error in momentum)
70  double dn_n_max; //> maximum fraction of density changes among species (i.e. maximum relative error in density in all species )
72  bool en_exit_ok;
74 
75  //> Checks the convergence criterion (i.e. conservation of mass, energy and momentum)
76  template<class Device>
77  inline void eval(int isp, int mesh_ind, const CollisionVelocityGrids<Device>& cvg, const CollisionSpecies<Device>& cs,double& dw,double& dp,double& dn_n) const{
78  double vpic_dn = 0.0;
79  double vpic_dw = 0.0;
80  double vpic_dp = 0.0;
81 
82  int gri = cs.s.h_view(isp, mesh_ind).grid_index;
83 
84  for (int index_i = 0; index_i<cvg.mesh_z.extent(2); index_i++){
85  double mesh_z2 = cvg.mesh_z(mesh_ind,gri,index_i)*cvg.mesh_z(mesh_ind,gri,index_i);
86  for (int index_j = 0; index_j<cvg.mesh_r.extent(2); index_j++){
87  double mesh_r2 = cvg.mesh_r(mesh_ind,gri,index_j)*cvg.mesh_r(mesh_ind,gri,index_j);
88  double vpic_dfc = (cs.pdf_np1.h_view(mesh_ind,isp,index_i,index_j) - cs.pdf_n.h_view(mesh_ind,isp,index_i,index_j)) * cvg.vol_h(mesh_ind,gri,index_j);
89 
90  vpic_dn += vpic_dfc;
91  vpic_dw += vpic_dfc*(mesh_z2 + mesh_r2);
92  vpic_dp += vpic_dfc*cvg.mesh_z(mesh_ind,gri,index_i);
93  }
94  }
95 
96  dw = vpic_dw*cs.s.h_view(isp,mesh_ind).mass;
97  dp = vpic_dp*cs.s.h_view(isp,mesh_ind).mass;
98  dn_n = std::abs(vpic_dn/cs.s.h_view(isp,mesh_ind).dens);
99  }
100 
101  public:
102 
103  template<class Device>
104  inline void set(int mesh_ind, const CollisionSpecies<Device>& col_spall){
105  w_sum = 0;
106  p_sum = 0;
107  min_p_thres = 1e99; //just large value to be reinitialized with a small value
108  for (int spi = 0; spi<col_spall.n(); spi++){
109  w_sum += col_spall.s.h_view(spi,mesh_ind).ens;
110  p_sum += col_spall.s.h_view(spi,mesh_ind).mom;
111  min_p_thres = std::min( col_spall.s.h_view(spi,mesh_ind).mass*col_spall.s.h_view(spi,mesh_ind).dens*sqrt(col_spall.s.h_view(spi,mesh_ind).numeric_vth2),
112  min_p_thres );
113  }
114  }
115 
116  template<class Device>
117  inline bool evaluate_conservation(int mesh_ind, const CollisionVelocityGrids<Device>& col_vgrids, const CollisionSpecies<Device>& col_spall, bool& values_are_all_finite){
118  dw_sum = 0.0;
119  dp_sum = 0.0;
120  dn_n_max = 0.0;
121  dens_exit_ok = true;
122 
123  for (int spi = 0; spi<col_spall.n(); spi++){
124  // Re-compute conservation errors after correction
125  double dw,dp,dn_n;
126  eval(spi, mesh_ind, col_vgrids, col_spall,dw,dp,dn_n);// moments evalulation from difference betw. pdf_n and pdf_np1
127  dw_sum += dw;
128  dp_sum += dp;
129  if(dn_n_max<dn_n) dn_n_max = dn_n;
130  dens_exit_ok = dens_exit_ok && (dn_n<1e-10);
131  }
132 
133  // Check for NaNs and Infs
134  values_are_all_finite = (std::isfinite(dw_sum) && std::isfinite(dp_sum) && std::isfinite(dn_n_max));
135 
136  en_exit_ok = std::abs(dw_sum/w_sum) <= 1e-7;
137  // bool mom_exit_ok = std::abs(col_dp_sum)/(std::max(std::abs(col_p_sum),min_p_thres)) <= (col_f_vp_max/col_f_nvz);// v_par = max_v_par of simulation domain / vth
138  // ALS : momentum tolerance changed to the tolerance in XGC's former collisions module:
139  // For momentum tolerance use main ion mass and electron density as normalization (when there are more than 2 species).
140  double mass_use = (col_spall.s.h_view(0,mesh_ind).is_electron ? col_spall.s.h_view(1,mesh_ind).mass : col_spall.s.h_view(0,mesh_ind).mass);
141  mom_exit_ok = std::abs(dp_sum)/(std::max(std::abs(p_sum),1e-3*mass_use*col_spall.s.h_view(0,mesh_ind).dens)) <= 1.0e-7;
142 
143  return (dens_exit_ok && en_exit_ok && mom_exit_ok);
144  }
145 };
146 
147 }
148 
149 
150 template<class Device>
151 struct TmpColData{
152 
153  // These views are both on CPU and GPU - dual views
154  Kokkos::View<double***,Device> gammac_spall;
155  Kokkos::DualView<int[4][4],Device> mat_pos_rel_indx; // Shouldn't need to be a dual view
156 
157  Kokkos::View<double***,Device> fhalf;
158  Kokkos::View<double***,Device> dfdr;
159  Kokkos::View<double***,Device> dfdz;
160  Kokkos::View<double****,Device> EDs;
161  Kokkos::View<double******,Device> M_ab;
162  Kokkos::View<double*****,Device> M_s;
163 
164  TmpColData<Device>(int nvr, int nvz, int sp_num, int n_vgrids, int mb_n_nodes)
165  : // Note: layout left
166  gammac_spall("gammac_spall",mb_n_nodes,sp_num,sp_num),
167  fhalf("fhalf",mb_n_nodes,nvz-1,nvr-1),
168  dfdr("dfdr",mb_n_nodes,nvz-1,nvr-1),
169  dfdz("dfdz",mb_n_nodes,nvz-1,nvr-1),
170  EDs("EDs",mb_n_nodes,nvz-1,nvr-1,ED::N),
171  M_s("M_s",mb_n_nodes,n_vgrids, (nvr-1)*(nvz-1), ED::N, nvr-1),
172  M_ab("M_ab",mb_n_nodes,n_vgrids, n_vgrids-1, (nvr-1)*(nvz-1), 3, (nvr-1)*(nvz-1)),
173  mat_pos_rel_indx("mat_pos_rel_indx")
174  {
175  // Set up mat_pos_rel_indx and send to GPU
176  int mat_loc[16] = {4,5,7,8,
177  1,2,4,5,
178  3,4,6,7,
179  0,1,3,4};
180 
181  for (int i=0;i<16;i++)
182  mat_pos_rel_indx.h_view(i/4,i%4)=mat_loc[i];
183 
184 #ifdef USE_GPU
185  Kokkos::deep_copy(mat_pos_rel_indx.d_view, mat_pos_rel_indx.h_view);
186 #endif
187  }
188 };
189 
190 
191 template<class Device>
193 
194  public:
195 
197 
198  double* node_cost; // pointer to array of timings for collisions
199 
200  Kokkos::View<bool*, Kokkos::HostSpace> in_range;
201 
203 
205 
208 
210 
211  //> Set up global variables of the collision operator
215  // These defaults have not been systematically optimized
216 #ifdef USE_GPU
217  int default_batch_size = 64;
218 #else
219  int default_batch_size = 1;//omp_get_max_threads();
220 #endif
221  std::string linalg_backend_str;
222  if(nlr.namelist_present("performance_param")){
223  nlr.use_namelist("performance_param");
224  batch_size = nlr.get<int>("mesh_batch_size", default_batch_size);
225  linalg_backend_str = nlr.get<std::string>("collisions_solver", "lapack");
226  ginkgo_residual_reduction = nlr.get<double>("ginkgo_residual_reduction", 1.0e-16);
227  ginkgo_max_iterations = nlr.get<int>("ginkgo_max_iterations", 100);
228  }else{
229  batch_size = default_batch_size;
230  linalg_backend_str = "lapack";
231  }
232 
234  }
235 
236  //> Updates some parameters that may change in the course of the simulation
237  void update_params(bool sml_symmetric_f, int nnode, int node_offset, double* node_cost_ptr){
238  // This may not need to be updated
239  node_cost = node_cost_ptr;
240  symmetric_f = sml_symmetric_f;
241 
242  in_range = Kokkos::View<bool*, Kokkos::HostSpace>("in_range",nnode);
243 
244  // nodes outside [sml_inpsi,sml_outpsi] and in private flux region are skipped
245  for (int i=0;i<nnode;i++){
246  int ftr_node = i + node_offset + 1;
247  in_range(i) = (get_col_range_setup(ftr_node)==1);
248  }
249  }
250 
252  nlr.use_namelist("ptl_param");
253  int plasma_nspecies = nlr.get<int>("ptl_nsp",1);
254 
255  nlr.use_namelist("sml_param");
256  int sml_special = nlr.get<int>("sml_special", 0);
257  bool sml_electron_on = nlr.get<bool>("sml_electron_on", false);
258  if(sml_special==4) sml_electron_on = false;
259  if(sml_electron_on) plasma_nspecies += 1; // Add electrons
260 
261  VelocityGrid vgrid(nlr);
262 #ifdef USE_GPU
263  int default_batch_size = 64;
264 #else
265  int default_batch_size = 1;//omp_get_max_threads();
266 #endif
267  int col_grid_batch_size;
268  if(nlr.namelist_present("performance_param")){
269  nlr.use_namelist("performance_param");
270  col_grid_batch_size = nlr.get<int>("mesh_batch_size", default_batch_size);
271  }else{
272  col_grid_batch_size = default_batch_size;
273  }
274 
275  double device_col_GB_per_vertex = plasma_nspecies*std::max(plasma_nspecies-1,1)*(vgrid.nvp*vgrid.nmu)*(vgrid.nvp*vgrid.nmu)*8*BYTES_TO_GB;
276  double gpu_memory_usage = (col_grid_batch_size*device_col_GB_per_vertex);
277 
278  MemoryPrediction memory_prediction{"Fields", 0.0, gpu_memory_usage};
279 
280  return memory_prediction;
281  }
282 
283  // Core init
284  void core_init(int isp, int mesh_ind, const CollisionVelocityGrids<Device>& col_vgrids, const CollisionSpecies<Device>& col_spall ) const;
285 
286  // Get maxw_fac
287  static KOKKOS_INLINE_FUNCTION double get_maxw_fac(double mesh_dr, double mesh_r, double numeric_vth2) ;
288 
289  // Get numeric v_thermal equilibrium for a given species against a given grid
290  View<double*,Device> get_numeric_v_thermal_equil(int mb_n_nodes, int spi, int grj, const CollisionVelocityGrids<Device>& col_vgrids, const CollisionSpecies<Device>& col_spall) const;
291 
292  // Delta init
293  void core_delta_init(int mb_n_nodes, int gri, int grj, int spi, CollisionVelocityGrids<Device>& col_vgrids, const CollisionSpecies<Device>& col_spall) const;
294 
295  // LU_matrix_ftn
296  static KOKKOS_INLINE_FUNCTION void LU_matrix_ftn(int mesh_ind, int gri, int grj, int spi, int cell_i,int cell_j,const CollisionVelocityGrids<Device>& col_vgrids,int mprl_col, int mat_pos,double coeff1,double coeff2, const TmpColData<Device>& tcd, const Kokkos::View<int**,Device>& index_map_LU_d,typename Collisions::GridMatrix<Device>::values_array_t LU_values);
297 
298  // LU_matrix
299  void LU_matrix(int mb_n_nodes, int gri, int grj, int spi, const CollisionVelocityGrids<Device>& col_vgrids,const TmpColData<Device>& tcd, Collisions::GridMatrix<Device>* const mtx) const;
300 
301  // the core loop including the picard loop is now inside this function
302  void picard_loop(int vpic_inner_iter_max, const CollisionVelocityGrids<Device>& col_vgrids, CollisionSpecies<Device>& col_spall, TmpColData<Device>& tcd, int mb_n_nodes, Kokkos::View<int*,HostType>& convergence_status, Kokkos::View<int*,HostType>& n_iterations_performed, Kokkos::View<Convergence::Moments*,HostType>& moments) const;
303 
304  // dispatch for E_and_D calc
305  void E_and_D(int mb_n_nodes, int gri, int grj, const CollisionVelocityGrids<Device>& col_vgrids, TmpColData<Device>& tcd) const;
306 
307  // E_and_D_s
308  static KOKKOS_INLINE_FUNCTION void E_and_D_s(int idx, int mb_n_nodes, int nvrm1, int nvzm1, const TmpColData<Device>& tcd, int gri) ;
309 
310  // dispatch for angle_avg calc
311  void angle_avg(int mb_n_nodes, int gri, int grj, CollisionVelocityGrids<Device>& col_vgrids, TmpColData<Device>& tcd) const;
312 
313  // angle_avg_s
314  static KOKKOS_INLINE_FUNCTION void angle_avg_s(int idx, int mb_n_nodes, int nvrm1, int nvzm1, const CollisionVelocityGrids<Device>& col_vgrids, const TmpColData<Device>& tcd, int gri);
315 
316  // E_and_D_ab
317  static KOKKOS_INLINE_FUNCTION void E_and_D_ab(int idx, int mb_n_nodes, int nvrm1, int nvzm1, const CollisionVelocityGrids<Device>& col_vgrids, const TmpColData<Device>& tcd, int gri, int grj);
318 
319  // angle_avg_ab
320  static KOKKOS_INLINE_FUNCTION void angle_avg_ab(int idx, int mb_n_nodes, int nvrm1, int nvzm1, const CollisionVelocityGrids<Device>& col_vgrids, const TmpColData<Device>& tcd, int gri, int grj);
321 
322  void f_df(int mb_n_nodes, const CollisionVelocityGrids<Device>& col_vgrids, const CollisionSpecies<Device>& col_spall,int spi,int grj,TmpColData<Device>& tcd) const;
323 
324  // Main collision algorithm
325  Kokkos::View<int*,HostType> core(CollisionVelocityGrids<Device>& col_vgrids, CollisionSpecies<Device>& col_spall, TmpColData<Device>& tcd, int mb_n_nodes) const;
326 
327 
328  // Carries out collisions
329  void collision(std::vector<Species<DeviceType>> &all_species, const Moments& moments, const DomainDecomposition<DeviceType>& pol_decomp, const VGridDistribution<HostType>& f0_f, Kokkos::View<double****,Kokkos::LayoutRight, Kokkos::HostSpace>& df0g_tmp, double dt, View<int*,CLayout,HostType>& converged_all) const;
330 };
331 
332 #include "col_grid.tpp"
333 
334 #endif
double min_p_thres
Definition: col_grid.hpp:65
Definition: col_grid_matrix.hpp:23
double w_sum
Definition: col_grid.hpp:63
int nmu
n points in mu (not including zero)
Definition: velocity_grid.hpp:13
Definition: col_grid.hpp:51
int nvp
n points in parallel velocity (not including zero)
Definition: velocity_grid.hpp:9
const bool use_superlu
Definition: col_grid.hpp:44
Kokkos::View< double ******, Device > M_ab
Definition: col_grid.hpp:161
static KOKKOS_INLINE_FUNCTION void LU_matrix_ftn(int mesh_ind, int gri, int grj, int spi, int cell_i, int cell_j, const CollisionVelocityGrids< Device > &col_vgrids, int mprl_col, int mat_pos, double coeff1, double coeff2, const TmpColData< Device > &tcd, const Kokkos::View< int **, Device > &index_map_LU_d, typename Collisions::GridMatrix< Device >::values_array_t LU_values)
Definition: col_grid.tpp:868
int batch_size
Definition: col_grid.hpp:196
Kokkos::View< double ***, Kokkos::LayoutRight, HostType > mesh_z
Definition: col_vgrids.hpp:21
T get(const string &param, const T default_val, int val_ind=0)
Definition: NamelistReader.hpp:373
constexpr double BYTES_TO_GB
Definition: constants.hpp:12
Kokkos::View< double *****, Device > M_s
Definition: col_grid.hpp:162
Definition: col_grid.hpp:192
Kokkos::DualView< double ****, Kokkos::LayoutRight, Device > pdf_np1
Definition: col_species.hpp:88
Definition: velocity_grid.hpp:8
void set(int mesh_ind, const CollisionSpecies< Device > &col_spall)
Definition: col_grid.hpp:104
bool symmetric_f
Definition: col_grid.hpp:202
Kokkos::View< double ***, Device > fhalf
Definition: col_grid.hpp:157
Collisions::LinAlgBackend labackend
Definition: col_grid.hpp:204
double p_sum
Definition: col_grid.hpp:64
Kokkos::View< value_type ***, Kokkos::LayoutRight, Device, Kokkos::MemoryTraits< Kokkos::Unmanaged >> values_array_t
Definition: col_grid_matrix.hpp:31
Kokkos::View< double ***, Device > gammac_spall
Definition: col_grid.hpp:154
Definition: NamelistReader.hpp:193
Definition: moments.hpp:13
Kokkos::View< double ***, Kokkos::LayoutRight, HostType > vol_h
Definition: col_vgrids.hpp:23
bool en_exit_ok
Definition: col_grid.hpp:72
Definition: col_grid.hpp:30
Kokkos::DualView< CollisionSpeciesScalars **, Device > s
Definition: col_species.hpp:85
double dn_n_max
Definition: col_grid.hpp:70
CollisionGrid()
Definition: col_grid.hpp:209
int ginkgo_max_iterations
Definition: col_grid.hpp:207
Kokkos::View< bool *, Kokkos::HostSpace > in_range
Definition: col_grid.hpp:200
Kokkos::View< int *, HostType > core(CollisionVelocityGrids< Device > &col_vgrids, CollisionSpecies< Device > &col_spall, TmpColData< Device > &tcd, int mb_n_nodes) const
Definition: col_grid.tpp:125
ConvergenceStatus
Definition: col_grid.hpp:47
Definition: col_vgrids.hpp:13
void core_delta_init(int mb_n_nodes, int gri, int grj, int spi, CollisionVelocityGrids< Device > &col_vgrids, const CollisionSpecies< Device > &col_spall) const
Definition: col_grid.tpp:807
View< double *, Device > get_numeric_v_thermal_equil(int mb_n_nodes, int spi, int grj, const CollisionVelocityGrids< Device > &col_vgrids, const CollisionSpecies< Device > &col_spall) const
Definition: col_grid.tpp:775
static KOKKOS_INLINE_FUNCTION void E_and_D_ab(int idx, int mb_n_nodes, int nvrm1, int nvzm1, const CollisionVelocityGrids< Device > &col_vgrids, const TmpColData< Device > &tcd, int gri, int grj)
Definition: col_grid.tpp:545
Definition: col_grid.hpp:151
void LU_matrix(int mb_n_nodes, int gri, int grj, int spi, const CollisionVelocityGrids< Device > &col_vgrids, const TmpColData< Device > &tcd, Collisions::GridMatrix< Device > *const mtx) const
Definition: col_grid.tpp:913
const int vpic_inner_iter_max
Definition: col_grid.hpp:40
static KOKKOS_INLINE_FUNCTION void E_and_D_s(int idx, int mb_n_nodes, int nvrm1, int nvzm1, const TmpColData< Device > &tcd, int gri)
Definition: col_grid.tpp:714
void core_init(int isp, int mesh_ind, const CollisionVelocityGrids< Device > &col_vgrids, const CollisionSpecies< Device > &col_spall) const
Definition: col_grid.tpp:386
double dw_sum
Definition: col_grid.hpp:68
Definition: col_grid.hpp:53
idx
Definition: diag_f0_df_port1.hpp:32
Kokkos::DualView< double ****, Kokkos::LayoutRight, Device > pdf_n
Definition: col_species.hpp:87
Definition: col_grid.hpp:52
void use_namelist(const string &namelist)
Definition: NamelistReader.hpp:355
Definition: col_grid.hpp:61
Definition: col_grid.hpp:32
Definition: memory_prediction.hpp:4
void eval(int isp, int mesh_ind, const CollisionVelocityGrids< Device > &cvg, const CollisionSpecies< Device > &cs, double &dw, double &dp, double &dn_n) const
Definition: col_grid.hpp:77
void E_and_D(int mb_n_nodes, int gri, int grj, const CollisionVelocityGrids< Device > &col_vgrids, TmpColData< Device > &tcd) const
Definition: col_grid.tpp:521
Kokkos::View< double ***, Device > dfdz
Definition: col_grid.hpp:159
Definition: col_grid.hpp:35
double ginkgo_residual_reduction
Definition: col_grid.hpp:206
static KOKKOS_INLINE_FUNCTION void angle_avg_s(int idx, int mb_n_nodes, int nvrm1, int nvzm1, const CollisionVelocityGrids< Device > &col_vgrids, const TmpColData< Device > &tcd, int gri)
Definition: col_grid.tpp:598
Definition: col_grid.hpp:48
bool dens_exit_ok
Definition: col_grid.hpp:71
bool namelist_present(const string &namelist)
Definition: NamelistReader.hpp:351
Definition: col_grid.hpp:31
Definition: col_grid.hpp:50
int get_col_range_setup(int inode)
Kokkos::View< double ****, Device > EDs
Definition: col_grid.hpp:160
Definition: col_grid.hpp:33
bool is_okay(int convergence_status)
Definition: col_grid.hpp:57
void collision(std::vector< Species< DeviceType >> &all_species, const Moments &moments, const DomainDecomposition< DeviceType > &pol_decomp, const VGridDistribution< HostType > &f0_f, Kokkos::View< double ****, Kokkos::LayoutRight, Kokkos::HostSpace > &df0g_tmp, double dt, View< int *, CLayout, HostType > &converged_all) const
Definition: col_grid.tpp:24
double * node_cost
Definition: col_grid.hpp:198
LinAlgBackend
Definition: col_grid_matrix.hpp:219
int n() const
Definition: col_species.hpp:174
Kokkos::View< double ***, Device > dfdr
Definition: col_grid.hpp:158
void update_params(bool sml_symmetric_f, int nnode, int node_offset, double *node_cost_ptr)
Definition: col_grid.hpp:237
static KOKKOS_INLINE_FUNCTION void angle_avg_ab(int idx, int mb_n_nodes, int nvrm1, int nvzm1, const CollisionVelocityGrids< Device > &col_vgrids, const TmpColData< Device > &tcd, int gri, int grj)
Definition: col_grid.tpp:451
Definition: col_grid.hpp:49
bool mom_exit_ok
Definition: col_grid.hpp:73
void picard_loop(int vpic_inner_iter_max, const CollisionVelocityGrids< Device > &col_vgrids, CollisionSpecies< Device > &col_spall, TmpColData< Device > &tcd, int mb_n_nodes, Kokkos::View< int *, HostType > &convergence_status, Kokkos::View< int *, HostType > &n_iterations_performed, Kokkos::View< Convergence::Moments *, HostType > &moments) const
Definition: col_grid.tpp:260
Definition: species.hpp:74
static MemoryPrediction estimate_memory_usage(NLReader::NamelistReader &nlr)
Definition: col_grid.hpp:251
Definition: col_species.hpp:81
Kokkos::DualView< int[4][4], Device > mat_pos_rel_indx
Definition: col_grid.hpp:155
void angle_avg(int mb_n_nodes, int gri, int grj, CollisionVelocityGrids< Device > &col_vgrids, TmpColData< Device > &tcd) const
Definition: col_grid.tpp:433
double dp_sum
Definition: col_grid.hpp:69
void f_df(int mb_n_nodes, const CollisionVelocityGrids< Device > &col_vgrids, const CollisionSpecies< Device > &col_spall, int spi, int grj, TmpColData< Device > &tcd) const
Definition: col_grid.tpp:663
Kokkos::View< double ***, Kokkos::LayoutRight, HostType > mesh_r
Definition: col_vgrids.hpp:20
static KOKKOS_INLINE_FUNCTION double get_maxw_fac(double mesh_dr, double mesh_r, double numeric_vth2)
Definition: col_grid.tpp:759
CollisionGrid(NLReader::NamelistReader &nlr)
Definition: col_grid.hpp:212
bool evaluate_conservation(int mesh_ind, const CollisionVelocityGrids< Device > &col_vgrids, const CollisionSpecies< Device > &col_spall, bool &values_are_all_finite)
Definition: col_grid.hpp:117
Definition: col_grid.hpp:34