ESyS-Particle  2.3.2
BWallInteraction.hpp
Go to the documentation of this file.
1 
2 // //
3 // Copyright (c) 2003-2014 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.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 #ifndef MODEL_BWALLINTERACTION_HPP
14 #define MODEL_BWALLINTERACTION_HPP
15 
16 template <class T>
18  AWallInteraction<T>(p,w,iflag)
19 {
20  // scale stiffness to particle cross section
21  double scale;
23 // scale=2.0*this->m_p->getRad();
24  scale=1.0;
25  } else { // 3D
26 // scale=3.1415926536*this->m_p->getRad()*this->m_p->getRad();
27  scale=3.1415926536*this->m_p->getRad();
28  }
29 
30  m_k=k*scale;
31 }
32 
37 template <class T>
39 {
40  Vec3 D=(this->m_p->getTotalDisplacement()-this->m_wall->getTotalDisplacement());
41  //double dist=sqrt(D*D);
42 
43  Vec3 force=D*m_k;
44  Vec3 pos=this->m_p->getPos();
45 
46  this->m_p->applyForce(-1.0*force,pos);
47  if(this->m_inner_flag) this->m_wall->addForce(force);
48 }
49 
53 template <class T>
55 {
56  Vec3 D=(this->m_p->getTotalDisplacement()-this->m_wall->getTotalDisplacement());
57  //const double dist=sqrt(D*D);
58 
59  return D*m_k;
60 }
61 
62 #endif