13 #ifndef __ROT_DAMPING_HPP
14 #define __ROT_DAMPING_HPP
32 m_vref=param->getVRef();
33 m_visc=param->getVisc();
34 m_dt=param->getTimeStep();
35 m_maxiter=param->getMaxIter();
61 Vec3 v=m_p->getAngVel();
63 Vec3 frc=m_p->getMoment();
65 double s=1.0/m_p->getInertRot();
66 double in=m_p->getInertRot();
67 double mass=m_p->getMass();
71 while((error*error>s_limit2) & (count<m_maxiter)){
74 v_rel=v-m_vref+s*m_dt*(frc-v_rel*m_visc*in);
75 error=(v_rel-v_old).norm2();
79 v_rel=
Vec3(0.0,0.0,0.0);
81 m_force=-1.0*m_visc*v_rel*mass;
82 m_p->applyMoment(-1.0*m_visc*v_rel*in);
83 m_E_diss=m_visc*v_rel*v*m_dt;
96 if(name==
"dissipated_energy"){
100 cerr <<
"ERROR - invalid name for interaction scalar access function" << endl;
117 cerr <<
"ERROR - invalid name for interaction scalar access function" << endl;
137 cerr <<
"ERROR - invalid name for interaction vector access function" << endl;
167 int tag1=m_p->getTag();
169 return ((tag1 & mask)==(tag & mask));
180 res.push_back(m_p->getID());
185 #endif // __ROT_DAMPING_HPP