ESyS-Particle  4.0.1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends
CParticle Class Reference

Class for a basic particle. More...

#include <Particle.h>

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

List of all members.

Classes

class  exchangeType

Public Types

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

Public Member Functions

 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)
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 dt)
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)

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

Friends

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

Detailed Description

Class for a basic particle.


Constructor & Destructor Documentation

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 m_circular_shift, m_initpos, and m_oldpos.


Member Function Documentation

void CParticle::applyForce ( const Vec3 force,
const Vec3 pos 
)

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

Reimplemented in CRotParticleVi, CRotThermParticle, and CRotParticle.

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

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 getKineticEnergy(), and sigma_d().

Here is the call graph for this function:

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.

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 CBasicParticle::m_pos.

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().

Here is the call graph for this function:

void CParticle::saveCheckPointData ( std::ostream &  oStream) [virtual]

save checkpoint data, sufficient for restart

Implements esys::lsm::CheckPointable.

Reimplemented in CRotParticleVi, and CRotParticle.

References m_circular_shift.

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 m_circular_shift.

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

References CBasicParticle::m_rad.

set pos and vel from exchangeType

Parameters:
Ethe exchanged values, i.e. a pair of pos and vel

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

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:

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, CBasicParticle::m_pos, and CBasicParticle::m_rad.

void CParticle::zeroForce ( ) [virtual]

zero forces on particle

Reimplemented in CRotParticle, and CRotParticleVi.

References m_sigma.


Member Data Documentation

stress tensor.

Warning:
Warning: this is unscaled, i.e. without the 1/V term

Referenced by applyForce(), sigma_d(), zeroForce(), CRotParticleVi::zeroForce(), and CRotParticle::zeroForce().


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