MercuryDPM  Alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FrictionInteraction Class Reference

This class allows one to take all three types of frictional interactions into account. The sliding, rolling and torsional frictional interaction. See. More...

#include <FrictionInteraction.h>

+ Inheritance diagram for FrictionInteraction:

Public Types

typedef FrictionSpecies SpeciesType
 An alias for FrictionSpecies. More...
 
- Public Types inherited from SlidingFrictionInteraction
typedef SlidingFrictionSpecies SpeciesType
 An alias name for SlidingFrictionSpecies data type. More...
 

Public Member Functions

 FrictionInteraction (BaseInteractable *P, BaseInteractable *I, Mdouble timeStamp)
 Constructor. More...
 
 FrictionInteraction (const FrictionInteraction &p)
 Copy constructor. More...
 
virtual ~FrictionInteraction ()
 Destructor. More...
 
void computeFrictionForce ()
 Computes the forces arising due to all three types of friction, i.e., sliding, rolling and torsional. More...
 
void read (std::istream &is)
 Interaction read function, which accepts an std::istream as input. More...
 
void write (std::ostream &os) const
 Interaction print function, which accepts an std::ostream as input. More...
 
void integrate (Mdouble timeStep)
 Computes the amount of compression in all the springs, i.e., increments the rollingSpring_, slidingSpring_ (see SlidingFrictionInteraction.cc) and torsionSpring_. More...
 
Mdouble getElasticEnergy () const
 Returns the global amount of energy stored in all the springs (rolling, sliding and torsional). More...
 
std::string getBaseName () const
 Returns interaction name/type. More...
 
const FrictionSpeciesgetSpecies () const
 Returns a const pointer of type FrictionSpecies*. More...
 
void reverseHistory ()
 A useful feature if one wants to return to the initial state of the springs. However, reverse history decrements the current state to the state corresponding to previous time step. Decrements the state or value of rollingSpring_, torsionSpring_ and slidingSpring_. More...
 
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...
 
Vec3D getRollingSpring () const
 
- Public Member Functions inherited from SlidingFrictionInteraction
 SlidingFrictionInteraction (BaseInteractable *P, BaseInteractable *I, Mdouble timeStamp)
 Constructor. More...
 
 SlidingFrictionInteraction (const SlidingFrictionInteraction &p)
 Copy constructor. More...
 
virtual ~SlidingFrictionInteraction ()
 Destructor. More...
 
void computeFrictionForce ()
 Computes the tangential force generated due to compression in the sliding spring. Does take into account if the interaction is between particle-particle or particle-wall. More...
 
void read (std::istream &is)
 Interaction read function, which accepts an std::istream as input. More...
 
void write (std::ostream &os) const
 Interaction write function, which accepts an std::ostream as input. More...
 
void integrate (Mdouble timeStep)
 Increments the amount of compression in sliding spring. More...
 
Mdouble getElasticEnergy () const
 Returns the amount of elastic energy stored in sliding spring. More...
 
Mdouble getTangentialOverlap () const
 Returns the amount of tangential overlap which is needed by BaseInteraction::writeToFstat(). More...
 
std::string getBaseName () const
 Returns the type/name of interaction (sliding friction interaction) More...
 
void setSlidingSpring (const Vec3D slidingSpring)
 
Vec3D getSlidingSpring () const
 
const Vec3D getTangentialForce () const
 Returns the sliding friction force vector. More...
 
const SlidingFrictionSpeciesgetSpecies () const
 Returns a const pointer of type SlidingFrictionSpecies*. More...
 
void reverseHistory ()
 A useful feature if one wants to return to the initial state of the spring. However, reverse history decrements the current state to the state corresponding to previous time step. Decrements the value of slidingSpring_. More...
 
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...
 
void moveSlidingSpring (const Vec3D displacement)
 
- Public Member Functions inherited from 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. 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...
 
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...
 
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...
 
InteractionHandlergetHandler () const
 Gets a point to the interaction handlers to which this interaction belongs. More...
 
const Vec3DgetForce () const
 Gets the current force (vector) between the two interacting objects. More...
 
