ESyS-Particle  2.3.2
CParticle Class Reference

Class for a basic particle. More...

#include <Particle.h>

Inheritance diagram for CParticle:
Collaboration diagram for CParticle:

Classes

class  exchangeType

Public Types

typedef double(CParticle::* ScalarFieldFunction )() const
typedef Vec3(CParticle::* VectorFieldFunction )() const

Public Member Functions

 CParticle ()
 CParticle (double, double, const Vec3 &, const Vec3 &, const Vec3 &, int, bool)
 CParticle (double, double, const Vec3 &, const Vec3 &, const Vec3 &, const Vec3 &, const Vec3 &, int, bool)
 CParticle (const esys::lsm::SimpleParticleData &particleData)
virtual ~CParticle ()
const Vec3getInitPos () const
void setInitPos (const Vec3 &initPos)
Vec3 getDisplacement () const
Vec3 getTotalDisplacement () const
const Vec3getOldPos () const
Vec3 getVel () const
double getAbsVel () const
void setVel (const Vec3 &V)
void setMass (double mass)
double getMass () const
double getInvMass () const
Vec3 getForce () const
virtual void setDensity (double)
void resetDisplacement ()
double getIDField () const
double getTagField () const
void applyForce (const Vec3 &, const Vec3 &)
virtual void integrate (double)
virtual void integrateTherm (double)
virtual void zeroForce ()
virtual void zeroHeat ()
virtual void thermExpansion ()
void moveToRel (const Vec3 &v)
double getKineticEnergy () const
 move relative to initial position
virtual void setNonDynamic ()
virtual void setNonDynamicLinear ()
virtual void setNonDynamicRot ()
void setFlag (bool b=true)
bool isFlagged () const
void writeAsDXLine (ostream &, int slid=0)
void print ()
void rescale ()
exchangeType getExchangeValues ()
void setExchangeValues (const exchangeType &)
void setCircular (const Vec3 &)
double sigma_xx_2D () const
double sigma_xy_2D () const
double sigma_yy_2D () const
double sigma_d () const
virtual void saveCheckPointData (std::ostream &oStream)
virtual void saveSnapShotData (std::ostream &oStream)
virtual void applyMoment (const Vec3 &)
virtual void loadCheckPointData (std::istream &iStream)
template<typename TmplVisitor >
void visit (TmplVisitor &visitor)
- Public Member Functions inherited from CBasicParticle
 CBasicParticle ()
 CBasicParticle (const Vec3 &pos, double radius, int id=-1, int tag=-1)
 CBasicParticle (const esys::lsm::SimpleParticleData &data)
virtual ~CBasicParticle ()
Vec3getPPos ()
Vec3 getPos () const
void setPos (const Vec3 &pos)
double getRad () const
int getID () const
void setID (int id)
void moveBy (Vec3 v)
 move relative to current position
void moveTo (Vec3 v)
 move absolute
void setRad (double r)
void setTag (int t)
 particle tag handling
int getTag () const
bool isValid () const
 CBasicParticle ()
 CBasicParticle (int, const Vec3 &, double)
Vec3getPPos ()
Vec3 getPos () const
double getRad () const
int getID () const
void moveBy (Vec3 v)
void moveTo (Vec3 v)
 move relative to current position
void setRad (double r)
 move absolute
- Public Member Functions inherited from esys::lsm::CheckPointable
 CheckPointable ()
virtual ~CheckPointable ()

Static Public Member Functions

static ScalarFieldFunction getScalarFieldFunction (const string &)
static VectorFieldFunction getVectorFieldFunction (const string &)
static void get_type ()
static void setDo2dCalculations (bool do2dCalculations)
static bool getDo2dCalculations ()

Protected Member Functions

void setForce (const Vec3 &force)

Protected Attributes

Matrix3 m_sigma
 stress tensor.
Vec3 m_vel
Vec3 m_force
Vec3 m_oldpos
 position at the time of last neighbor search
Vec3 m_initpos
 position at time of construction
Vec3 m_circular_shift
 shift vector if particle is circular image
double m_mass
double m_div_mass
bool flag
bool m_is_dynamic
- Protected Attributes inherited from CBasicParticle
Vec3 m_pos
 position
double m_rad
 radius
int m_global_id
int m_tag
int m_id

Static Private Attributes

static bool s_do2Calculations = false

Friends

class TML_PackedMessageInterface
ostream & operator<< (ostream &, const CParticle &)

Additional Inherited Members

- Static Public Attributes inherited from CBasicParticle
static const CBasicParticle INVALID = CBasicParticle(Vec3::ZERO, 0.0, -1, -1)

Detailed Description

Class for a basic particle.

Member Typedef Documentation

typedef double(CParticle::* CParticle::ScalarFieldFunction)() const
typedef Vec3(CParticle::* CParticle::VectorFieldFunction)() const

Constructor & Destructor Documentation

CParticle::CParticle ( )
CParticle::CParticle ( double  rad,
double  mass,
const Vec3 pos,
const Vec3 vel,
const Vec3 force,
int  id,
bool  is_dyn 
)

