21 template<
class Device, VarType VT, PhiInterpType PIT, TorType TT, KinType KT, ScatterType ST = ScatterType::Atomic>
25 template<
class Device, VarType VT, PhiInterpType PIT>
31 Kokkos::View<field_type*,Kokkos::LayoutRight,Device>
f;
34 GridField(std::string name,
int nphi,
int nrho,
int nnode) : f(name,nnode) {}
35 GridField(std::string name,
int nnode) : f(name,nnode) {}
37 int size()
const {
return f.size();}
38 int nnode()
const {
return f.extent(0);}
40 int nphi()
const {
return 1;}
42 KOKKOS_INLINE_FUNCTION
bool is_allocated()
const {
return f.is_allocated();}
43 KOKKOS_INLINE_FUNCTION
field_type& operator ()(
int inode)
const {
return f(inode);}
47 f(node).scatter(phi_wts, i_simd, particle_weight);
52 for (
int j = 0; j<3; j++){
55 double wp=grid_wts.p[j][i_simd];
58 scatter(node, grid_wts.phi_wts, i_simd, wp*particle_weight);
67 for (
int i_simd = 0; i_simd<SIMD_SIZE; i_simd++){
68 if(grid_wts.is_invalid(i_simd))
continue;
71 for (
int ip = 0; ip<3; ip++){
73 double wp = grid_wts.p[ip][i_simd];
74 f(node).gather(fld,i_simd,wp);
84 for (
int i_simd = 0; i_simd<SIMD_SIZE; i_simd++){
85 if(grid_wts.is_invalid(i_simd))
continue;
88 for (
int ip = 0; ip<3; ip++){
90 double wp = grid_wts.p[ip][i_simd];
91 f(node).gather(fld,i_simd,wp,grid_wts.phi_wts);
98 for (
int i_simd = 0; i_simd<SIMD_SIZE; i_simd++){
100 int itr_work = grid_wts.
is_valid(i_simd) ? grid_wts.
itr[i_simd] : 1;
103 for (
int ip = 0; ip<3; ip++){
105 double wp = grid_wts.
is_valid(i_simd) ? grid_wts.
p[ip][i_simd] : 0.0;
107 const int node = i_node - node_offset;
108 f(node).gather(fld,i_simd, wp, grid_wts.
phi_wts);
114 int ndoubles_in_grid_field = f.size()*field_type::SIZE();
115 Kokkos::View<double*,Kokkos::LayoutRight,Device,Kokkos::MemoryTraits<Kokkos::Unmanaged>> view_1d_double((
double*)(data()), ndoubles_in_grid_field);
116 Kokkos::deep_copy(view_1d_double, 0.0);
124 View<double*,CLayout,Device,Kokkos::MemoryTraits<Kokkos::Unmanaged>> f_unmanaged((
double*)data(),nnode());
126 Kokkos::deep_copy(dest_view, f_unmanaged);
129 View<double*,CLayout,Device,Kokkos::MemoryTraits<Kokkos::Unmanaged>>
unmanaged()
const{
130 return View<double*,CLayout,Device,Kokkos::MemoryTraits<Kokkos::Unmanaged>>((
double*)(f.data()), f.layout());
137 constexpr
int n_phi = field_type::NPHI();
140 View<double**,CLayout,Device,Kokkos::MemoryTraits<Kokkos::Unmanaged>> f_unmanaged((
double*)data(),nnode(), n_phi);
143 Kokkos::parallel_for(
"var_transpose_copy", Kokkos::RangePolicy<typename Device::execution_space>( 0, nnode()), KOKKOS_LAMBDA(
const int inode){
144 for(
int iphi=0; iphi<n_phi; iphi++){
145 dest_view(iphi, inode) = f_unmanaged(inode, iphi);
154 constexpr
int n_phi = field_type::NPHI();
157 View<double**,CLayout,Device,Kokkos::MemoryTraits<Kokkos::Unmanaged>> f_unmanaged((
double*)data(),nnode(), n_phi);
160 Kokkos::parallel_for(
"var_transpose_copy", Kokkos::RangePolicy<ExSpace>( 0, nnode()), KOKKOS_LAMBDA(
const int inode){
161 for(
int iphi=0; iphi<n_phi; iphi++){
162 f_unmanaged(inode, iphi) = src_view(iphi, inode);
170 static KOKKOS_INLINE_FUNCTION
void view_gather3(
const Grid<DeviceType>& grid,
const View<double*,CLayout,Device>& view1,
const View<double*,CLayout,Device>& view2,
const View<double*,CLayout,Device>& view3,
const SimdGridWeights<Order::One, PIT_GLOBAL>& grid_wts,
double& val1,
double& val2,
double& val3,
int i_simd){
174 for (
int ip=0; ip<3; ip++){
176 val1 += view1(nd)*grid_wts.p[ip][i_simd];
177 val2 += view2(nd)*grid_wts.p[ip][i_simd];
178 val3 += view3(nd)*grid_wts.p[ip][i_simd];
184 for (
int i_simd = 0; i_simd<SIMD_SIZE; i_simd++){
185 if(grid_wts.itr[i_simd]<=0)
continue;
186 for (
int ip = 0; ip < 3; ip++){
188 val[i_simd] += grid_wts.p[ip][i_simd]*view(node);
196 val.
phi[i_simd] = 0.0;
197 for (
int ip = 0; ip<3; ip++){
199 double wp = grid_wts.p[ip][i_simd];
200 view(ind,node).gather(val, i_simd, wp);
207 val.
phi[i_simd] = 0.0;
208 int node = grid_wts.node[i_simd];
209 constexpr
double wp = 1.0;
210 view(ind,node).gather(val, i_simd, wp);
213 static KOKKOS_INLINE_FUNCTION
void view_gyro_scatter3(
const Grid<DeviceType>& grid,
const View<double**,CLayout,Device>& view1,
const View<double**,CLayout,Device>& view2,
const View<double**,CLayout,Device>& view3,
const SimdGridWeights<Order::One, PIT_GLOBAL>& grid_wts,
double val1,
double val2,
double val3,
int i_simd,
const LinearWeights& rho_wts,
bool is_gyro){
215 for (
int ip = 0; ip < 3; ip++){
217 Kokkos::atomic_add(&(view1(rho_wts.
i, node)), grid_wts.p[ip][i_simd]*rho_wts.
w[0]*val1);
218 Kokkos::atomic_add(&(view2(rho_wts.
i, node)), grid_wts.p[ip][i_simd]*rho_wts.
w[0]*val2);
219 Kokkos::atomic_add(&(view3(rho_wts.
i, node)), grid_wts.p[ip][i_simd]*rho_wts.
w[0]*val3);
221 Kokkos::atomic_add(&(view1(rho_wts.
i+1, node)), grid_wts.p[ip][i_simd]*rho_wts.
w[1]*val1);
222 Kokkos::atomic_add(&(view2(rho_wts.
i+1, node)), grid_wts.p[ip][i_simd]*rho_wts.
w[1]*val2);
223 Kokkos::atomic_add(&(view3(rho_wts.
i+1, node)), grid_wts.p[ip][i_simd]*rho_wts.
w[1]*val3);
230 for (
int j = 0; j<3; j++){
232 double wp=grid_wts.p[j][i_simd];
234 Kokkos::atomic_add(&(view(ind,node)), wp*val);
239 for (
int j = 0; j<3; j++){
241 double wp=grid_wts.p[j][i_simd];
243 Kokkos::atomic_add(&(view(node)), wp*val);
248 for (
int j = 0; j<3; j++){
250 double wp=grid_wts.p[j][i_simd];
252 Kokkos::atomic_add(&(view(0,node)), wp*wphi*val);
253 Kokkos::atomic_add(&(view(1,node)), wp*(1.0-wphi)*val);
257 static KOKKOS_INLINE_FUNCTION
void view_odim_variance(
const Grid<DeviceType>& grid,
const View<double**,CLayout,Device>& view,
const View<double**,CLayout,Device>& variance,
int ind,
const SimdGridWeights<Order::One, PIT_GLOBAL>& grid_wts,
double val,
int i_simd){
258 for (
int j = 0; j<3; j++){
260 double wp=grid_wts.p[j][i_simd];
262 double tmp = view(ind,node) - wp*val;
263 Kokkos::atomic_add(&(variance(ind,node)), tmp*tmp);
267 static KOKKOS_INLINE_FUNCTION
void view_rep_scatter3(
const Grid<DeviceType>& grid,
const View<double***,CLayout,Device>& view,
int ind1,
int ind2,
int ind3,
const SimdGridWeights<Order::One, PIT_GLOBAL>& grid_wts,
double val1,
double val2,
double val3,
int ithread,
int i_simd){
269 for (
int ip = 0; ip < 3; ip++){
271 double wp = grid_wts.p[ip][i_simd];
273 access_add(&(view(ithread,node,ind1)),wp*val1);
274 access_add(&(view(ithread,node,ind2)),wp*val2);
275 access_add(&(view(ithread,node,ind3)),wp*val3);
280 template<
class Device, VarType VT, PhiInterpType PIT>
286 Kokkos::View<field_type**,Kokkos::LayoutRight,Device>
f;
289 GridField(std::string name,
int nphi,
int nrho,
int nnode) : f(name,nnode, nrho+1) {}
290 GridField(std::string name,
int nrho,
int nnode) : f(name,nnode, nrho+1) {}
292 int size()
const {
return f.size();}
293 int nnode()
const {
return f.extent(0);}
296 KOKKOS_INLINE_FUNCTION
bool is_allocated()
const {
return f.is_allocated();}
297 KOKKOS_INLINE_FUNCTION
field_type& operator ()(
int inode,
int irho)
const {
return f(inode, irho);}
301 int irho = rho_wts.
irho(i_simd);
302 f(node,irho).scatter(rho_wts, phi_wts, i_simd, particle_weight, f(node,irho+1));
307 for (
int j = 0; j<3; j++){
310 double wp=grid_wts.p[j][i_simd];
313 scatter(node, grid_wts.phi_wts, rho_wts, i_simd, wp*particle_weight);
319 for (
int i_simd = 0; i_simd<SIMD_SIZE; i_simd++){
321 int itr_work = grid_wts.
is_valid(i_simd) ? grid_wts.
itr[i_simd] : 1;
323 int irho = rho_wts.
irho(i_simd);
326 for (
int ip = 0; ip<3; ip++){
328 double wp = grid_wts.
is_valid(i_simd) ? grid_wts.
p[ip][i_simd] : 0.0;
330 f(node,irho).gather(fld,i_simd, wp, rho_wts, grid_wts.
phi_wts, f(node,irho+1));
336 int ndoubles_in_grid_field = f.size()*field_type::SIZE();
337 Kokkos::View<double*,Kokkos::LayoutRight,Device,Kokkos::MemoryTraits<Kokkos::Unmanaged>> view_1d_double((
double*)(f.data()), ndoubles_in_grid_field);
338 Kokkos::deep_copy(view_1d_double, 0.0);
343 template<
class Device, VarType VT, PhiInterpType PIT>
349 Kokkos::View<field_type**,Kokkos::LayoutRight,Device>
f;
355 int size()
const {
return f.size();}
356 int nnode()
const {
return f.extent(1);}
359 KOKKOS_INLINE_FUNCTION
bool is_allocated()
const {
return f.is_allocated();}
360 KOKKOS_INLINE_FUNCTION
field_type& operator ()(
int ithread,
int inode)
const {
return f(ithread, inode);}
364 f(ithread,node).scatter(phi_wts, i_simd, particle_weight);
369 for (
int j = 0; j<3; j++){
372 double wp=grid_wts.p[j][i_simd];
375 scatter(ithread, node, grid_wts.phi_wts, i_simd, wp*particle_weight);
380 int ndoubles_in_grid_field = f.size()*field_type::SIZE();
381 Kokkos::View<double*,Kokkos::LayoutRight,Device,Kokkos::MemoryTraits<Kokkos::Unmanaged>> view_1d_double((
double*)(f.data()), ndoubles_in_grid_field);
382 Kokkos::deep_copy(view_1d_double, 0.0);
386 template<
class Device, VarType VT, PhiInterpType PIT>
392 Kokkos::View<field_type***,Kokkos::LayoutRight,Device>
f;
398 int size()
const {
return f.size();}
399 int nnode()
const {
return f.extent(1);}
402 KOKKOS_INLINE_FUNCTION
bool is_allocated()
const {
return f.is_allocated();}
403 KOKKOS_INLINE_FUNCTION
field_type& operator ()(
int ithread,
int inode,
int irho)
const {
return f(ithread,inode, irho);}
407 int irho = rho_wts.
irho(i_simd);
408 f(ithread,node,irho).scatter(rho_wts, phi_wts, i_simd, particle_weight, f(ithread,node,irho+1));
413 for (
int j = 0; j<3; j++){
416 double wp=grid_wts.p[j][i_simd];
419 scatter(ithread, node, grid_wts.phi_wts, rho_wts, i_simd, wp*particle_weight);
424 int ndoubles_in_grid_field = f.size()*field_type::SIZE();
425 Kokkos::View<double*,Kokkos::LayoutRight,Device,Kokkos::MemoryTraits<Kokkos::Unmanaged>> view_1d_double((
double*)(f.data()), ndoubles_in_grid_field);
426 Kokkos::deep_copy(view_1d_double, 0.0);
431 template<
class Device, VarType VT, PhiInterpType PIT>
437 Kokkos::View<field_type**,Kokkos::LayoutRight,Device>
f;
440 GridField(std::string name,
int nphi,
int nrho,
int nnode) : f(name,nphi, nnode) {}
441 GridField(std::string name,
int nphi,
int nnode) : f(name,nphi, nnode) {}
443 int size()
const {
return f.size();}
444 int nnode()
const {
return f.extent(1);}
446 int nphi()
const {
return f.extent(0);}
447 KOKKOS_INLINE_FUNCTION
bool is_allocated()
const {
return f.is_allocated();}
448 KOKKOS_INLINE_FUNCTION
field_type& operator ()(
int iphi,
int inode)
const {
return f(iphi, inode);}
456 Kokkos::View<double**,Kokkos::LayoutRight,Device,Kokkos::MemoryTraits<Kokkos::Unmanaged>>
unmanaged()
const{
457 return Kokkos::View<double**,Kokkos::LayoutRight,Device,Kokkos::MemoryTraits<Kokkos::Unmanaged>>((
double*)(f.data()), f.layout());
461 template<
class Device, VarType VT, PhiInterpType PIT>
467 Kokkos::View<field_type***,Kokkos::LayoutRight,Device>
f;
470 GridField(std::string name,
int nphi,
int nrho,
int nnode) : f(name,nphi, nnode, nrho+1) {}
472 int size()
const {
return f.size();}
473 int nnode()
const {
return f.extent(1);}
475 int nphi()
const {
return f.extent(0);}
476 KOKKOS_INLINE_FUNCTION
bool is_allocated()
const {
return f.is_allocated();}
477 KOKKOS_INLINE_FUNCTION
field_type& operator ()(
int iphi,
int inode,
int irho)
const {
return f(iphi, inode, irho);}
501 template<
typename T1,
typename T2>
504 dest = T1(
"grid_field",src.nphi(), src.nrhop1()-1, src.nnode());
506 Kokkos::deep_copy(dest.f, src.f);
Definition: field.hpp:276
static KOKKOS_INLINE_FUNCTION void view_odim_scatter(const Grid< DeviceType > &grid, const View< double **, CLayout, Device > &view, int ind, const SimdGridWeights< Order::One, PIT_GLOBAL > &grid_wts, double val, int i_simd)
Definition: grid_field.hpp:229
GridField< DeviceType, VarType::Vector2D, PhiInterpType::None, TorType::OnePlane, KinType::GyroKin > Efield2DGyroType
Definition: grid_field.hpp:489
Simd< double > r
Definition: simd.hpp:150
int size() const
Definition: grid_field.hpp:443
GridField(std::string name, int nphi, int nrho, int nnode)
Definition: grid_field.hpp:34
Device device_type
Definition: grid_field.hpp:389
static KOKKOS_INLINE_FUNCTION void view_gather3(const Grid< DeviceType > &grid, const View< double *, CLayout, Device > &view1, const View< double *, CLayout, Device > &view2, const View< double *, CLayout, Device > &view3, const SimdGridWeights< Order::One, PIT_GLOBAL > &grid_wts, double &val1, double &val2, double &val3, int i_simd)
Definition: grid_field.hpp:170
Device device_type
Definition: grid_field.hpp:434
int nnode() const
Definition: grid_field.hpp:399
KOKKOS_INLINE_FUNCTION void scatter(const Grid< DeviceType > &grid, int ithread, const SimdGridWeights< Order::One, PIT_GLOBAL > &grid_wts, int i_simd, const SimdGyroWeights< DriftKin > &rho_wts, double particle_weight) const
Definition: grid_field.hpp:368
GridField(std::string name, int nphi, int nrho, int nnode)
Definition: grid_field.hpp:440
int nphi() const
Definition: grid_field.hpp:401
GridField< DeviceType, VarType::Scalar, PIT_GLOBAL, TorType::MultiplePlanes, KinType::DriftKin > PotType
Definition: grid_field.hpp:486
KOKKOS_INLINE_FUNCTION bool is_allocated() const
Definition: grid_field.hpp:42
int size() const
Definition: grid_field.hpp:37
GridField(std::string name, int nrho, int nnode)
Definition: grid_field.hpp:290
void transpose_copy_to_double_view(const View< double **, CLayout, Device > &dest_view) const
Definition: grid_field.hpp:135
KOKKOS_INLINE_FUNCTION int irho(int i_simd) const
Definition: gyro_radius.hpp:109
KOKKOS_INLINE_FUNCTION bool is_allocated() const
Definition: grid_field.hpp:296
static KOKKOS_INLINE_FUNCTION void view_gyro_scatter3(const Grid< DeviceType > &grid, const View< double **, CLayout, Device > &view1, const View< double **, CLayout, Device > &view2, const View< double **, CLayout, Device > &view3, const SimdGridWeights< Order::One, PIT_GLOBAL > &grid_wts, double val1, double val2, double val3, int i_simd, const LinearWeights &rho_wts, bool is_gyro)
Definition: grid_field.hpp:213
Simd< int > itr
Definition: grid_weights.hpp:74
GridField(std::string name, int nrho, int nnode)
Definition: grid_field.hpp:396
Definition: grid_weights.hpp:73
void copy_to_double_view(const View< double *, CLayout, Device > &dest_view) const
Definition: grid_field.hpp:122
static KOKKOS_INLINE_FUNCTION void view_ff_scatter(const Grid< DeviceType > &grid, const View< double **, CLayout, Device > &view, const SimdGridWeights< Order::One, PhiInterpType::Planes > &grid_wts, double wphi, double val, int i_simd)
Definition: grid_field.hpp:247
Definition: linear_weights.hpp:8
KOKKOS_INLINE_FUNCTION void gather(const Grid< Device > &grid, const SimdGridWeights< Order::One, PIT > &grid_wts, const SimdGyroWeights< DriftKin > &rho_wts, Simd< double > &fld, int node_offset=0) const
Definition: grid_field.hpp:96
int size() const
Definition: grid_field.hpp:355
int size() const
Definition: grid_field.hpp:292
Kokkos::View< field_type **, Kokkos::LayoutRight, Device > f
Definition: grid_field.hpp:286
Definition: globals.hpp:89
Definition: grid_weights.hpp:47
KOKKOS_INLINE_FUNCTION bool is_allocated() const
Definition: grid_field.hpp:447
GridField(std::string name, int nphi, int nnode)
Definition: grid_field.hpp:441
GridField(std::string name, int nnode)
Definition: grid_field.hpp:35
field_type * data() const
Definition: grid_field.hpp:354
Kokkos::View< double **, Kokkos::LayoutRight, Device, Kokkos::MemoryTraits< Kokkos::Unmanaged > > unmanaged() const
Definition: grid_field.hpp:456
int nphi() const
Definition: grid_field.hpp:40
View< double *, CLayout, Device, Kokkos::MemoryTraits< Kokkos::Unmanaged > > unmanaged() const
Definition: grid_field.hpp:129
GridField< DeviceType, VarType::Vector2D, PhiInterpType::None, TorType::MultiplePlanes, KinType::DriftKin > Efield2DType
Definition: grid_field.hpp:485
int nrhop1() const
Definition: grid_field.hpp:474
GridField()
Definition: grid_field.hpp:469
GridField< DeviceType, VarType::Vector, PhiInterpType::Planes, TorType::MultiplePlanes, KinType::DriftKin > EfieldType
Definition: grid_field.hpp:484
KOKKOS_INLINE_FUNCTION bool is_allocated() const
Definition: grid_field.hpp:359
int nrhop1() const
Definition: grid_field.hpp:445
Kokkos::LayoutRight CLayout
Definition: space_settings.hpp:68
GridField< DeviceType, VarType::Vector2D, PIT_GLOBAL, TorType::OnePlane, KinType::DriftKin > E00Type
Definition: grid_field.hpp:487
void reset_to_zero()
Definition: grid_field.hpp:423
KOKKOS_INLINE_FUNCTION bool is_allocated() const
Definition: grid_field.hpp:476
int size() const
Definition: grid_field.hpp:472
constexpr KOKKOS_INLINE_FUNCTION PhiWtUsage get_phi_wt_usage(PhiInterpType PIT)
Definition: grid_weights.hpp:15
SimdPhiWeights< get_phi_wt_usage(PIT)> phi_wts
Definition: grid_weights.hpp:77
field_type * data() const
Definition: grid_field.hpp:442
GridField(std::string name, int nphi, int nrho, int nnode)
Definition: grid_field.hpp:352
Definition: grid_field.hpp:22
KOKKOS_INLINE_FUNCTION void gather(const Grid< Device > &grid, const SimdGridWeights< Order::One, PhiInterpType::Planes > &grid_wts, const Simd< double > &phi, Simd< double > &fld) const
Definition: grid_field.hpp:80
GridField< DeviceType, VarType::Scalar, PIT_GLOBAL, TorType::OnePlane, KinType::DriftKin > AxisymPotType
Definition: grid_field.hpp:483
KOKKOS_INLINE_FUNCTION void scatter(const Grid< DeviceType > &grid, int ithread, const SimdGridWeights< Order::One, PIT_GLOBAL > &grid_wts, int i_simd, const SimdGyroWeights< DriftKin > &rho_wts, double particle_weight) const
Definition: grid_field.hpp:51
field_type * data() const
Definition: grid_field.hpp:36
Definition: grid_weights.hpp:18
void reset_to_zero()
Definition: grid_field.hpp:113
TorType
Definition: grid_field.hpp:14
int nphi() const
Definition: grid_field.hpp:295
Definition: gyro_radius.hpp:116
KOKKOS_INLINE_FUNCTION void scatter(const Grid< DeviceType > &grid, int ithread, const SimdGridWeights< Order::One, PIT_GLOBAL > &grid_wts, int i_simd, const SimdGyroWeights< GyroKin > &rho_wts, double particle_weight) const
Definition: grid_field.hpp:306
int size() const
Definition: grid_field.hpp:398
KOKKOS_INLINE_FUNCTION void gather(const Grid< Device > &grid, const SimdGridWeights< Order::One, PIT > &grid_wts, const SimdGyroWeights< GyroKin > &rho_wts, Simd< double > &fld) const
Definition: grid_field.hpp:317
GridField()
Definition: grid_field.hpp:33
Definition: gyro_radius.hpp:84
int nrhop1() const
Definition: grid_field.hpp:294
Kokkos::View< field_type *, Kokkos::LayoutRight, Device > f
Definition: grid_field.hpp:31
Device device_type
Definition: grid_field.hpp:283
KOKKOS_INLINE_FUNCTION void scatter(int ithread, int node, const SimdPhiWeights< get_phi_wt_usage(PIT)> &phi_wts, const SimdGyroWeights< GyroKin > &rho_wts, int i_simd, double particle_weight) const
Definition: grid_field.hpp:406
KOKKOS_INLINE_FUNCTION void access_add(T *addr, T val)
Definition: access_add.hpp:40
KOKKOS_INLINE_FUNCTION void scatter(int node, const SimdPhiWeights< get_phi_wt_usage(PIT)> &phi_wts, int i_simd, double particle_weight) const
Definition: grid_field.hpp:46
static KOKKOS_INLINE_FUNCTION void view_odim_variance(const Grid< DeviceType > &grid, const View< double **, CLayout, Device > &view, const View< double **, CLayout, Device > &variance, int ind, const SimdGridWeights< Order::One, PIT_GLOBAL > &grid_wts, double val, int i_simd)
Definition: grid_field.hpp:257
void grid_field_copy(T &dest, const T &src)
Definition: grid_field.hpp:496
void transpose_copy_from_double_view(const View< double **, CLayout, Device > &src_view) const
Definition: grid_field.hpp:152
KOKKOS_INLINE_FUNCTION int get_node_index(int triangle_index, int tri_vertex_index) const
Definition: grid.tpp:158
GridField(std::string name, int nphi, int nrho, int nnode)
Definition: grid_field.hpp:289
KOKKOS_INLINE_FUNCTION void scatter(int ithread, int node, const SimdPhiWeights< get_phi_wt_usage(PIT)> &phi_wts, int i_simd, double particle_weight) const
Definition: grid_field.hpp:363
double w[2]
Definition: linear_weights.hpp:10
Device device_type
Definition: grid_field.hpp:346
Definition: globals.hpp:90
GridField< DeviceType, VarType::Scalar, PhiInterpType::None, TorType::OnePlane, KinType::DriftKin > ScalarGridField
Definition: grid_field.hpp:481
void scatter(const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const GridField< DeviceType, VarType::Scalar, PIT, TorType::OnePlane, KT > &Ah_gf, const Species< DeviceType > &species, bool exclude_private, bool do_cv_adjustment, bool cv_full_weight, const Charge< DeviceType, KT > &charge)
Definition: scatter.cpp:250
GridField< Device, VT, PIT, TorType::OnePlane, KinType::DriftKin > subfield(int subfield_idx) const
Definition: grid_field.hpp:450
static KOKKOS_INLINE_FUNCTION void view_vec_odim_gather(const Grid< DeviceType > &grid, const View< Field< VarType::Vector, PhiInterpType::None > **, CLayout, Device > &view, int ind, const SimdGridWeights< Order::One, PhiInterpType::None > &grid_wts, SimdVector &val, int i_simd)
Definition: grid_field.hpp:193
static KOKKOS_INLINE_FUNCTION void view_scatter(const Grid< DeviceType > &grid, const View< double *, CLayout, Device > &view, const SimdGridWeights< Order::One, PhiInterpType::None > &grid_wts, double val, int i_simd)
Definition: grid_field.hpp:238
GridField()
Definition: grid_field.hpp:439
Simd< double > phi
Definition: simd.hpp:152
field_type * data() const
Definition: grid_field.hpp:291
int nrhop1() const
Definition: grid_field.hpp:39
KOKKOS_INLINE_FUNCTION void gather(const Grid< Device > &grid, const SimdGridWeights< Order::One, PhiInterpType::None > &grid_wts, const Simd< double > &phi, Simd< double > &fld) const
Definition: grid_field.hpp:63
Simd< double > z
Definition: simd.hpp:151
int i
Definition: linear_weights.hpp:9
KinType
Definition: globals.hpp:88
Kokkos::View< field_type ***, Kokkos::LayoutRight, Device > f
Definition: grid_field.hpp:467
Device device_type
Definition: grid_field.hpp:28
GridField< DeviceType, VarType::Vector2D, PIT_GLOBAL, TorType::OnePlane, KinType::GyroKin > E00GyroType
Definition: grid_field.hpp:491
field_type * data() const
Definition: grid_field.hpp:471
int nphi() const
Definition: grid_field.hpp:358
int nphi() const
Definition: grid_field.hpp:446
field_type * data() const
Definition: grid_field.hpp:397
int nnode() const
Definition: grid_field.hpp:293
GridField()
Definition: grid_field.hpp:351
Kokkos::View< field_type **, Kokkos::LayoutRight, Device > f
Definition: grid_field.hpp:349
Kokkos::View< T *, Kokkos::LayoutRight, Device > my_subview(const Kokkos::View< T ****, Kokkos::LayoutRight, Device > &view, int i, int j, int k)
Definition: my_subview.hpp:8
GridField< DeviceType, VarType::Scalar, PIT_GLOBAL, TorType::OnePlane, KinType::GyroKin > PotGyroType
Definition: grid_field.hpp:490
KOKKOS_INLINE_FUNCTION void scatter(int node, const SimdPhiWeights< get_phi_wt_usage(PIT)> &phi_wts, const SimdGyroWeights< GyroKin > &rho_wts, int i_simd, double particle_weight) const
Definition: grid_field.hpp:300
SimdGridVec p
Definition: grid_weights.hpp:75
Device device_type
Definition: grid_field.hpp:464
int nrhop1() const
Definition: grid_field.hpp:400
int nnode() const
Definition: grid_field.hpp:444
KOKKOS_INLINE_FUNCTION bool is_valid(int i_simd) const
Definition: grid_weights.hpp:84
KOKKOS_INLINE_FUNCTION bool is_allocated() const
Definition: grid_field.hpp:402
int get_num_cpu_threads()
Definition: globals.hpp:17
Kokkos::View< field_type ***, Kokkos::LayoutRight, Device > f
Definition: grid_field.hpp:392
GridField(std::string name, int nphi, int nrho, int nnode)
Definition: grid_field.hpp:470
static KOKKOS_INLINE_FUNCTION void view_gather(const Grid< DeviceType > &grid, const View< double *, CLayout, Device > &view, const SimdGridWeights< Order::One, PIT_GLOBAL > &grid_wts, Simd< double > &val)
Definition: grid_field.hpp:182
int nnode() const
Definition: grid_field.hpp:356
GridField()
Definition: grid_field.hpp:288
void reset_to_zero()
Definition: grid_field.hpp:379
void parallel_for(const std::string name, int n_ptl, Function func, Option option, HostAoSoA aosoa_h, DeviceAoSoA aosoa_d)
Definition: streamed_parallel_for.hpp:252
int nnode() const
Definition: grid_field.hpp:38
GridField< DeviceType, VarType::Scalar, PIT_GLOBAL, TorType::OnePlane, KinType::DriftKin > OnePlanePotType
Definition: grid_field.hpp:482
KOKKOS_INLINE_FUNCTION void scatter(const Grid< DeviceType > &grid, int ithread, const SimdGridWeights< Order::One, PIT_GLOBAL > &grid_wts, int i_simd, const SimdGyroWeights< GyroKin > &rho_wts, double particle_weight) const
Definition: grid_field.hpp:412
GridField< DeviceType, VarType::Vector, PhiInterpType::Planes, TorType::OnePlane, KinType::GyroKin > EfieldGyroType
Definition: grid_field.hpp:488
Kokkos::View< field_type **, Kokkos::LayoutRight, Device > f
Definition: grid_field.hpp:437
int nrhop1() const
Definition: grid_field.hpp:357
GridField()
Definition: grid_field.hpp:394
GridField(std::string name, int nphi, int nrho, int nnode)
Definition: grid_field.hpp:395
static KOKKOS_INLINE_FUNCTION void view_rep_scatter3(const Grid< DeviceType > &grid, const View< double ***, CLayout, Device > &view, int ind1, int ind2, int ind3, const SimdGridWeights< Order::One, PIT_GLOBAL > &grid_wts, double val1, double val2, double val3, int ithread, int i_simd)
Definition: grid_field.hpp:267
int nnode() const
Definition: grid_field.hpp:473
void reset_to_zero()
Definition: grid_field.hpp:335
int nphi() const
Definition: grid_field.hpp:475
GridField(std::string name, int nnode)
Definition: grid_field.hpp:353
static KOKKOS_INLINE_FUNCTION void view_vec_odim_gather(const Grid< DeviceType > &grid, const View< Field< VarType::Vector, PhiInterpType::None > **, CLayout, Device > &view, int ind, const SimdGridWeights< Order::Zero, PhiInterpType::None > &grid_wts, SimdVector &val, int i_simd)
Definition: grid_field.hpp:204