chombo-discharge
Public Member Functions | Protected Attributes | List of all members
TracerParticle< M, N > Class Template Reference

A tracer particle class. This is templated for holding extra storage (useful for kernels). More...

#include <CD_TracerParticle.H>

Inheritance diagram for TracerParticle< M, N >:
Inheritance graph
[legend]
Collaboration diagram for TracerParticle< M, N >:
Collaboration graph
[legend]

Public Member Functions

 TracerParticle ()
 Default constructor – initializes everything to zero.
 
 TracerParticle (const TracerParticle< M, N > &a_other)
 Copy constructor. Copies all fields. More...
 
virtual ~TracerParticle ()
 Destructor (deallocates runtime memory storage)
 
Real & weight ()
 Get the particle "weight". More...
 
const Real & weight () const
 Get the particle "weight". More...
 
RealVect & velocity ()
 Get the particle velocity. More...
 
const RealVect & velocity () const
 Get the particle velocity. More...
 
virtual int size () const override
 Returns the size, in number of bytes, of a flat representation of the data in this object.
 
virtual void linearOut (void *a_buffer) const override
 Write a linear binary representation of the internal data. Assumes that sufficient memory for the buffer has already been allocated by the caller. More...
 
virtual void linearIn (void *a_buffer) override
 Read a linear binary representation of the internal data. Assumes that the buffer has the correct data. More...
 
- Public Member Functions inherited from GenericParticle< M, N >
 GenericParticle ()
 Default constructor – initializes everything to zero.
 
 GenericParticle (const GenericParticle< M, N > &a_other)
 Copy constructor. Copies all fields. More...
 
virtual ~GenericParticle ()
 Destructor (deallocates runtime memory storage)
 
RealVect & position ()
 Get the particle position. More...
 
const RealVect & position () const
 Get the particle position. More...
 
const std::array< Real, M > & getReals () const noexcept
 Get the M scalars. More...
 
std::array< Real, M > & getReals () noexcept
 Get the M scalars. More...
 
const std::array< RealVect, N > & getVects () const noexcept
 Get the N vectors. More...
 
std::array< RealVect, N > & getVects () noexcept
 Get the N vectors. More...
 
template<size_t K>
Real & real ()
 Get one of the scalars. More...
 
template<size_t K>
const Real & real () const
 Get one of the scalars. More...
 
template<size_t K>
RealVect & vect ()
 Get one of the RealVects. More...
 
template<size_t K>
const RealVect & vect () const
 Get one of the RealVects. More...
 
bool operator== (const GenericParticle< M, N > &a_other) const
 Comparison operator with other particle. More...
 
bool operator!= (const GenericParticle< M, N > &a_other) const
 Comparison operator with other particle. More...
 
bool operator< (const GenericParticle< M, N > &a_other) const noexcept
 Particle comparison operator. Returns lexicographical ordering.
 

Protected Attributes

Real m_weight
 Particle "weight".
 
RealVect m_velocity
 Particle velocity.
 
- Protected Attributes inherited from GenericParticle< M, N >
RealVect m_position
 Particle position.
 
std::array< Real, M > m_scalars
 Scalar storage array.
 
std::array< RealVect, N > m_vectors
 vector storage array
 

Detailed Description

template<size_t M, size_t N>
class TracerParticle< M, N >

A tracer particle class. This is templated for holding extra storage (useful for kernels).

The template parameters M and N determine extra storage allocated to the particle. M determines the number of allocated scalars (Reals) and N determines the number of allocated vectors (RealVects). These quantities are communicated when remapping particles.

Constructor & Destructor Documentation

◆ TracerParticle()

template<size_t M, size_t N>
TracerParticle< M, N >::TracerParticle ( const TracerParticle< M, N > &  a_other)
inline

Copy constructor. Copies all fields.

Parameters
[in]a_otherOther particle.

Member Function Documentation

◆ linearIn()

template<size_t M, size_t N>
void TracerParticle< M, N >::linearIn ( void *  a_buffer)
inlineoverridevirtual

Read a linear binary representation of the internal data. Assumes that the buffer has the correct data.

Parameters
[in]a_bufferPointer to memory block

Reimplemented from GenericParticle< M, N >.

◆ linearOut()

template<size_t M, size_t N>
void TracerParticle< M, N >::linearOut ( void *  a_buffer) const
inlineoverridevirtual

Write a linear binary representation of the internal data. Assumes that sufficient memory for the buffer has already been allocated by the caller.

Parameters
[in]a_bufferPointer to memory block

Reimplemented from GenericParticle< M, N >.

◆ velocity() [1/2]

template<size_t M, size_t N>
RealVect & TracerParticle< M, N >::velocity
inline

Get the particle velocity.

Returns
m_velocity

◆ velocity() [2/2]

template<size_t M, size_t N>
const RealVect & TracerParticle< M, N >::velocity
inline

Get the particle velocity.

Returns
m_velocity

◆ weight() [1/2]

template<size_t M, size_t N>
Real & TracerParticle< M, N >::weight
inline

Get the particle "weight".

Returns
m_weight

◆ weight() [2/2]

template<size_t M, size_t N>
const Real & TracerParticle< M, N >::weight
inline

Get the particle "weight".

Returns
m_weight

The documentation for this class was generated from the following files: