MercuryDPM
Beta
|
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... | |
virtual | ~BaseInteraction () |
The default destructor. 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... | |
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... | |
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... | |
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 | 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 | setForce (Vec3D force) |
set total force (this is used by the normal force, tangential forces are added use addForce) More... | |
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 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 51 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_.
|
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 83 of file BaseInteraction.cc.
References I_, P_, and BaseInteractable::removeInteraction().
|
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 541 of file BaseInteraction.cc.
References force_.
Referenced by LiquidBridgeWilletInteraction::computeAdhesionForce(), ReversibleAdhesiveInteraction::computeAdhesionForce(), IrreversibleAdhesiveInteraction::computeAdhesionForce(), and SlidingFrictionInteraction::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 551 of file BaseInteraction.cc.
References torque_.
Referenced by FrictionInteraction::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 629 of file BaseInteraction.cc.
Referenced by DPMBase::computeForcesDueToWalls(), and DPMBase::computeInternalForces().
|
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 224 of file BaseInteraction.cc.
References BaseInteractable::addInteraction(), InteractionHandler::addObject(), copy(), getI(), getP(), handler_, I_, P_, and reverseHistory().
void BaseInteraction::gatherContactStatistics | ( | ) |
Definition at line 732 of file BaseInteraction.cc.
References Vec3D::dot(), force_, DPMBase::gatherContactStatistics(), BaseHandler< T >::getDPMBase(), getHandler(), getI(), 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.
Return the absolve normal force. This is the magnitude of the normal force.
Definition at line 531 of file BaseInteraction.cc.
References absoluteNormalForce_.
Referenced by SlidingFrictionInteraction::computeFrictionForce(), and FrictionInteraction::computeFrictionForce().
|
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 617 of file BaseInteraction.cc.
References species_.
Referenced by IrreversibleAdhesiveInteraction::getSpecies(), LiquidBridgeWilletInteraction::getSpecies(), EmptyFrictionInteraction::getSpecies(), EmptyAdhesiveInteraction::getSpecies(), HertzianViscoelasticInteraction::getSpecies(), ReversibleAdhesiveInteraction::getSpecies(), LinearPlasticViscoelasticInteraction::getSpecies(), LinearViscoelasticInteraction::getSpecies(), FrictionInteraction::getSpecies(), and SlidingFrictionInteraction::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 282 of file BaseInteraction.cc.
References contactPoint_.
Referenced by DPMBase::computeForcesDueToWalls(), DPMBase::computeInternalForces(), LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), and LinearViscoelasticInteraction::computeNormalForce().
Mdouble BaseInteraction::getDistance | ( | ) | const |
Returns an Mdouble which is the norm (length) of distance vector.
Definition at line 474 of file BaseInteraction.cc.
References distance_.
Referenced by SlidingFrictionInteraction::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 707 of file BaseInteraction.cc.
References getI(), getOverlap(), getP(), and BaseParticle::getRadius().
Referenced by FrictionInteraction::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 = \(R_I*R_P/(R_I+R_P)\) See also BaseInteraction::getEffectiveCorrectedRadius()
Definition at line 676 of file BaseInteraction.cc.
References getI(), getP(), and BaseParticle::getRadius().
Referenced by LiquidBridgeWilletInteraction::computeAdhesionForce(), FrictionInteraction::computeFrictionForce(), HertzianViscoelasticInteraction::computeNormalForce(), 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 IrreversibleAdhesiveInteraction, FrictionInteraction, LinearViscoelasticInteraction, SlidingFrictionInteraction, LinearPlasticViscoelasticInteraction, ReversibleAdhesiveInteraction, HertzianViscoelasticInteraction, EmptyAdhesiveInteraction, EmptyFrictionInteraction, and LiquidBridgeWilletInteraction.
Definition at line 638 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 251 of file BaseInteraction.cc.
References force_.
Referenced by DPMBase::computeForcesDueToWalls(), and DPMBase::computeInternalForces().
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 196 of file BaseInteraction.cc.
References handler_.
Referenced by SlidingFrictionInteraction::computeFrictionForce(), FrictionInteraction::computeFrictionForce(), and gatherContactStatistics().
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 312 of file BaseInteraction.cc.
References I_.
Referenced by SlidingFrictionInteraction::computeFrictionForce(), FrictionInteraction::computeFrictionForce(), LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), LinearViscoelasticInteraction::computeNormalForce(), copySwitchPointer(), gatherContactStatistics(), getEffectiveCorrectedRadius(), getEffectiveRadius(), InteractionHandler::removeObjectKeepingPeriodics(), and writeToFStat().
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 332 of file BaseInteraction.cc.
References I_.
|
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 127 of file BaseInteraction.cc.
Referenced by write().
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 271 of file BaseInteraction.cc.
References normal_.
Referenced by LiquidBridgeWilletInteraction::computeAdhesionForce(), ReversibleAdhesiveInteraction::computeAdhesionForce(), IrreversibleAdhesiveInteraction::computeAdhesionForce(), SlidingFrictionInteraction::computeFrictionForce(), FrictionInteraction::computeFrictionForce(), LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), LinearViscoelasticInteraction::computeNormalForce(), gatherContactStatistics(), Coil::getInteractionWith(), AxisymmetricIntersectionOfWalls::getInteractionWith(), Screw::getInteractionWith(), CylindricalWall::getInteractionWith(), InfiniteWallWithHole::getInteractionWith(), InfiniteWall::getInteractionWith(), IntersectionOfWalls::getInteractionWith(), BaseParticle::getInteractionWith(), FrictionInteraction::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 519 of file BaseInteraction.cc.
References normalRelativeVelocity_.
Referenced by SlidingFrictionInteraction::computeFrictionForce(), LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), and LinearViscoelasticInteraction::computeNormalForce().
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 292 of file BaseInteraction.cc.
References overlap_.
Referenced by LiquidBridgeWilletInteraction::computeAdhesionForce(), ReversibleAdhesiveInteraction::computeAdhesionForce(), IrreversibleAdhesiveInteraction::computeAdhesionForce(), LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), LinearViscoelasticInteraction::computeNormalForce(), gatherContactStatistics(), getEffectiveCorrectedRadius(), HertzianViscoelasticInteraction::getElasticEnergy(), LinearPlasticViscoelasticInteraction::getElasticEnergy(), LinearViscoelasticInteraction::getElasticEnergy(), IrreversibleAdhesiveInteraction::getElasticEnergy(), Coil::getInteractionWith(), AxisymmetricIntersectionOfWalls::getInteractionWith(), Screw::getInteractionWith(), CylindricalWall::getInteractionWith(), InfiniteWallWithHole::getInteractionWith(), InfiniteWall::getInteractionWith(), IntersectionOfWalls::getInteractionWith(), BaseParticle::getInteractionWith(), LinearPlasticViscoelasticInteraction::getUnloadingStiffness(), 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 302 of file BaseInteraction.cc.
References P_.
Referenced by SlidingFrictionInteraction::computeFrictionForce(), FrictionInteraction::computeFrictionForce(), LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), LinearViscoelasticInteraction::computeNormalForce(), copySwitchPointer(), gatherContactStatistics(), getEffectiveCorrectedRadius(), getEffectiveRadius(), InteractionHandler::removeObjectKeepingPeriodics(), and writeToFStat().
const BaseInteractable * BaseInteraction::getP | ( | ) | const |
Returns a constant pointer to the first object in the interactions; normally the particle.
Definition at line 322 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 508 of file BaseInteraction.cc.
References relativeVelocity_.
Referenced by SlidingFrictionInteraction::computeFrictionForce(), LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), and LinearViscoelasticInteraction::computeNormalForce().
|
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, and SlidingFrictionInteraction.
Definition at line 498 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, and SlidingFrictionInteraction.
Definition at line 486 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 343 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 261 of file BaseInteraction.cc.
References torque_.
Referenced by DPMBase::computeForcesDueToWalls(), and DPMBase::computeInternalForces().
|
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, FrictionInteraction, and SlidingFrictionInteraction.
Definition at line 359 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 FrictionInteraction, IrreversibleAdhesiveInteraction, EmptyFrictionInteraction, LinearViscoelasticInteraction, EmptyAdhesiveInteraction, SlidingFrictionInteraction, LinearPlasticViscoelasticInteraction, LiquidBridgeWilletInteraction, ReversibleAdhesiveInteraction, and HertzianViscoelasticInteraction.
Definition at line 115 of file BaseInteraction.cc.
References force_, and torque_.
Referenced by HertzianViscoelasticInteraction::read(), LinearPlasticViscoelasticInteraction::read(), and LinearViscoelasticInteraction::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 205 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 SlidingFrictionInteraction, and FrictionInteraction.
Definition at line 653 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 SlidingFrictionInteraction, and FrictionInteraction.
Definition at line 657 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 605 of file BaseInteraction.cc.
References absoluteNormalForce_.
Referenced by LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), and LinearViscoelasticInteraction::computeNormalForce().
void BaseInteraction::setContactPoint | ( | Vec3D | contactPoint | ) |
Set the location of the contact point between the two interacting objects.
Definition at line 165 of file BaseInteraction.cc.
References contactPoint_.
Referenced by Coil::getInteractionWith(), AxisymmetricIntersectionOfWalls::getInteractionWith(), Screw::getInteractionWith(), CylindricalWall::getInteractionWith(), InfiniteWallWithHole::getInteractionWith(), InfiniteWall::getInteractionWith(), IntersectionOfWalls::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 146 of file BaseInteraction.cc.
References distance_.
Referenced by Coil::getInteractionWith(), AxisymmetricIntersectionOfWalls::getInteractionWith(), Screw::getInteractionWith(), CylindricalWall::getInteractionWith(), InfiniteWallWithHole::getInteractionWith(), InfiniteWall::getInteractionWith(), IntersectionOfWalls::getInteractionWith(), and BaseParticle::getInteractionWith().
|
protected |
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 562 of file BaseInteraction.cc.
References force_.
Referenced by LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), and LinearViscoelasticInteraction::computeNormalForce().
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 186 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 399 of file BaseInteraction.cc.
References BaseInteractable::addInteraction(), I_, and BaseInteractable::removeInteraction().
Referenced by InteractionHandler::removeObjectKeepingPeriodics().
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 137 of file BaseInteraction.cc.
References normal_.
Referenced by Coil::getInteractionWith(), AxisymmetricIntersectionOfWalls::getInteractionWith(), Screw::getInteractionWith(), CylindricalWall::getInteractionWith(), InfiniteWallWithHole::getInteractionWith(), InfiniteWall::getInteractionWith(), IntersectionOfWalls::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 595 of file BaseInteraction.cc.
References normalRelativeVelocity_.
Referenced by LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), and LinearViscoelasticInteraction::computeNormalForce().
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 156 of file BaseInteraction.cc.
References overlap_.
Referenced by Coil::getInteractionWith(), AxisymmetricIntersectionOfWalls::getInteractionWith(), Screw::getInteractionWith(), CylindricalWall::getInteractionWith(), InfiniteWallWithHole::getInteractionWith(), InfiniteWall::getInteractionWith(), IntersectionOfWalls::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 384 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 584 of file BaseInteraction.cc.
References relativeVelocity_.
Referenced by LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), and LinearViscoelasticInteraction::computeNormalForce().
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 371 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 176 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 573 of file BaseInteraction.cc.
References torque_.
Referenced by LinearPlasticViscoelasticInteraction::computeLinearPlasticViscoelasticForce(), HertzianViscoelasticInteraction::computeNormalForce(), and LinearViscoelasticInteraction::computeNormalForce().
|
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 IrreversibleAdhesiveInteraction, FrictionInteraction, EmptyFrictionInteraction, LinearViscoelasticInteraction, EmptyAdhesiveInteraction, SlidingFrictionInteraction, LinearPlasticViscoelasticInteraction, LiquidBridgeWilletInteraction, ReversibleAdhesiveInteraction, and HertzianViscoelasticInteraction.
Definition at line 97 of file BaseInteraction.cc.
References force_, BaseObject::getId(), getName(), I_, P_, timeStamp_, and torque_.
Referenced by HertzianViscoelasticInteraction::write(), LinearPlasticViscoelasticInteraction::write(), and LinearViscoelasticInteraction::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 415 of file BaseInteraction.cc.
References Vec3D::dot(), force_, getI(), 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 363 of file BaseInteraction.h.
Referenced by getAbsoluteNormalForce(), and setAbsoluteNormalForce().
|
private |
This is Vec3D which stores the contact point of the interaction.
Definition at line 346 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 368 of file BaseInteraction.h.
Referenced by getDistance(), and setDistance().
|
private |
First computed by NormalForceInteraction, but added to by FrictionForceInteraction and AdhesiveForceInteraction.
Definition at line 373 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 331 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 341 of file BaseInteraction.h.
Referenced by BaseInteraction(), copySwitchPointer(), gatherContactStatistics(), getI(), setI(), write(), writeToFStat(), and ~BaseInteraction().
|
private |
Vec3D which stores the normal vector of the interaction.
Definition at line 388 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 358 of file BaseInteraction.h.
Referenced by getNormalRelativeVelocity(), and setNormalRelativeVelocity().
|
private |
Mdouble which stores the current overlap.
Definition at line 393 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 336 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 353 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 398 of file BaseInteraction.h.
Referenced by BaseInteraction(), getBaseSpecies(), and setSpecies().
|
private |
Mdouble which store the last timeStamp the interaction was active.
Definition at line 383 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 378 of file BaseInteraction.h.
Referenced by addTorque(), BaseInteraction(), getTorque(), read(), rotateHistory(), setTorque(), and write().