MercuryDPM  Alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MindlinInteraction.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2017, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 #ifndef MINDLININTERACTION_H
27 #define MINDLININTERACTION_H
28 
30 #include "Math/Vector.h"
31 
32 class BaseParticle;
33 class MindlinSpecies;
34 class BaseInteractable;
39 class MindlinInteraction : public virtual BaseInteraction
40 {
41 public:
49  MindlinInteraction(BaseInteractable* P, BaseInteractable* I, unsigned timeStamp);
61  virtual ~MindlinInteraction();
66  void computeFrictionForce();
70  void read(std::istream& is) override;
74  void write(std::ostream& os) const override;
78  void integrate(Mdouble timeStep) override;
82  Mdouble getElasticEnergy() const override;
86  Mdouble getTangentialOverlap() const override;
90  std::string getBaseName() const;
91 
92  //setters and getters
96  const Vec3D getTangentialForce() const override;
97  //k_edit
98  //Returns a scalar value letting us know the direction of the tangential force
99  //(i.e. positive or negative) so that accurate values can be output to the fstat file
100  const Mdouble getTangentialForceDirection() const;
101 
102  //k_edit
107 
108  //k_edit
112  void setAbsoluteNormalForcePrevious(Mdouble absoluteNormalForcePrevious);
113 
117  const MindlinSpecies* getSpecies() const;
123  void reverseHistory() override;
124 
125  void rotateHistory(Matrix3D& rotationMatrix) override;
126 
127  //k_edit
128  //Allows the K_t0 parameter (for Mindlin model) to be set
129  void setTangentialStiffnessZero(Mdouble newKt0);
130 
131  //k_edit
132  //Allows the K_t0 parameter (for Mindlin model) to be accessed
134 
135  //k_edit
136  //...and a similar function for the "normal" K_t
138 
139  //k_edit
140  //A quick way to update the K_t0 parameter when necessary...
141  void updateTangentialStiffnessZero(Mdouble rad, double shearMod);
142  //k_edit
143  //...and a second, similar method by which to update K_t0 for loading curves in which
144  //multiple steps are required to increment the tangential force
145  //void updateTangentialStiffnessZeroSecondStep(Mdouble rad, double shearMod);
146 
147  //k_edit
148  //A way to easily update K_t for all possible cases,
149  //i.e. initial loading (under constant normal force)...
151  void updateTangentialStiffnessInitial2(const Mdouble fric, const Vec3D direction);
152  //...unloading (under constant normal force)...
153  void updateTangentialStiffnessUnloading(const Mdouble fric, const Vec3D direction);
154  //...reloading (under constant normal force)...
155  void updateTangentialStiffnessReloading(const Mdouble fric, const Vec3D direction);
156  //...reloading (i.e. tangential force increasing) and normal force varying (moving from state 1 to 2)...
157  void updateTangentialStiffnessReloadingTanUp(const Mdouble fric, const Vec3D direction);
158  //...and with increasing normal force and decreasing tangential...
159  void updateTangentialStiffnessUnloadingTanDown(const Mdouble fric, const Vec3D direction) ;
160 
161 
162  //k_new
163  void updateK_t(const Mdouble fric, const Vec3D direction,const bool useTurningPoint, const bool isLoading);
164 
165 protected:
171  //k_edit
172  //Introducing a parameter to store the value of "slidingSpring_" (i.e. delta_t) for a previous timestep
183  //k_edit
184  //adding a parameter to store the tangential force from a previous timestep
186  //a parameter to give the (scalar) DIRECTION of the force, i.e. "with" or "against" the tangential motion!
188  //k_edit
189  //A pair of parameters to store the force at turning point, for use in calculating unloading/reloading
190  //curves using the Mindlin model (see Di Renzo and Di Maio 2004)
191  //"UL" and "LU" are used to distinguish between turning points between unloading and loading and
192  //those between loading and unloading
195  //A pair of variables to temporarily store updated versions of these values for use in multi-step
196  //Mindlin calculations
199  //a pair of vectors to store the current tangential displacements at each turning point
202 
203 
204  //k_edit
205  // the constant K_t0 used to calculate the tangential stiffness (K_t) for the
206  //Mindlin model (see, for example, Di Renzo and Di Maio, 2004)
208  //...and a variable to save its value from the previous timestep
210  // the constant K_t as used in Di Maio and Di Renzo
212  //k_edit
213  //a simple flag to let functions know whether loading has been performed before or not
214  //(0 if no prior loading, 1 if prior loading)
216 
217  //k_edit
218  //a pair of variables to temporarily store the intermediate values of f_t and delta_t
219  //during the multiple-point force calculations necessary when both normal and tangential
220  //forces are varying
223 
224  //k_edit
225  //A second set of temporary vectors for when >2 steps are required.
226  //although not technically necessary, helps the clarity of the code GREATLY!
229 
230  //k_edit
231  //the minimal tangential displacement for which the simple loading assumption can be expected to hold
232  //in Herz-Mindlin theory
234 
235  //records the initial tangential velocity such that all subsequent motion can be directly compared to this!
237 
238  //k_edit
239  //parameter allowing previous values of the normal force to be stored and used in calculations
241 
242 };
243 #endif
void updateTangentialStiffnessZero(Mdouble rad, double shearMod)
std::string getBaseName() const
Returns the type/name of interaction (sliding friction interaction)
void updateTangentialStiffnessUnloading(const Mdouble fric, const Vec3D direction)
Mdouble getTangentialOverlap() const override
Returns the amount of tangential overlap which is needed by BaseInteraction::writeToFstat().
Vec3D slidingSpringVelocity_
Stores the rate at which the sliding spring compressed or relaxed. Set in the member function compute...
void updateK_t(const Mdouble fric, const Vec3D direction, const bool useTurningPoint, const bool isLoading)
Vec3D tangentialForceTurningPointULTemp_
Vec3D tangentialDisplacementTurningPointLU_
Mdouble absoluteNormalForcePrevious_
double Mdouble
Computes the forces corresponding to sliding friction.
void updateTangentialStiffnessReloading(const Mdouble fric, const Vec3D direction)
Vec3D slidingSpring_
Stores the amount of sliding spring ( ) compression from the expression . Set in the member function ...
MindlinSpecies contains the parameters used to describe sliding friction.
void integrate(Mdouble timeStep) override
Increments the amount of compression in sliding spring.
void updateTangentialStiffnessReloadingTanUp(const Mdouble fric, const Vec3D direction)
Stores information about interactions between two interactable objects; often particles but could be ...
const Mdouble getTangentialForceDirection() const
void reverseHistory() override
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_.
void updateTangentialStiffnessUnloadingTanDown(const Mdouble fric, const Vec3D direction)
void rotateHistory(Matrix3D &rotationMatrix) override
When periodic particles are used, some interactions need certain history properties rotated (e...
void computeFrictionForce()
Computes the tangential force generated due to compression in the sliding spring. Does take into acco...
Mdouble getElasticEnergy() const override
Returns the amount of elastic energy stored in sliding spring.
const Vec3D getTangentialForce() const override
Returns the sliding friction force vector.
Vec3D tangentialForce_
Computes the tangential force such that . Set and computed in computeFrictionForce().
void setTangentialStiffnessZero(Mdouble newKt0)
Mdouble getAbsoluteNormalForcePrevious() const
Returns the absolute value of the norm (length) of the previous Normal force vector.
void updateTangentialStiffnessInitial(Mdouble fric)
const MindlinSpecies * getSpecies() const
Returns a const pointer of type MindlinSpecies*.
Defines the basic properties that a interactable object can have.
Mdouble getTangentialStiffnessZero()
Mdouble tangentialStiffnessZeroPrevious_
virtual ~MindlinInteraction()
Destructor.
Implementation of a 3D matrix.
Definition: Matrix.h:36
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
Vec3D tangentialDisplacementTurningPointUL_
MindlinInteraction()
Empty constructor.
Vec3D tangentialForceTurningPointLUTemp_
void setAbsoluteNormalForcePrevious(Mdouble absoluteNormalForcePrevious)
allows the previous normal force to be (re)set from external classes
void updateTangentialStiffnessInitial2(const Mdouble fric, const Vec3D direction)
MindlinSpecies SpeciesType
An alias name for MindlinSpecies data type.
void write(std::ostream &os) const override
Interaction write function, which accepts an std::ostream as input.
void read(std::istream &is) override
Interaction read function, which accepts an std::istream as input.