XGC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ff_projection.hpp
Go to the documentation of this file.
1 #ifndef FF_PROJECTION_HPP
2 #define FF_PROJECTION_HPP
3 
4 #include "space_settings.hpp"
6 #include "plane.hpp"
7 
8 template<class Device>
9 struct Projection{
10  // This line enables private access between the host and device implementations of this class
11  // i.e. Makes the copy from host to device more straightforward
12  template<class Device2> friend class Projection;
13 
14  enum Method{
17  };
18 
19  bool node_based;
20 
22  View<int**,CLayout,Device> tr;
23  View<int***,CLayout,Device> nd;
24  View<double***,CLayout,Device> p;
25  View<double**,CLayout,Device> dx;
26 
28 
30  const Plane<DeviceType>& plane_start0, const Plane<DeviceType>& plane_dest0, double phi_start0, double phi_dest0, const View<int**,CLayout,DeviceType>& tr_node_dest0,
31  const Plane<DeviceType>& plane_start1, const Plane<DeviceType>& plane_dest1, double phi_start1, double phi_dest1, const View<int**,CLayout,DeviceType>& tr_node_dest1);
32 
33  // Create a mirror with a different device type
34  template<class Device2>
35  inline Projection<Device2> mirror() const{
37 
39 
40  m.tr = my_mirror_view(tr, Device2());
41  mirror_copy(m.tr, tr);
42  m.nd = my_mirror_view(nd, Device2());
43  mirror_copy(m.nd, nd);
44  m.p = my_mirror_view(p, Device2());
45  mirror_copy(m.p, p);
46  m.dx = my_mirror_view(dx, Device2());
47  mirror_copy(m.dx, dx);
48  return m;
49  }
50 
51  Projection(const DomainDecomposition<DeviceType>& pol_decomp, const Projection<HostType>& proj_in, int iphi);
52 };
53 
54 void ff_write_projections_to_file(const Plane<HostType>& midplane, const Plane<HostType>& lplane, const Plane<HostType>& rplane, const Projection<HostType>& half_plane_ff, const Projection<HostType>& ff_lplane_to_neighbors, const Projection<HostType>& ff_to_midplane);
55 
56 
57 void check_ff_property(const Projection<HostType>& projection, const std::string label);
58 
59 #endif
void check_ff_property(const Projection< HostType > &projection, const std::string label)
Definition: ff_projection.cpp:379
Definition: ff_projection.hpp:9
Projection()
Definition: ff_projection.hpp:27
void mirror_copy(T1 &view_dest, const T2 &view_src)
Definition: my_mirror_view.hpp:122
Definition: NamelistReader.hpp:193
Definition: magnetic_field.hpp:12
View< double ***, CLayout, Device > p
Definition: ff_projection.hpp:24
void ff_write_projections_to_file(const Plane< HostType > &midplane, const Plane< HostType > &lplane, const Plane< HostType > &rplane, const Projection< HostType > &half_plane_ff, const Projection< HostType > &ff_lplane_to_neighbors, const Projection< HostType > &ff_to_midplane)
Definition: ff_projection.cpp:362
View< int ***, CLayout, Device > nd
The nodes of the three vertices of the triangles that are mapped to by the projection. Zero-indexed (!)
Definition: ff_projection.hpp:23
View< T *, CLayout, Device > my_mirror_view(const View< T *, CLayout, Device > &view, Device nd)
Definition: my_mirror_view.hpp:14
View< int **, CLayout, Device > tr
The triangles that are mapped to by the projection. One-indexed.
Definition: ff_projection.hpp:22
Projection< Device2 > mirror() const
Definition: ff_projection.hpp:35
Definition: magnetic_field.F90:1
bool node_based
Definition: ff_projection.hpp:19
Definition: ff_projection.hpp:15
Method
Definition: ff_projection.hpp:14
Definition: ff_projection.hpp:16
View< double **, CLayout, Device > dx
Definition: ff_projection.hpp:25