ESyS-Particle  4.0.1
HertzianViscoElasticInteraction.h
1 
2 // //
3 // Copyright (c) 2003-2011 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 __HERTZIANVISCOELASTICINTERACTION_H
14 #define __HERTZIANVISCOELASTICINTERACTION_H
15 
16 #include "Model/IGParam.h"
17 #include "Model/Interaction.h"
18 #include "Model/Particle.h"
19 
20 
25 {
26 public:
27  double m_A;
28  double m_E;
29  double m_nu; // poisson ratio
30 
32  CHertzianViscoElasticIGP(const std::string&,double,double,double);
33 
34  virtual std::string getTypeString() const {return "HertzianViscoElastic";}
35 };
36 
45 {
46 public:
47 
48  typedef
49  double (CHertzianViscoElasticInteraction::* ScalarFieldFunction)() const;
50  typedef
51  Vec3 (CHertzianViscoElasticInteraction::* VectorFieldFunction)() const;
52  typedef
53  pair<bool,double>
54  (CHertzianViscoElasticInteraction::* CheckedScalarFieldFunction)() const;
55 
56  static ScalarFieldFunction getScalarFieldFunction(const string&);
57  static VectorFieldFunction getVectorFieldFunction(const string&);
58  static CheckedScalarFieldFunction getCheckedScalarFieldFunction(
59  const string&
60  );
61 
62 private:
63  double m_A;
64  double m_E;
65  double m_nu;
66  Vec3 m_force; // caching force for E_pot
67  double m_dn; // caching displacement for E_pot
68  Vec3 m_cpos; // center position
69 
70 public:
72 
74  CParticle*,
75  CParticle*,
77  );
79 
80  virtual Vec3 getPos() const {return m_cpos;};
81  double getPotentialEnergy() const;
82 
83  virtual void calcForces();
84  Vec3 getForce() const;
85 };
86 #endif //__HERTZIANVISCOELASTICINTERACTION_H