ESyS-Particle
4.0.1
|
Elastic interaction between bonded particles. More...
#include <BondedInteraction.h>
Public Types | |
typedef CBondedIGP | ParameterType |
typedef BondedInteractionCpData | CheckPointable |
typedef double(CBondedInteraction::* | ScalarFieldFunction )() const |
typedef pair< bool, double > (CBondedInteraction::* | CheckedScalarFieldFunction )() const |
typedef Vec3(CBondedInteraction::* | VectorFieldFunction )() const |
Public Member Functions | |
CBondedInteraction (CParticle *particle1, CParticle *particle2, const CBondedIGP ¶ms) | |
virtual void | calcForces () |
void | setBreak (double) |
bool | broken () |
int | getTag () const |
void | setTag (int tag) |
double | getCriterion () const |
double | getPotentialEnergy () const |
double | getStrain () const |
Vec3 | getForce () const |
virtual Vec3 | getPos () const |
virtual void | saveCheckPointData (std::ostream &oStream) |
virtual void | saveRestartData (std::ostream &oStream) |
virtual void | loadRestartData (std::istream &iStream) |
Static Public Member Functions | |
static ScalarFieldFunction | getScalarFieldFunction (const string &) |
static CheckedScalarFieldFunction | getCheckedScalarFieldFunction (const string &) |
static VectorFieldFunction | getVectorFieldFunction (const string &) |
static string | getType () |
Protected Member Functions | |
CBondedInteraction (CParticle *, CParticle *) | |
Protected Attributes | |
double | m_k |
spring constant | |
double | m_r0 |
equilibrium distance | |
double | m_dist |
current distance, cached from last calcForces() | |
double | m_break |
breaking distance | |
Vec3 | m_force |
current force, cached for E_pot calculation | |
Vec3 | m_cpos |
int | m_tag |
Interaction tag;. | |
bool | m_scaling |
scaling k with particle radius | |
Friends | |
class | TML_PackedMessageInterface |
ostream & | operator<< (ostream &, const CBondedInteraction &) |
Elastic interaction between bonded particles.
$Revision$ $Date$
Used by PIS to save/load check-point data for objects of this type.
Reimplemented in CShortBondedInteraction.
CBondedInteraction::CBondedInteraction | ( | CParticle * | p1, |
CParticle * | p2 | ||
) | [protected] |
just do the APairInteraction part of the constructor - not to be used directly, only by derived class -> therefore protected
References CBondedInteraction().
Referenced by CBondedInteraction().
void CBondedInteraction::calcForces | ( | ) | [virtual] |
Calculate bonded elastic forces. 21 Flops
Implements APairInteraction.
Reimplemented in CCappedBondedInteraction.
References CParticle::applyForce(), m_dist, m_force, m_k, and m_r0.
CBondedInteraction::CheckedScalarFieldFunction CBondedInteraction::getCheckedScalarFieldFunction | ( | const string & | name | ) | [static] |
Get the particle member function which returns a checked scalar field of a given name.
name | the name of the field |
Reimplemented in CCappedBondedInteraction, and CShortBondedInteraction.
Vec3 CBondedInteraction::getForce | ( | ) | const |
get force - points to p1 on extension, to p2 on compression
References m_force.
Referenced by CShortBondedInteraction::getVectorFieldFunction(), CCappedBondedInteraction::getVectorFieldFunction(), and getVectorFieldFunction().
double CBondedInteraction::getPotentialEnergy | ( | ) | const |
get the potential energy stored in the interaction
Referenced by CShortBondedInteraction::getScalarFieldFunction(), CCappedBondedInteraction::getScalarFieldFunction(), and getScalarFieldFunction().
CBondedInteraction::ScalarFieldFunction CBondedInteraction::getScalarFieldFunction | ( | const string & | name | ) | [static] |
Get the particle member function which returns a scalar field of a given name.
name | the name of the field |
Reimplemented in CCappedBondedInteraction, and CShortBondedInteraction.
References getPotentialEnergy(), and getStrain().
double CBondedInteraction::getStrain | ( | ) | const |
get strain - compression positive
Referenced by CShortBondedInteraction::getScalarFieldFunction(), CCappedBondedInteraction::getScalarFieldFunction(), and getScalarFieldFunction().
CBondedInteraction::VectorFieldFunction CBondedInteraction::getVectorFieldFunction | ( | const string & | name | ) | [static] |
Get the particle member function which returns a vector field of a given name.
name | the name of the field |
Reimplemented in CCappedBondedInteraction, and CShortBondedInteraction.
References getForce().
void CBondedInteraction::loadRestartData | ( | std::istream & | iStream | ) | [virtual] |
load restart data from stream
iStream | the input stream |
Reimplemented from APairInteraction.
References m_break, m_dist, AInteraction::m_id, m_k, m_r0, and m_scaling.
void CBondedInteraction::saveCheckPointData | ( | std::ostream & | oStream | ) | [virtual] |
Save snapshot data (non-restartable, viz/postprocessing only) to an output stream.
oStream | the output stream |
Reimplemented in CShortBondedInteraction.
void CBondedInteraction::saveRestartData | ( | std::ostream & | oStream | ) | [virtual] |
save restart data to ostream
oStream | the output stream |
Reimplemented from APairInteraction.
References m_break, m_dist, AInteraction::m_id, m_k, m_r0, and m_scaling.
void CBondedInteraction::setBreak | ( | double | rel_break | ) |
Set breaking distance to sum of the radii multiplied with given "relative breaking distance"
rel_break | the relative breaking distance |
References m_break.