const Vec3DgetTorque () const
 Gets the current torque (vector) between the two interacting objects. More...
 
const Vec3DgetNormal () const
 Gets the normal vector between the two interacting objects. More...
 
const Vec3DgetContactPoint () 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 ()
 
BaseInteractablegetP ()
 Returns a pointer to first object involved in the interaction (normally a particle). More...
 
BaseInteractablegetI ()
 
const BaseInteractablegetP () const
 
const BaseInteractablegetI () 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...
 
Mdouble getDistance () const
 Returns an Mdouble which is the norm (length) of distance vector. More...
 
const Vec3DgetRelativeVelocity () 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 BaseInteractioncopy () 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 actionsAfterTimeStep ()
 
virtual unsigned getNumberOfFieldsVTK () const
 
virtual std::string getTypeVTK (unsigned i) const
 
virtual std::string getNameVTK (unsigned i) const
 
virtual std::vector< MdoublegetFieldVTK (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...
 

Private Attributes

Vec3D rollingSpring_
 Stores the amount of rolling spring compression. Set in integrate(), used in computing frictional force due to rolling. More...
 
Vec3D rollingSpringVelocity_
 Stores the rate at which the rolling spring compresses or relaxes. Set in computeFrictionForce(), used in computing the amount of compression in rolling spring. Used in integrate(). More...
 
Vec3D torsionSpring_
 Stores the amount of torsional spring compression. Set in integrate(), used in computing frictional force due to torsion. More...
 
Vec3D torsionSpringVelocity_
 Stores the rate at which the torsional spring compresses or relaxes. Set in computeFrictionForce(), used in computing the amount of compression in torsion spring. Used in integrate(). More...
 

Additional Inherited Members

- Protected Member Functions inherited from BaseInteraction
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 BaseSpeciesgetBaseSpecies () const
 Return a constant point to BaseSpecies of the interaction. More...
 
virtual Mdouble getElasticEnergyAtEquilibrium (Mdouble adhesiveForce) const
 

Detailed Description

This class allows one to take all three types of frictional interactions into account. The sliding, rolling and torsional frictional interaction. See.

Definition at line 41 of file FrictionInteraction.h.

Member Typedef Documentation

Constructor & Destructor Documentation

FrictionInteraction::FrictionInteraction ( BaseInteractable P,
BaseInteractable I,
Mdouble  timeStamp 
)

Constructor.

Parameters
[in]P
[in]I
[in]timeStamp

Definition at line 40 of file FrictionInteraction.cc.

References rollingSpring_, Vec3D::setZero(), and torsionSpring_.

41  : BaseInteraction(P, I, timeStamp), SlidingFrictionInteraction(P, I, timeStamp)
42 {
45 #ifdef DEBUG_CONSTRUCTOR
46  std::cout<<"FrictionInteraction::FrictionInteraction() finished"<<std::endl;
47 #endif
48 }
SlidingFrictionInteraction(BaseInteractable *P, BaseInteractable *I, Mdouble timeStamp)
Constructor.
void setZero()
Sets all elements to zero.
Definition: Vector.cc:52
BaseInteraction()
Empty constructor.
Vec3D torsionSpring_
Stores the amount of torsional spring compression. Set in integrate(), used in computing frictional f...
Vec3D rollingSpring_
Stores the amount of rolling spring compression. Set in integrate(), used in computing frictional for...
FrictionInteraction::FrictionInteraction ( const FrictionInteraction p)

Copy constructor.

Parameters
[in]p

Definition at line 52 of file FrictionInteraction.cc.

References rollingSpring_, and torsionSpring_.

54 {
57 #ifdef DEBUG_CONSTRUCTOR
58  std::cout<<"FrictionInteraction::FrictionInteraction(const FrictionInteraction& p) finished"<<std::endl;
59 #endif
60 }
SlidingFrictionInteraction(BaseInteractable *P, BaseInteractable *I, Mdouble timeStamp)
Constructor.
BaseInteraction()
Empty constructor.
Vec3D torsionSpring_
Stores the amount of torsional spring compression. Set in integrate(), used in computing frictional f...
Vec3D rollingSpring_
Stores the amount of rolling spring compression. Set in integrate(), used in computing frictional for...
FrictionInteraction::~FrictionInteraction ( )
virtual

Destructor.

Definition at line 64 of file FrictionInteraction.cc.

65 {
66 #ifdef DEBUG_DESTRUCTOR
67  std::cout<<"FrictionInteraction::~FrictionInteraction() finished"<<std::endl;
68 #endif
69 }

Member Function Documentation

void FrictionInteraction::computeFrictionForce ( )

Computes the forces arising due to all three types of friction, i.e., sliding, rolling and torsional.

Calls the slidingFrictionInteraction::computeFrictionForce() as well, see slidingFrictionInteraction.cc.

Todo:
TW: Why do we not use the corrected diameter here, as in the rolling case? And check if Stefan uses radius or diameter

Definition at line 92 of file FrictionInteraction.cc.

References BaseInteraction::addTorque(), SlidingFrictionInteraction::computeFrictionForce(), Vec3D::cross(), Vec3D::dot(), BaseInteraction::getAbsoluteNormalForce(), BaseInteraction::getDistance(), BaseHandler< T >::getDPMBase(), BaseInteraction::getEffectiveRadius(), BaseInteraction::getHandler(), BaseInteraction::getI(), Vec3D::getLengthSquared(), BaseInteraction::getNormal(), BaseInteraction::getP(), FrictionSpecies::getRollingDissipation(), FrictionSpecies::getRollingFrictionCoefficient(), FrictionSpecies::getRollingFrictionCoefficientStatic(), FrictionSpecies::getRollingStiffness(), getSpecies(), DPMBase::getTimeStep(), FrictionSpecies::getTorsionDissipation(), FrictionSpecies::getTorsionFrictionCoefficient(), FrictionSpecies::getTorsionFrictionCoefficientStatic(), FrictionSpecies::getTorsionStiffness(), BaseInteractable::getVelocity(), rollingSpring_, rollingSpringVelocity_, mathsFunc::square(), torsionSpring_, and torsionSpringVelocity_.

93 {
95 
96  const FrictionSpecies* species = getSpecies();
97  //If tangential forces are present
98  if (getAbsoluteNormalForce() == 0.0) return;
99 
100 
101  if (species->getRollingFrictionCoefficient() != 0.0)
102  {
103  if (species->getRollingStiffness() != 0.0)
104  {
105  Mdouble effectiveDiameter = 2.0*getEffectiveRadius();
106 
107  //From Luding2008, objective rolling velocity (eq 15) w/o 2.0!
108  Vec3D rollingRelativeVelocity = -effectiveDiameter *
109  Vec3D::cross(getNormal(), getP()->getAngularVelocity() - getI()->getAngularVelocity());
110 
111  if (dynamic_cast<BaseParticle*>(getI())==0) //if particle-wall
112  rollingSpringVelocity_= rollingRelativeVelocity;
113  else //if particle-particle
114  {
115  const Vec3D relativeVelocity = getP()->getVelocity() - getI()->getVelocity();
116  rollingSpringVelocity_ = rollingRelativeVelocity
117  - Vec3D::dot(rollingSpring_, relativeVelocity) / getDistance() * getNormal();
118  }
119 
120  //used to Integrate the spring
121  //rollingSpringVelocity_= rollingRelativeVelocity;
122  //integrate(getHandler()->timeStep_);
124 
125  //Calculate test force acting on P including viscous force
126  Vec3D rollingForce = - species->getRollingStiffness() * rollingSpring_ - species->getRollingDissipation() * rollingRelativeVelocity;
127 
128  //tangential forces are modelled by a spring-damper of elasticity kt and viscosity dispt (sticking),
129  //but the force is limited by Coulomb friction (rolling):
130  Mdouble rollingForceSquared = rollingForce.getLengthSquared();
131  if (rollingForceSquared <= mathsFunc::square(species->getRollingFrictionCoefficientStatic() * getAbsoluteNormalForce()))
132  {
133  //if sticking (|ft|<=mu*|fn|), apply the force
134  }
135  else
136  {
137  //if rolling, resize the tangential force such that |ft|=mu*|fn|
138  rollingForce *= species->getRollingFrictionCoefficient() * getAbsoluteNormalForce() / std::sqrt(rollingForceSquared);
139  //resize the tangential spring accordingly such ft=-k*delta-nu*relVel
140  rollingSpring_ = -(rollingForce + species->getRollingDissipation() * rollingRelativeVelocity) / species->getRollingStiffness();
141  }
142  //Add (virtual) rolling force to torque
143  addTorque(effectiveDiameter * Vec3D::cross(getNormal(), rollingForce));
144  }
145  else //if no spring stiffness is set
146  {
147  std::cerr << "FrictionInteraction::computeFrictionForce(): Rolling stiffness is zero" << std::endl;
148  exit(-1);
149  }
150  } //end if rolling force
151 
152  if (species->getTorsionFrictionCoefficient() != 0.0)
153  {
154  if (species->getTorsionStiffness() != 0.0)
155  {
157  Mdouble effectiveDiameter = 2.0*getEffectiveRadius();
158 
159  //From Luding2008, spin velocity (eq 16) w/o 2.0!
160  Vec3D torsionRelativeVelocity = effectiveDiameter * Vec3D::dot(getNormal(), getP()->getAngularVelocity() - getI()->getAngularVelocity()) * getNormal();
161 
162  //Integrate the spring
163  torsionSpringVelocity_= torsionRelativeVelocity;
164  //integrate(getHandler()->timeStep_);
165  torsionSpring_ += Vec3D::dot(torsionSpring_ + torsionSpringVelocity_ * getHandler()->getDPMBase()->getTimeStep(), getNormal()) * getNormal();
166 
167  //Calculate test force acting on P including viscous force
168  Vec3D torsionForce = - species->getTorsionStiffness() * torsionSpring_ - species->getTorsionDissipation() * torsionRelativeVelocity;
169 
170  //tangential forces are modelled by a spring-damper of elasticity kt and viscosity dispt (sticking),
171  //but the force is limited by Coulomb friction (torsion):
172  Mdouble torsionForceSquared = torsionForce.getLengthSquared();
173  if (torsionForceSquared <= mathsFunc::square(species->getTorsionFrictionCoefficientStatic() * getAbsoluteNormalForce()))
174  {
175  //if sticking (|ft|<=mu*|fn|), apply the force
176  }
177  else
178  {
179  //if torsion, resize the tangential force such that |ft|=mu*|fn|
180  torsionForce *= species->getTorsionFrictionCoefficient() * getAbsoluteNormalForce() / std::sqrt(torsionForceSquared);
181  //resize the tangential spring accordingly such ft=-k*delta-nu*relVel
182  torsionSpring_ = -(torsionForce + species->getTorsionDissipation() * torsionRelativeVelocity) / species->getTorsionStiffness();
183  }
184  //Add (virtual) rolling force to torque
185  addTorque(effectiveDiameter * torsionForce);
186  }
187  else //if no spring stiffness is set
188  {
189  std::cerr << "FrictionInteraction::computeFrictionForce(): Torsion stiffness is zero" << std::endl;
190  exit(-1);
191  }
192  } //end if torsion force
193 }
static Mdouble getLengthSquared(const Vec3D &a)
Calculates the squared length of a Vec3D: .
Definition: Vector.cc:291
Mdouble getRollingFrictionCoefficient() const
Allows the (dynamic) Coulomb friction coefficient to be accessed.
const FrictionSpecies * getSpecies() const
Returns a const pointer of type FrictionSpecies*.
Mdouble getEffectiveRadius() const
Returns a Mdouble to the effective radius of the interaction. (Not corrected for the overlap) ...
InteractionHandler * getHandler() const
Gets a point to the interaction handlers to which this interaction belongs.
Mdouble getTorsionFrictionCoefficient() const
Allows the (dynamic) Coulomb torsion friction coefficient to be accessed.
FrictionSpecies contains the parameters used to describe sliding, rolling and torsional friction...
double Mdouble
void addTorque(Vec3D torque)
Mdouble getTorsionStiffness() const
Allows the torsion stiffness to be accessed.
static Mdouble dot(const Vec3D &a, const Vec3D &b)
Calculates the dot product of two Vec3D: .
Definition: Vector.cc:167
Mdouble getRollingDissipation() const
Allows the tangential viscosity to be accessed.
Mdouble getRollingFrictionCoefficientStatic() const
Allows the static Coulomb rolling friction coefficient to be accessed.
T square(T val)
squares a number
Definition: ExtendedMath.h:91
Mdouble getRollingStiffness() const
Allows the spring constant to be accessed.
void computeFrictionForce()
Computes the tangential force generated due to compression in the sliding spring. Does take into acco...
const Vec3D & getNormal() const
Gets the normal vector between the two interacting objects.
static Vec3D cross(const Vec3D &a, const Vec3D &b)
Calculates the cross product of two Vec3D: .
Definition: Vector.cc:255
BaseInteractable * getI()
Mdouble getDistance() const
Returns an Mdouble which is the norm (length) of distance vector.
Vec3D rollingSpringVelocity_
Stores the rate at which the rolling spring compresses or relaxes. Set in computeFrictionForce(), used in computing the amount of compression in rolling spring. Used in integrate().
BaseInteractable * getP()
Returns a pointer to first object involved in the interaction (normally a particle).
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Mdouble getTorsionDissipation() const
Allows the torsion viscosity to be accessed.
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
DPMBase * getDPMBase()
Gets the problem that is solved using this handler.
Definition: BaseHandler.h:543
Mdouble getTimeStep() const
Allows the time step dt to be accessed.
Definition: DPMBase.cc:465
Vec3D torsionSpring_
Stores the amount of torsional spring compression. Set in integrate(), used in computing frictional f...
Vec3D torsionSpringVelocity_
Stores the rate at which the torsional spring compresses or relaxes. Set in computeFrictionForce(), used in computing the amount of compression in torsion spring. Used in integrate().
Mdouble getTorsionFrictionCoefficientStatic() const
Allows the static Coulomb torsion friction coefficient to be accessed.
Vec3D rollingSpring_
Stores the amount of rolling spring compression. Set in integrate(), used in computing frictional for...
Mdouble getAbsoluteNormalForce() const
Returns the absolute value of the norm (length) of the Normal force vector.
std::string FrictionInteraction::getBaseName ( ) const

Returns interaction name/type.

Returns
std::string

Definition at line 222 of file FrictionInteraction.cc.

223 {
224  return "Friction";
225 }
Mdouble FrictionInteraction::getElasticEnergy ( ) const
virtual

Returns the global amount of energy stored in all the springs (rolling, sliding and torsional).

Returns
Mdouble

Reimplemented from BaseInteraction.

Definition at line 206 of file FrictionInteraction.cc.

References SlidingFrictionInteraction::getElasticEnergy(), Vec3D::getLengthSquared(), FrictionSpecies::getRollingStiffness(), getSpecies(), FrictionSpecies::getTorsionStiffness(), rollingSpring_, and torsionSpring_.

207 {
211 }
static Mdouble getLengthSquared(const Vec3D &a)
Calculates the squared length of a Vec3D: .
Definition: Vector.cc:291
const FrictionSpecies * getSpecies() const
Returns a const pointer of type FrictionSpecies*.
Mdouble getTorsionStiffness() const
Allows the torsion stiffness to be accessed.
Mdouble getRollingStiffness() const
Allows the spring constant to be accessed.
Mdouble getElasticEnergy() const
Returns the amount of elastic energy stored in sliding spring.
Vec3D torsionSpring_
Stores the amount of torsional spring compression. Set in integrate(), used in computing frictional f...
Vec3D rollingSpring_
Stores the amount of rolling spring compression. Set in integrate(), used in computing frictional for...
Vec3D FrictionInteraction::getRollingSpring ( ) const

Definition at line 250 of file FrictionInteraction.cc.

References rollingSpring_.

251 {
252  return rollingSpring_;
253 }
Vec3D rollingSpring_
Stores the amount of rolling spring compression. Set in integrate(), used in computing frictional for...
const FrictionSpecies * FrictionInteraction::getSpecies ( ) const

Returns a const pointer of type FrictionSpecies*.

Returns
const FrictionSpecies*

Definition at line 215 of file FrictionInteraction.cc.

References BaseInteraction::getBaseSpecies().

Referenced by computeFrictionForce(), and getElasticEnergy().

216 {
217  return dynamic_cast<const FrictionSpecies*>(getBaseSpecies());
218 }
FrictionSpecies contains the parameters used to describe sliding, rolling and torsional friction...
const BaseSpecies * getBaseSpecies() const
Return a constant point to BaseSpecies of the interaction.
void FrictionInteraction::integrate ( Mdouble timeStep  )
virtual

Computes the amount of compression in all the springs, i.e., increments the rollingSpring_, slidingSpring_ (see SlidingFrictionInteraction.cc) and torsionSpring_.

Parameters
[in]timeStep

Reimplemented from BaseInteraction.

Definition at line 197 of file FrictionInteraction.cc.

References Vec3D::dot(), BaseInteraction::getNormal(), SlidingFrictionInteraction::integrate(), rollingSpring_, rollingSpringVelocity_, torsionSpring_, and torsionSpringVelocity_.

198 {
202 }
static Mdouble dot(const Vec3D &a, const Vec3D &b)
Calculates the dot product of two Vec3D: .
Definition: Vector.cc:167
const Vec3D & getNormal() const
Gets the normal vector between the two interacting objects.
void integrate(Mdouble timeStep)
Increments the amount of compression in sliding spring.
Vec3D rollingSpringVelocity_
Stores the rate at which the rolling spring compresses or relaxes. Set in computeFrictionForce(), used in computing the amount of compression in rolling spring. Used in integrate().
Vec3D torsionSpring_
Stores the amount of torsional spring compression. Set in integrate(), used in computing frictional f...
Vec3D torsionSpringVelocity_
Stores the rate at which the torsional spring compresses or relaxes. Set in computeFrictionForce(), used in computing the amount of compression in torsion spring. Used in integrate().
Vec3D rollingSpring_
Stores the amount of rolling spring compression. Set in integrate(), used in computing frictional for...
void FrictionInteraction::read ( std::istream &  is)
virtual

Interaction read function, which accepts an std::istream as input.

Parameters
in/out]is

