chombo-discharge
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
ItoParticle Class Reference

A particle class for use with ItoSolvers, i.e. drifting Brownian walkers. More...

#include <CD_ItoParticle.H>

Inheritance diagram for ItoParticle:
Inheritance graph
[legend]
Collaboration diagram for ItoParticle:
Collaboration graph
[legend]

Public Member Functions

 ItoParticle ()
 Default constructor – user should subsequently set the variables or call define.
 
 ItoParticle (const Real a_weight, const RealVect &a_position, const RealVect &a_velocity=RealVect::Zero, const Real a_diffusion=0.0, const Real a_mobility=1.0, const Real a_energy=0.0)
 Constructor. This calls the define function.
 
 ItoParticle (const ItoParticle &a_other)
 Copy constructor. Copies all fields.
 
virtual ~ItoParticle ()
 Destructor (deallocates runtime memory storage)
 
void define (const Real a_weight, const RealVect &a_position, const RealVect &a_velocity=RealVect::Zero, const Real a_diffusion=0.0, const Real a_mobility=1.0, const Real a_energy=0.0)
 Full define function.
 
Realweight ()
 Get particle weight.
 
const Realweight () const
 Get particle weight.
 
Realdiffusion ()
 Get particle diffusion coefficient.
 
const Realdiffusion () const
 Get particle diffusion coefficient.
 
Realmobility ()
 Get mobility coefficient.
 
const Realmobility () const
 Get mobility coefficient.
 
Realenergy ()
 Get average particle energy.
 
const Realenergy () const
 Get average particle energy.
 
RealVectoldPosition ()
 Get the old particle position.
 
const RealVectoldPosition () const
 Get the old particle position.
 
RealVectvelocity ()
 Get the particle velocity.
 
const RealVectvelocity () const
 Get the particle velocity.
 
Real totalEnergy () const
 Get the total energy.
 
Real conductivity () const
 Get the particle conductivity.
 
Real diffusivity () const
 Get the particle diffusivity.
 
RealtmpReal ()
 Return scratch scalar storage.
 
const RealtmpReal () const
 Return scratch scalar storage.
 
RealVecttmpVect ()
 Return scratch RealVect storage.
 
const RealVecttmpVect () const
 Return scratch RealVect storage.
 
virtual int H5size () const
 Function that is used when writing particles to HDF5.
 
virtual void H5linearOut (void *const a_buffer) const
 Linearize the checkpointed Real components onto a buffer workable by HDF5.
 
virtual void H5linearIn (const void *const a_buffer)
 Delinearize the buffer onto the checkpointed real components in the particle class.
 
- Public Member Functions inherited from GenericParticle< 5, 3 >
 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.
 
Realreal ()
 Get one of the scalars.
 
const Realreal () const
 Get one of the scalars.
 
RealVectvect ()
 Get one of the RealVects.
 
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.
 
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.
 

Static Public Attributes

static std::vector< std::strings_realVariables = {"weight", "mobility", "diffusion", "energy", "tmpReal"}
 Naming convention for scalar fields.
 
static std::vector< std::strings_vectVariables = {"oldPos", "velocity", "tmpVect"}
 Naming convention for vector fields.
 

Additional Inherited Members

- Protected Attributes inherited from GenericParticle< 5, 3 >
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

A particle class for use with ItoSolvers, i.e. drifting Brownian walkers.

This class is used to encapsulate the requirements for running an ItoSolver. This computational particle contains position, weight, velocity, as well as a diffusion coefficient, a mobility, energy, and previous particle position. These are stored as follows:

m_scalars[0] => weight m_scalars[1] => mobility m_scalars[2] => diffusion m_scalars[3] => energy m_scalars[4] => Temp storage. m_vectors[0] => oldPosition m_vectors[1] => velocity m_vectors[3] => Temp storage.

Constructor & Destructor Documentation

◆ ItoParticle() [1/3]

ItoParticle::ItoParticle ( )
inline

Default constructor – user should subsequently set the variables or call define.

Note
If the user has called setNumRuntimeScalars/Vectors then will allocate runtime buffers

