XGC1
 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  // This isn't used on GPU right now
119  //m.adj = my_mirror_view(adj, Device2());
120  //mirror_copy(m.adj, adj);
121 
122  m.nwall = nwall;
123  m.wall_nodes = my_mirror_view(wall_nodes, Device2());
125  m.node_to_wall = my_mirror_view(node_to_wall, Device2());
127 
129 
130  m.volumes_and_areas = volumes_and_areas; // Doesn't require mirror view since everything is on host
131 
134 
135 #ifdef NO_FORTRAN_MODULES
136  m.gradient_matrices_h = gradient_matrices_h;
137 #endif
138 
139  return m;
140  }
141 
142  void write_to_file() const;
143 
144  KOKKOS_INLINE_FUNCTION void t_coeff(const SimdVector2D &x, const Simd<int>& itr, SimdGridVec &p) const;
145 
146  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;
147 
148  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;
149 
150  KOKKOS_INLINE_FUNCTION void search_tr2_no_precheck(const double r, const double z, int& itr, double (&p)[3]) const;
151 
152  KOKKOS_INLINE_FUNCTION void search_tr2( const SimdVector2D &xy, Simd<int>& itr, SimdGridVec &pout ) const;
153 
154  KOKKOS_INLINE_FUNCTION void search_tr_check_guess(const SimdVector2D &x, const Simd<int>& old_itr,Simd<int>& itr,SimdGridVec &p ) const;
155 
156  KOKKOS_INLINE_FUNCTION void psi_search(double psi,double &wp,int &ip) const;
157 
158  KOKKOS_INLINE_FUNCTION void follow_field_to_midplane(const MagneticField<Device> &magnetic_field, const SimdVector2D &x, const Simd<double>& phi, SimdVector2D &xff) const;
159 
160  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;
161 
162  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;
163 
164  template<PhiInterpType PIT>
165  KOKKOS_INLINE_FUNCTION void nearest_node(const SimdGridWeights<Order::One, PIT>& grid_wts, SimdGridWeights<Order::Zero, PIT>& grid_wts0) const;
166 
167  template<PhiInterpType PIT>
168  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;
169 
170  template<PhiInterpType PIT>
171  KOKKOS_INLINE_FUNCTION void get_grid_weights(const MagneticField<Device> &magnetic_field, const SimdVector &v, SimdVector2D &xff, SimdGridWeights<Order::One, PIT>& grid_wts) const;
172 
173  template<PhiInterpType PIT>
174  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;
175 
176  template<PhiInterpType PIT>
177  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;
178 
179  template<PhiInterpType PIT>
180  KOKKOS_INLINE_FUNCTION void get_grid_weights(const MagneticField<Device> &magnetic_field, const SimdVector &v, SimdGridWeights<Order::Zero, PIT>& grid_wts) const;
181 
182  template<PhiInterpType PIT>
183  KOKKOS_INLINE_FUNCTION void get_grid_weights(const MagneticField<Device> &magnetic_field, const SimdVector &v, SimdGridWeights<Order::One, PIT>& grid_wts) const;
184 
185  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;
186 
187  KOKKOS_INLINE_FUNCTION void wedge_modulo_phi(Simd<double>& phi_mod) const;
188 
189  KOKKOS_INLINE_FUNCTION double wedge_modulo_phi(double phi) const;
190 
191  KOKKOS_INLINE_FUNCTION bool node_is_inside_psi_range(const MagneticField<Device> &magnetic_field, const int node) const;
192 
193  KOKKOS_INLINE_FUNCTION int get_plane_index(double phi) const;
194 
195  KOKKOS_INLINE_FUNCTION int get_node_index(int triangle_index, int tri_vertex_index) const;
196 
197  KOKKOS_INLINE_FUNCTION double node_area_to_volume(const MagneticField<Device> &magnetic_field, double area, int node_index) const;
198 
199  KOKKOS_INLINE_FUNCTION void get_triangle_area_and_volume(const MagneticField<Device> &magnetic_field, int i, double& area, double& volume) const;
200 
201  KOKKOS_INLINE_FUNCTION double get_r_center_of_mass(int itr) const;
202 
203  KOKKOS_INLINE_FUNCTION bool node_is_in_region_1_or_2_no_wall(const int inode) const;
204 
205  KOKKOS_INLINE_FUNCTION bool node_is_in_private_region_no_wall(const int inode) const;
206 
207  KOKKOS_INLINE_FUNCTION bool node_is_in_included_region(const int inode, const bool exclude_private_region) const;
208 
209  KOKKOS_INLINE_FUNCTION bool node_is_in_region_1_or_2(const MagneticField<Device> &magnetic_field, const int inode) const;
210 
211  KOKKOS_INLINE_FUNCTION int uses_rz_basis(const int inode) const;
212 
213  KOKKOS_INLINE_FUNCTION double get_r(const int inode) const;
214 
215  KOKKOS_INLINE_FUNCTION double get_dist2_from_node(const int inode, const double r, const double z) const;
216 
217  KOKKOS_INLINE_FUNCTION double get_dist_from_node(const int inode, const double r, const double z) const;
218 
219  KOKKOS_INLINE_FUNCTION void get_rz_coordinates(const int inode, double& r, double& z) const;
220 
221  KOKKOS_INLINE_FUNCTION void get_rz_coordinates(const Simd<int>& grid_inds, SimdVector2D& x) const;
222 
223  KOKKOS_INLINE_FUNCTION void get_rz_coordinates(const int itr, const double (&p)[3], double& r, double& z) const;
224 
225  KOKKOS_INLINE_FUNCTION void get_rz_coordinates(const Simd<int>& itr, const SimdGridVec& p, SimdVector2D& x) const;
226 
227  KOKKOS_INLINE_FUNCTION int get_nearest_node(const Simd<int>& itr, const SimdGridVec& p, int i_simd) const;
228 
229  KOKKOS_INLINE_FUNCTION int get_nearest_node(const int itr, const double (&p)[3]) const;
230 
231  KOKKOS_INLINE_FUNCTION double get_nearest_midplane(double phi) const;
232 
233  KOKKOS_INLINE_FUNCTION void set_gradient_mat_triangle(const View<int*,CLayout,DeviceType>& num_t_node,
234  const View<int**,CLayout,DeviceType>& tr_node, const View<double*,CLayout,DeviceType>& tr_area,
235  const View<double***, CLayout, DeviceType>& unit_vecs,
236  const int i, const GradientMatrices<Device>& gradient_matrices) const;
237 
238  KOKKOS_INLINE_FUNCTION int get_characteristic_length(const View<int*,CLayout,DeviceType>& num_t_node,
239  const View<int**,CLayout,DeviceType>& tr_node, const int i,
240  double& dist_triangle, double& dist_psi, double& dist_theta) const;
241 
242  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;
243 
244  void draw_ascii_grid(MagneticField<Device> magnetic_field, double rmin, double rmax, double dr, double zmin, double zmax, double dz){
245  printf("\n\n******** PLOT OF GRID ******* \n");
246  Kokkos::View<int*,HostType> save_vert("save_vert", 1+((rmax-rmin)/dr));
247  for (double zplot = zmax; zplot>=zmin; zplot-=dz){
248  printf("\n");
249  int save_num = 0;
250  int rsave_ind = -1;
251  for (double rplot = rmin; rplot<=rmax; rplot+=dr){
252  rsave_ind++;
253  SimdVector v;
254  v.r = rplot;
255  v.z = zplot;
256  v.phi = 0.001;
257 
258  // Get itr (triangle index)
259  SimdGridVec p;
260  Simd<int> itr = -1;
261  get_grid_weights(magnetic_field, v, itr, p);
262  if(itr[0]!=save_num || itr[0]!=save_vert[rsave_ind]){
263  if(itr[0]<10 && itr[0]>=0) printf("%d ",itr[0]);
264  else printf("%d ",itr[0]);
265  save_num = itr[0];
266  save_vert[rsave_ind] = itr[0];
267  } else {printf(" ");}
268  }
269  }
270  }
271 
272  int ntriangle;
273  int nnode;
274  int nplanes;
275  double wedge_angle;
276  double delta_phi;
277  double inv_delta_phi;
278 
279  Kokkos::View<double*,Kokkos::LayoutRight,Device> psi;
280  Kokkos::View<double*,Kokkos::LayoutRight,Device> bfield;
281 
282  private:
283  Kokkos::View<int*, Kokkos::LayoutRight,Device> basis;
284  Kokkos::View<Vertex*,Kokkos::LayoutRight,Device> nodes;
285  Kokkos::View<VertexMap*,Kokkos::LayoutRight,Device> mapping;
287 
288  public:
292  Kokkos::View<double*,Kokkos::LayoutRight,Device> psi_surf2;
294 
295  private:
297 
298  Kokkos::View<int*,Kokkos::LayoutRight,Device> rgn;
299  Kokkos::View<RZPair*,Kokkos::LayoutRight,Device> gx;
300 
301  View<int**,CLayout,Device> adj;
302 
303  public:
304  int nwall;
305 
306  //private:
307  Kokkos::View<int*,Kokkos::LayoutRight,Device> wall_nodes;
308  Kokkos::View<int*,Kokkos::LayoutRight,Device> node_to_wall;
309 
311 
312  public:
313 
314  // Volume- and Area-related Host Views. Should find a different location for these so that these unused views aren't sent to GPU
316 
317  // Projections - reside in host memory for now
320 
321 
322 #ifdef NO_FORTRAN_MODULES
323  GradientMatrices<HostType> gradient_matrices_h;
324 #endif
325 };
326 
327 #include "grid.tpp"
328 #endif
Projection< HostType > one_plane_ff
Definition: grid.hpp:319
KOKKOS_INLINE_FUNCTION void t_coeff(const SimdVector2D &x, const Simd< int > &itr, SimdGridVec &p) const
Definition: grid.tpp:510
double inv_delta_phi
1/delta_phi
Definition: grid.hpp:277
VolumesAndAreas volumes_and_areas
Definition: grid.hpp:315
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:674
void init_fortran_vols_and_areas(double *tr_area_h, double *tr_vol_h, double *node_vol_ff_h, double *node_vol_nearest_h, double *node_vol_h, double *node_area_h)
Definition: simd.hpp:149
GuessList1D< Device > psi_guess
Definition: grid.hpp:296
Definition: grid.hpp:53
Projection()
Definition: grid.hpp:58
KOKKOS_INLINE_FUNCTION double get_r_center_of_mass(int itr) const
Definition: grid.tpp:965
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:73
Kokkos::View< double *, Kokkos::LayoutRight, Device > bfield
Magnetic field magnitude at nodes.
Definition: grid.hpp:280
int ntriangle
Number of grid triangles.
Definition: grid.hpp:272
KOKKOS_INLINE_FUNCTION double get_dist_from_node(const int inode, const double r, const double z) const
Definition: grid.tpp:1072
double minval_psi_surf2
Definition: grid.hpp:290
View< int **, CLayout, Device > adj
The indices of the three adjacent triangles for each triangle.
Definition: grid.hpp:301
KOKKOS_INLINE_FUNCTION bool node_is_in_private_region_no_wall(const int inode) const
Definition: grid.tpp:992
Definition: grid_weights.hpp:47
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:1259
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:1005
View< double *, CLayout, HostType > node_area_h
Definition: grid.hpp:26
Definition: grid_files.hpp:608
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:939
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:389
int nplanes
Number of planes.
Definition: grid.hpp:274
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:820
Projection< HostType > half_plane_ff
Definition: grid.hpp:318
KOKKOS_INLINE_FUNCTION double get_nearest_midplane(double phi) const
Definition: grid.tpp:1182
KOKKOS_INLINE_FUNCTION int uses_rz_basis(const int inode) const
Definition: grid.tpp:1031
Kokkos::View< double *, Kokkos::LayoutRight, Device > psi_surf2
Definition: grid.hpp:292
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:275
int nwall
Definition: grid.hpp:304
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:528
Kokkos::View< double *, Kokkos::LayoutRight, Device > psi
An array of psi coordinates.
Definition: grid.hpp:279
KOKKOS_INLINE_FUNCTION void get_rz_coordinates(const int inode, double &r, double &z) const
Definition: grid.tpp:1097
void write_to_file() const
Definition: guess_table.hpp:8
GuessTable< Device > guess
Definition: grid.hpp:286
Kokkos::View< int *, Kokkos::LayoutRight, Device > rgn
Definition: grid.hpp:298
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:283
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:653
int npsi_surf2
Definition: grid.hpp:289
KOKKOS_INLINE_FUNCTION int get_nearest_node(const Simd< int > &itr, const SimdGridVec &p, int i_simd) const
Definition: grid.tpp:1154
KOKKOS_INLINE_FUNCTION int get_node_index(int triangle_index, int tri_vertex_index) const
Definition: grid.tpp:908
KOKKOS_INLINE_FUNCTION double get_r(const int inode) const
Definition: grid.tpp:1043
KOKKOS_INLINE_FUNCTION bool node_is_inside_psi_range(const MagneticField< Device > &magnetic_field, const int node) const
Definition: grid.tpp:882
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:752
KOKKOS_INLINE_FUNCTION int get_plane_index(double phi) const
Definition: grid.tpp:895
KOKKOS_INLINE_FUNCTION void search_tr2_no_precheck(const double r, const double z, int &itr, double(&p)[3]) const
Definition: grid.tpp:263
KOKKOS_INLINE_FUNCTION void wedge_modulo_phi(Simd< double > &phi_mod) const
Definition: grid.tpp:790
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:314
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:619
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:924
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:980
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:308
Kokkos::View< int *, Kokkos::LayoutRight, Device > wall_nodes
Definition: grid.hpp:307
KOKKOS_INLINE_FUNCTION double get_dist2_from_node(const int inode, const double r, const double z) const
Definition: grid.tpp:1058
Definition: grid_weights.hpp:52
View< double *, CLayout, HostType > node_vol_h
Definition: grid.hpp:25
UniformRange psi00
Definition: grid.hpp:293
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:244
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:1197
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:705
double maxval_psi_surf2
Definition: grid.hpp:291
int nnode
Number of grid nodes.
Definition: grid.hpp:273
double delta_phi
Distance between planes.
Definition: grid.hpp:276
double eps_flux_surface
The minimum difference in psi that counts as being on two different flux surfaces.
Definition: grid.hpp:310
Kokkos::View< VertexMap *, Kokkos::LayoutRight, Device > mapping
Definition: grid.hpp:285
KOKKOS_INLINE_FUNCTION void psi_search(double psi, double &wp, int &ip) const
Definition: grid.tpp:572
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:1384
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:1019
Kokkos::View< Vertex *, Kokkos::LayoutRight, Device > nodes
Definition: grid.hpp:284
Kokkos::View< RZPair *, Kokkos::LayoutRight, Device > gx
Definition: grid.hpp:299
View< double **, CLayout, HostType > node_vol_ff_h
Definition: grid.hpp:23