13#ifndef CD_GENERICPARTICLE_H
14#define CD_GENERICPARTICLE_H
28#include <CD_NamespaceHeader.H>
41 static_assert(std::is_trivially_copyable<T>::value,
42 "detail::pushParticleProperty expects trivially-copyable fields");
59 static_assert(std::is_trivially_copyable<T>::value,
60 "detail::pushParticleProperty expects trivially-copyable fields");
75template <
size_t M,
size_t N>
317#include <CD_NamespaceFooter.H>
Implementation of CD_GenericParticle.H.
void pullParticleProperty(const uint8_t *&p, T &a_x)
Helper function for linearizing a buffer onto a particle property.
Definition CD_GenericParticle.H:57
void pushParticleProperty(uint8_t *&p, const T &a_x)
Helper function for linearizing a particle onto a buffer.
Definition CD_GenericParticle.H:39
A generic particle class, holding the position and a specified number of real and vector values.
Definition CD_GenericParticle.H:77
virtual void linearOut(void *a_buffer) const
Write a linear binary representation of the internal data. Assumes that sufficient memory for the buf...
Definition CD_GenericParticleImplem.H:207
virtual ~GenericParticle()
Destructor (deallocates runtime memory storage)
const int32_t & particleID() const noexcept
Get the particle ID.
Definition CD_GenericParticleImplem.H:59
virtual int H5size() const
Function that is used when writing particles to HDF5.
Definition CD_GenericParticleImplem.H:263
int32_t m_rankID
MPI rank owning this particle.
Definition CD_GenericParticle.H:289
RealVect & position()
Get the particle position.
Definition CD_GenericParticleImplem.H:45
Real & real()
Get one of the scalars.
Definition CD_GenericParticleImplem.H:116
const std::array< Real, M > & getReals() const noexcept
Get the M scalars.
Definition CD_GenericParticleImplem.H:87
virtual int size() const
Returns the size, in number of bytes, of a flat representation of the data in this object.
Definition CD_GenericParticleImplem.H:191
virtual void H5linearOut(void *a_buffer) const
Linearize the Real components onto a buffer workable by HDF5.
Definition CD_GenericParticleImplem.H:276
RealVect & vect()
Get one of the RealVects.
Definition CD_GenericParticleImplem.H:132
const int32_t & rankID() const noexcept
Get the MPI rank ID.
Definition CD_GenericParticleImplem.H:73
int32_t m_particleID
Particle ID.
Definition CD_GenericParticle.H:284
virtual void linearIn(const void *a_buffer)
Read a linear binary representation of the internal data. Assumes that the buffer has the correct dat...
Definition CD_GenericParticleImplem.H:235
virtual void H5linearIn(const void *a_buffer)
Delinearize the buffer onto the real components in the particle class.
Definition CD_GenericParticleImplem.H:301
RealVect m_position
Particle position.
Definition CD_GenericParticle.H:294
GenericParticle()
Default constructor – initializes everything to zero.
Definition CD_GenericParticleImplem.H:21
std::array< Real, M > m_scalars
Scalar storage array.
Definition CD_GenericParticle.H:299
std::array< RealVect, N > m_vectors
vector storage array
Definition CD_GenericParticle.H:304
const std::array< RealVect, N > & getVects() const noexcept
Get the N vectors.
Definition CD_GenericParticleImplem.H:101
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:38
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:26