XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
flux_surface_average.hpp
Go to the documentation of this file.
1 #ifndef FLUX_SURFACE_AVERAGE_HPP
2 #define FLUX_SURFACE_AVERAGE_HPP
3 
4 #include "plane.hpp"
5 #include "volumes_and_areas.hpp"
6 
7 template<class Device>
9  // This line enables private access between the host and device implementations of this class
10  // i.e. Makes the copy from host to device more straightforward
11  template<class Device2> friend class FluxSurfaceAverage;
12 
15  View<double*, CLayout, Device> surf_vol;
16  View<double*, CLayout, Device> surf_vol_3D;
17 
18  void wall_nodes_strikep_method(NLReader::NamelistReader& nlr, const MagneticField<DeviceType>& magnetic_field, const Plane<HostType>& plane, const PlaneFiles& plane_files, const View<double*,CLayout,HostType>& psi_surf, const View<int*,CLayout,DeviceType>& num_t_node, const View<int**,CLayout,DeviceType>& tr_node);
19 
20  public:
21 
23 
24  // Create a mirror with a different device type
25  template<class Device2>
28 
29  m.to_flux_surface = to_flux_surface.template mirror<Device2>();
30  m.from_flux_surface = from_flux_surface.template mirror<Device2>();
31 
32  m.surf_vol = my_mirror_view(surf_vol, Device2());
34 
35  m.surf_vol_3D = my_mirror_view(surf_vol_3D, Device2());
37 
38  return m;
39  }
40 
41  FluxSurfaceAverage(NLReader::NamelistReader& nlr, const DomainDecomposition<DeviceType>& pol_decomp, const MagneticField<DeviceType>& magnetic_field, const Plane<HostType>& plane, const PlaneFiles& plane_files, const VolumesAndAreas& volumes_and_areas, const View<int*,CLayout,DeviceType>& num_t_node, const View<int**,CLayout,DeviceType>& tr_node);
42 
43  View<double*, CLayout, Device> to_surf(const View<double*, CLayout, Device>& input) const;
44 
45  void from_surf(const View<double*, CLayout, Device>& input, const View<double*, CLayout, Device>& output) const;
46 
47  View<double*, CLayout, Device> average(const View<double*, CLayout, Device>& array) const;
48 
49  View<double*, CLayout, Device> average(const View<double*, CLayout, Device>& array, const View<double*, CLayout, Device>& output_surf) const;
50 
51  void average(const View<double*, CLayout, Device>& array, const View<double*, CLayout, Device>& output_surf, const View<double*, CLayout, Device>& tmp00) const;
52 
53  void average(const View<double**, CLayout, Device>& array) const;
54 
55  View<double*, CLayout, Device> average_3D(const DomainDecomposition<DeviceType>& pol_decomp, const View<double*, CLayout, Device>& array, const View<double*, CLayout, Device>& output_array) const;
56 
57  int nsurfs() const;
58 };
59 
60 #endif
FluxSurfaceAverage()
Definition: flux_surface_average.hpp:22
Matrix< Device > to_flux_surface
Definition: flux_surface_average.hpp:13
void mirror_copy(T1 &view_dest, const T2 &view_src)
Definition: my_mirror_view.hpp:122
void wall_nodes_strikep_method(NLReader::NamelistReader &nlr, const MagneticField< DeviceType > &magnetic_field, const Plane< HostType > &plane, const PlaneFiles &plane_files, const View< double *, CLayout, HostType > &psi_surf, const View< int *, CLayout, DeviceType > &num_t_node, const View< int **, CLayout, DeviceType > &tr_node)
Definition: NamelistReader.hpp:193
Definition: magnetic_field.hpp:12
void from_surf(const View< double *, CLayout, Device > &input, const View< double *, CLayout, Device > &output) const
Definition: flux_surface_average.cpp:360
View< double *, CLayout, Device > average_3D(const DomainDecomposition< DeviceType > &pol_decomp, const View< double *, CLayout, Device > &array, const View< double *, CLayout, Device > &output_array) const
Definition: flux_surface_average.cpp:436
View< double *, CLayout, Device > to_surf(const View< double *, CLayout, Device > &input) const
Definition: flux_surface_average.cpp:346
Definition: flux_surface_average.hpp:8
Definition: plane.hpp:17
Matrix< Device > from_flux_surface
Definition: flux_surface_average.hpp:14
Definition: volumes_and_areas.hpp:8
int nsurfs() const
Definition: flux_surface_average.cpp:468
FluxSurfaceAverage< Device2 > mirror() const
Definition: flux_surface_average.hpp:26
Definition: matrix.hpp:11
View< double *, CLayout, Device > surf_vol
Definition: flux_surface_average.hpp:15
View< T *, CLayout, Device > my_mirror_view(const View< T *, CLayout, Device > &view, Device nd)
Definition: my_mirror_view.hpp:14
Definition: magnetic_field.F90:1
Definition: grid_files.hpp:21
View< double *, CLayout, Device > average(const View< double *, CLayout, Device > &array) const
Definition: flux_surface_average.cpp:373
View< double *, CLayout, Device > surf_vol_3D
Definition: flux_surface_average.hpp:16