ESyS-Particle  4.0.1
WallIG.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 __AWALLINTERACTIONGROUP_H
00014 #define __AWALLINTERACTIONGROUP_H
00015 
00016 //--- project includes ---
00017 #include "Model/Wall.h"
00018 #include "Model/InteractionGroup.h"
00019 
00020 //--- IO includes ---
00021 #include <iostream>
00022 
00023 //--- TML includes ---
00024 #include "tml/comm/comm.h"
00025 
00029 template<class T>
00030 class AWallInteractionGroup : public AInteractionGroup<T>
00031 {
00032 protected:
00033   CWall* m_wall; 
00034   TML_Comm* m_comm; 
00035   int m_inner_count;
00036 
00037 public:
00038   AWallInteractionGroup(TML_Comm* comm)
00039     :m_wall(NULL),
00040      m_comm(comm),
00041      m_inner_count(0)
00042   {
00043   }
00044 
00045   virtual ~AWallInteractionGroup()
00046   {
00047   }
00048 
00052   virtual void setTimeStepSize(double dt)
00053   {
00054     // do nothing, time step size not required in wall interactions.
00055   }
00056 
00057   virtual void calcForces()=0;
00058   
00059   virtual void applyForce(const Vec3&){
00060     std::cerr
00061       << "calling unimplemented function AWallInteractionGroup::applyForce"
00062       << std::endl;
00063   }
00064   virtual void setVelocity(const Vec3&){
00065     std::cerr
00066       << "calling unimplemented function AWallInteractionGroup::setVelocity"
00067       << std::endl;
00068   }
00069   inline double getDisplacement(){return m_wall->getDisplacement();};
00070   inline void resetDisplacement(){m_wall->resetDisplacement();};
00071   inline void moveWallBy(const Vec3& mv){m_wall->moveBy(mv);};
00072   inline void setWallNormal(const Vec3& wn){m_wall->setNormal(wn);};
00073   inline void zeroForce(){m_wall->zeroForce();};
00074 };
00075 
00076 
00077 #endif // __AWALLINTERACTIONGROUP_H