Get< PArrs > Struct Template Reference
SPADES API
|
spades::particles::Get< PArrs > Struct Template Reference
Functor for accessing a particle in a cell. More...
#include <ParticleOps.H>
Public Member Functions | |
AMREX_GPU_DEVICE AMREX_FORCE_INLINE | Get (const amrex::IntVect &iv, const amrex::Array4< const int > &counts, const amrex::Array4< const int > &offsets, PArrs &parrs) |
Constructor. | |
AMREX_GPU_DEVICE AMREX_FORCE_INLINE int | operator() (const int n, const int typ) const |
Get a particle in a cell. | |
AMREX_GPU_DEVICE AMREX_FORCE_INLINE bool | check (const int n, const int typ) const |
Check validity of the particle type. | |
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void | assert_different (const int n, const int typ, const int expected_type) const |
Assert that the particle is of a different but expected type. | |
Public Attributes | |
const amrex::IntVect & | m_iv |
Cell index. | |
const amrex::Array4< const int > & | m_counts |
Cell counts of particle types. | |
const amrex::Array4< const int > & | m_offsets |
Cell offsets of particle types. | |
PArrs & | m_parrs |
Particle array. | |
Detailed Description
template<class PArrs>
struct spades::particles::Get< PArrs >
struct spades::particles::Get< PArrs >
Functor for accessing a particle in a cell.
Constructor & Destructor Documentation
◆ Get()
template<class PArrs >
|
inline |
Constructor.
- Parameters
-
iv [in] cell index of the particle counts [in] cell counts of particle types offsets [in] cell offsets of particle types parrs [in] particle arrays
130 {}
const amrex::Array4< const int > & m_offsets
Cell offsets of particle types.
Definition ParticleOps.H:197
const amrex::Array4< const int > & m_counts
Cell counts of particle types.
Definition ParticleOps.H:194
Member Function Documentation
◆ assert_different()
template<class PArrs >
|
inline |
Assert that the particle is of a different but expected type.
A particle sometimes changes type (e.g., marked as undefined) but the counts and offsets haven't been updated yet. This asserts that the requested particle of a certain type typ
changed to another type expected_type
.
- Parameters
-
n [in] nth particle to return typ [in] particle type that is requested expected_type [in] expected particle type
180 {
181#ifdef AMREX_DEBUG
183 AMREX_ASSERT(
185#else
186 amrex::ignore_unused(n, typ, expected_type);
187#endif
188 }
◆ check()
template<class PArrs >
|
inline |
Check validity of the particle type.
- Parameters
-
n [in] nth particle to return typ [in] particle type that is requested
- Returns
- boolean if the particle is of the requested type
◆ operator()()
template<class PArrs >
|
inline |
Get a particle in a cell.
- Parameters
-
n [in] nth particle to return typ [in] particle type that is requested
- Returns
- particle index of type
typ
and at positionn
Member Data Documentation
◆ m_counts
template<class PArrs >
const amrex::Array4<const int>& spades::particles::Get< PArrs >::m_counts |
Cell counts of particle types.
◆ m_iv
template<class PArrs >
const amrex::IntVect& spades::particles::Get< PArrs >::m_iv |
Cell index.
◆ m_offsets
template<class PArrs >
const amrex::Array4<const int>& spades::particles::Get< PArrs >::m_offsets |
Cell offsets of particle types.
◆ m_parrs
template<class PArrs >
PArrs& spades::particles::Get< PArrs >::m_parrs |
Particle array.
The documentation for this struct was generated from the following file:
- /home/runner/work/spades/spades/Source/ParticleOps.H
Generated by