chombo-discharge
Loading...
Searching...
No Matches
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.
 
virtual ~TracerParticle ()
 Destructor (deallocates runtime memory storage)
 
Realweight ()
 Get the particle "weight".
 
const Realweight () const
 Get the particle "weight".
 
RealVectvelocity ()
 Get the particle velocity.
 
const RealVectvelocity () const
 Get the particle velocity.
 
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 *const 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.
 
virtual void linearIn (const void *const a_buffer) override
 Read a linear binary representation of the internal data. Assumes that the buffer has the correct data.
 
virtual int H5size () const
 Function that is used when writing particles to HDF5.
 
virtual void H5linearOut (void *const a_buffer) const
 Linearize the Real components onto a buffer workable by HDF5.
 
virtual void H5linearIn (const void *const a_buffer)
 Delinearize the buffer onto the real components in the particle class.
 
template<size_t K>
Realreal ()
 Get one of the scalars.
 
template<size_t K>
const Realreal () const
 Get one of the scalars.
 
template<size_t K>
RealVectvect ()
 Get one of the RealVects.
 
template<size_t K>
const RealVectvect () const
 Get one of the RealVects.
 
- 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.
 
virtual ~GenericParticle ()
 Destructor (deallocates runtime memory storage)
 
const int32_tparticleID () const noexcept
 Get the particle ID.
 
int32_tparticleID () noexcept
 Get the particle ID.
 
const int32_trankID () const noexcept
 Get the MPI rank ID.
 
int32_trankID () noexcept
 Get the MPI rank ID.
 
RealVectposition ()
 Get the particle position.
 
const RealVectposition () const
 Get the particle position.
 
const std::array< Real, M > & getReals () const noexcept
 Get the M scalars.
 
std::array< Real, M > & getReals () noexcept
 Get the M scalars.
 
const std::array< RealVect, N > & getVects () const noexcept
 Get the N vectors.
 
std::array< RealVect, N > & getVects () noexcept
 Get the N vectors.
 
template<size_t K>
Realreal ()
 Get one of the scalars.
 
template<size_t K>
const Realreal () const
 Get one of the scalars.
 
template<size_t K>
RealVectvect ()
 Get one of the RealVects.
 
template<size_t K>
const RealVectvect () const
 Get one of the RealVects.
 
bool operator== (const GenericParticle< M, N > &a_other) const
 Comparison operator with other particle.
 
bool operator!= (const GenericParticle< M, N > &a_other) const
 Comparison operator with other particle.
 
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 >
int32_t m_particleID
 Particle ID.
 
int32_t m_rankID
 MPI rank owning this particle.
 
RealVect m_position
 Particle position.
 
std::array< Real, Mm_scalars
 Scalar storage array.
 
std::array< RealVect, Nm_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

◆ H5linearIn()

template<size_t M, size_t N>
void TracerParticle< M, N >::H5linearIn ( const void *const  a_buffer)
inlinevirtual

Delinearize the buffer onto the real components in the particle class.

Ignores the particleID and rankID, so we can directly plug into Chombo's HDF5 API.

Parameters
[in]a_bufferPointer to memory block

Reimplemented from GenericParticle< M, N >.

◆ H5linearOut()

template<size_t M, size_t N>
void TracerParticle< M, N >::H5linearOut ( void *const  a_buffer) const
inlinevirtual

Linearize the Real components onto a buffer workable by HDF5.

Ignores the particleID and rankID, so we can directly plug into Chombo's HDF5 API.

Parameters
[in]a_bufferPointer to memory block

Reimplemented from GenericParticle< M, N >.

◆ H5size()

template<size_t M, size_t N>
int TracerParticle< M, N >::H5size ( ) const
inlinevirtual

Function that is used when writing particles to HDF5.

This ignores the particleID and rankID, so we can directory plug into Chombo's HDF5 APIs.

Reimplemented from GenericParticle< M, N >.

◆ linearIn()

template<size_t M, size_t N>
void TracerParticle< M, N >::linearIn ( const void *const  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 *const  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 >.

◆ real() [1/2]

template<size_t M, size_t N>
template<size_t K>
Real & TracerParticle< M, N >::real ( )
inline

Get one of the scalars.

Template parameter is the position in the m_scalars array. This is templated so that compilers may throw compile-time errors if trying to fetch elements out of range.

Returns
m_scalars[K]

◆ real() [2/2]

template<size_t M, size_t N>
template<size_t K>
const Real & TracerParticle< M, N >::real ( ) const
inline

Get one of the scalars.

Template parameter is the position in the m_scalars array. This is templated so that compilers may throw compile-time errors if trying to fetch elements out of range.

Returns
m_scalars[K]

◆ size()

template<size_t M, size_t N>
int TracerParticle< M, N >::size ( ) const
inlineoverridevirtual

Returns the size, in number of bytes, of a flat representation of the data in this object.

Reimplemented from GenericParticle< M, N >.

◆ vect() [1/2]

template<size_t M, size_t N>
template<size_t K>
RealVect & TracerParticle< M, N >::vect ( )
inline

Get one of the RealVects.

Template parameter is the position in the m_vectors array. This is templated so that compilers may throw compile-time errors if trying to fetch elements out of range.

Returns
m_vectors[K]

◆ vect() [2/2]

template<size_t M, size_t N>
template<size_t K>
const RealVect & TracerParticle< M, N >::vect ( ) const
inline

Get one of the RealVects.

Template parameter is the position in the m_vectors array. This is templated so that compilers may throw compile-time errors if trying to fetch elements out of range.

Returns
m_vectors[K]

◆ 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 ( ) const
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 ( ) const
inline

Get the particle "weight".

Returns
m_weight

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