Construct particle. Old and initial position are assumed to be identical to current position.

Parameters
radradius
massmass
poscurrent position
velcurrent velocity
forcecurrently applied force
idparticle id

References flag, m_circular_shift, m_div_mass, m_force, CBasicParticle::m_global_id, m_initpos, m_is_dynamic, m_mass, m_oldpos, m_vel, and zeroVec3.

CParticle::CParticle ( double  rad,
double  mass,
const Vec3 pos,
const Vec3 oldpos,
const Vec3 initpos,
const Vec3 vel,
const Vec3 force,
int  id,
bool  is_dyn 
)
CParticle::CParticle ( const esys::lsm::SimpleParticleData particleData)
virtual CParticle::~CParticle ( )
inlinevirtual

Member Function Documentation

virtual void CParticle::applyMoment ( const Vec3 )
inlinevirtual

Reimplemented in CRotParticle, and CRotParticleVi.

static void CParticle::get_type ( )
inlinestatic
double CParticle::getAbsVel ( ) const
inline

References m_vel, and Vec3::norm().

Referenced by getScalarFieldFunction(), and CRotParticle::getScalarFieldFunction().

Here is the call graph for this function:

Here is the caller graph for this function:

Vec3 CParticle::getDisplacement ( ) const
inline
CParticle::exchangeType CParticle::getExchangeValues ( )

get values to be exchanged, i.e. pos and vel

Reimplemented in CRotParticleVi, CRotThermParticle, and CRotParticle.

References m_circular_shift, m_initpos, m_is_dynamic, m_oldpos, CBasicParticle::m_pos, and m_vel.

double CParticle::getIDField ( ) const
inline
double CParticle::getKineticEnergy ( ) const
inline

move relative to initial position

Reimplemented in CRotParticleVi, and CRotParticle.

References m_mass, and m_vel.

Referenced by getScalarFieldFunction().

Here is the caller graph for this function:

const Vec3& CParticle::getOldPos ( ) const
inline

References m_oldpos.

Referenced by saveCheckPointData(), and saveSnapShotData().

Here is the caller graph for this function:

CParticle::ScalarFieldFunction CParticle::getScalarFieldFunction ( const string &  name)
static

Get the particle member function which returns a scalar field of a given name.

Parameters
namethe name of the field

Reimplemented in CRotThermParticle, CRotParticle, and CRotParticleVi.

References getAbsVel(), getIDField(), getKineticEnergy(), CBasicParticle::getRad(), getTagField(), NULL, sigma_d(), sigma_xx_2D(), sigma_xy_2D(), and sigma_yy_2D().

Here is the call graph for this function:

double CParticle::getTagField ( ) const
inline

References CBasicParticle::getTag().

Referenced by getScalarFieldFunction(), and CRotParticle::getScalarFieldFunction().

Here is the call graph for this function:

Here is the caller graph for this function:

Vec3 CParticle::getTotalDisplacement ( ) const
inline
CParticle::VectorFieldFunction CParticle::getVectorFieldFunction ( const string &  name)
static

Get the particle member function which returns a vector field of a given name.

Parameters
namethe name of the field

Reimplemented in CRotThermParticle, CRotParticle, and CRotParticleVi.

References getForce(), CBasicParticle::getPos(), getTotalDisplacement(), getVel(), and NULL.

Here is the call graph for this function:

void CParticle::integrate ( double  dt)
virtual

Do the time integration for the particle by 1st order method.

Parameters
dtthe time step

Reimplemented in CRotThermParticle, CRotParticle, and CRotParticleVi.

References getDo2dCalculations(), m_div_mass, m_force, m_is_dynamic, CBasicParticle::m_pos, m_vel, Vec3::X(), and Vec3::Y().

Here is the call graph for this function:

virtual void CParticle::integrateTherm ( double  )
inlinevirtual
bool CParticle::isFlagged ( ) const
inline

References flag.

void CParticle::loadCheckPointData ( std::istream &  iStream)
virtual

load checkpoint data saved with CParticle::saveCheckPointData

Implements esys::lsm::CheckPointable.

Reimplemented in CRotParticleVi, and CRotParticle.

References CBasicParticle::setTag().

Referenced by esys::lsm::CheckPointLoader::ParticleData::read().

Here is the call graph for this function:

Here is the caller graph for this function:

void CParticle::moveToRel ( const Vec3 v)
inline

References m_initpos, and CBasicParticle::m_pos.

void CParticle::print ( )
inline
void CParticle::rescale ( )
inline

Reimplemented in CRotParticleVi, and CRotParticle.

void CParticle::resetDisplacement ( )
inline
void CParticle::saveCheckPointData ( std::ostream &  oStream)
virtual

save checkpoint data, sufficient for restart

Implements esys::lsm::CheckPointable.

Reimplemented in CRotParticleVi, and CRotParticle.

References getForce(), CBasicParticle::getID(), getInitPos(), getMass(), getOldPos(), CBasicParticle::getPos(), CBasicParticle::getRad(), CBasicParticle::getTag(), getVel(), m_circular_shift, and m_is_dynamic.