Reimplemented from BaseInteraction.

Definition at line 82 of file FrictionInteraction.cc.

References SlidingFrictionInteraction::read(), rollingSpring_, and torsionSpring_.

83 {
85  std::string dummy;
86  is >> dummy >> rollingSpring_;
87  is >> dummy >> torsionSpring_;
88 }
void read(std::istream &is)
Interaction read function, which accepts an std::istream as input.
Vec3D torsionSpring_
Stores the amount of torsional spring compression. Set in integrate(), used in computing frictional f...
Vec3D rollingSpring_
Stores the amount of rolling spring compression. Set in integrate(), used in computing frictional for...
void FrictionInteraction::reverseHistory ( )
virtual

A useful feature if one wants to return to the initial state of the springs. However, reverse history decrements the current state to the state corresponding to previous time step. Decrements the state or value of rollingSpring_, torsionSpring_ and slidingSpring_.

Reimplemented from BaseInteraction.

Definition at line 229 of file FrictionInteraction.cc.

References SlidingFrictionInteraction::reverseHistory(), torsionSpring_, and torsionSpringVelocity_.

230 {
232  //rollingSpring_=-rollingSpring_;
233  //rollingSpringVelocity_=-rollingSpringVelocity_;
236 }
void reverseHistory()
A useful feature if one wants to return to the initial state of the spring. However, reverse history decrements the current state to the state corresponding to previous time step. Decrements the value of slidingSpring_.
Vec3D torsionSpring_
Stores the amount of torsional spring compression. Set in integrate(), used in computing frictional f...
Vec3D torsionSpringVelocity_
Stores the rate at which the torsional spring compresses or relaxes. Set in computeFrictionForce(), used in computing the amount of compression in torsion spring. Used in integrate().
void FrictionInteraction::rotateHistory ( Matrix3D rotationMatrix)
virtual

