MercuryDPM
Beta
|
Contains information about the contact between two interactables, BaseInteraction::P_ and BaseInteraction::I_;. More...
#include <Interaction.h>
Public Member Functions | |
Interaction (BaseInteractable *P, BaseInteractable *I, Mdouble timeStamp) | |
The default constructor. More... | |
Interaction (const Interaction &p) | |
The default copy constructor. More... | |
virtual | ~Interaction () |
The default destructor. More... | |
Interaction < NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction > * | copy () const final |
Creates a copy of this Interaction. More... | |
void | computeForce () final |
Computes the normal, tangential, and adhesive forces. More... | |
void | read (std::istream &is) final |
Read Interaction properties from a file. More... | |
void | write (std::ostream &os) const final |
Writes Interaction properties to a file. More... | |
std::string | getName () const final |
Returns the name of the Interaction. More... | |
Mdouble | getElasticEnergy () const final |
Returns the elastic energy stored in the Interaction. More... | |
void | integrate (Mdouble timeStep) final |
Integrates the time-dependent parameters of the contact force. More... | |
void | reverseHistory () final |
Reverses the parameters of the contact force. More... | |
void | rotateHistory (Matrix3D &rotationMatrix) final |
Contains information about the contact between two interactables, BaseInteraction::P_ and BaseInteraction::I_;.
An instance is created every time two BaseInteractables (particles or walls) get into contact with another, and gets deleted when the contact ends.
Next, the call process is described for this function for the case of two particles (it is very similar for a particle-wall contact.
Then, in each time step, every time that a contact is detected, DPMBase::computeInternalForces is called, which calls BaseParticle::getInteractionWith to create a new Interaction (setting the links to the interactables P_ and I_ and adds it to the InteractionHandler) or find an existing one. When a new Interaction is created, the Species determines what kind of Interaction it will be. DPMBase::computeInternalForces also sets the timeStamp_, normal_, overlap_, distance_, and contactPoint_ of the Interaction.
Then, computeForce is called, which sets the force_, which sets BaseInteraction::force_ and BaseInteraction::torque_ of the Interaction, and a few temporary values to communicate between the three different computeForce routines (see diamond inheritance below).
The force_ and torque_ is then used in DPMBase::integrateBeforeForceComputation and DPMBase::integrateAfterForceComputation to calcutate the new positions and velocities.
As there are many types of contact forces, the class is templated to allow for different force models. This is done in a diamond inheritance structure: First, three kinds of Interactions are created:
A full Interaction object is then derived by inheriting from all of the above:
Definition at line 107 of file Interaction.h.
Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction >::Interaction | ( | BaseInteractable * | P, |
BaseInteractable * | I, | ||
Mdouble | timeStamp | ||
) |
The default constructor.
Definition at line 148 of file Interaction.h.
The default copy constructor.
Definition at line 157 of file Interaction.h.
|
virtual |
The default destructor.
Definition at line 166 of file Interaction.h.
|
final |
Computes the normal, tangential, and adhesive forces.
Computes the normal, tangential, and adhesive forces (in that order). The order is important, as the normal force computation also calculates some additional parameters required by the other force laws: relativeVelocity_, normalRelativeVelocity_, absoluteNormalForce_.
Definition at line 257 of file Interaction.h.
|
final |
Creates a copy of this Interaction.
Useful for polymorphism as it can be called from a BaseInteraction* pointer.
Definition at line 177 of file Interaction.h.
|
final |
Returns the elastic energy stored in the Interaction.
Returns the elastic energy stored in the Interaction, adding up contributions from the normal, frictional and adhesive interaction The elastic (=potential) energy is defined as the energy gained by separating P_ and I_.
Definition at line 271 of file Interaction.h.
|
final |
Returns the name of the Interaction.
Returns the name of the Interaction, which depends on the template parameters.
Definition at line 232 of file Interaction.h.
|
final |
Integrates the time-dependent parameters of the contact force.
Called by ??? to integrate time-dependent parameters of the contact force, such as the SlidingFrictionInteraction::slidingSpring_
[in] | the | time step. |
Definition at line 243 of file Interaction.h.
|
final |
Read Interaction properties from a file.
Reads Interaction properties in human-readable form from a file, typically Files::restartFile.
[in] | is | the istream from which the data is read. |
Definition at line 199 of file Interaction.h.
|
final |
Reverses the parameters of the contact force.
Called by BaseInteraction::copySwitchPointer to reverse the parameters of the contact force in the case that the interactables P_ and I_ are switched. This is needed to deal with periodic particles.
Definition at line 212 of file Interaction.h.
|
final |
Definition at line 220 of file Interaction.h.
|
final |
Writes Interaction properties to a file.
Writes Interaction properties in human-readable form to a file, typically Files::restartFile.
[out] | os | the ostream to which the data is written. |
Definition at line 187 of file Interaction.h.