ESyS-Particle  4.0.1
WallIG.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 __AWALLINTERACTIONGROUP_H
14 #define __AWALLINTERACTIONGROUP_H
15 
16 //--- project includes ---
17 #include "Model/Wall.h"
18 #include "Model/InteractionGroup.h"
19 
20 //--- IO includes ---
21 #include <iostream>
22 
23 //--- TML includes ---
24 #include "tml/comm/comm.h"
25 
29 template<class T>
31 {
32 protected:
35  int m_inner_count;
36 
37 public:
39  :m_wall(NULL),
40  m_comm(comm),
41  m_inner_count(0)
42  {
43  }
44 
45  virtual ~AWallInteractionGroup()
46  {
47  }
48 
52  virtual void setTimeStepSize(double dt)
53  {
54  // do nothing, time step size not required in wall interactions.
55  }
56 
57  virtual void calcForces()=0;
58 
59  virtual void applyForce(const Vec3&){
60  std::cerr
61  << "calling unimplemented function AWallInteractionGroup::applyForce"
62  << std::endl;
63  }
64  virtual void setVelocity(const Vec3&){
65  std::cerr
66  << "calling unimplemented function AWallInteractionGroup::setVelocity"
67  << std::endl;
68  }
69  inline double getDisplacement(){return m_wall->getDisplacement();};
70  inline void resetDisplacement(){m_wall->resetDisplacement();};
71  inline void moveWallBy(const Vec3& mv){m_wall->moveBy(mv);};
72  inline void setWallNormal(const Vec3& wn){m_wall->setNormal(wn);};
73  inline void zeroForce(){m_wall->zeroForce();};
74 };
75 
76 
77 #endif // __AWALLINTERACTIONGROUP_H