XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
sort.hpp
Go to the documentation of this file.
1 #ifndef SORT_HPP
2 #define SORT_HPP
3 
5 #include "grid.hpp"
6 #include "sheath.hpp"
7 
8 template<class Device>
9 struct SortViews{
10  Kokkos::View<double**,Kokkos::LayoutRight,Device> tmp_const;
11  Kokkos::View<int*,Kokkos::LayoutRight,Device> iperm;
12  Kokkos::View<int*,Kokkos::LayoutRight,Device> key;
13 
14  // Permutation
15  Kokkos::View<int*,Kokkos::LayoutRight,Device> count;
16  Kokkos::View<unsigned int*,Kokkos::LayoutRight,Device> place;
17 
18  SortViews(int n_ptl, int n_bins)
19  : tmp_const(Kokkos::ViewAllocateWithoutInitializing("tmp_const"), 4,n_ptl),
20  iperm(Kokkos::ViewAllocateWithoutInitializing("iperm"), n_ptl),
21  key(Kokkos::ViewAllocateWithoutInitializing("key"), n_ptl),
22  count(Kokkos::ViewAllocateWithoutInitializing("count"), n_bins),
23  place(Kokkos::ViewAllocateWithoutInitializing("place"), n_bins) {}
24 };
25 
26 void sort_particles_by_triangle(const SortViews<DeviceType> &sort_views, const Grid<DeviceType> &grid, const Species<DeviceType> &species, const SheathParticles<DeviceType> &sheath_particles, bool sort_sheath_ptl, bool sort_phase0);
27 void sort_particles_by_pid(const SortViews<DeviceType> &sort_views, const Grid<DeviceType> &grid, const MagneticField<DeviceType> &magnetic_field, const DomainDecomposition<DeviceType> &pol_decomp, const Species<DeviceType> &species, bool sort_phase0);
28 #endif
void sort_particles_by_pid(const SortViews< DeviceType > &sort_views, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const DomainDecomposition< DeviceType > &pol_decomp, const Species< DeviceType > &species, bool sort_phase0)
Definition: sort.cpp:190
Kokkos::View< int *, Kokkos::LayoutRight, Device > key
Sorting key.
Definition: sort.hpp:12
Definition: magnetic_field.hpp:9
Definition: grid.hpp:10
SortViews(int n_ptl, int n_bins)
Definition: sort.hpp:18
Kokkos::View< int *, Kokkos::LayoutRight, Device > count
How many particles in each bin.
Definition: sort.hpp:15
Definition: sheath.hpp:16
Definition: sort.hpp:9
Kokkos::View< int *, Kokkos::LayoutRight, Device > iperm
New order of data to be sorted.
Definition: sort.hpp:11
Kokkos::View< double **, Kokkos::LayoutRight, Device > tmp_const
Temporary array for sorting.
Definition: sort.hpp:10
Definition: magnetic_field.F90:1
Kokkos::View< unsigned int *, Kokkos::LayoutRight, Device > place
Where we are in the particle list.
Definition: sort.hpp:16
Definition: domain_decomposition.hpp:11
Definition: species.hpp:21
void sort_particles_by_triangle(const SortViews< DeviceType > &sort_views, const Grid< DeviceType > &grid, const Species< DeviceType > &species, const SheathParticles< DeviceType > &sheath_particles, bool sort_sheath_ptl, bool sort_phase0)
Definition: sort.cpp:172