When periodic particles are used, some interactions need certain history properties rotated (e.g. tangential springs). This is the function for that.

Todo:
some of these might be unneccesary

Reimplemented from BaseInteraction.

Definition at line 241 of file FrictionInteraction.cc.

References rollingSpring_, rollingSpringVelocity_, SlidingFrictionInteraction::rotateHistory(), torsionSpring_, and torsionSpringVelocity_.

242 {
244  rollingSpring_=rotationMatrix*rollingSpring_;
246  torsionSpring_=rotationMatrix*torsionSpring_;
248 }
void rotateHistory(Matrix3D &rotationMatrix)
When periodic particles are used, some interactions need certain history properties rotated (e...
Vec3D rollingSpringVelocity_
Stores the rate at which the rolling spring compresses or relaxes. Set in computeFrictionForce(), used in computing the amount of compression in rolling spring. Used in integrate().
Vec3D torsionSpring_
Stores the amount of torsional spring compression. Set in integrate(), used in computing frictional f...
Vec3D torsionSpringVelocity_
Stores the rate at which the torsional spring compresses or relaxes. Set in computeFrictionForce(), used in computing the amount of compression in torsion spring. Used in integrate().
Vec3D rollingSpring_
Stores the amount of rolling spring compression. Set in integrate(), used in computing frictional for...
void FrictionInteraction::write ( std::ostream &  os) const
virtual

Interaction print function, which accepts an std::ostream as input.

Parameters
in/out]os

