14 #ifndef MODEL_SOFTBWALLINTERACTION_HPP
15 #define MODEL_SOFTBWALLINTERACTION_HPP
17 #include "SoftBWallInteraction.h"
27 if(CParticle::getDo2dCalculations()){
32 scale=3.1415926536*this->m_p->getRad();
39 m_normalK=normalK*scale;
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);