ESyS-Particle  4.0.1
RotPairInteraction.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 __ROTPAIRINTERCTION_H
14 #define __ROTPAIRINTERCTION_H
15 
16 // -- project includes --
17 #include "Model/RotParticle.h"
18 #include "Model/Interaction.h"
19 
29 {
30  protected:
31  CRotParticle *m_p1,*m_p2;
32 
33  public:
34  // functions
37  virtual ~ARotPairInteraction();
38 
39  inline const CParticle* first()const {return m_p1;};
40  inline const CParticle* second()const {return m_p2;};
41  inline CRotParticle* first() {return m_p1;};
42  inline CRotParticle* second() {return m_p2;};
43  inline pair<int,int> getPairID() const {return make_pair(m_p1->getID(),m_p2->getID());}
44  virtual Vec3 getPos() const = 0;
45  virtual void calcForces()=0;
46  void checkIDs();
47  virtual bool hasTag(int,int) const;
48  virtual Vec3 getPosFirst() const {return m_p1->getPos();}
49  virtual Vec3 getPosSecond() const {return m_p2->getPos();}
50  void setPP(CRotParticle*,CRotParticle*);
51  void setPP(const vector<CRotParticle*>);
52 
54  {
55  return
57  m_p1->getPos(),
58  m_p1->getRad(),
59  m_p2->getPos(),
60  m_p2->getRad(),
61  getPos()
62  );
63  }
64 
65  virtual void calcHeatTrans() {}
66  virtual void calcHeatFrict() {}
67 
68  // dummy implementations for save/load of restart parameters
69  virtual void saveRestartData(std::ostream &oStream){};
70  virtual void loadRestartData(std::istream &iStream){};
71 };
72 
73 #endif // __ROTPAIRINTERCTION_H