ESyS-Particle  4.0.1
RotLocalDamping.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 MODEL_ROTLOCALDAMPING_H
14 #define MODEL_ROTLOCALDAMPING_H
15 
16 // -- project includes --
17 #include "Model/LocalDampingIGP.h"
18 #include "Foundation/vec3.h"
19 #include "Foundation/quintuple.h"
20 
21 class CVarMPIBuffer;
22 class AMPIBuffer;
23 
28 template <class T>
30 {
31 protected:
32  T *m_p;
33  double m_visc;
34  double m_dt;
35  double m_E_diss;
37 
38 public:
40 
41  typedef double (CRotLocalDamping::* ScalarFieldFunction)() const;
42  typedef pair<bool,double> (CRotLocalDamping::* CheckedScalarFieldFunction)() const;
43  typedef Vec3 (CRotLocalDamping::* VectorFieldFunction)() const;
44 
45  static ScalarFieldFunction getScalarFieldFunction(const string&);
46  static CheckedScalarFieldFunction getCheckedScalarFieldFunction(const string&);
47  static VectorFieldFunction getVectorFieldFunction(const string&);
48 
49  CRotLocalDamping(T*,double,double); // to be obsoleted
52  virtual ~CRotLocalDamping();
53 
54  void setTimeStepSize(double dt);
55  virtual void calcForces();
56 
57  virtual bool hasTag(int,int) const;
58  virtual Vec3 getPosFirst() const {return m_p->getPos();};
59  virtual Vec3 getPosSecond() const {return Vec3(0.0,0.0,0.0);};
60  virtual Vec3 getPos() const {return m_p->getPos();};
61  vector<int> getAllID() const;
62 
64  {
65  return
67  m_p->getPos(),
68  m_p->getRad(),
69  Vec3::ZERO,
70  0,
71  getPos()
72  );
73  }
74 
75  double getDissipatedEnergy() const;
76  Vec3 getForce() const;
77 };
78 
79 #include "Model/RotLocalDamping.hpp"
80 
81 #endif //__ROTLOCALDAMPING_H