12 #ifndef CD_GenericParticle_H
13 #define CD_GenericParticle_H
26 #include <CD_NamespaceHeader.H>
31 template <
size_t M,
size_t N>
62 inline const RealVect&
69 inline const std::array<Real, M>&
76 inline std::array<Real, M>&
83 inline const std::array<RealVect, N>&
90 inline std::array<RealVect, N>&
130 inline const RealVect&
198 template <
size_t M,
size_t N>
202 #include <CD_NamespaceFooter.H>
Implementation of CD_GenericParticle.H.
std::ostream & operator<<(std::ostream &ostr, const GenericParticle< M, N > &p)
Particle printing function.
Definition: CD_GenericParticleImplem.H:232
A generic particle class, holding the position and a specified number of real and vector values.
Definition: CD_GenericParticle.H:33
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:173
virtual ~GenericParticle()
Destructor (deallocates runtime memory storage)
Definition: CD_GenericParticleImplem.H:42
virtual void linearIn(void *a_buffer)
Read a linear binary representation of the internal data. Assumes that the buffer has the correct dat...
Definition: CD_GenericParticleImplem.H:203
RealVect & position()
Get the particle position.
Definition: CD_GenericParticleImplem.H:47
Real & real()
Get one of the scalars.
Definition: CD_GenericParticleImplem.H:90
const std::array< Real, M > & getReals() const noexcept
Get the M scalars.
Definition: CD_GenericParticleImplem.H:61
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:165
RealVect & vect()
Get one of the RealVects.
Definition: CD_GenericParticleImplem.H:106
bool operator==(const GenericParticle< M, N > &a_other) const
Comparison operator with other particle.
Definition: CD_GenericParticleImplem.H:121
bool operator!=(const GenericParticle< M, N > &a_other) const
Comparison operator with other particle.
Definition: CD_GenericParticleImplem.H:128
bool operator<(const GenericParticle< M, N > &a_other) const noexcept
Particle comparison operator. Returns lexicographical ordering.
Definition: CD_GenericParticleImplem.H:135
RealVect m_position
Particle position.
Definition: CD_GenericParticle.H:180
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:185
std::array< RealVect, N > m_vectors
vector storage array
Definition: CD_GenericParticle.H:190
const std::array< RealVect, N > & getVects() const noexcept
Get the N vectors.
Definition: CD_GenericParticleImplem.H:75