chombo-discharge
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. More...
 
 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. More...
 
 ItoParticle (const ItoParticle &a_other)
 Copy constructor. Copies all fields. More...
 
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. More...
 
Real & weight ()
 Get particle weight. More...
 
const Real & weight () const
 Get particle weight. More...
 
Real & diffusion ()
 Get particle diffusion coefficient. More...
 
const Real & diffusion () const
 Get particle diffusion coefficient. More...
 
Real & mobility ()
 Get mobility coefficient. More...
 
const Real & mobility () const
 Get mobility coefficient. More...
 
Real & energy ()
 Get average particle energy. More...
 
const Real & energy () const
 Get average particle energy. More...
 
RealVect & oldPosition ()
 Get the old particle position. More...
 
const RealVect & oldPosition () const
 Get the old particle position. More...
 
RealVect & velocity ()
 Get the particle velocity. More...
 
const RealVect & velocity () const
 Get the particle velocity. More...
 
Real totalEnergy () const
 Get the total energy. More...
 
Real conductivity () const
 Get the particle conductivity. More...
 
Real diffusivity () const
 Get the particle diffusivity. More...
 
Real & tmpReal ()
 Return scratch scalar storage.
 
const Real & tmpReal () const
 Return scratch scalar storage.
 
RealVect & tmpVect ()
 Return scratch RealVect storage.
 
const RealVect & tmpVect () const
 Return scratch RealVect storage.
 
- 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. 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...
 
Real & real ()
 Get one of the scalars. More...
 
const Real & real () const
 Get one of the scalars. More...
 
RealVect & vect ()
 Get one of the RealVects. More...
 
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.
 
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 *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. More...
 
virtual void linearIn (void *a_buffer)
 Read a linear binary representation of the internal data. Assumes that the buffer has the correct data. More...
 

Static Public Attributes

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

Additional Inherited Members

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

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

◆ 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: