MercuryDPM
Alpha
|
Stores information about interactions between two interactable objects; often particles but could be walls etc. By info about interactions one means the overlaps, contact point, forces, torques, relative velocities etc. More...
#include <BaseInteraction.h>
Public Member Functions | |
BaseInteraction (BaseInteractable *P, BaseInteractable *I, Mdouble timeStamp) | |
A constructor takes the BaseInteractable objects which are interacting (come into contact) and time the interaction starts. More... | |
BaseInteraction (const BaseInteraction &p) | |
Copy constructor. More... | |
BaseInteraction () | |
Empty constructor. More... | |
virtual | ~BaseInteraction () |
The default destructor. More... | |
virtual void | actionsOnErase () |
If an interaction needs to do something before it gets erased, add it here. E.g. Liquid bridges rupture at the end of their lifetime, and the liquid bridge volume has to be redistributed. The reason this action is not done in the destructor is that this action should not be taken when erasing ghost interactions. More... | |
virtual void | computeForce () |
Virtual function that contains the force law between the two objects interacting. More... | |
virtual void | read (std::istream &is) |
Interaction read function, which accepts an std::istream as input. More... | |
virtual void | write (std::ostream &os) const |
Interaction print function, which accepts an std::ostream as input. More... | |
void | writeToFStat (std::ostream &os) const |
Writes forces data to the FStat file. More... | |
virtual std::string | getName () const |
Virtual function which allows interactions to be named. More... | |
virtual Mdouble | getElasticEnergy () const |
Returns a Mdouble which is the current about of Elastic energy in the interaction. More... | |
void | setDistance (Mdouble distance) |
Sets the interaction distance between the two interacting objects. More... | |
void | setNormal (Vec3D normal) |
Sets the normal vector between the two interacting objects. More... | |
void | setOverlap (Mdouble overlap) |
Set the overlap between the two interacting object. More... | |
void | setContactPoint (Vec3D contactPoint) |
Set the location of the contact point between the two interacting objects. More... | |
void | setTimeStamp (Mdouble timeStamp) |
Updates the time step of the interacting. Note, timesteps used to find completed interactions. More... | |
void | setSpecies (BaseSpecies *species) |
Set the Species of the interaction; note this can either be a Species or MixedSpecies. More... | |
void | setP (BaseInteractable *P) |
Sets the first object involved in the interaction (normally a particle). More... | |
void | setI (BaseInteractable *I) |
Sets the second object involved in the interaction (often particle or wall). More... | |
void | setHandler (InteractionHandler *handler) |
Sets the pointer to the interaction hander which is storing this interaction. More... | |
InteractionHandler * | getHandler () const |
Gets a point to the interaction handlers to which this interaction belongs. More... | |
const Vec3D & | getForce () const |
Gets the current force (vector) between the two interacting objects. More... | |
const Vec3D & | getTorque () const |
Gets the current torque (vector) between the two interacting objects. More... | |
const Vec3D & | getNormal () const |
Gets the normal vector between the two interacting objects. More... | |
const Vec3D & | getContactPoint () const |
Gets constant reference to contact point (vector). More... | |
Mdouble | getOverlap () const |
Returns a Mdouble with the current overlap between the two interacting objects. More... | |
Mdouble | getContactRadius () const |
Returns a Mdouble with the current contact between the two interacting objects. More... | |
void | removeFromHandler () |
Removes this interaction from its interaction hander. More... | |
void | copySwitchPointer (const BaseInteractable *original, BaseInteractable *ghost) const |
This copies the interactions of the original particle and replaces the original with the ghost copy. More... | |
void | gatherContactStatistics () |
BaseInteractable * | getP () |
Returns a pointer to first object involved in the interaction (normally a particle). More... | |
BaseInteractable * | getI () |
const BaseInteractable * | getP () const |
const BaseInteractable * | getI () const |
Returns a constant pointer to the second object involved in the interaction. More... | |
Mdouble | getTimeStamp () const |
Returns an Mdouble which is the time stamp of the interaction. More... | |
virtual void | integrate (Mdouble timeStep) |
integrates variables of the interaction which need to be integrate e.g. the tangential overlap. More... | |
virtual Mdouble | getTangentialOverlap () const |
get the length of the current tangential overlap More... | |
Mdouble | getDistance () const |
Returns an Mdouble which is the norm (length) of distance vector. More... | |
const Vec3D & | getRelativeVelocity () const |
Returns a constant reference to a vector of relative velocity. More... | |
Mdouble | getNormalRelativeVelocity () const |
Returns a double which is the norm (length) of the relative velocity vector. More... | |
Mdouble | getAbsoluteNormalForce () const |
Returns the absolute value of the norm (length) of the Normal force vector. More... | |
virtual BaseInteraction * | copy () const =0 |
Makes a copy of the interaction and returns a pointer to the copy. More... | |
unsigned int | getMultiContactIdentifier () const |
void | setMultiContactIdentifier (unsigned int multiContactIdentifier_) |
virtual void | rotateHistory (Matrix3D &rotationMatrix) |
When periodic particles are used, some interactions need certain history properties rotated (e.g. tangential springs). This is the function for that. More... | |
virtual void | actionsAfterTimeStep () |
virtual unsigned | getNumberOfFieldsVTK () const |
virtual std::string | getTypeVTK (unsigned i) const |
virtual std::string | getNameVTK (unsigned i) const |
virtual std::vector< Mdouble > | getFieldVTK (unsigned i) const |
void | setForce (Vec3D force) |
set total force (this is used by the normal force, tangential forces are added use addForce) More... | |
Public Member Functions inherited from BaseObject | |
BaseObject () | |
Default constructor. More... | |
BaseObject (const BaseObject &p) | |
Copy constructor, copies all the objects BaseObject contains. More... | |
virtual | ~BaseObject () |
virtual destructor More... | |
virtual void | moveInHandler (const unsigned int index) |
Except that it is virtual, it does the same thing as setIndex() does. More... | |
void | setIndex (const unsigned int index) |
Allows one to assign an index to an object in the handler/container. More... | |
void | setId (const unsigned int id) |
Assigns a unique identifier to each object in the handler (container) which remains constant even after the object is deleted from the container/handler. More... | |
unsigned int | getIndex () const |
Returns the index of the object in the handler. More... | |
unsigned int | getId () const |
Returns the unique identifier of any particular object. More... | |
Protected Member Functions | |
virtual const Vec3D | getTangentialForce () const |
Mdouble | getEffectiveRadius () const |
Returns a Mdouble to the effective radius of the interaction. (Not corrected for the overlap) More... | |
Mdouble | getEffectiveMass () const |
Returns a Mdouble to the effective radius of the interaction. (Not corrected for the overlap) More... | |
Mdouble | getEffectiveCorrectedRadius () |
Returns a Mdouble to the effective radius corrected for the overlaps of the particles. More... | |
void | addForce (Vec3D force) |
add an force increment to the total force. More... | |
void | addTorque (Vec3D torque) |
void | setTorque (Vec3D torque) |
set the total force (this is used by the normal force, tangential torques are added use addTorque) More... | |
void | setRelativeVelocity (Vec3D relativeVelocity) |
set the relative velocity of the current of the interactions. More... | |
void | setNormalRelativeVelocity (Mdouble normalRelativeVelocit) |
set the normal component of the relative velocity. More... | |
void | setAbsoluteNormalForce (Mdouble absoluteNormalForce) |
the absolute values of the norm (length) of the normal force More... | |
const BaseSpecies * | getBaseSpecies () const |
Return a constant point to BaseSpecies of the interaction. More... | |
virtual Mdouble | getElasticEnergyAtEquilibrium (Mdouble adhesiveForce) const |
virtual void | reverseHistory () |
When periodic particles some interaction need certain history properties reversing. This is the function for that. More... | |
Stores information about interactions between two interactable objects; often particles but could be walls etc. By info about interactions one means the overlaps, contact point, forces, torques, relative velocities etc.
This class is completely a MercuryDPM internal and should not be visible to users. It is also an abstract base class. All possible Mercury interactions are derived from this class. It is basically a policy class that defines what an interaction must have in Mercury. Advanced uses that need to add a new interaction must derive it from here and implement the black functions.
Definition at line 52 of file BaseInteraction.h.
BaseInteraction::BaseInteraction | ( | BaseInteractable * | P, |
BaseInteractable * | I, | ||
Mdouble | timeStamp | ||
) |
A constructor takes the BaseInteractable objects which are interacting (come into contact) and time the interaction starts.
This is the constructor which creates a new interactions between two BaseInteractable objects. The timeStamp is time the interactions is created and is used to check if the interations is current or has ended. It adds
[in] | P | BaseInteractable pointer which is the first object involved in the interaction normally a particle. |
[in] | I | BaseInteractable pointer which is the second object involved in the interaction often a wall or particle. |
[in] | timeStamp | Mdouble which is the time the interaction starts. |
Definition at line 44 of file BaseInteraction.cc.
References BaseInteractable::addInteraction(), force_, I_, normal_, overlap_, P_, Vec3D::setZero(), species_, timeStamp_, and torque_.
BaseInteraction::BaseInteraction | ( | const BaseInteraction & | p | ) |
Copy constructor.
This an copy constructor for a BaseInteraction.
[in] | p | BaseInteraction |
Definition at line 66 of file BaseInteraction.cc.
References force_, I_, normal_, overlap_, P_, species_, timeStamp_, and torque_.
BaseInteraction::BaseInteraction | ( | ) |
Empty constructor.
Empty interaction. Will be used for parallel in t
Definition at line 82 of file BaseInteraction.cc.
References force_, I_, normal_, overlap_, P_, Vec3D::setZero(), species_, timeStamp_, and torque_.
|
virtual |
The default destructor.
Destructor for BaseInteraction. Also removes the interaction from the list of interactions for both objects involved in the interaction.
Definition at line 99 of file BaseInteraction.cc.
References I_, P_, and BaseInteractable::removeInteraction().
|
virtual |
Reimplemented in LiquidMigrationWilletInteraction.
Definition at line 799 of file BaseInteraction.cc.
|
inlinevirtual |
If an interaction needs to do something before it gets erased, add it here. E.g. Liquid bridges rupture at the end of their lifetime, and the liquid bridge volume has to be redistributed. The reason this action is not done in the destructor is that this action should not be taken when erasing ghost interactions.
Reimplemented in LiquidMigrationWilletInteraction.
Definition at line 76 of file BaseInteraction.h.
Referenced by InteractionHandler::eraseOldInteractions().
|
protected |
add an force increment to the total force.
add an increment to total force in the interaction. This is used by tangential and non-contact forces (e.g. adhesive forces) as this are 'added' after the normal forces have been computed.
Definition at line 569 of file BaseInteraction.cc.
References force_.
Referenced by ChargedBondedInteraction::computeAdhesionForce(), LiquidBridgeWilletInteraction::computeAdhesionForce(), ParhamiMcMeekingSinterInteraction::computeAdhesionForce(), ReversibleAdhesiveInteraction::computeAdhesionForce(), BondedInteraction::computeAdhesionForce(), IrreversibleAdhesiveInteraction::computeAdhesionForce(), LiquidMigrationWilletInteraction::computeAdhesionForce(), SlidingFrictionInteraction::computeFrictionForce(), and MindlinInteraction::computeFrictionForce().
|
protected |
add an increment to total torque in the interaction. This is used by tangential and non-contact forces (e.g. adhesive forces) as this are 'added' after the normal forces have been computed.
Definition at line 579 of file BaseInteraction.cc.
References torque_.
Referenced by FrictionInteraction::computeFrictionForce(), and MindlinRollingTorsionInteraction::computeFrictionForce().
|
virtual |
Virtual function that contains the force law between the two objects interacting.
The children of this class will implement this function; however, it is blank. This function will do the actually force calculation for this interaction. Note, it is not virtual as it is not called from within this class.
Definition at line 657 of file BaseInteraction.cc.
|
pure virtual |
Makes a copy of the interaction and returns a pointer to the copy.
Referenced by copySwitchPointer().
void BaseInteraction::copySwitchPointer | ( | const BaseInteractable * | original, |
BaseInteractable * | ghost | ||
) | const |
This copies the interactions of the original particle and replaces the original with the ghost copy.
This functions copies the interactions of a real original particle. It first works out which of P and I is not the original particle. Then it create a new interactions between the new ghost copy and which every object is not the original particle from the P and I of the interaction. Note, at the end the ghost will be I in the new interaction and original item being interacted with will be P.
[in] | original | BaseInteractable* to the original particles who periodic image is being created from. |
[in] | ghost | BaseInteractble* to the new ghost (periodic partcles) that has just been created. |
Definition at line 240 of file BaseInteraction.cc.
References BaseInteractable::addInteraction(), InteractionHandler::addObject(), copy(), getI(), getP(), handler_, I_, P_, and reverseHistory().
Referenced by BaseInteractable::copyInteractionsForPeriodicParticles().
void BaseInteraction::gatherContactStatistics | ( | ) |
Definition at line 806 of file BaseInteraction.cc.
References Vec3D::dot(), force_, DPMBase::gatherContactStatistics(), BaseHandler< T >::getDPMBase(), getHandler(), BaseObject::getIndex(), Vec3D::getLength(), getNormal(), getOverlap(), getP(), BaseParticle::getPeriodicFromParticle(), BaseInteractable::getPosition(), BaseParticle::getRadius(), getTangentialForce(), getTangentialOverlap(), I_, BaseParticle::isFixed(), normal_, overlap_, and P_.
Mdouble BaseInteraction::getAbsoluteNormalForce | ( | ) | const |
Returns the absolute value of the norm (length) of the Normal force vector.
Returns the absolute normal force. This is the magnitude of the normal force.
Definition at line 559 of file BaseInteraction.cc.
References absoluteNormalForce_.
Referenced by SlidingFrictionInteraction::computeFrictionForce(), FrictionInteraction::computeFrictionForce(), MindlinInteraction::computeFrictionForce(), MindlinRollingTorsionInteraction::computeFrictionForce(), and MindlinInteraction::updateK_t().
|
protected |
Return a constant point to BaseSpecies of the interaction.
Returns a BaseSpecies pointer to the current species. Note, this will be either a Species or a MixedSpecies done of which are derived from BaseSpecies.
Definition at line 645 of file BaseInteraction.cc.
References species_.
Referenced by BondedInteraction::getSpecies(), IrreversibleAdhesiveInteraction::getSpecies(), LiquidBridgeWilletInteraction::getSpecies(), EmptyFrictionInteraction::getSpecies(), EmptyAdhesiveInteraction::getSpecies(), ReversibleAdhesiveInteraction::getSpecies(), ChargedBondedInteraction::getSpecies(), SinterInteraction::getSpecies(), ParhamiMcMeekingSinterInteraction::getSpecies(), HertzianSinterInteraction::getSpecies(), LinearViscoelasticInteraction::getSpecies(), LiquidMigrationWilletInteraction::getSpecies(), LinearPlasticViscoelasticInteraction::getSpecies(), HertzianViscoelasticInteraction::getSpecies(), FrictionInteraction::getSpecies(), MindlinRollingTorsionInteraction::getSpecies(), SlidingFrictionInteraction::getSpecies(), and MindlinInteraction::getSpecies().
const Vec3D & BaseInteraction::getContactPoint | ( | ) | const |
Gets constant reference to contact point (vector).
Returns a reference to a Vec3D which contains the current value of the contact point for the particles in interaction. Normally, does not change about the interaction is created.
Definition at line 298 of file BaseInteraction.cc.
References contactPoint_.
Referenced by LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), SinterInteraction::computeNormalForce(), LinearViscoelasticInteraction::computeNormalForce(), and HertzianSinterInteraction::computeSinterForce().
Mdouble BaseInteraction::getContactRadius | ( | ) | const |
Returns a Mdouble with the current contact between the two interacting objects.
Returns a Mdouble to the current overlap for the objects involved in the interaction.
Definition at line 318 of file BaseInteraction.cc.
References getEffectiveRadius(), and getOverlap().
Mdouble BaseInteraction::getDistance | ( | ) | const |
Returns an Mdouble which is the norm (length) of distance vector.
Definition at line 502 of file BaseInteraction.cc.
References distance_.
Referenced by SlidingFrictionInteraction::computeFrictionForce(), FrictionInteraction::computeFrictionForce(), MindlinInteraction::computeFrictionForce(), and MindlinRollingTorsionInteraction::computeFrictionForce().
|
protected |
Returns a Mdouble to the effective radius corrected for the overlaps of the particles.
Computes the effective corrected radius of a particle. This is used by some of the later interaction models. This correction is for the overlap. This functions assumes P is the particle and I is either a particle or a wall. See also BaseInteraction::getEffectiveCorrectedRadius()
Definition at line 777 of file BaseInteraction.cc.
References getI(), getOverlap(), getP(), and BaseParticle::getRadius().
|
protected |
Returns a Mdouble to the effective radius of the interaction. (Not corrected for the overlap)
Computes the effective radius of a particle. This is used by many of the later interaction models. This functions assumes P is the particle and I is either a particle or a wall. Effective Radius = See also BaseInteraction::getEffectiveCorrectedRadius()
Definition at line 746 of file BaseInteraction.cc.
References getI(), BaseParticle::getMass(), and getP().
Referenced by MindlinInteraction::computeFrictionForce().
|
protected |
Returns a Mdouble to the effective radius of the interaction. (Not corrected for the overlap)
Computes the effective radius of a particle. This is used by many of the later interaction models. This functions assumes P is the particle and I is either a particle or a wall. Effective Radius = See also BaseInteraction::getEffectiveCorrectedRadius()
Definition at line 715 of file BaseInteraction.cc.
References getI(), getP(), and BaseParticle::getRadius().
Referenced by LiquidBridgeWilletInteraction::computeAdhesionForce(), ParhamiMcMeekingSinterInteraction::computeAdhesionForce(), LiquidMigrationWilletInteraction::computeAdhesionForce(), FrictionInteraction::computeFrictionForce(), MindlinInteraction::computeFrictionForce(), MindlinRollingTorsionInteraction::computeFrictionForce(), LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), SinterInteraction::computeNormalForce(), HertzianSinterInteraction::computeSinterForce(), getContactRadius(), HertzianViscoelasticInteraction::getElasticEnergy(), HertzianViscoelasticInteraction::getElasticEnergyAtEquilibrium(), SinterInteraction::getFieldVTK(), HertzianSinterInteraction::getUnloadingModulus(), SinterInteraction::getUnloadingStiffness(), and LinearPlasticViscoelasticInteraction::getUnloadingStiffness().
|
virtual |
Returns a Mdouble which is the current about of Elastic energy in the interaction.
The children of this class will implement this function; however, it is blank. This function will contain the calculation for th elastic energy. Note, it is not virtual as it is not called from within this class.
Reimplemented in BondedInteraction, IrreversibleAdhesiveInteraction, MindlinRollingTorsionInteraction, MindlinInteraction, HertzianViscoelasticInteraction, LinearPlasticViscoelasticInteraction, FrictionInteraction, LiquidMigrationWilletInteraction, LinearViscoelasticInteraction, SlidingFrictionInteraction, HertzianSinterInteraction, SinterInteraction, ChargedBondedInteraction, ParhamiMcMeekingSinterInteraction, ReversibleAdhesiveInteraction, EmptyAdhesiveInteraction, EmptyFrictionInteraction, and LiquidBridgeWilletInteraction.
Definition at line 666 of file BaseInteraction.cc.
|
inlineprotectedvirtual |
Reimplemented in HertzianViscoelasticInteraction, and LinearViscoelasticInteraction.
Definition at line 350 of file BaseInteraction.h.
Referenced by ChargedBondedInteraction::getElasticEnergy().
|
virtual |
Reimplemented in LiquidMigrationWilletInteraction, and SinterInteraction.
Definition at line 871 of file BaseInteraction.cc.
const Vec3D & BaseInteraction::getForce | ( | ) | const |
Gets the current force (vector) between the two interacting objects.
Return a reference to a Vec3D which contains the current value of the force associated with this interaction.
Definition at line 267 of file BaseInteraction.cc.
References force_.
InteractionHandler * BaseInteraction::getHandler | ( | ) | const |
Gets a point to the interaction handlers to which this interaction belongs.
Returns a pointer to the InteractionHandler that this interaction belongs.
Definition at line 212 of file BaseInteraction.cc.
References handler_.
Referenced by SlidingFrictionInteraction::computeFrictionForce(), FrictionInteraction::computeFrictionForce(), MindlinInteraction::computeFrictionForce(), MindlinRollingTorsionInteraction::computeFrictionForce(), SinterInteraction::computeNormalForce(), HertzianSinterInteraction::computeSinterForce(), gatherContactStatistics(), and LiquidMigrationWilletInteraction::rupture().
BaseInteractable * BaseInteraction::getI | ( | ) |
Returns a pointer to the second object in the interaction; often a particle or a wall i.e. a general interactale hence I.
Definition at line 338 of file BaseInteraction.cc.
References I_.
Referenced by ChargedBondedInteraction::computeAdhesionForce(), SlidingFrictionInteraction::computeFrictionForce(), FrictionInteraction::computeFrictionForce(), MindlinInteraction::computeFrictionForce(), MindlinRollingTorsionInteraction::computeFrictionForce(), LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), SinterInteraction::computeNormalForce(), LinearViscoelasticInteraction::computeNormalForce(), HertzianSinterInteraction::computeSinterForce(), copySwitchPointer(), LiquidMigrationWilletInteraction::form(), getEffectiveCorrectedRadius(), getEffectiveMass(), getEffectiveRadius(), ChargedBondedInteraction::getElasticEnergy(), BaseInteractable::removeInteraction(), InteractionHandler::removeObjectKeepingPeriodics(), and LiquidMigrationWilletInteraction::rupture().
const BaseInteractable * BaseInteraction::getI | ( | ) | const |
Returns a constant pointer to the second object involved in the interaction.
Returns a constant pointer to the second object in the interaction; often a particle or a wall i.e. a general interactale hence I.
Definition at line 358 of file BaseInteraction.cc.
References I_.
unsigned int BaseInteraction::getMultiContactIdentifier | ( | ) | const |
Definition at line 685 of file BaseInteraction.cc.
References multiContactIdentifier_.
|
virtual |
Virtual function which allows interactions to be named.
Functions which returns the name of the Interaction here is called BaseInteraction; but, it should be later overridden by the actual interaction classes.
Implements BaseObject.
Definition at line 143 of file BaseInteraction.cc.
Referenced by write().
|
virtual |
Reimplemented in LiquidMigrationWilletInteraction, and SinterInteraction.
Definition at line 867 of file BaseInteraction.cc.
Referenced by InteractionHandler::writeVTK().
const Vec3D & BaseInteraction::getNormal | ( | ) | const |
Gets the normal vector between the two interacting objects.
Returns a reference to a Vec3D which contains the current value of the normal associated with the interactions.
Definition at line 287 of file BaseInteraction.cc.
References normal_.
Referenced by ChargedBondedInteraction::computeAdhesionForce(), LiquidBridgeWilletInteraction::computeAdhesionForce(), ParhamiMcMeekingSinterInteraction::computeAdhesionForce(), ReversibleAdhesiveInteraction::computeAdhesionForce(), BondedInteraction::computeAdhesionForce(), IrreversibleAdhesiveInteraction::computeAdhesionForce(), LiquidMigrationWilletInteraction::computeAdhesionForce(), SlidingFrictionInteraction::computeFrictionForce(), FrictionInteraction::computeFrictionForce(), MindlinInteraction::computeFrictionForce(), MindlinRollingTorsionInteraction::computeFrictionForce(), LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), SinterInteraction::computeNormalForce(), LinearViscoelasticInteraction::computeNormalForce(), HertzianSinterInteraction::computeSinterForce(), gatherContactStatistics(), BaseWall::getInteractionWith(), BaseParticle::getInteractionWith(), FrictionInteraction::integrate(), MindlinRollingTorsionInteraction::integrate(), and writeToFStat().
Mdouble BaseInteraction::getNormalRelativeVelocity | ( | ) | const |
Returns a double which is the norm (length) of the relative velocity vector.
Returns the norm (length) of the relative normal velocity. Note, this can be negative or positive it is not a speed.
Definition at line 547 of file BaseInteraction.cc.
References normalRelativeVelocity_.
Referenced by ChargedBondedInteraction::computeAdhesionForce(), ParhamiMcMeekingSinterInteraction::computeAdhesionForce(), BondedInteraction::computeAdhesionForce(), SlidingFrictionInteraction::computeFrictionForce(), MindlinInteraction::computeFrictionForce(), LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), SinterInteraction::computeNormalForce(), LinearViscoelasticInteraction::computeNormalForce(), and HertzianSinterInteraction::computeSinterForce().
|
virtual |
Reimplemented in LiquidMigrationWilletInteraction, and SinterInteraction.
Definition at line 859 of file BaseInteraction.cc.
Referenced by InteractionHandler::writeVTK().
Mdouble BaseInteraction::getOverlap | ( | ) | const |
Returns a Mdouble with the current overlap between the two interacting objects.
Returns a Mdouble to the current overlap for the objects involved in the interaction.
Definition at line 308 of file BaseInteraction.cc.
References overlap_.
Referenced by LiquidMigrationWilletInteraction::actionsAfterTimeStep(), ChargedBondedInteraction::computeAdhesionForce(), ParhamiMcMeekingSinterInteraction::computeAdhesionForce(), ReversibleAdhesiveInteraction::computeAdhesionForce(), LiquidBridgeWilletInteraction::computeAdhesionForce(), IrreversibleAdhesiveInteraction::computeAdhesionForce(), BondedInteraction::computeAdhesionForce(), LiquidMigrationWilletInteraction::computeAdhesionForce(), LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), SinterInteraction::computeNormalForce(), LinearViscoelasticInteraction::computeNormalForce(), HertzianSinterInteraction::computeSinterForce(), gatherContactStatistics(), getContactRadius(), getEffectiveCorrectedRadius(), ChargedBondedInteraction::getElasticEnergy(), HertzianSinterInteraction::getElasticEnergy(), SinterInteraction::getElasticEnergy(), LinearViscoelasticInteraction::getElasticEnergy(), HertzianViscoelasticInteraction::getElasticEnergy(), LinearPlasticViscoelasticInteraction::getElasticEnergy(), IrreversibleAdhesiveInteraction::getElasticEnergy(), BondedInteraction::getElasticEnergy(), BaseWall::getInteractionWith(), BaseParticle::getInteractionWith(), HertzianSinterInteraction::getUnloadingModulus(), SinterInteraction::getUnloadingStiffness(), LinearPlasticViscoelasticInteraction::getUnloadingStiffness(), MindlinInteraction::updateTangentialStiffnessZero(), and writeToFStat().
BaseInteractable * BaseInteraction::getP | ( | ) |
Returns a pointer to first object involved in the interaction (normally a particle).
Returns a pointer to the first object in the interactions; normally the particle.
Definition at line 328 of file BaseInteraction.cc.
References P_.
Referenced by ChargedBondedInteraction::computeAdhesionForce(), SlidingFrictionInteraction::computeFrictionForce(), FrictionInteraction::computeFrictionForce(), MindlinInteraction::computeFrictionForce(), MindlinRollingTorsionInteraction::computeFrictionForce(), LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), SinterInteraction::computeNormalForce(), LinearViscoelasticInteraction::computeNormalForce(), HertzianSinterInteraction::computeSinterForce(), copySwitchPointer(), LiquidMigrationWilletInteraction::form(), gatherContactStatistics(), getEffectiveCorrectedRadius(), getEffectiveMass(), getEffectiveRadius(), ChargedBondedInteraction::getElasticEnergy(), BaseInteractable::removeInteraction(), InteractionHandler::removeObjectKeepingPeriodics(), LiquidMigrationWilletInteraction::rupture(), and writeToFStat().
const BaseInteractable * BaseInteraction::getP | ( | ) | const |
Returns a constant pointer to the first object in the interactions; normally the particle.
Definition at line 348 of file BaseInteraction.cc.
References P_.
const Vec3D & BaseInteraction::getRelativeVelocity | ( | ) | const |
Returns a constant reference to a vector of relative velocity.
Returns the relative velocity between the two interactable objects involved in the interaction.
Definition at line 536 of file BaseInteraction.cc.
References relativeVelocity_.
Referenced by ParhamiMcMeekingSinterInteraction::computeAdhesionForce(), SlidingFrictionInteraction::computeFrictionForce(), MindlinInteraction::computeFrictionForce(), LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), SinterInteraction::computeNormalForce(), LinearViscoelasticInteraction::computeNormalForce(), and HertzianSinterInteraction::computeSinterForce().
|
protectedvirtual |
Returns a constant vector to the Tangential Force
Returns the vector that is the tangential force Note, at this level there cannot be a tangential force therefore by default it return the zero vector. This function will be overridden by interactions that have tangential components.
Reimplemented in EmptyFrictionInteraction, MindlinInteraction, and SlidingFrictionInteraction.
Definition at line 526 of file BaseInteraction.cc.
Referenced by gatherContactStatistics(), and writeToFStat().
|
virtual |
get the length of the current tangential overlap
Returns tangential overlap. Note, at this level there cannot be a tangential overlap hence by default it returns 0. This function will be overridden by interactions that have tangential components.
Reimplemented in EmptyFrictionInteraction, MindlinInteraction, and SlidingFrictionInteraction.
Definition at line 514 of file BaseInteraction.cc.
Referenced by gatherContactStatistics(), and writeToFStat().
Mdouble BaseInteraction::getTimeStamp | ( | ) | const |
Returns an Mdouble which is the time stamp of the interaction.
Returns the current time stamp of interaction. This should be the last time the interaction was active and used to find the end of the interaction.
Definition at line 369 of file BaseInteraction.cc.
References timeStamp_.
Referenced by InteractionHandler::eraseOldInteractions(), and InteractionHandler::removeObjectKeepingPeriodics().
const Vec3D & BaseInteraction::getTorque | ( | ) | const |
Gets the current torque (vector) between the two interacting objects.
Return a reference to a Vec3D which contains the current value of the torque associated with the interaction.
Definition at line 277 of file BaseInteraction.cc.
References torque_.
|
virtual |
Reimplemented in LiquidMigrationWilletInteraction, and SinterInteraction.
Definition at line 863 of file BaseInteraction.cc.
Referenced by InteractionHandler::writeVTK().
|
virtual |
integrates variables of the interaction which need to be integrate e.g. the tangential overlap.
Various variables in the force law need to be integrated. This is the place where this code goes. Note, it is empty and abstract at this point; but, not virtual as it as not called from within this class. It is only called by higher classes.
[in] | timeStep | This is the current time step and is passed in case the variables that are integrated depend on the absolute time of the system |
Reimplemented in EmptyFrictionInteraction, MindlinRollingTorsionInteraction, MindlinInteraction, FrictionInteraction, and SlidingFrictionInteraction.
Definition at line 385 of file BaseInteraction.cc.
|
virtual |
Interaction read function, which accepts an std::istream as input.
BaseInteaction read functions. Reads in all the information about an interaction. Note, this can be from any istream but would normally be a file See also BaseInteaction::write
[in] | is | std::istream to which the information is read from. |
Implements BaseObject.
Reimplemented in MindlinRollingTorsionInteraction, LiquidMigrationWilletInteraction, MindlinInteraction, HertzianViscoelasticInteraction, LinearPlasticViscoelasticInteraction, FrictionInteraction, BondedInteraction, IrreversibleAdhesiveInteraction, EmptyFrictionInteraction, LinearViscoelasticInteraction, EmptyAdhesiveInteraction, SlidingFrictionInteraction, HertzianSinterInteraction, SinterInteraction, ChargedBondedInteraction, LiquidBridgeWilletInteraction, ParhamiMcMeekingSinterInteraction, and ReversibleAdhesiveInteraction.
Definition at line 131 of file BaseInteraction.cc.
References force_, and torque_.
Referenced by HertzianSinterInteraction::read(), SinterInteraction::read(), LinearViscoelasticInteraction::read(), LinearPlasticViscoelasticInteraction::read(), and HertzianViscoelasticInteraction::read().
void BaseInteraction::removeFromHandler | ( | ) |
Removes this interaction from its interaction hander.
Removes the interaction from its InteractionHandler. Does no other cleaning up as it does not remove it from the particles.
Definition at line 221 of file BaseInteraction.cc.
References BaseObject::getIndex(), handler_, and BaseHandler< T >::removeObject().
|
protectedvirtual |
When periodic particles some interaction need certain history properties reversing. This is the function for that.
The children of this class will implement this function; however, it is blank. This function will contain code that changes some history information if a copy changes the P <-> I order; as can happen in creating a periodic particle. See also PeriodicBoundary::createPeriodicParticles and BaseInteraction::copySwitchPointer Note, it is not virtual as it is not called from within this class.
Reimplemented in MindlinInteraction, SlidingFrictionInteraction, MindlinRollingTorsionInteraction, and FrictionInteraction.
Definition at line 681 of file BaseInteraction.cc.
Referenced by copySwitchPointer().
|
virtual |
When periodic particles are used, some interactions need certain history properties rotated (e.g. tangential springs). This is the function for that.
Reimplemented in MindlinInteraction, SlidingFrictionInteraction, MindlinRollingTorsionInteraction, and FrictionInteraction.
Definition at line 696 of file BaseInteraction.cc.
References contactPoint_, force_, normal_, relativeVelocity_, and torque_.
|
protected |
the absolute values of the norm (length) of the normal force
set absolute normal force.
[in] | absoluteNormalForce | Mdouble contain the value of the absolute normal force. |
Definition at line 633 of file BaseInteraction.cc.
References absoluteNormalForce_.
Referenced by LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), SinterInteraction::computeNormalForce(), LinearViscoelasticInteraction::computeNormalForce(), and HertzianSinterInteraction::computeSinterForce().
void BaseInteraction::setContactPoint | ( | Vec3D | contactPoint | ) |
Set the location of the contact point between the two interacting objects.
Definition at line 181 of file BaseInteraction.cc.
References contactPoint_.
Referenced by TriangulatedWall::getInteractionWith(), BaseWall::getInteractionWith(), and BaseParticle::getInteractionWith().
void BaseInteraction::setDistance | ( | Mdouble | distance | ) |
Sets the interaction distance between the two interacting objects.
set the distance of the interaction.
[in] | distance | Mdouble which is the distance to set. |
Definition at line 162 of file BaseInteraction.cc.
References distance_.
Referenced by TriangulatedWall::getInteractionWith(), BaseWall::getInteractionWith(), and BaseParticle::getInteractionWith().
void BaseInteraction::setForce | ( | Vec3D | force | ) |
set total force (this is used by the normal force, tangential forces are added use addForce)
set the absolute values of the force. This is used by the normal forces as these are always called first and then the tangential and non-contact (e.g. adhesive forces) forces are added. See also BaseInteraction::addForce.
Definition at line 590 of file BaseInteraction.cc.
References force_.
Referenced by LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), SinterInteraction::computeNormalForce(), LinearViscoelasticInteraction::computeNormalForce(), and HertzianSinterInteraction::computeSinterForce().
void BaseInteraction::setHandler | ( | InteractionHandler * | handler | ) |
Sets the pointer to the interaction hander which is storing this interaction.
set the handler which this interactions belongs to.
[in] | handler | InteractionHandler* pointer to the interaction handler, this interaction will belong. |
Definition at line 202 of file BaseInteraction.cc.
References handler_.
Referenced by InteractionHandler::addObject().
void BaseInteraction::setI | ( | BaseInteractable * | I | ) |
Sets the second object involved in the interaction (often particle or wall).
Changes the second object involved in the interaction; often a general interactable not always a particle. Note, set is slightly misleading as it removed the interaction from old interactable and adds it to the new interactable.
[in] | I | BaseInteractable* An interactable object that is involved in the interaction. |
Definition at line 425 of file BaseInteraction.cc.
References BaseInteractable::addInteraction(), I_, and BaseInteractable::removeInteraction().
Referenced by InteractionHandler::removeObjectKeepingPeriodics().
void BaseInteraction::setMultiContactIdentifier | ( | unsigned int | multiContactIdentifier_ | ) |
Definition at line 690 of file BaseInteraction.cc.
References multiContactIdentifier_.
void BaseInteraction::setNormal | ( | Vec3D | normal | ) |
Sets the normal vector between the two interacting objects.
sets the normal of the interaction, in direction from I to P. Must be a unit normal vector. This is not checked by the class.
[in] | normal | Vec3D which is the normal of the interaction. |
Definition at line 153 of file BaseInteraction.cc.
References normal_.
Referenced by TriangulatedWall::getInteractionWith(), BaseWall::getInteractionWith(), and BaseParticle::getInteractionWith().
|
protected |
set the normal component of the relative velocity.
set the norm (length) of the normal relative velocity.
[in] | normalRelativeVelocity | Mdouble containing the normal (length) of the normal velocity between the interactable objects. |
Definition at line 623 of file BaseInteraction.cc.
References normalRelativeVelocity_.
Referenced by LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), SinterInteraction::computeNormalForce(), LinearViscoelasticInteraction::computeNormalForce(), and HertzianSinterInteraction::computeSinterForce().
void BaseInteraction::setOverlap | ( | Mdouble | overlap | ) |
Set the overlap between the two interacting object.
set the overlap between the two interactable object involved in the interactions.
[in] | overlap | Mdouble which is the overlap to set. |
Definition at line 172 of file BaseInteraction.cc.
References overlap_.
Referenced by TriangulatedWall::getInteractionWith(), BaseWall::getInteractionWith(), and BaseParticle::getInteractionWith().
void BaseInteraction::setP | ( | BaseInteractable * | P | ) |
Sets the first object involved in the interaction (normally a particle).
Changes the first object involved in the interaction; normally a particle. Note, set is slightly misleading as it removed the interaction from old particle and adds it to the new particle.
[in] | P | BaseInteractable* An interactable object that is involved in the interaction. |
Definition at line 410 of file BaseInteraction.cc.
References BaseInteractable::addInteraction(), P_, and BaseInteractable::removeInteraction().
|
protected |
set the relative velocity of the current of the interactions.
set the relative velocity between the two particles involved in the interaction.
[in] | relativeVelocity | This is Vec3D that contains the relative velocity between the two interactable objects. |
Definition at line 612 of file BaseInteraction.cc.
References relativeVelocity_.
Referenced by LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), SinterInteraction::computeNormalForce(), LinearViscoelasticInteraction::computeNormalForce(), and HertzianSinterInteraction::computeSinterForce().
void BaseInteraction::setSpecies | ( | BaseSpecies * | species | ) |
Set the Species of the interaction; note this can either be a Species or MixedSpecies.
Sets the species for the interactions. Note, this can be either a normal Species or a MixedSpecies; depending on if this interaction is between interactables of the same or different types.
[in] | BaseSpecies* | pointer to the actually species of the interaction. |
Definition at line 397 of file BaseInteraction.cc.
References species_.
Referenced by InteractionHandler::getInteraction().
void BaseInteraction::setTimeStamp | ( | Mdouble | timeStamp | ) |
Updates the time step of the interacting. Note, timesteps used to find completed interactions.
Updated the time stamp of the interaction. The time stamp being old is how ended interactions are detected.
[in] | timeStamp | The new timeStamp for the interactions should be the current time step. |
Definition at line 192 of file BaseInteraction.cc.
References timeStamp_.
Referenced by InteractionHandler::getInteraction().
|
protected |
set the total force (this is used by the normal force, tangential torques are added use addTorque)
set the absolute values of the torque. This is used by the normal forces as these are always called first and then the tangential and non-contact (e.g. adhesive forces) forces/torques are added. See also BaseInteraction::addTorque.
Definition at line 601 of file BaseInteraction.cc.
References torque_.
Referenced by LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), SinterInteraction::computeNormalForce(), LinearViscoelasticInteraction::computeNormalForce(), and HertzianSinterInteraction::computeSinterForce().
|
virtual |
Interaction print function, which accepts an std::ostream as input.
BaseInteaction write function. Writes out all the information required to recreate this interaction. To write this interaction to the screen call write(std::cout). See also BaseInteraction::read
[in] | os | std::ostream to which the information is written. Note, is any ostram is can be file or screen. |
Implements BaseObject.
Reimplemented in MindlinRollingTorsionInteraction, LiquidMigrationWilletInteraction, MindlinInteraction, HertzianViscoelasticInteraction, LinearPlasticViscoelasticInteraction, BondedInteraction, IrreversibleAdhesiveInteraction, FrictionInteraction, EmptyFrictionInteraction, LinearViscoelasticInteraction, EmptyAdhesiveInteraction, SlidingFrictionInteraction, HertzianSinterInteraction, SinterInteraction, ChargedBondedInteraction, LiquidBridgeWilletInteraction, ParhamiMcMeekingSinterInteraction, and ReversibleAdhesiveInteraction.
Definition at line 113 of file BaseInteraction.cc.
References force_, BaseObject::getId(), getName(), I_, P_, timeStamp_, and torque_.
Referenced by HertzianSinterInteraction::write(), SinterInteraction::write(), LinearViscoelasticInteraction::write(), LinearPlasticViscoelasticInteraction::write(), and HertzianViscoelasticInteraction::write().
void BaseInteraction::writeToFStat | ( | std::ostream & | os | ) | const |
Writes forces data to the FStat file.
Writes the FStat information that is required for the coarse- graining package MercuryCG if you want stress and force information. Note, it takes a general ostream but is normally a file i.e. ofstream
[in] | os | This is the ostream that the FStat information will be written to. Normally, a file but could be a gerneral ostream. |
Definition at line 441 of file BaseInteraction.cc.
References Vec3D::dot(), force_, BaseObject::getIndex(), Vec3D::getLength(), getNormal(), getOverlap(), getP(), BaseParticle::getPeriodicFromParticle(), BaseInteractable::getPosition(), BaseParticle::getRadius(), getTangentialForce(), getTangentialOverlap(), I_, BaseParticle::isFixed(), normal_, overlap_, P_, and timeStamp_.
|
private |
Variables calculated by NormalForceInteraction, used by FrictionForceInteraction and AdhesiveForceInteraction (but not changed by them)
Definition at line 395 of file BaseInteraction.h.
Referenced by getAbsoluteNormalForce(), and setAbsoluteNormalForce().
|
private |
This is Vec3D which stores the contact point of the interaction.
Definition at line 378 of file BaseInteraction.h.
Referenced by getContactPoint(), rotateHistory(), and setContactPoint().
|
private |
Variables calculated by NormalForceInteraction, used by FrictionForceInteraction and AdhesiveForceInteraction (but not changed by them)
Definition at line 400 of file BaseInteraction.h.
Referenced by getDistance(), and setDistance().
|
private |
First computed by NormalForceInteraction, but added to by FrictionForceInteraction and AdhesiveForceInteraction.
Definition at line 405 of file BaseInteraction.h.
Referenced by addForce(), BaseInteraction(), gatherContactStatistics(), getForce(), read(), rotateHistory(), setForce(), write(), and writeToFStat().
|
private |
Pointer to the InteractionHander for this interaction.
Definition at line 363 of file BaseInteraction.h.
Referenced by copySwitchPointer(), getHandler(), removeFromHandler(), and setHandler().
|
private |
This is the second of the two interactable object involved in the interaction; often a particle or a wall, hence I because it is general interactable.
Definition at line 373 of file BaseInteraction.h.
Referenced by BaseInteraction(), copySwitchPointer(), gatherContactStatistics(), getI(), setI(), write(), writeToFStat(), and ~BaseInteraction().
|
private |
Identifies individual contact such that it can be distinguished. E.g. the face number of a triangulated wall.
Definition at line 437 of file BaseInteraction.h.
Referenced by getMultiContactIdentifier(), and setMultiContactIdentifier().
|
private |
Vec3D which stores the normal vector of the interaction.
Definition at line 421 of file BaseInteraction.h.
Referenced by BaseInteraction(), gatherContactStatistics(), getNormal(), rotateHistory(), setNormal(), and writeToFStat().
|
private |
Variables calculated by NormalForceInteraction, used in other force routines (but not changed by them)
Definition at line 390 of file BaseInteraction.h.
Referenced by getNormalRelativeVelocity(), and setNormalRelativeVelocity().
|
private |
Mdouble which stores the current overlap.
Definition at line 426 of file BaseInteraction.h.
Referenced by BaseInteraction(), gatherContactStatistics(), getOverlap(), setOverlap(), and writeToFStat().
|
private |
This first of two interactable objects involved in the interaction; normally a particle hence P.
Definition at line 368 of file BaseInteraction.h.
Referenced by BaseInteraction(), copySwitchPointer(), gatherContactStatistics(), getP(), setP(), write(), writeToFStat(), and ~BaseInteraction().
|
private |
Variables calculated by the normal force routines used in other force routines (but not changed by them).
Definition at line 385 of file BaseInteraction.h.
Referenced by getRelativeVelocity(), rotateHistory(), and setRelativeVelocity().
|
private |
Pointer to the species of the interaction could be a mixed species or a species.
Definition at line 431 of file BaseInteraction.h.
Referenced by BaseInteraction(), getBaseSpecies(), and setSpecies().
|
private |
Mdouble which store the last timeStamp the interaction was active.
Definition at line 416 of file BaseInteraction.h.
Referenced by BaseInteraction(), getTimeStamp(), setTimeStamp(), write(), and writeToFStat().
|
private |
First computed by NormalForceInteraction, but added to by FrictionForceInteraction and AdhesiveForceInteraction.
Definition at line 410 of file BaseInteraction.h.
Referenced by addTorque(), BaseInteraction(), getTorque(), read(), rotateHistory(), setTorque(), and write().