XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
particles.hpp
Go to the documentation of this file.
1 #ifndef PARTICLES_HPP
2 #define PARTICLES_HPP
3 #include <Cabana_AoSoA.hpp>
4 #include <Kokkos_Core.hpp>
5 #include "globals.hpp"
6 
7 // Set the type for the particle AoSoA.
8 using ParticleDataTypes = Cabana::MemberTypes<double[6],double[3],long long int>;
9 
10 // Phase
11 struct SimdPhase{
18 };
19 
20 // Constants
25 };
26 
27 // SoA particle structure, with inner array of length SIMD_SIZE (generally, VEC_LEN on CPU, 1 on GPU)
32 };
33 
34 // Phase
35 struct VecPhase{
36  double r[VEC_LEN];
37  double z[VEC_LEN];
38  double phi[VEC_LEN];
39  double rho[VEC_LEN];
40  double w1[VEC_LEN];
41  double w2[VEC_LEN];
42 };
43 
44 // Constants
45 struct VecConstants{
46  double mu[VEC_LEN];
47  double w0[VEC_LEN];
48  double f0[VEC_LEN];
49 };
50 
51 // SoA particle structure, with inner array of length VEC_LEN (just like the AoSoA)
52 struct VecParticles{
55  long long int gid[VEC_LEN];
56 };
57 
58 KOKKOS_INLINE_FUNCTION void remove_particles(Simd<long long int>& gid, const Simd<bool>& deactivate);
59 
60 KOKKOS_INLINE_FUNCTION void update_phases(SimdPhase &ph_new, const SimdPhase &ph, double local_dt, const SimdPhase &dph);
61 
62 KOKKOS_INLINE_FUNCTION void simd_2_AoSoA(VecParticles *part, const SimdParticles &part_one, int a_vec, int s_vec);
63 
64 KOKKOS_INLINE_FUNCTION void AoSoA_2_simd(SimdParticles &part_one, const VecParticles *part, int a_vec, int s_vec);
65 
66 KOKKOS_INLINE_FUNCTION void AoSoA_indices(int i_item,int &s_vec,int &a_vec);
67 
68 KOKKOS_INLINE_FUNCTION void update_dphm(SimdPhase &dphm,const SimdPhase &dpht);
69 
70 KOKKOS_INLINE_FUNCTION void update_dpht(SimdPhase &dpht,const SimdPhase &dph,const SimdPhase &dphm);
71 
72 int p_range(int num_particle);
73 
74 #include "particles.tpp"
75 #endif
KOKKOS_INLINE_FUNCTION void update_dphm(SimdPhase &dphm, const SimdPhase &dpht)
Definition: particles.tpp:32
KOKKOS_INLINE_FUNCTION void update_phases(SimdPhase &ph_new, const SimdPhase &ph, double local_dt, const SimdPhase &dph)
Definition: particles.tpp:17
KOKKOS_INLINE_FUNCTION void simd_2_AoSoA(VecParticles *part, const SimdParticles &part_one, int a_vec, int s_vec)
Definition: particles.tpp:65
double rho[VEC_LEN]
Definition: particles.hpp:39
Simd< double > w1
Definition: particles.hpp:16
Definition: particles.hpp:45
VecConstants ct
Definition: particles.hpp:54
Definition: particles.hpp:35
Definition: particles.hpp:52
KOKKOS_INLINE_FUNCTION void AoSoA_indices(int i_item, int &s_vec, int &a_vec)
Definition: particles.tpp:109
KOKKOS_INLINE_FUNCTION void update_dpht(SimdPhase &dpht, const SimdPhase &dph, const SimdPhase &dphm)
Definition: particles.tpp:48
KOKKOS_INLINE_FUNCTION void AoSoA_2_simd(SimdParticles &part_one, const VecParticles *part, int a_vec, int s_vec)
Definition: particles.tpp:88
Simd< double > rho
Definition: particles.hpp:15
double w2[VEC_LEN]
Definition: particles.hpp:41
double mu[VEC_LEN]
Definition: particles.hpp:46
Simd< double > r
Definition: particles.hpp:12
int p_range(int num_particle)
Definition: particles.tpp:124
double w0[VEC_LEN]
Definition: particles.hpp:47
SimdPhase ph
Definition: particles.hpp:29
long long int gid[VEC_LEN]
Definition: particles.hpp:55
Simd< double > f0
Definition: particles.hpp:24
double f0[VEC_LEN]
Definition: particles.hpp:48
Definition: particles.hpp:28
VecPhase ph
Definition: particles.hpp:53
Definition: particles.hpp:21
Cabana::MemberTypes< double[6], double[3], long long int > ParticleDataTypes
Definition: particles.hpp:8
Simd< double > z
Definition: particles.hpp:13
Simd< long long int > gid
Definition: particles.hpp:31
Simd< double > w0
Definition: particles.hpp:23
Simd< double > phi
Definition: particles.hpp:14
Definition: particles.hpp:11
SimdConstants ct
Definition: particles.hpp:30
double phi[VEC_LEN]
Definition: particles.hpp:38
Simd< double > w2
Definition: particles.hpp:17
double r[VEC_LEN]
Definition: particles.hpp:36
Simd< double > mu
Definition: particles.hpp:22
KOKKOS_INLINE_FUNCTION void remove_particles(Simd< long long int > &gid, const Simd< bool > &deactivate)
Definition: particles.tpp:4
double z[VEC_LEN]
Definition: particles.hpp:37
double w1[VEC_LEN]
Definition: particles.hpp:40