ESyS-Particle  4.0.1
RotPairInteraction.h
00001 
00002 //                                                         //
00003 // Copyright (c) 2003-2011 by The University of Queensland //
00004 // Earth Systems Science Computational Centre (ESSCC)      //
00005 // http://www.uq.edu.au/esscc                              //
00006 //                                                         //
00007 // Primary Business: Brisbane, Queensland, Australia       //
00008 // Licensed under the Open Software License version 3.0    //
00009 // http://www.opensource.org/licenses/osl-3.0.php          //
00010 //                                                         //
00012 
00013 #ifndef __ROTPAIRINTERCTION_H
00014 #define __ROTPAIRINTERCTION_H
00015 
00016 // -- project includes --
00017 #include "Model/RotParticle.h"
00018 #include "Model/Interaction.h"
00019 
00028 class ARotPairInteraction : public AInteraction
00029 {
00030  protected:
00031   CRotParticle *m_p1,*m_p2;
00032 
00033  public:
00034   // functions 
00035   ARotPairInteraction();
00036   ARotPairInteraction(CRotParticle*,CRotParticle*);
00037   virtual ~ARotPairInteraction();
00038 
00039   inline const CParticle* first()const {return m_p1;}; 
00040   inline const CParticle* second()const {return m_p2;};
00041   inline CRotParticle* first() {return m_p1;};
00042   inline CRotParticle* second() {return m_p2;};
00043   inline pair<int,int> getPairID() const {return make_pair(m_p1->getID(),m_p2->getID());}
00044   virtual Vec3 getPos() const = 0;
00045   virtual void calcForces()=0;
00046   void checkIDs();
00047   virtual bool hasTag(int,int) const;
00048   virtual Vec3 getPosFirst() const {return m_p1->getPos();}
00049   virtual Vec3 getPosSecond() const {return m_p2->getPos();}
00050   void setPP(CRotParticle*,CRotParticle*);
00051   void setPP(const vector<CRotParticle*>);
00052   
00053   esys::lsm::quintuple<Vec3,double,Vec3,double,Vec3> getRaw2Data() const
00054   {
00055     return 
00056       esys::lsm::quintuple<Vec3,double,Vec3,double,Vec3>(
00057         m_p1->getPos(),
00058         m_p1->getRad(),
00059         m_p2->getPos(),
00060         m_p2->getRad(),
00061         getPos()
00062       );
00063   }
00064 
00065   virtual void calcHeatTrans() {}
00066   virtual void calcHeatFrict() {}
00067 
00068   // dummy implementations for save/load of restart parameters
00069   virtual void saveRestartData(std::ostream &oStream){};
00070   virtual void loadRestartData(std::istream &iStream){};
00071 };
00072 
00073 #endif // __ROTPAIRINTERCTION_H