MercuryDPM  Beta
 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...
 
- 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...
 
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...
 
- 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...
 
virtual ~BaseInteraction ()
 The default destructor. 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...
 
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...
 
- 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 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 BaseSpeciesgetBaseSpecies () const
 Return a constant point to BaseSpecies of the interaction. More...
 

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(BaseInteractable *P, BaseInteractable *I, Mdouble timeStamp)
A constructor takes the BaseInteractable objects which are interacting (come into contact) and time t...
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(BaseInteractable *P, BaseInteractable *I, Mdouble timeStamp)
A constructor takes the BaseInteractable objects which are interacting (come into contact) and time t...
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(), BaseHandler< T >::getDPMBase(), BaseInteraction::getEffectiveCorrectedRadius(), 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(), 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*getEffectiveCorrectedRadius();
106 
107  //From Luding2008, objective rolling velocity (eq 15) w/o 2.0!
108  Vec3D rollingRelativeVelocity = -effectiveDiameter * Vec3D::cross(getNormal(), getP()->getAngularVelocity() - getI()->getAngularVelocity());
109 
110  //used to Integrate the spring
111  rollingSpringVelocity_= rollingRelativeVelocity;
112  //integrate(getHandler()->timeStep_);
114 
115  //Calculate test force acting on P including viscous force
116  Vec3D rollingForce = - species->getRollingStiffness() * rollingSpring_ - species->getRollingDissipation() * rollingRelativeVelocity;
117 
118  //tangential forces are modelled by a spring-damper of elasticity kt and viscosity dispt (sticking),
119  //but the force is limited by Coulomb friction (rolling):
120  Mdouble rollingForceSquared = rollingForce.getLengthSquared();
121  if (rollingForceSquared <= mathsFunc::square(species->getRollingFrictionCoefficientStatic() * getAbsoluteNormalForce()))
122  {
123  //if sticking (|ft|<=mu*|fn|), apply the force
124  }
125  else
126  {
127  //if rolling, resize the tangential force such that |ft|=mu*|fn|
128  rollingForce *= species->getRollingFrictionCoefficient() * getAbsoluteNormalForce() / std::sqrt(rollingForceSquared);
129  //resize the tangential spring accordingly such ft=-k*delta-nu*relVel
130  rollingSpring_ = -(rollingForce + species->getRollingDissipation() * rollingRelativeVelocity) / species->getRollingStiffness();
131  }
132  //Add (virtual) rolling force to torque
133  addTorque(effectiveDiameter * Vec3D::cross(getNormal(), rollingForce));
134  }
135  else //if no spring stiffness is set
136  {
137  std::cerr << "FrictionInteraction::computeFrictionForce(): Rolling stiffness is zero" << std::endl;
138  exit(-1);
139  }
140  } //end if rolling force
141 
142  if (species->getTorsionFrictionCoefficient() != 0.0)
143  {
144  if (species->getTorsionStiffness() != 0.0)
145  {
147  Mdouble effectiveDiameter = 2.0*getEffectiveRadius();
148 
149  //From Luding2008, spin velocity (eq 16) w/o 2.0!
150  Vec3D torsionRelativeVelocity = effectiveDiameter * Vec3D::dot(getNormal(), getP()->getAngularVelocity() - getI()->getAngularVelocity()) * getNormal();
151 
152  //Integrate the spring
153  torsionSpringVelocity_= torsionRelativeVelocity;
154  //integrate(getHandler()->timeStep_);
155  torsionSpring_ += Vec3D::dot(torsionSpring_ + torsionSpringVelocity_ * getHandler()->getDPMBase()->getTimeStep(), getNormal()) * getNormal();
156 
157  //Calculate test force acting on P including viscous force
158  Vec3D torsionForce = - species->getTorsionStiffness() * torsionSpring_ - species->getTorsionDissipation() * torsionRelativeVelocity;
159 
160  //tangential forces are modelled by a spring-damper of elasticity kt and viscosity dispt (sticking),
161  //but the force is limited by Coulomb friction (torsion):
162  Mdouble torsionForceSquared = torsionForce.getLengthSquared();
163  if (torsionForceSquared <= mathsFunc::square(species->getTorsionFrictionCoefficientStatic() * getAbsoluteNormalForce()))
164  {
165  //if sticking (|ft|<=mu*|fn|), apply the force
166  }
167  else
168  {
169  //if torsion, resize the tangential force such that |ft|=mu*|fn|
170  torsionForce *= species->getTorsionFrictionCoefficient() * getAbsoluteNormalForce() / std::sqrt(torsionForceSquared);
171  //resize the tangential spring accordingly such ft=-k*delta-nu*relVel
172  torsionSpring_ = -(torsionForce + species->getTorsionDissipation() * torsionRelativeVelocity) / species->getTorsionStiffness();
173  }
174  //Add (virtual) rolling force to torque
175  addTorque(effectiveDiameter * torsionForce);
176  }
177  else //if no spring stiffness is set
178  {
179  std::cerr << "FrictionInteraction::computeFrictionForce(): Torsion stiffness is zero" << std::endl;
180  exit(-1);
181  }
182  } //end if torsion force
183 }
static Mdouble getLengthSquared(const Vec3D &a)
Calculates the squared length of a Vec3D: .
Definition: Vector.cc:304
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:187
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:268
BaseInteractable * getI()
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).
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:512
Mdouble getTimeStep() const
Allows the time step dt to be accessed.
Definition: DPMBase.cc:368
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.
Mdouble getEffectiveCorrectedRadius()
Returns a Mdouble to the effective radius corrected for the overlaps of the particles.
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 212 of file FrictionInteraction.cc.

213 {
214  return "Friction";
215 }
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 196 of file FrictionInteraction.cc.

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

197 {
201 }
static Mdouble getLengthSquared(const Vec3D &a)
Calculates the squared length of a Vec3D: .
Definition: Vector.cc:304
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...
const FrictionSpecies * FrictionInteraction::getSpecies ( ) const

Returns a const pointer of type FrictionSpecies*.

Returns
const FrictionSpecies*

Definition at line 205 of file FrictionInteraction.cc.

References BaseInteraction::getBaseSpecies().

Referenced by computeFrictionForce(), and getElasticEnergy().

206 {
207  return dynamic_cast<const FrictionSpecies*>(getBaseSpecies());
208 }
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 187 of file FrictionInteraction.cc.

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

188 {
192 }
static Mdouble dot(const Vec3D &a, const Vec3D &b)
Calculates the dot product of two Vec3D: .
Definition: Vector.cc:187
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 219 of file FrictionInteraction.cc.

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

220 {
222  //rollingSpring_=-rollingSpring_;
223  //rollingSpringVelocity_=-rollingSpringVelocity_;
226 }
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 231 of file FrictionInteraction.cc.

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

232 {
234  rollingSpring_=rotationMatrix*rollingSpring_;
236  torsionSpring_=rotationMatrix*torsionSpring_;
238 }
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 104 of file FrictionInteraction.h.

Referenced by computeFrictionForce(), FrictionInteraction(), getElasticEnergy(), 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 109 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 114 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 119 of file FrictionInteraction.h.

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


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