12#ifndef CD_GenericParticle_H
13#define CD_GenericParticle_H
27#include <CD_NamespaceHeader.H>
40 static_assert(std::is_trivially_copyable<T>::value,
41 "detail::pushParticleProperty expects trivially-copyable fields");
58 static_assert(std::is_trivially_copyable<T>::value,
59 "detail::pushParticleProperty expects trivially-copyable fields");
74template <
size_t M,
size_t N>
301template <
size_t M,
size_t N>
305#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. @detail This copies from the buffe...
Definition CD_GenericParticle.H:56
std::ostream & operator<<(std::ostream &ostr, const GenericParticle< M, N > &p)
Particle printing function.
Definition CD_GenericParticleImplem.H:330
void pushParticleProperty(uint8_t *&p, const T &a_x)
Helper function for linearizing a particle onto a buffer. @detail This copies T into the buffer p and...
Definition CD_GenericParticle.H:38
A generic particle class, holding the position and a specified number of real and vector values.
Definition CD_GenericParticle.H:76
virtual ~GenericParticle()
Destructor (deallocates runtime memory storage)
Definition CD_GenericParticleImplem.H:44
virtual void linearOut(void *const a_buffer) const
Write a linear binary representation of the internal data. Assumes that sufficient memory for the buf...
Definition CD_GenericParticleImplem.H:211
const int32_t & particleID() const noexcept
Get the particle ID.
Definition CD_GenericParticleImplem.H:63
virtual int H5size() const
Function that is used when writing particles to HDF5.
Definition CD_GenericParticleImplem.H:267
int32_t m_rankID
MPI rank owning this particle.
Definition CD_GenericParticle.H:278
RealVect & position()
Get the particle position.
Definition CD_GenericParticleImplem.H:49
Real & real()
Get one of the scalars.
Definition CD_GenericParticleImplem.H:120
virtual void linearIn(const void *const a_buffer)
Read a linear binary representation of the internal data. Assumes that the buffer has the correct dat...
Definition CD_GenericParticleImplem.H:239
const std::array< Real, M > & getReals() const noexcept
Get the M scalars.
Definition CD_GenericParticleImplem.H:91
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:195
RealVect & vect()
Get one of the RealVects.
Definition CD_GenericParticleImplem.H:136
virtual void H5linearOut(void *const a_buffer) const
Linearize the Real components onto a buffer workable by HDF5.
Definition CD_GenericParticleImplem.H:280
const int32_t & rankID() const noexcept
Get the MPI rank ID.
Definition CD_GenericParticleImplem.H:77
int32_t m_particleID
Particle ID.
Definition CD_GenericParticle.H:273
virtual void H5linearIn(const void *const a_buffer)
Delinearize the buffer onto the real components in the particle class.
Definition CD_GenericParticleImplem.H:305
bool operator==(const GenericParticle< M, N > &a_other) const
Comparison operator with other particle.
Definition CD_GenericParticleImplem.H:151
bool operator!=(const GenericParticle< M, N > &a_other) const
Comparison operator with other particle.
Definition CD_GenericParticleImplem.H:158
bool operator<(const GenericParticle< M, N > &a_other) const noexcept
Particle comparison operator. Returns lexicographical ordering.
Definition CD_GenericParticleImplem.H:165
RealVect m_position
Particle position.
Definition CD_GenericParticle.H:283
GenericParticle()
Default constructor – initializes everything to zero.
Definition CD_GenericParticleImplem.H:20
std::array< Real, M > m_scalars
Scalar storage array.
Definition CD_GenericParticle.H:288
std::array< RealVect, N > m_vectors
vector storage array
Definition CD_GenericParticle.H:293
const std::array< RealVect, N > & getVects() const noexcept
Get the N vectors.
Definition CD_GenericParticleImplem.H:105
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:37
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:25