ESyS-Particle  4.0.1
RotThermPairInteraction.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 __ROTTHERMPAIRINTERCTION_H
00014 #define __ROTTHERMPAIRINTERCTION_H
00015 
00016 // -- project includes --
00017 #include "Model/RotThermParticle.h"
00018 #include "Model/Interaction.h"
00019 
00023 class ARotThermPairInteraction : public AInteraction
00024 {
00025  protected:
00026   CRotThermParticle *m_p1,*m_p2;
00027 
00028  public:
00029   // functions 
00030   ARotThermPairInteraction();
00031   ARotThermPairInteraction(CRotThermParticle*,CRotThermParticle*);
00032   virtual ~ARotThermPairInteraction();
00033 
00034   inline const CRotThermParticle* first()const {return m_p1;}; 
00035   inline const CRotThermParticle* second()const {return m_p2;};
00036   inline CRotThermParticle* first() {return m_p1;};
00037   inline CRotThermParticle* second() {return m_p2;};
00038   inline pair<int,int> getPairID() const {return make_pair(m_p1->getID(),m_p2->getID());}
00039   virtual Vec3 getPos() const = 0;
00040   virtual void calcForces()=0 ;
00041   virtual void calcHeatFrict(){} ;
00042   virtual void calcHeatTrans(){} ;
00043   void checkIDs();
00044   virtual bool hasTag(int,int) const;
00045   virtual Vec3 getPosFirst() const {return m_p1->getPos();}
00046   virtual Vec3 getPosSecond() const {return m_p2->getPos();}
00047   void setPP(CRotThermParticle*,CRotThermParticle*);
00048   void setPP(const vector<CRotThermParticle*>);
00049   
00050   esys::lsm::quintuple<Vec3,double,Vec3,double,Vec3> getRaw2Data() const
00051   {
00052     return 
00053       esys::lsm::quintuple<Vec3,double,Vec3,double,Vec3>(
00054         m_p1->getPos(),
00055         m_p1->getRad(),
00056         m_p2->getPos(),
00057         m_p2->getRad(),
00058         getPos()
00059       );
00060   }
00061   
00062 };
00063 
00064 #endif // __ROTTHERMPAIRINTERCTION_H