Reimplemented from BaseInteraction.

Definition at line 73 of file FrictionInteraction.cc.

References rollingSpring_, torsionSpring_, and SlidingFrictionInteraction::write().

74 {
76  os << " rollingSpring " << rollingSpring_;
77  os << " torsionSpring " << torsionSpring_;
78 }
void write(std::ostream &os) const
Interaction write function, which accepts an std::ostream as input.
Vec3D torsionSpring_
Stores the amount of torsional spring compression. Set in integrate(), used in computing frictional f...
Vec3D rollingSpring_
Stores the amount of rolling spring compression. Set in integrate(), used in computing frictional for...

Member Data Documentation

Vec3D FrictionInteraction::rollingSpring_
private

Stores the amount of rolling spring compression. Set in integrate(), used in computing frictional force due to rolling.

Definition at line 106 of file FrictionInteraction.h.

Referenced by computeFrictionForce(), FrictionInteraction(), getElasticEnergy(), getRollingSpring(), integrate(), read(), rotateHistory(), and write().

Vec3D FrictionInteraction::rollingSpringVelocity_
private

Stores the rate at which the rolling spring compresses or relaxes. Set in computeFrictionForce(), used in computing the amount of compression in rolling spring. Used in integrate().

Definition at line 111 of file FrictionInteraction.h.

Referenced by computeFrictionForce(), integrate(), and rotateHistory().

Vec3D FrictionInteraction::torsionSpring_
private

Stores the amount of torsional spring compression. Set in integrate(), used in computing frictional force due to torsion.

Definition at line 116 of file FrictionInteraction.h.

Referenced by computeFrictionForce(), FrictionInteraction(), getElasticEnergy(), integrate(), read(), reverseHistory(), rotateHistory(), and write().

Vec3D FrictionInteraction::torsionSpringVelocity_
private

Stores the rate at which the torsional spring compresses or relaxes. Set in computeFrictionForce(), used in computing the amount of compression in torsion spring. Used in integrate().

Definition at line 121 of file FrictionInteraction.h.

Referenced by computeFrictionForce(), integrate(), reverseHistory(), and rotateHistory().


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