Here is the call graph for this function:

void CParticle::saveSnapShotData ( std::ostream &  oStream)
virtual

save snapshot data not neccesarily sufficient for restart

Reimplemented from esys::lsm::CheckPointable.

Reimplemented in CRotParticleVi, and CRotParticle.

References getForce(), CBasicParticle::getID(), getInitPos(), getMass(), getOldPos(), CBasicParticle::getPos(), CBasicParticle::getRad(), CBasicParticle::getTag(), getVel(), and m_circular_shift.

Here is the call graph for this function:

void CParticle::setCircular ( const Vec3 cv)

set circular shift vector

Parameters
cvthe circular shift vector

Reimplemented in CRotThermParticle, CRotParticleVi, and CRotParticle.

References m_circular_shift, m_initpos, m_oldpos, and CBasicParticle::m_pos.

void CParticle::setDensity ( double  rho)
virtual

set the density of the particle

Reimplemented in CRotParticle.

References getDo2dCalculations(), m_div_mass, m_mass, and CBasicParticle::m_rad.

Here is the call graph for this function:

static void CParticle::setDo2dCalculations ( bool  do2dCalculations)
inlinestatic

References s_do2Calculations.

void CParticle::setFlag ( bool  b = true)
inline

References flag.

Referenced by CBondedInteraction::broken(), CRotThermBondedInteraction::broken(), and CRotBondedInteraction::broken().

Here is the caller graph for this function:

void CParticle::setInitPos ( const Vec3 initPos)
inline

References m_initpos.

Referenced by esys::lsm::RotThermalParticlePy::PickleSuite::setstate(), and esys::lsm::RotParticleViPy::PickleSuite::setstate().

Here is the caller graph for this function:

void CParticle::setMass ( double  mass)
inline

References m_div_mass, and m_mass.

Referenced by esys::lsm::RotThermalParticlePy::PickleSuite::setstate(), and esys::lsm::RotParticleViPy::PickleSuite::setstate().

Here is the caller graph for this function:

virtual void CParticle::setNonDynamic ( )
inlinevirtual

Reimplemented in CRotParticle.

References m_is_dynamic.

virtual void CParticle::setNonDynamicLinear ( )
inlinevirtual

Reimplemented in CRotParticle.

References m_is_dynamic.

virtual void CParticle::setNonDynamicRot ( )
inlinevirtual

Reimplemented in CRotParticle.

void CParticle::setVel ( const Vec3 V)
inline
double CParticle::sigma_d ( ) const

get deviatoric stress

References m_sigma, Matrix3::trace(), and Matrix3::Unit().

Referenced by getScalarFieldFunction(), CRotParticleVi::getScalarFieldFunction(), CRotParticle::getScalarFieldFunction(), and CRotThermParticle::getScalarFieldFunction().

Here is the call graph for this function:

Here is the caller graph for this function:

double CParticle::sigma_xx_2D ( ) const
inline

Reimplemented in CRotParticle, and CRotParticleVi.

References CBasicParticle::m_rad, and m_sigma.

Referenced by getScalarFieldFunction().

Here is the caller graph for this function:

double CParticle::sigma_xy_2D ( ) const
inline

Reimplemented in CRotParticle, and CRotParticleVi.

References CBasicParticle::m_rad, and m_sigma.

Referenced by getScalarFieldFunction().

Here is the caller graph for this function:

double CParticle::sigma_yy_2D ( ) const
inline

Reimplemented in CRotParticle, and CRotParticleVi.

References CBasicParticle::m_rad, and m_sigma.

Referenced by getScalarFieldFunction().

Here is the caller graph for this function:

virtual void CParticle::thermExpansion ( )
inlinevirtual
template<typename TmplVisitor >
void CParticle::visit ( TmplVisitor &  visitor)
inline
void CParticle::writeAsDXLine ( ostream &  ost,
int  slid = 0 
)

write particle data as a line in openDX format into a stream(file)

Parameters
ostthe output stream
slidfrom which sublattice the particle is coming

Reimplemented in CRotParticleVi, and CRotParticle.

References m_initpos, m_mass, CBasicParticle::m_pos, CBasicParticle::m_rad, m_vel, Vec3::X(), Vec3::Y(), and Vec3::Z().

Here is the call graph for this function:

void CParticle::zeroForce ( )
virtual

zero forces on particle

Reimplemented in CRotParticle, and CRotParticleVi.

References m_force, and m_sigma.

virtual void CParticle::zeroHeat ( )
inlinevirtual

Friends And Related Function Documentation

ostream& operator<< ( ostream &  ost,
const CParticle CP 
)
friend
friend class TML_PackedMessageInterface
friend

Member Data Documentation

double CParticle::m_div_mass
protected
Vec3 CParticle::m_oldpos
protected

position at the time of last neighbor search

Referenced by CParticle(), getDisplacement(), getExchangeValues(), getOldPos(), resetDisplacement(), setCircular(), and setExchangeValues().

bool CParticle::s_do2Calculations = false
staticprivate

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