ESyS-Particle  4.0.1
LinearDashpotInteraction.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 __LINEARDASHPOTINTERACTION_H
14 #define __LINEARDASHPOTINTERACTION_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_damp;
28  double m_cutoff;
29 
31  CLinearDashpotIGP(const std::string&,double,double);
32 
33  virtual std::string getTypeString() const {return "LinearDashpot";}
34 };
35 
44 {
45 public:
46 
47  typedef double (CLinearDashpotInteraction::* ScalarFieldFunction)() const;
48  typedef Vec3 (CLinearDashpotInteraction::* VectorFieldFunction)() const;
49  typedef pair<bool,double> (CLinearDashpotInteraction::* CheckedScalarFieldFunction)() const;
50 
51  static ScalarFieldFunction getScalarFieldFunction(const string&);
52  static VectorFieldFunction getVectorFieldFunction(const string&);
53  static CheckedScalarFieldFunction getCheckedScalarFieldFunction(const string&);
54 
55 private:
56  double m_damp;
57  double m_cutoff;
58  double m_cross_section;
59  Vec3 m_force; // caching force for E_pot
60  Vec3 m_cpos; // center position
61 
62 public:
64 
66  virtual ~CLinearDashpotInteraction(){};
67 
68  virtual Vec3 getPos() const {return m_cpos;};
69  double getPotentialEnergy() const;
70 
71  virtual void calcForces();
72  Vec3 getForce() const;
73 };
74 #endif //__HERTZIANELASTICINTERACTION_H