|
chombo-discharge
|
A generic particle class, holding the position and a specified number of real and vector values. More...
#include <CD_GenericParticle.H>

Public Member Functions | |
| 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_t & | particleID () const noexcept |
| Get the particle ID. | |
| int32_t & | particleID () noexcept |
| Get the particle ID. | |
| const int32_t & | rankID () const noexcept |
| Get the MPI rank ID. | |
| int32_t & | rankID () noexcept |
| Get the MPI rank ID. | |
| RealVect & | position () |
| Get the particle position. | |
| const RealVect & | position () 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> | |
| Real & | real () |
| Get one of the scalars. | |
| template<size_t K> | |
| const Real & | real () const |
| Get one of the scalars. | |
| template<size_t K> | |
| RealVect & | vect () |
| Get one of the RealVects. | |
| template<size_t K> | |
| const RealVect & | vect () 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. | |
| virtual int | size () const |
| 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 |
| 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) |
| 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. | |
Protected Attributes | |
| int32_t | m_particleID |
| Particle ID. | |
| int32_t | m_rankID |
| MPI rank owning this particle. | |
| RealVect | m_position |
| Particle position. | |
| std::array< Real, M > | m_scalars |
| Scalar storage array. | |
| std::array< RealVect, N > | m_vectors |
| vector storage array | |
A generic particle class, holding the position and a specified number of real and vector values.
For the sake of simplicity, I have added separate linearization functions H5size, H5linearOut, H5linearIn that only linearizes the Real components of the particle. This is done for convenience only, so I don't have to rewrite all of Chombo's particle HDF5 checkpointing routines. Instead, we simply run a bootleg version of those codes that call the H5 linearization versions instead of the regular linearization functions. Users can use this functionality for trimming other types of unnecessary properties that don't need to go into the HDF5 files.
|
inline |
Copy constructor. Copies all fields.
| [in] | a_other | Other particle. |
|
inlinenoexcept |
Get the M scalars.
|
inlinenoexcept |
Get the M scalars.
|
inlinenoexcept |
Get the N vectors.
|
inlinenoexcept |
Get the N vectors.
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.
| [in] | a_buffer | Pointer to memory block. |
Reimplemented in ItoParticle, and TracerParticle< M, N >.
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.
| [in] | a_buffer | Pointer to memory block. |
Reimplemented in ItoParticle, and TracerParticle< M, N >.
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 in ItoParticle, and TracerParticle< M, N >.
Read a linear binary representation of the internal data. Assumes that the buffer has the correct data.
| [in] | a_buffer | Pointer to memory block. |
Reimplemented in TracerParticle< M, N >.
Write a linear binary representation of the internal data. Assumes that sufficient memory for the buffer has already been allocated by the caller.
| [in] | a_buffer | Pointer to memory block |
Reimplemented in TracerParticle< M, N >.
|
inline |
Comparison operator with other particle.
| [in] | a_other | Other particle |
|
inline |
Comparison operator with other particle.
| [in] | a_other | Other particle |
Get the particle position.
Get the particle position.
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.
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 the size, in number of bytes, of a flat representation of the data in this object.
Reimplemented in TracerParticle< M, N >.
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.
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.