XGC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
unfused_push_algorithm.hpp
Go to the documentation of this file.
1 #ifndef UNFUSED_PUSH_ALGORITHM_HPP
2 #define UNFUSED_PUSH_ALGORITHM_HPP
3 #include "globals.hpp"
4 #include "magnetic_field.hpp"
5 #include "grid.hpp"
6 #include "species.hpp"
7 #include "perturbed_B_field.hpp"
8 #include "electric_field.hpp"
9 #include "sort.hpp"
10 #include "sheath.hpp"
11 #include "neutrals.hpp"
12 
13 /* This struct contains views that store intermediate values of the electron push so that the kernel can be split into
14  * smaller pieces
15  */
16 template<class Device>
18  // Storage views used to split the electron push kernel
19  Cabana::AoSoA<PhaseDataTypes,Device,VEC_LEN> phase0;
20  Cabana::AoSoA<PhaseDataTypes,Device,VEC_LEN> dy;
21  Cabana::AoSoA<PhaseDataTypes,Device,VEC_LEN> dy_sum;
22  View<int*,CLayout,Device> current_tr;
23 
25 
27  : phase0("phase0", n),
28  dy("dy", n),
29  dy_sum("dy_sum", n),
30  current_tr(NoInit("current_tr"), n) {}
31 
32  void resize(int n){
33  phase0.resize(n);
34  dy.resize(n);
35  dy_sum.resize(n);
36  Kokkos::resize(current_tr, n);
37 
38  // Set current_tr to -1 - this might not be necessary
39  Kokkos::deep_copy(current_tr, -1);
40  }
41 };
42 
43 void unfused_electron_push_kernel(Species<DeviceType> &species, const PushControls &push_controls, const DomainDecomposition<DeviceType>& pol_decomp,
44  const Grid<DeviceType> &grid, const MagneticField<DeviceType> &magnetic_field, const GridFieldPackPtr& gfpack_ptr,
45  const GridFieldPackPtr &gfpack_near_ptr,
46  const PerturbedBField<DeviceType> &perturbed_B_field, SortViews<DeviceType>& sort_views,
47  const Sheath<DeviceType> &sheath, const Neutrals<DeviceType> &neutrals,
48  const HeatDiagnostics<DeviceType> &heat_diag, UnfusedPushTmpViews<DeviceType>& tmp, int ncycles_per_launch, double dt);
49 
50 void local_shift(const PushControls &push_controls, Species<DeviceType> &species, SortViews<DeviceType>& sort_views, const Grid<DeviceType> &grid, const MagneticField<DeviceType> &magnetic_field, const DomainDecomposition<DeviceType> &pol_decomp, UnfusedPushTmpViews<DeviceType>& unfused_push_tmp_views, bool send_phase0, bool use_near_field);
51 
52 #endif
View< int *, CLayout, Device > current_tr
Definition: unfused_push_algorithm.hpp:22
Definition: perturbed_B_field.hpp:12
std::unique_ptr< GridFieldPackGeneric > GridFieldPackPtr
Definition: grid_field_pack.hpp:21
Definition: unfused_push_algorithm.hpp:17
void local_shift(const PushControls &push_controls, Species< DeviceType > &species, SortViews< DeviceType > &sort_views, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const DomainDecomposition< DeviceType > &pol_decomp, UnfusedPushTmpViews< DeviceType > &unfused_push_tmp_views, bool send_intermediate_values, bool use_near_field)
Definition: unfused_push_algorithm.cpp:338
Definition: push_controls.hpp:9
Definition: magnetic_field.hpp:12
Cabana::AoSoA< PhaseDataTypes, Device, VEC_LEN > dy
Definition: unfused_push_algorithm.hpp:20
Cabana::AoSoA< PhaseDataTypes, Device, VEC_LEN > dy_sum
Definition: unfused_push_algorithm.hpp:21
Cabana::AoSoA< PhaseDataTypes, Device, VEC_LEN > phase0
Definition: unfused_push_algorithm.hpp:19
UnfusedPushTmpViews(int n)
Definition: unfused_push_algorithm.hpp:26
void resize(int n)
Definition: unfused_push_algorithm.hpp:32
void unfused_electron_push_kernel(Species< DeviceType > &species, const PushControls &push_controls, const DomainDecomposition< DeviceType > &pol_decomp, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const GridFieldPackPtr &gfpack_ptr, const GridFieldPackPtr &gfpack_near_ptr, const PerturbedBField< DeviceType > &perturbed_B_field, SortViews< DeviceType > &sort_views, const Sheath< DeviceType > &sheath, const Neutrals< DeviceType > &neutrals, const HeatDiagnostics< DeviceType > &heat_diag, UnfusedPushTmpViews< DeviceType > &tmp, int ncycles_per_launch, double dt)
Definition: unfused_push_algorithm.cpp:438
Definition: neutrals.hpp:14
Definition: sort.hpp:9
UnfusedPushTmpViews()
Definition: unfused_push_algorithm.hpp:24
Definition: magnetic_field.F90:1
Definition: sheath.hpp:49
Definition: species.hpp:75
Kokkos::ViewAllocateWithoutInitializing NoInit
Definition: space_settings.hpp:69