14 #ifndef MODEL_SOFTBWALLINTERACTION_HPP
15 #define MODEL_SOFTBWALLINTERACTION_HPP
32 scale=3.1415926536*this->
m_p->getRad();
49 const Vec3 &n = this->m_wall->getNormal();
50 const Vec3 relDisplacement =
52 this->m_p->getTotalDisplacement()
54 this->m_wall->getTotalDisplacement()
57 const double normalDist =
dot(relDisplacement, n)/(n.
norm());
58 const Vec3 normalForce = ((m_normalK*normalDist)/n.
norm())*n;
64 const Vec3 tangentDisplacement =
65 (relDisplacement - ((normalDist/(n.
norm()))*n));
66 const Vec3 tangentForce = m_shearK*tangentDisplacement;
68 const Vec3 totalForce = normalForce + tangentForce;
69 this->m_p->applyForce(-1.0*totalForce,this->m_p->getPos());
70 if(this->m_inner_flag) this->m_wall->addForce(totalForce);
79 const Vec3 &n = this->m_wall->getNormal();
80 const Vec3 relDisplacement =
82 this->m_p->getTotalDisplacement()
84 this->m_wall->getTotalDisplacement()
87 const double normalDist =
dot(relDisplacement, n)/(n.
norm());
88 const Vec3 normalForce = ((m_normalK*normalDist)/n.
norm())*n;
94 const Vec3 tangentDisplacement =
95 (relDisplacement - ((normalDist/(n.
norm()))*n));
96 const Vec3 tangentForce = m_shearK*tangentDisplacement;
98 const Vec3 totalForce = normalForce + tangentForce;
static bool getDo2dCalculations()
Definition: Particle.h:181
T * m_p
Definition: WallInteraction.h:32
Abstract base for all interactions between a particle and a wall.
Definition: WallInteraction.h:29
VEC3_INLINE double dot(const Vec3 &v1, const Vec3 &v2)
Definition: vec3.hpp:196
base class for all walls
Definition: Wall.h:39
VEC3_INLINE double norm() const
Definition: vec3.hpp:211
virtual Vec3 getForce()
Definition: SoftBWallInteraction.hpp:77
virtual void calcForces()
Definition: SoftBWallInteraction.hpp:47
double m_shearK
directional spring constants
Definition: SoftBWallInteraction.h:32
double m_normalK
Definition: SoftBWallInteraction.h:32
CSoftBondedWallInteraction()