ESyS-Particle  4.0.1
BEdge2DInteraction.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 __BEDGE2DINTERACTION_H
00014 #define __BEDGE2DINTERACTION_H
00015 
00016 // -- Project includes --
00017 #include "Foundation/vec3.h"
00018 #include "Geometry/Edge2D.h"
00019 #include "Model/Particle.h"
00020 #include "Model/BMesh2DIP.h"
00021 #include "Model/BMesh2DInteractionCpData.h"
00022 
00031 class BEdge2DInteraction
00032 {
00033  private:
00034   CParticle *m_p;
00035   Edge2D *m_ed;
00036   double m_k;
00037   double m_break;
00038   double m_dist;
00039   int m_eid;
00040   int m_pid;
00041 
00042   Vec3 m_ap; // anchor point in local coord. 
00047   bool m_inner_flag; 
00048 
00049  public:  
00050   typedef BMesh2DIP  ParameterType;
00051   typedef BMesh2DInteractionCpData CheckPointable; 
00052 
00053   BEdge2DInteraction();
00054   BEdge2DInteraction(CParticle*,Edge2D*,BMesh2DIP,bool iflag=true);
00055   virtual ~BEdge2DInteraction();
00056 
00057   bool isInner(){return m_inner_flag;};
00058   virtual void calcForces();
00059   bool broken();
00060   virtual Vec3 getPos()const {return m_p->getPos();}; // ??
00061   inline int getPid() const {return m_pid;};
00062   inline int getTid() const {return m_eid;};
00063   virtual void setPP(CParticle* part_p){m_p=part_p;};
00064   virtual void setTP(Edge2D* tri_p){m_ed=tri_p;};
00065 
00066   friend class TML_PackedMessageInterface;
00067 };
00068 #endif //__BEDGE2DINTERACTION_H