ESyS-Particle  2.3.4
SphereBodyIG.h
Go to the documentation of this file.
1 // //
3 // Copyright (c) 2003-2017 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.apache.org/licenses/LICENSE-2.0 //
10 // //
12 
13 #ifndef __ASPHEREBODYINTERACTIONGROUP_H
14 #define __ASPHEREBODYINTERACTIONGROUP_H
15 
16 //--- project includes ---
17 #include "Model/SphereBody.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:
36 
37 public:
39  :m_sphere(NULL),
40  m_comm(comm),
41  m_inner_count(0)
42  {
43  }
44 
46  {
47  }
48 
52  virtual void setTimeStepSize(double dt)
53  {
54  // do nothing, time step size not required in sphere body interactions.
55  }
56 
57  virtual void calcForces()=0;
58 
59  virtual void applyForce(const Vec3&){
60  std::cerr
61  << "calling unimplemented function ASphereBodyInteractionGroup::applyForce"
62  << std::endl;
63  }
64  virtual void setVelocity(const Vec3&){
65  std::cerr
66  << "calling unimplemented function ASphereBodyInteractionGroup::setVelocity"
67  << std::endl;
68  }
69  inline double getDisplacement(){return m_sphere->getDisplacement();};
71  inline void moveSphereBodyBy(const Vec3& mv){m_sphere->moveBy(mv);};
72  inline void zeroForce(){m_sphere->zeroForce();};
73 };
74 
75 
76 #endif // __ASPHEREBODYINTERACTIONGROUP_H
CSphereBody::zeroForce
void zeroForce()
Definition: SphereBody.h:61
ASphereBodyInteractionGroup::m_comm
TML_Comm * m_comm
MPI communicator.
Definition: SphereBodyIG.h:34
CSphereBody::moveBy
void moveBy(const Vec3 &v)
Definition: SphereBody.h:53
CSphereBody::resetDisplacement
void resetDisplacement()
Definition: SphereBody.h:68
ASphereBodyInteractionGroup::applyForce
virtual void applyForce(const Vec3 &)
Definition: SphereBodyIG.h:59
ASphereBodyInteractionGroup::zeroForce
void zeroForce()
Definition: SphereBodyIG.h:72
ASphereBodyInteractionGroup::~ASphereBodyInteractionGroup
virtual ~ASphereBodyInteractionGroup()
Definition: SphereBodyIG.h:45
AInteractionGroup
Abstract base class for a group of interactions.
Definition: InteractionGroup.h:35
ASphereBodyInteractionGroup::setVelocity
virtual void setVelocity(const Vec3 &)
Definition: SphereBodyIG.h:64
ASphereBodyInteractionGroup::moveSphereBodyBy
void moveSphereBodyBy(const Vec3 &mv)
Definition: SphereBodyIG.h:71
ASphereBodyInteractionGroup::getDisplacement
double getDisplacement()
Definition: SphereBodyIG.h:69
ASphereBodyInteractionGroup
Abstract Base class for a group of interactions between particles and a sphere body.
Definition: SphereBodyIG.h:31
NULL
#define NULL
Definition: t_list.h:17
ASphereBodyInteractionGroup::calcForces
virtual void calcForces()=0
CSphereBody
base class for spherical non-inertial bodies (similar to simple walls)
Definition: SphereBody.h:40
comm.h
ASphereBodyInteractionGroup::m_inner_count
int m_inner_count
Definition: SphereBodyIG.h:35
Vec3
Definition: vec3.h:47
CSphereBody::getDisplacement
double getDisplacement()
Definition: SphereBody.h:66
TML_Comm
abstract base class for communicator
Definition: comm.h:47
ASphereBodyInteractionGroup::ASphereBodyInteractionGroup
ASphereBodyInteractionGroup(TML_Comm *comm)
Definition: SphereBodyIG.h:38
InteractionGroup.h
ASphereBodyInteractionGroup::setTimeStepSize
virtual void setTimeStepSize(double dt)
Definition: SphereBodyIG.h:52
ASphereBodyInteractionGroup::m_sphere
CSphereBody * m_sphere
the sphere body
Definition: SphereBodyIG.h:33
ASphereBodyInteractionGroup::resetDisplacement
void resetDisplacement()
Definition: SphereBodyIG.h:70
SphereBody.h