XGC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
volumes_and_areas.hpp
Go to the documentation of this file.
1 #ifndef VOLUMES_AND_AREAS_HPP
2 #define VOLUMES_AND_AREAS_HPP
3 
4 #include "globals.hpp"
5 
6 extern "C" void init_fortran_vols_and_areas(double* tr_area_h, double* tr_vol_h,
7 #ifdef XGC1
8  double* node_vol_ff_h,
9 #endif
10  double* node_vol_nearest_h, double* node_vol_h, double* node_area_h, double* psi00_h, int npsi00);
11 
12 
13 // Volume- and Area-related Host Views. Should find a different location for these so that these unused views aren't sent to GPU
15  View<double*,CLayout,HostType> tr_area_h;
16  View<double*,CLayout,HostType> tr_vol_h;
17  View<double**,CLayout,HostType> node_vol_ff_h; // Default to midplane, for now
18  View<double**,CLayout,HostType> node_vol_ff_l_h; // Field following volume for left plane nodes
19  View<double**,CLayout,HostType> node_vol_ff_r_h; // Field following volume for right plane nnodes
20  View<double*,CLayout,HostType> node_vol_nearest_h;
21  View<double*,CLayout,HostType> node_vol_h;
22  View<double*,CLayout,HostType> node_area_h;
23  View<double*,CLayout,HostType> vol00_h;
24 
26 
27  VolumesAndAreas(int ntriangle_in, int nnode_in, int npsi00_in)
28  : tr_area_h(NoInit("tr_area"), ntriangle_in),
29  tr_vol_h(NoInit("tr_vol"), ntriangle_in),
30 #ifdef XGC1
31  node_vol_ff_h(NoInit("node_vol_ff"),2, nnode_in),
32 #ifdef STELLARATOR
33  node_vol_ff_l_h(NoInit("node_vol_ff_l"),2, nnode_in),
34  node_vol_ff_r_h(NoInit("node_vol_ff_r"),2, nnode_in),
35 #else
36  node_vol_ff_l_h(node_vol_ff_h), // Shallow copy of midplane node_vol_ff
38 #endif
39 #endif
40  node_vol_nearest_h(NoInit("node_vol_nearest"),nnode_in),
41  node_vol_h(NoInit("node_vol"),nnode_in),
42  node_area_h(NoInit("node_area"),nnode_in),
43  vol00_h(NoInit("vol00_h"), npsi00_in)
44  {}
45 
47 #ifndef NO_FORTRAN_MODULES
48  int npsi00 = vol00_h.size();
50 #ifdef XGC1
51  node_vol_ff_h.data(),
52 #endif
53  node_vol_nearest_h.data(), node_vol_h.data(), node_area_h.data(),
54  vol00_h.data(), npsi00);
55 #endif
56  }
57 };
58 
59 #endif
VolumesAndAreas(int ntriangle_in, int nnode_in, int npsi00_in)
Definition: volumes_and_areas.hpp:27
void set_fortran_ptrs()
Definition: volumes_and_areas.hpp:46
View< double *, CLayout, HostType > vol00_h
Definition: volumes_and_areas.hpp:23
View< double *, CLayout, HostType > node_area_h
Definition: volumes_and_areas.hpp:22
Definition: volumes_and_areas.hpp:14
View< double **, CLayout, HostType > node_vol_ff_l_h
Definition: volumes_and_areas.hpp:18
View< double *, CLayout, HostType > tr_area_h
Definition: volumes_and_areas.hpp:15
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, double *psi00_h, int npsi00)
View< double *, CLayout, HostType > tr_vol_h
Definition: volumes_and_areas.hpp:16
View< double *, CLayout, HostType > node_vol_h
Definition: volumes_and_areas.hpp:21
View< double **, CLayout, HostType > node_vol_ff_r_h
Definition: volumes_and_areas.hpp:19
Kokkos::ViewAllocateWithoutInitializing NoInit
Definition: space_settings.hpp:68
View< double *, CLayout, HostType > node_vol_nearest_h
Definition: volumes_and_areas.hpp:20
VolumesAndAreas()
Definition: volumes_and_areas.hpp:25
View< double **, CLayout, HostType > node_vol_ff_h
Definition: volumes_and_areas.hpp:17