XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
grid.hpp
Go to the documentation of this file.
1 #ifndef GRID_HPP
2 #define GRID_HPP
3 
4 #include "magnetic_field.hpp"
5 #include "grid_structs.hpp"
6 #include "grid_weights.hpp"
7 #include "grid_files.hpp"
8 #include "guess_table.hpp"
9 #include "uniform_range.hpp"
10 #include "guess_list_1d.hpp"
11 #include "gradient_matrices.hpp"
12 
13 extern "C" void init_fortran_vols_and_areas(double* tr_area_h, double* tr_vol_h,
14 #ifdef XGC1
15  double* node_vol_ff_h,
16 #endif
17  double* node_vol_nearest_h, double* node_vol_h, double* node_area_h);
18 
19 // Volume- and Area-related Host Views. Should find a different location for these so that these unused views aren't sent to GPU
21  View<double*,CLayout,HostType> tr_area_h;
22  View<double*,CLayout,HostType> tr_vol_h;
23  View<double**,CLayout,HostType> node_vol_ff_h;
24  View<double*,CLayout,HostType> node_vol_nearest_h;
25  View<double*,CLayout,HostType> node_vol_h;
26  View<double*,CLayout,HostType> node_area_h;
27 
29 
30  VolumesAndAreas(int ntriangle_in, int nnode_in)
31  : tr_area_h(NoInit("tr_area"), ntriangle_in),
32  tr_vol_h(NoInit("tr_vol"), ntriangle_in),
33 #ifdef XGC1
34  node_vol_ff_h(NoInit("node_vol_ff"),2, nnode_in),
35 #endif
36  node_vol_nearest_h(NoInit("node_vol_nearest"),nnode_in),
37  node_vol_h(NoInit("node_vol"),nnode_in),
38  node_area_h(NoInit("node_area"),nnode_in)
39  {}
40 
42 #ifndef NO_FORTRAN_MODULES
44 #ifdef XGC1
45  node_vol_ff_h.data(),
46 #endif
47  node_vol_nearest_h.data(), node_vol_h.data(), node_area_h.data());
48 #endif
49  }
50 };
51 
52 template<class Device>
53 struct Projection{
54  View<int**,CLayout,Device> tr;
55  View<double***,CLayout,Device> p;
56  View<double**,CLayout,Device> dx;
57 
59  Projection(int nnode)
60  : tr(NoInit("tr"),2,nnode),
61  p(NoInit("p"),2,nnode,3),
62  dx(NoInit("dx"),2,nnode){}
63 };
64 
65 // Grid class
66 template<class Device>
67 class Grid {
68  // This line enables private access between the host and device implementations of this class
69  // i.e. Makes the copy from host to device more straightforward
70  template<class Device2> friend class Grid;
71 
72  public:
73 
74  // Constructor from namelist
76 
77  // Default constructor
78  Grid(){}
79 
80  // Create a mirror with a different device type
81  template<class Device2>
82  inline Grid<Device2> mirror() const{
83  Grid<Device2> m;
84 
85  m.ntriangle = ntriangle;
86  m.nnode = nnode;
87  m.nplanes = nplanes;
89  m.delta_phi = delta_phi;
91 
92  m.psi = my_mirror_view(psi, Device2());
93  mirror_copy(m.psi, psi);
94  m.bfield = my_mirror_view(bfield, Device2());
96  m.basis = my_mirror_view(basis, Device2());
98  m.nodes = my_mirror_view(nodes, Device2());
100  m.mapping = my_mirror_view(mapping, Device2());
102 
103  m.guess = guess.template mirror<Device2>();
104 
108  m.psi_surf2 = my_mirror_view(psi_surf2, Device2());
110 
111  m.psi00 = psi00;
112  m.psi_guess = psi_guess.template mirror<Device2>();
113 
114  m.rgn = my_mirror_view(rgn, Device2());
115  mirror_copy(m.rgn, rgn);
116  m.gx = my_mirror_view(gx, Device2());
117  mirror_copy(m.gx, gx);
118 
119  m.nwall = nwall;
120  m.wall_nodes = my_mirror_view(wall_nodes, Device2());
122  m.node_to_wall = my_mirror_view(node_to_wall, Device2());
124 
126 
127  m.volumes_and_areas = volumes_and_areas; // Doesn't require mirror view since everything is on host
128 
131 
132 #ifdef NO_FORTRAN_MODULES
133  m.gradient_matrices_h = gradient_matrices_h;
134 #endif
135 
136  return m;
137  }
138 
139  KOKKOS_INLINE_FUNCTION void t_coeff(const SimdVector2D &x, const Simd<int>& itr, SimdGridVec &p) const;
140 
141  KOKKOS_INLINE_FUNCTION void t_coeff_mod(const MagneticField<Device> &magnetic_field, const double r, const double z, const double psiin, const int itr, double (&p)[3] ) const;
142 
143  KOKKOS_INLINE_FUNCTION void t_coeff_mod(const MagneticField<Device> &magnetic_field, const SimdVector2D &xy, const Simd<double>& psiin, const Simd<int>& itr, SimdGridVec &p ) const;
144 
145  KOKKOS_INLINE_FUNCTION void search_tr2_no_precheck(const double r, const double z, int& itr, double (&p)[3]) const;
146 
147  KOKKOS_INLINE_FUNCTION void search_tr2( const SimdVector2D &xy, Simd<int>& itr, SimdGridVec &pout ) const;
148 
149  KOKKOS_INLINE_FUNCTION void search_tr_check_guess(const SimdVector2D &x, const Simd<int>& old_itr,Simd<int>& itr,SimdGridVec &p ) const;
150 
151  KOKKOS_INLINE_FUNCTION void psi_search(double psi,double &wp,int &ip) const;
152 
153  KOKKOS_INLINE_FUNCTION void follow_field_to_midplane(const MagneticField<Device> &magnetic_field, const SimdVector2D &x, const Simd<double>& phi, SimdVector2D &xff) const;
154 
155  KOKKOS_INLINE_FUNCTION void get_grid_weights_ff(const MagneticField<Device> &magnetic_field, const SimdVector &v, const Simd<double>& psi_in,SimdVector2D &xff,SimdGridWeights<Order::One, PhiInterpType::Planes>& grid_wts) const;
156 
157  KOKKOS_INLINE_FUNCTION void get_grid_weights_no_ff(const MagneticField<Device> &magnetic_field, const SimdVector2D &x, const Simd<double>& psi_in,SimdGridWeights<Order::One, PhiInterpType::None>& grid_wts) const;
158 
159  template<PhiInterpType PIT>
160  KOKKOS_INLINE_FUNCTION void nearest_node(const SimdGridWeights<Order::One, PIT>& grid_wts, SimdGridWeights<Order::Zero, PIT>& grid_wts0) const;
161 
162  template<PhiInterpType PIT>
163  KOKKOS_INLINE_FUNCTION void get_grid_weights(const MagneticField<Device> &magnetic_field, const SimdVector &v, const Simd<double>& psi, SimdVector2D &xff,SimdGridWeights<Order::One, PIT>& grid_wts) const;
164 
165  template<PhiInterpType PIT>
166  KOKKOS_INLINE_FUNCTION void get_grid_weights(const MagneticField<Device> &magnetic_field, const SimdVector &v, SimdVector2D &xff, SimdGridWeights<Order::One, PIT>& grid_wts) const;
167 
168  template<PhiInterpType PIT>
169  KOKKOS_INLINE_FUNCTION void get_grid_weights(const MagneticField<Device> &magnetic_field, const SimdVector &v, const Simd<double>& psi_in, SimdGridWeights<Order::Zero, PIT>& grid_wts) const;
170 
171  template<PhiInterpType PIT>
172  KOKKOS_INLINE_FUNCTION void get_grid_weights(const MagneticField<Device> &magnetic_field, const SimdVector &v, const Simd<double>& psi_in, SimdGridWeights<Order::One, PIT>& grid_wts) const;
173 
174  template<PhiInterpType PIT>
175  KOKKOS_INLINE_FUNCTION void get_grid_weights(const MagneticField<Device> &magnetic_field, const SimdVector &v, SimdGridWeights<Order::Zero, PIT>& grid_wts) const;
176 
177  template<PhiInterpType PIT>
178  KOKKOS_INLINE_FUNCTION void get_grid_weights(const MagneticField<Device> &magnetic_field, const SimdVector &v, SimdGridWeights<Order::One, PIT>& grid_wts) const;
179 
180  KOKKOS_INLINE_FUNCTION void get_wall_index(const Simd<bool>& just_left_the_grid,const SimdVector2D &x, const SimdGridWeights<Order::One, PIT_GLOBAL>& grid_wts, Simd<int>& widx) const;
181 
182  KOKKOS_INLINE_FUNCTION void wedge_modulo_phi(Simd<double>& phi_mod) const;
183 
184  KOKKOS_INLINE_FUNCTION bool node_is_inside_psi_range(const MagneticField<Device> &magnetic_field, const int node) const;
185 
186  KOKKOS_INLINE_FUNCTION int get_plane_index(double phi) const;
187 
188  KOKKOS_INLINE_FUNCTION int get_node_index(int triangle_index, int tri_vertex_index) const;
189 
190  KOKKOS_INLINE_FUNCTION double node_area_to_volume(const MagneticField<Device> &magnetic_field, double area, int node_index) const;
191 
192  KOKKOS_INLINE_FUNCTION void get_triangle_area_and_volume(const MagneticField<Device> &magnetic_field, int i, double& area, double& volume) const;
193 
194  KOKKOS_INLINE_FUNCTION double get_r_center_of_mass(int itr) const;
195 
196  KOKKOS_INLINE_FUNCTION bool node_is_in_region_1_or_2_no_wall(const int inode) const;
197 
198  KOKKOS_INLINE_FUNCTION bool node_is_in_private_region_no_wall(const int inode) const;
199 
200  KOKKOS_INLINE_FUNCTION bool node_is_in_included_region(const int inode, const bool exclude_private_region) const;
201 
202  KOKKOS_INLINE_FUNCTION bool node_is_in_region_1_or_2(const MagneticField<Device> &magnetic_field, const int inode) const;
203 
204  KOKKOS_INLINE_FUNCTION int uses_rz_basis(const int inode) const;
205 
206  KOKKOS_INLINE_FUNCTION double get_r(const int inode) const;
207 
208  KOKKOS_INLINE_FUNCTION double get_dist2_from_node(const int inode, const double r, const double z) const;
209 
210  KOKKOS_INLINE_FUNCTION double get_dist_from_node(const int inode, const double r, const double z) const;
211 
212  KOKKOS_INLINE_FUNCTION void get_rz_coordinates(const int inode, double& r, double& z) const;
213 
214  KOKKOS_INLINE_FUNCTION void get_rz_coordinates(const Simd<int>& grid_inds, SimdVector2D& x) const;
215 
216  KOKKOS_INLINE_FUNCTION void get_rz_coordinates(const int itr, const double (&p)[3], double& r, double& z) const;
217 
218  KOKKOS_INLINE_FUNCTION void get_rz_coordinates(const Simd<int>& itr, const SimdGridVec& p, SimdVector2D& x) const;
219 
220  KOKKOS_INLINE_FUNCTION int get_nearest_node(const Simd<int>& itr, const SimdGridVec& p, int i_simd) const;
221 
222  KOKKOS_INLINE_FUNCTION int get_nearest_node(const int itr, const double (&p)[3]) const;
223 
224  KOKKOS_INLINE_FUNCTION double get_nearest_midplane(double phi) const;
225 
226  KOKKOS_INLINE_FUNCTION void set_gradient_mat_triangle(const View<int*,CLayout,DeviceType>& num_t_node,
227  const View<int**,CLayout,DeviceType>& tr_node, const View<double*,CLayout,DeviceType>& tr_area,
228  const View<double***, CLayout, DeviceType>& unit_vecs,
229  const int i, const GradientMatrices<Device>& gradient_matrices) const;
230 
231  KOKKOS_INLINE_FUNCTION int get_characteristic_length(const View<int*,CLayout,DeviceType>& num_t_node,
232  const View<int**,CLayout,DeviceType>& tr_node, const int i,
233  double& dist_triangle, double& dist_psi, double& dist_theta) const;
234 
235  KOKKOS_INLINE_FUNCTION void set_grad_matrix_from_psi_theta(bool is_psi_dir, int itr_pos, int itr_neg, double (&p_pos)[3], double (&p_neg)[3], double dl_pos, double dl_neg, int inode, const Matrix<Device>& matrix) const;
236 
237  void draw_ascii_grid(MagneticField<Device> magnetic_field, double rmin, double rmax, double dr, double zmin, double zmax, double dz){
238  printf("\n\n******** PLOT OF GRID ******* \n");
239  Kokkos::View<int*,HostType> save_vert("save_vert", 1+((rmax-rmin)/dr));
240  for (double zplot = zmax; zplot>=zmin; zplot-=dz){
241  printf("\n");
242  int save_num = 0;
243  int rsave_ind = -1;
244  for (double rplot = rmin; rplot<=rmax; rplot+=dr){
245  rsave_ind++;
246  SimdVector v;
247  v.r = rplot;
248  v.z = zplot;
249  v.phi = 0.001;
250 
251  // Get itr (triangle index)
252  SimdGridVec p;
253  Simd<int> itr = -1;
254  get_grid_weights(magnetic_field, v, itr, p);
255  if(itr[0]!=save_num || itr[0]!=save_vert[rsave_ind]){
256  if(itr[0]<10 && itr[0]>=0) printf("%d ",itr[0]);
257  else printf("%d ",itr[0]);
258  save_num = itr[0];
259  save_vert[rsave_ind] = itr[0];
260  } else {printf(" ");}
261  }
262  }
263  }
264 
265  int ntriangle;
266  int nnode;
267  int nplanes;
268  double wedge_angle;
269  double delta_phi;
270  double inv_delta_phi;
271 
272  Kokkos::View<double*,Kokkos::LayoutRight,Device> psi;
273  Kokkos::View<double*,Kokkos::LayoutRight,Device> bfield;
274 
275  private:
276  Kokkos::View<int*, Kokkos::LayoutRight,Device> basis;
277  Kokkos::View<Vertex*,Kokkos::LayoutRight,Device> nodes;
278  Kokkos::View<VertexMap*,Kokkos::LayoutRight,Device> mapping;
280 
281  public:
285  Kokkos::View<double*,Kokkos::LayoutRight,Device> psi_surf2;
287 
288  private:
290 
291  Kokkos::View<int*,Kokkos::LayoutRight,Device> rgn;
292  Kokkos::View<RZPair*,Kokkos::LayoutRight,Device> gx;
293 
294  public:
295  int nwall;
296 
297  private:
298  Kokkos::View<int*,Kokkos::LayoutRight,Device> wall_nodes;
299  Kokkos::View<int*,Kokkos::LayoutRight,Device> node_to_wall;
300 
302 
303  public:
304 
305  // Volume- and Area-related Host Views. Should find a different location for these so that these unused views aren't sent to GPU
307 
308  // Projections - reside in host memory for now
311 
312 
313 #ifdef NO_FORTRAN_MODULES
314  GradientMatrices<HostType> gradient_matrices_h;
315 #endif
316 };
317 
318 #include "grid.tpp"
319 #endif
Projection< HostType > one_plane_ff
Definition: grid.hpp:310
KOKKOS_INLINE_FUNCTION void t_coeff(const SimdVector2D &x, const Simd< int > &itr, SimdGridVec &p) const
Definition: grid.tpp:494
double inv_delta_phi
1/delta_phi
Definition: grid.hpp:270
VolumesAndAreas volumes_and_areas
Definition: grid.hpp:306
Simd< double > r
Definition: simd.hpp:150
Definition: guess_list_1d.hpp:7
KOKKOS_INLINE_FUNCTION void get_grid_weights_ff(const MagneticField< Device > &magnetic_field, const SimdVector &v, const Simd< double > &psi_in, SimdVector2D &xff, SimdGridWeights< Order::One, PhiInterpType::Planes > &grid_wts) const
Definition: grid.tpp:658
Definition: simd.hpp:149
GuessList1D< Device > psi_guess
Definition: grid.hpp:289
Definition: grid.hpp:53
Projection()
Definition: grid.hpp:58
KOKKOS_INLINE_FUNCTION double get_r_center_of_mass(int itr) const
Definition: grid.tpp:934
Grid()
Definition: grid.hpp:78
Definition: gradient_matrices.hpp:9
void mirror_copy(T1 &view_dest, const T2 &view_src)
Definition: my_mirror_view.hpp:122
void set_fortran_ptrs()
Definition: grid.hpp:41
Definition: grid_weights.hpp:77
Kokkos::View< double *, Kokkos::LayoutRight, Device > bfield
Magnetic field magnitude at nodes.
Definition: grid.hpp:273
int ntriangle
Number of grid triangles.
Definition: grid.hpp:265
KOKKOS_INLINE_FUNCTION double get_dist_from_node(const int inode, const double r, const double z) const
Definition: grid.tpp:1041
double minval_psi_surf2
Definition: grid.hpp:283
KOKKOS_INLINE_FUNCTION bool node_is_in_private_region_no_wall(const int inode) const
Definition: grid.tpp:961
Definition: grid_weights.hpp:51
KOKKOS_INLINE_FUNCTION int get_characteristic_length(const View< int *, CLayout, DeviceType > &num_t_node, const View< int **, CLayout, DeviceType > &tr_node, const int i, double &dist_triangle, double &dist_psi, double &dist_theta) const
Definition: grid.tpp:1228
Definition: NamelistReader.hpp:193
Definition: magnetic_field.hpp:12
Grid< Device2 > mirror() const
Definition: grid.hpp:82
KOKKOS_INLINE_FUNCTION bool node_is_in_included_region(const int inode, const bool exclude_private_region) const
Definition: grid.tpp:974
View< double *, CLayout, HostType > node_area_h
Definition: grid.hpp:26
Definition: grid_files.hpp:17
Definition: grid.hpp:67
KOKKOS_INLINE_FUNCTION void get_triangle_area_and_volume(const MagneticField< Device > &magnetic_field, int i, double &area, double &volume) const
Definition: grid.tpp:908
KOKKOS_INLINE_FUNCTION void t_coeff_mod(const MagneticField< Device > &magnetic_field, const double r, const double z, const double psiin, const int itr, double(&p)[3]) const
Definition: grid.tpp:373
int nplanes
Number of planes.
Definition: grid.hpp:267
KOKKOS_INLINE_FUNCTION void get_wall_index(const Simd< bool > &just_left_the_grid, const SimdVector2D &x, const SimdGridWeights< Order::One, PIT_GLOBAL > &grid_wts, Simd< int > &widx) const
Definition: grid.tpp:789
Projection< HostType > half_plane_ff
Definition: grid.hpp:309
KOKKOS_INLINE_FUNCTION double get_nearest_midplane(double phi) const
Definition: grid.tpp:1151
KOKKOS_INLINE_FUNCTION int uses_rz_basis(const int inode) const
Definition: grid.tpp:1000
Kokkos::View< double *, Kokkos::LayoutRight, Device > psi_surf2
Definition: grid.hpp:285
double wedge_angle
The size of the wedge (the model is periodic in phi, a angle of e.g. pi means half the tokamak is mod...
Definition: grid.hpp:268
int nwall
Definition: grid.hpp:295
Definition: grid.hpp:20
View< double ***, CLayout, Device > p
Definition: grid.hpp:55
KOKKOS_INLINE_FUNCTION void search_tr_check_guess(const SimdVector2D &x, const Simd< int > &old_itr, Simd< int > &itr, SimdGridVec &p) const
Definition: grid.tpp:512
void init_fortran_vols_and_areas(double *tr_area_h, double *tr_vol_h, double *node_vol_nearest_h, double *node_vol_h, double *node_area_h)
Kokkos::View< double *, Kokkos::LayoutRight, Device > psi
An array of psi coordinates.
Definition: grid.hpp:272
KOKKOS_INLINE_FUNCTION void get_rz_coordinates(const int inode, double &r, double &z) const
Definition: grid.tpp:1066
Definition: guess_table.hpp:8
GuessTable< Device > guess
Definition: grid.hpp:279
Kokkos::View< int *, Kokkos::LayoutRight, Device > rgn
Definition: grid.hpp:291
View< double *, CLayout, HostType > tr_area_h
Definition: grid.hpp:21
Kokkos::View< int *, Kokkos::LayoutRight, Device > basis
0 for Psi-theta, 1 for R-Z ; should be enum (and bool/char?)
Definition: grid.hpp:276
KOKKOS_INLINE_FUNCTION void get_grid_weights_no_ff(const MagneticField< Device > &magnetic_field, const SimdVector2D &x, const Simd< double > &psi_in, SimdGridWeights< Order::One, PhiInterpType::None > &grid_wts) const
Definition: grid.tpp:637
int npsi_surf2
Definition: grid.hpp:282
KOKKOS_INLINE_FUNCTION int get_nearest_node(const Simd< int > &itr, const SimdGridVec &p, int i_simd) const
Definition: grid.tpp:1123
KOKKOS_INLINE_FUNCTION int get_node_index(int triangle_index, int tri_vertex_index) const
Definition: grid.tpp:877
KOKKOS_INLINE_FUNCTION double get_r(const int inode) const
Definition: grid.tpp:1012
KOKKOS_INLINE_FUNCTION bool node_is_inside_psi_range(const MagneticField< Device > &magnetic_field, const int node) const
Definition: grid.tpp:851
VolumesAndAreas(int ntriangle_in, int nnode_in)
Definition: grid.hpp:30
KOKKOS_INLINE_FUNCTION void nearest_node(const SimdGridWeights< Order::One, PIT > &grid_wts, SimdGridWeights< Order::Zero, PIT > &grid_wts0) const
Definition: grid.tpp:729
KOKKOS_INLINE_FUNCTION int get_plane_index(double phi) const
Definition: grid.tpp:864
KOKKOS_INLINE_FUNCTION void search_tr2_no_precheck(const double r, const double z, int &itr, double(&p)[3]) const
Definition: grid.tpp:247
KOKKOS_INLINE_FUNCTION void wedge_modulo_phi(Simd< double > &phi_mod) const
Definition: grid.tpp:767
Simd< double > phi
Definition: simd.hpp:152
View< double *, CLayout, HostType > tr_vol_h
Definition: grid.hpp:22
KOKKOS_INLINE_FUNCTION void search_tr2(const SimdVector2D &xy, Simd< int > &itr, SimdGridVec &pout) const
Definition: grid.tpp:298
Definition: matrix.hpp:13
KOKKOS_INLINE_FUNCTION void follow_field_to_midplane(const MagneticField< Device > &magnetic_field, const SimdVector2D &x, const Simd< double > &phi, SimdVector2D &xff) const
Definition: grid.tpp:603
Simd< double > z
Definition: simd.hpp:151
KOKKOS_INLINE_FUNCTION double node_area_to_volume(const MagneticField< Device > &magnetic_field, double area, int node_index) const
Definition: grid.tpp:893
Definition: grid_structs.hpp:7
KOKKOS_INLINE_FUNCTION bool node_is_in_region_1_or_2_no_wall(const int inode) const
Definition: grid.tpp:949
View< T *, CLayout, Device > my_mirror_view(const View< T *, CLayout, Device > &view, Device nd)
Definition: my_mirror_view.hpp:14
Kokkos::View< int *, Kokkos::LayoutRight, Device > node_to_wall
Definition: grid.hpp:299
Kokkos::View< int *, Kokkos::LayoutRight, Device > wall_nodes
Definition: grid.hpp:298
KOKKOS_INLINE_FUNCTION double get_dist2_from_node(const int inode, const double r, const double z) const
Definition: grid.tpp:1027
Definition: grid_weights.hpp:56
View< double *, CLayout, HostType > node_vol_h
Definition: grid.hpp:25
UniformRange psi00
Definition: grid.hpp:286
View< int **, CLayout, Device > tr
Definition: grid.hpp:54
Projection(int nnode)
Definition: grid.hpp:59
Definition: magnetic_field.F90:1
void draw_ascii_grid(MagneticField< Device > magnetic_field, double rmin, double rmax, double dr, double zmin, double zmax, double dz)
Definition: grid.hpp:237
Definition: simd.hpp:139
Definition: uniform_range.hpp:6
KOKKOS_INLINE_FUNCTION void set_gradient_mat_triangle(const View< int *, CLayout, DeviceType > &num_t_node, const View< int **, CLayout, DeviceType > &tr_node, const View< double *, CLayout, DeviceType > &tr_area, const View< double ***, CLayout, DeviceType > &unit_vecs, const int i, const GradientMatrices< Device > &gradient_matrices) const
Definition: grid.tpp:1166
KOKKOS_INLINE_FUNCTION void get_grid_weights(const MagneticField< Device > &magnetic_field, const SimdVector &v, const Simd< double > &psi, SimdVector2D &xff, SimdGridWeights< Order::One, PIT > &grid_wts) const
Definition: grid.tpp:682
double maxval_psi_surf2
Definition: grid.hpp:284
int nnode
Number of grid nodes.
Definition: grid.hpp:266
double delta_phi
Distance between planes.
Definition: grid.hpp:269
double eps_flux_surface
The minimum difference in psi that counts as being on two different flux surfaces.
Definition: grid.hpp:301
Kokkos::View< VertexMap *, Kokkos::LayoutRight, Device > mapping
Definition: grid.hpp:278
KOKKOS_INLINE_FUNCTION void psi_search(double psi, double &wp, int &ip) const
Definition: grid.tpp:556
View< double **, CLayout, Device > dx
Definition: grid.hpp:56
KOKKOS_INLINE_FUNCTION void set_grad_matrix_from_psi_theta(bool is_psi_dir, int itr_pos, int itr_neg, double(&p_pos)[3], double(&p_neg)[3], double dl_pos, double dl_neg, int inode, const Matrix< Device > &matrix) const
Definition: grid.tpp:1353
Kokkos::ViewAllocateWithoutInitializing NoInit
Definition: space_settings.hpp:68
View< double *, CLayout, HostType > node_vol_nearest_h
Definition: grid.hpp:24
VolumesAndAreas()
Definition: grid.hpp:28
KOKKOS_INLINE_FUNCTION bool node_is_in_region_1_or_2(const MagneticField< Device > &magnetic_field, const int inode) const
Definition: grid.tpp:988
Kokkos::View< Vertex *, Kokkos::LayoutRight, Device > nodes
Definition: grid.hpp:277
Kokkos::View< RZPair *, Kokkos::LayoutRight, Device > gx
Definition: grid.hpp:292
View< double **, CLayout, HostType > node_vol_ff_h
Definition: grid.hpp:23