◆ ItoParticle() [2/3]

ItoParticle::ItoParticle ( const Real  a_weight,
const RealVect a_position,
const RealVect a_velocity = RealVect::Zero,
const Real  a_diffusion = 0.0,
const Real  a_mobility = 1.0,
const Real  a_energy = 0.0 
)
inline

Constructor. This calls the define function.

Parameters
[in]a_weightParticle weight
[in]a_positionParticle position
[in]a_velocityParticle velocity
[in]a_diffusionParticle diffusion coefficient
[in]a_mobilityParticle mobility coefficient
[in]a_energyParticle average energy
Note
If the user has called setNumRuntimeScalars/Vectors then will allocate runtime buffers

◆ ItoParticle() [3/3]

ItoParticle::ItoParticle ( const ItoParticle a_other)
inline

Copy constructor. Copies all fields.

Parameters
[in]a_otherOther particle.

Member Function Documentation

◆ conductivity()

Real ItoParticle::conductivity ( ) const
inline

Get the particle conductivity.

Returns
Returns m_weight * m_mobility

◆ define()

void ItoParticle::define ( const Real  a_weight,
const RealVect a_position,
const RealVect a_velocity = RealVect::Zero,
const Real  a_diffusion = 0.0,
const Real  a_mobility = 1.0,
const Real  a_energy = 0.0 
)
inline

Full define function.

Parameters
[in]a_weightParticle weight
[in]a_positionParticle position
[in]a_velocityParticle velocity
[in]a_diffusionParticle diffusion coefficient
[in]a_mobilityParticle mobility coefficient
[in]a_energyParticle average energy

◆ diffusion() [1/2]

Real & ItoParticle::diffusion ( )
inline

Get particle diffusion coefficient.

Returns
m_diffusion

◆ diffusion() [2/2]

const Real & ItoParticle::diffusion ( ) const
inline

Get particle diffusion coefficient.

Returns
m_diffusion

◆ diffusivity()

Real ItoParticle::diffusivity ( ) const
inline

Get the particle diffusivity.

Returns
Returns m_weight * m_diffusion

◆ energy() [1/2]

Real & ItoParticle::energy ( )
inline

Get average particle energy.

Returns
m_energy

◆ energy() [2/2]

const Real & ItoParticle::energy ( ) const
inline

Get average particle energy.

Returns
m_energy

◆ H5linearIn()

void ItoParticle::H5linearIn ( const void *const  a_buffer)
inlinevirtual

Delinearize the buffer onto the checkpointed 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< 5, 3 >.

◆ H5linearOut()

void ItoParticle::H5linearOut ( void *const  a_buffer) const
inlinevirtual

Linearize the checkpointed 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< 5, 3 >.

◆ H5size()

int ItoParticle::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< 5, 3 >.

◆ mobility() [1/2]

Real & ItoParticle::mobility ( )
inline

Get mobility coefficient.

Returns
m_mobility

◆ mobility() [2/2]

const Real & ItoParticle::mobility ( ) const
inline

Get mobility coefficient.

Returns
m_mobility

◆ oldPosition() [1/2]

RealVect & ItoParticle::oldPosition ( )
inline

Get the old particle position.

Returns
m_oldPosition.

◆ oldPosition() [2/2]

const RealVect & ItoParticle::oldPosition ( ) const
inline

Get the old particle position.

Returns
m_oldPosition.

◆ totalEnergy()

Real ItoParticle::totalEnergy ( ) const
inline

Get the total energy.

Returns
Returns m_weight * m_energy

◆ velocity() [1/2]

RealVect & ItoParticle::velocity ( )
inline

Get the particle velocity.

Returns
m_velocity

◆ velocity() [2/2]

const RealVect & ItoParticle::velocity ( ) const
inline

Get the particle velocity.

Returns
m_velocity

◆ weight() [1/2]

Real & ItoParticle::weight ( )
inline

Get particle weight.

Returns
m_weight

◆ weight() [2/2]

const Real & ItoParticle::weight ( ) const
inline

Get particle weight.

Returns
m_weight

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