ESyS-Particle  2.2
RotFricInteraction.h
Go to the documentation of this file.
1 
2 // //
3 // Copyright (c) 2003-2013 by The University of Queensland //
4 // Earth Systems Science Computational Centre (ESSCC) //
5 // http://www.uq.edu.au/esscc //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 #ifndef __ROTFRICTIONINTERACTION_H
14 #define __ROTFRICTIONINTERACTION_H
15 
16 // -- project includes --
18 #include "Model/RotParticle.h"
19 #include "Model/IGParam.h"
20 #include "Foundation/vec3.h"
21 
22 // -- I/O includes --
23 #include <iostream>
24 using std::ostream;
25 
26 
27 //double calc_angle( double , double ) ;
28 
29 
37 class CRotFrictionIGP : public AIGParam
38 {
39 public:
41 
43  const std::string &name,
44  double k,
45  double mu_d,
46  double mu_s,
47  double k_s,
48  double dt,
49  bool scaling,
50  bool rigid,
51  bool meanR_scaling
52  );
53 
55  const std::string &name,
56  double youngsModulus,
57  double poissonsRatio,
58  double mu_d,
59  double mu_s,
60  double dt,
61  bool rigid,
62  bool meanR_scaling
63  );
64 
65  virtual std::string getTypeString() const
66  {
67  return "RotFriction";
68  }
69 
70  void setTimeStepSize(double dt);
71 
72  double k;
73  double mu_d; // sliding frictional coefficient
74  double mu_s; // max static frictional coefficient
75  double k_s;
76  double dt;
77  bool scaling;
78  bool rigid;
80 };
81 
90 {
91  public: // types
93 
94  typedef double (CRotFrictionInteraction::* ScalarFieldFunction)() const;
95  typedef pair<bool,double> (CRotFrictionInteraction::* CheckedScalarFieldFunction)() const;
97 
99  static ScalarFieldFunction getScalarFieldFunction(const string&);
100  static VectorFieldFunction getVectorFieldFunction(const string&);
101 
102 // protected:
103  private:
104 
105  double m_k;
106  double m_r0;
107  double m_mu_d;
108  double m_mu_s;
109  double m_ks;
110  double m_dt;
117  double m_E_diss;
118  bool m_scaling;
119  bool m_rigid;
121 
122  //Quaternion m_init_q1, m_init_q2;
123  //Vec3 m_init_pos1 , m_init_pos2;
124 
125  public:
128  virtual ~CRotFrictionInteraction();
129 
130  static string getType() {return "RotFriction";};
131 
132  virtual void calcForces();
133  virtual void calcSimpleForces();
134  virtual void calcRigidBodyForces();
135  virtual bool isPersistent();
136 
137  void setTimeStepSize(double dt);
138 
139  void calcNormalForce();
140  double getAbsForceDeficit()const;
141  double getPotentialEnergy()const;
142  double getSlipping()const;
143  double getSticking()const;
144  double getDissipatedEnergy() const;
145  double getAbsSlip() const;
146  virtual double Count() const;
147  virtual Vec3 getPos() const {return m_cpos;};
148  Vec3 getForce() const;
149  Vec3 getNormalForce() const;
150  Vec3 getTangentialForce() const;
151 
152  friend ostream& operator<<(ostream&,const CRotFrictionInteraction&);
154 
155  // checkpointing
156  virtual void saveRestartData(std::ostream &oStream);
157  virtual void loadRestartData(std::istream &iStream);
158 };
159 
160 #endif //__ROTFRICTIONINTERACTION_H