XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
distribution.hpp
Go to the documentation of this file.
1 #ifndef DISTRIBUTION_HPP
2 #define DISTRIBUTION_HPP
3 
4 #include <Kokkos_Core.hpp>
5 #include "space_settings.hpp"
6 #include "globals.hpp"
7 #include "velocity_grid.hpp"
8 
9 template<class Device>
10 struct Distribution{
11 
12  // Suffix _h to distinguish the host versions
13  // Local Domain arrays
14  View<double***,CLayout, Kokkos::HostSpace, Kokkos::MemoryTraits<Kokkos::Unmanaged>> f0g_h;
15  View<double***,CLayout,Device> f0g;
16 
17  View<double*,Kokkos::HostSpace, Kokkos::MemoryTraits<Kokkos::Unmanaged>> fg_temp_ev_h;
18  View<double*,CLayout,Device> fg_temp_ev;
19 
20  View<double*,Kokkos::HostSpace, Kokkos::MemoryTraits<Kokkos::Unmanaged>> fg_flow_h;
21  View<double*,CLayout,Device> fg_flow;
22 
23  View<double*,Kokkos::HostSpace, Kokkos::MemoryTraits<Kokkos::Unmanaged>> fg_vth_inv_h;
24  View<double*,CLayout,Device> fg_vth_inv;
25 
26 
27  View<double*,Kokkos::HostSpace, Kokkos::MemoryTraits<Kokkos::Unmanaged>> grid_vol_h;
28  View<double*,CLayout,Device> grid_vol;
29 
30  View<double*,Kokkos::HostSpace, Kokkos::MemoryTraits<Kokkos::Unmanaged>> grid_vol_vonly_h;
31  View<double*,CLayout,Device> grid_vol_vonly;
32 
33  View<double*,Kokkos::HostSpace, Kokkos::MemoryTraits<Kokkos::Unmanaged>> inv_grid_vol_h;
34  View<double*,CLayout,Device> inv_grid_vol;
35 
36  // following strucutre variables are related to f_Maxwellian
37  View<double*,Kokkos::HostSpace, Kokkos::MemoryTraits<Kokkos::Unmanaged>> temp_ev_h;
38  View<double*,CLayout,Device> temp_ev;
39 
40  View<double*,Kokkos::HostSpace, Kokkos::MemoryTraits<Kokkos::Unmanaged>> flow_h;
41  View<double*,CLayout,Device> flow;
42 
43  View<double*,Kokkos::HostSpace, Kokkos::MemoryTraits<Kokkos::Unmanaged>> den_h;
44  View<double*,CLayout,Device> den;
45 
46  // Plane Domain arrays
47  View<double*,CLayout,HostType, Kokkos::MemoryTraits<Kokkos::Unmanaged>> delta_n_h;
48  View<double*,CLayout,Device> delta_n;
49 
50  View<double*,CLayout,HostType, Kokkos::MemoryTraits<Kokkos::Unmanaged>> delta_u_h;
51  View<double*,CLayout,Device> delta_u;
52 
53  View<double*,CLayout,HostType, Kokkos::MemoryTraits<Kokkos::Unmanaged>> delta_T_h;
54  View<double*,CLayout,Device> delta_T;
55 
56  View<double*,CLayout, HostType, Kokkos::MemoryTraits<Kokkos::Unmanaged>> den_global_h;
57  View<double*,CLayout,Device> den_global;
58 
59  View<double*,CLayout, HostType, Kokkos::MemoryTraits<Kokkos::Unmanaged>> temp_global_h;
60  View<double*,CLayout,Device> temp_global;
61 
62 
64 
66  f0g = View<double***,CLayout,Device>(NoInit("f0g"), f0g_h.layout());
67  Kokkos::deep_copy(f0g, f0g_h);
68  }
69 
71  fg_temp_ev = View<double*,CLayout,Device>(NoInit("fg_temp_ev"), fg_temp_ev_h.layout());
72  Kokkos::deep_copy(fg_temp_ev, fg_temp_ev_h);
73  }
74 
76  fg_flow = View<double*,CLayout,Device>(NoInit("fg_flow"), fg_flow_h.layout());
77  Kokkos::deep_copy(fg_flow, fg_flow_h);
78  }
79 
81  fg_vth_inv = View<double*,CLayout,Device>(NoInit("fg_vth_inv"), fg_vth_inv_h.layout());
82  Kokkos::deep_copy(fg_vth_inv, fg_vth_inv_h);
83  }
84 
86  temp_ev = View<double*,CLayout,Device>(NoInit("temp_ev"), temp_ev_h.layout());
87  Kokkos::deep_copy(temp_ev, temp_ev_h);
88  }
89 
91  den = View<double*,CLayout,Device>(NoInit("den"), den_h.layout());
92  Kokkos::deep_copy(den, den_h);
93  }
94 
96  flow = View<double*,CLayout,Device>(NoInit("flow"), flow_h.layout());
97  Kokkos::deep_copy(flow, flow_h);
98  }
99 
101  grid_vol = View<double*,CLayout,Device>(NoInit("grid_vol"), grid_vol_h.layout());
102  Kokkos::deep_copy(grid_vol, grid_vol_h);
103  }
104 
106  grid_vol_vonly = View<double*,CLayout,Device>(NoInit("grid_vol_vonly"), grid_vol_vonly_h.layout());
107  Kokkos::deep_copy(grid_vol_vonly, grid_vol_vonly_h);
108  }
109 
111  inv_grid_vol = View<double*,CLayout,Device>(NoInit("inv_grid_vol"), inv_grid_vol_h.layout());
112  Kokkos::deep_copy(inv_grid_vol, inv_grid_vol_h);
113  }
114 
116  delta_n = View<double*,CLayout,Device>(NoInit("delta_n"), delta_n_h.layout());
117  Kokkos::deep_copy(delta_n, delta_n_h);
118  }
119 
121  delta_u = View<double*,CLayout,Device>(NoInit("delta_u"), delta_u_h.layout());
122  Kokkos::deep_copy(delta_u, delta_u_h);
123  }
124 
126  delta_T = View<double*,CLayout,Device>(NoInit("delta_T"), delta_T_h.layout());
127  Kokkos::deep_copy(delta_T, delta_T_h);
128  }
129 
131  den_global = View<double*,CLayout,Device>(NoInit("den_global"), den_global_h.layout());
132  Kokkos::deep_copy(den_global, den_global_h);
133  }
134 
136  temp_global = View<double*,CLayout,Device>(NoInit("temp_global"), temp_global_h.layout());
137  Kokkos::deep_copy(temp_global, temp_global_h);
138  }
139 
140  // Deallocates all device views (doesn't matter if they are already deallocated)
142  f0g = View<double***,CLayout,Device>();
143 
144  fg_temp_ev = View<double*,CLayout,Device>();
145  fg_flow = View<double*,CLayout,Device>();
146  fg_vth_inv = View<double*,CLayout,Device>();
147 
148  grid_vol = View<double*,CLayout,Device>();
149  grid_vol_vonly = View<double*,CLayout,Device>();
150  inv_grid_vol = View<double*,CLayout,Device>();
151 
152  //F_M below
153  temp_ev = View<double*,CLayout,Device>();
154  flow = View<double*,CLayout,Device>();
155  den = View<double*,CLayout,Device>();
156 
157  delta_n = View<double*,CLayout,Device>();
158  delta_u = View<double*,CLayout,Device>();
159  delta_T = View<double*,CLayout,Device>();
160 
161  den_global = View<double*,CLayout,Device>();
162  temp_global = View<double*,CLayout,Device>();
163  }
164 };
165 #endif
View< double *, CLayout, Device > fg_flow
Definition: distribution.hpp:21
View< double *, CLayout, Device > den
Definition: distribution.hpp:44
void grid_vol_vonly_send_to_device()
Definition: distribution.hpp:105
void temp_ev_send_to_device()
Definition: distribution.hpp:85
void fg_vth_inv_send_to_device()
Definition: distribution.hpp:80
View< double *, CLayout, Device > den_global
Definition: distribution.hpp:57
View< double *, CLayout, Device > temp_global
Definition: distribution.hpp:60
View< double *, CLayout, Device > grid_vol_vonly
Definition: distribution.hpp:31
void den_send_to_device()
Definition: distribution.hpp:90
View< double *, CLayout, Device > temp_ev
Definition: distribution.hpp:38
void grid_vol_send_to_device()
Definition: distribution.hpp:100
void flow_send_to_device()
Definition: distribution.hpp:95
Distribution()
Definition: distribution.hpp:63
View< double *, Kokkos::HostSpace, Kokkos::MemoryTraits< Kokkos::Unmanaged > > fg_temp_ev_h
Definition: distribution.hpp:17
View< double ***, CLayout, Device > f0g
Definition: distribution.hpp:15
View< double ***, CLayout, Kokkos::HostSpace, Kokkos::MemoryTraits< Kokkos::Unmanaged > > f0g_h
Definition: distribution.hpp:14
View< double *, Kokkos::HostSpace, Kokkos::MemoryTraits< Kokkos::Unmanaged > > inv_grid_vol_h
Definition: distribution.hpp:33
View< double *, Kokkos::HostSpace, Kokkos::MemoryTraits< Kokkos::Unmanaged > > den_h
Definition: distribution.hpp:43
View< double *, Kokkos::HostSpace, Kokkos::MemoryTraits< Kokkos::Unmanaged > > fg_vth_inv_h
Definition: distribution.hpp:23
View< double *, CLayout, Device > flow
Definition: distribution.hpp:41
View< double *, CLayout, Device > grid_vol
Definition: distribution.hpp:28
void fg_flow_send_to_device()
Definition: distribution.hpp:75
View< double *, Kokkos::HostSpace, Kokkos::MemoryTraits< Kokkos::Unmanaged > > temp_ev_h
Definition: distribution.hpp:37
View< double *, Kokkos::HostSpace, Kokkos::MemoryTraits< Kokkos::Unmanaged > > flow_h
Definition: distribution.hpp:40
View< double *, CLayout, HostType, Kokkos::MemoryTraits< Kokkos::Unmanaged > > temp_global_h
Definition: distribution.hpp:59
View< double *, CLayout, HostType, Kokkos::MemoryTraits< Kokkos::Unmanaged > > delta_n_h
Definition: distribution.hpp:47
View< double *, CLayout, HostType, Kokkos::MemoryTraits< Kokkos::Unmanaged > > den_global_h
Definition: distribution.hpp:56
void fg_temp_ev_send_to_device()
Definition: distribution.hpp:70
View< double *, CLayout, HostType, Kokkos::MemoryTraits< Kokkos::Unmanaged > > delta_u_h
Definition: distribution.hpp:50
View< double *, CLayout, HostType, Kokkos::MemoryTraits< Kokkos::Unmanaged > > delta_T_h
Definition: distribution.hpp:53
void inv_grid_vol_send_to_device()
Definition: distribution.hpp:110
View< double *, Kokkos::HostSpace, Kokkos::MemoryTraits< Kokkos::Unmanaged > > grid_vol_vonly_h
Definition: distribution.hpp:30
View< double *, Kokkos::HostSpace, Kokkos::MemoryTraits< Kokkos::Unmanaged > > grid_vol_h
Definition: distribution.hpp:27
View< double *, CLayout, Device > delta_n
Definition: distribution.hpp:48
void den_global_send_to_device()
Definition: distribution.hpp:130
View< double *, CLayout, Device > delta_T
Definition: distribution.hpp:54
View< double *, CLayout, Device > fg_vth_inv
Definition: distribution.hpp:24
void temp_global_send_to_device()
Definition: distribution.hpp:135
void deallocate_device_views()
Definition: distribution.hpp:141
View< double *, CLayout, Device > inv_grid_vol
Definition: distribution.hpp:34
View< double *, CLayout, Device > delta_u
Definition: distribution.hpp:51
void delta_u_send_to_device()
Definition: distribution.hpp:120
View< double *, CLayout, Device > fg_temp_ev
Definition: distribution.hpp:18
void delta_n_send_to_device()
Definition: distribution.hpp:115
void delta_T_send_to_device()
Definition: distribution.hpp:125
View< double *, Kokkos::HostSpace, Kokkos::MemoryTraits< Kokkos::Unmanaged > > fg_flow_h
Definition: distribution.hpp:20
Kokkos::ViewAllocateWithoutInitializing NoInit
Definition: space_settings.hpp:68
Definition: distribution.hpp:10
void f0g_send_to_device()
Definition: distribution.hpp:65