XGC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Typedefs | Functions
particles.hpp File Reference
#include <Cabana_AoSoA.hpp>
#include <Kokkos_Core.hpp>
#include "globals.hpp"
#include "particles.tpp"
Include dependency graph for particles.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SimdPhase
 
struct  SimdConstants
 
struct  SimdParticles
 
struct  VecPhase
 
struct  VecConstants
 
struct  VecParticles
 
struct  VecParticlesSimple< T >
 
struct  OneParticle< T >
 
struct  AoSoAIndices< Device >
 

Typedefs

using ParticleDataTypes = Cabana::MemberTypes< double[PTL_NPHASE], double[PTL_NCONST], long long int >
 
using PhaseDataTypes = Cabana::MemberTypes< double[PTL_NPHASE]>
 

Functions

KOKKOS_INLINE_FUNCTION void update_phases (SimdPhase &ph_new, const SimdPhase &ph, double local_dt, const SimdPhase &dph)
 
KOKKOS_INLINE_FUNCTION void simd_2_AoSoA (VecParticles *part, const SimdParticles &part_one, int a_vec, int s_vec)
 
KOKKOS_INLINE_FUNCTION void AoSoA_2_simd (SimdParticles &part_one, const VecParticles *part, int a_vec, int s_vec)
 
KOKKOS_INLINE_FUNCTION void update_dphm (SimdPhase &dphm, const SimdPhase &dpht)
 
KOKKOS_INLINE_FUNCTION void update_dpht (SimdPhase &dpht, const SimdPhase &dph, const SimdPhase &dphm)
 
template<class Device >
int p_range (int num_particle)
 
template<>
int p_range< DeviceType > (int num_particle)
 
int add_vec_buffer (int n_ptl)
 

Typedef Documentation

using ParticleDataTypes = Cabana::MemberTypes<double[PTL_NPHASE],double[PTL_NCONST],long long int>
using PhaseDataTypes = Cabana::MemberTypes<double[PTL_NPHASE]>

Function Documentation

int add_vec_buffer ( int  n_ptl)
inline

Return n_ptl rounded up to the nearest full vector

Here is the call graph for this function:

Here is the caller graph for this function:

KOKKOS_INLINE_FUNCTION void AoSoA_2_simd ( SimdParticles part_one,
const VecParticles part,
int  a_vec,
int  s_vec 
)

Copy from the AoSoA to a local SoA of array length SIMD_SIZE. This should be obsolete at some point

Parameters
[out]part_oneThe local SimdParticle array
[in]partThe particle AoSoA
[in]a_vecThe index in the inner array of the AoSoA
[in]s_vecThe index in the outer array of the AoSoA

Here is the caller graph for this function:

template<class Device >
int p_range ( int  num_particle)
inline

Determine parallel for range for particles. Returns number of vectors

Parameters
[in]num_particleNumber of particles

Here is the call graph for this function:

template<>
int p_range< DeviceType > ( int  num_particle)
inline

Determine parallel for range for particles. Returns number of particles

Parameters
[in]num_particleNumber of particles

Here is the caller graph for this function:

KOKKOS_INLINE_FUNCTION void simd_2_AoSoA ( VecParticles part,
const SimdParticles part_one,
int  a_vec,
int  s_vec 
)

Copy from local SoA of array length SIMD_SIZE back into the AoSoA. This should be obsolete at some point

Parameters
[in,out]partThe particle AoSoA
[in]part_oneThe local SimdParticle array
[in]a_vecThe index in the inner array of the AoSoA
[in]s_vecThe index in the outer array of the AoSoA

Here is the caller graph for this function:

KOKKOS_INLINE_FUNCTION void update_dphm ( SimdPhase dphm,
const SimdPhase dpht 
)

Add the second vector of phase derivatives to the first (for use in RK4)

Parameters
[in,out]dphmVector of phase derivatives
[in]dphtVector of phase derivatives

Here is the caller graph for this function:

KOKKOS_INLINE_FUNCTION void update_dpht ( SimdPhase dpht,
const SimdPhase dph,
const SimdPhase dphm 
)

Add the second vector of phase derivatives and 2x the third vector to the first, i.e. dpht = dpht + dph + 2 dphm (for use in RK4)

Parameters
[in,out]dphtVector of phase derivatives
[in]dphVector of phase derivatives
[in]dphmVector of phase derivatives

Here is the caller graph for this function:

KOKKOS_INLINE_FUNCTION void update_phases ( SimdPhase ph_new,
const SimdPhase ph,
double  local_dt,
const SimdPhase dph 
)

Update a vector of particle phases with a time step

Parameters
[out]ph_newVector of new phase
[in]phVector of old phase
[in]local_dtTime step size
[in]dphVector of time derivatives of the phase

Here is the caller graph for this function: