Skip to content
Snippets Groups Projects
Commit 641a431b authored by cmaffeo2's avatar cmaffeo2
Browse files

Fixed unit conversion in RB integrator for Langevin dynamics

parent 29210d6d
No related branches found
No related tags found
No related merge requests found
...@@ -208,13 +208,13 @@ void RigidBody::applyGridParticleForces(Vector3* forcestorques, const std::vecto ...@@ -208,13 +208,13 @@ void RigidBody::applyGridParticleForces(Vector3* forcestorques, const std::vecto
void RigidBody::addLangevin(Vector3 w1, Vector3 w2) void RigidBody::addLangevin(Vector3 w1, Vector3 w2)
{ {
Vector3 transForceCoeff = Vector3::element_sqrt( 2. * Temp * t->mass*t->transDamping / timestep ); Vector3 transForceCoeff = Vector3::element_sqrt( 2. * Temp * t->mass*t->transDamping / timestep );
Vector3 rotTorqueCoeff = Vector3::element_sqrt( 2. * Temp * Vector3::element_mult(t->inertia,t->rotDamping) / timestep ); Vector3 rotTorqueCoeff = Vector3::element_sqrt( 2. * Temp * Vector3::element_mult( t->inertia,t->rotDamping) / timestep );
Force f = Vector3::element_mult(transForceCoeff,w1) * 2.046167337 - Force f = Vector3::element_mult(transForceCoeff,w1) -
Vector3::element_mult(t->transDamping, orientation.transpose()*momentum) * 41867.999435; Vector3::element_mult(t->transDamping, orientation.transpose()*momentum) * 10000;
Force torq = Vector3::element_mult(rotTorqueCoeff,w2) * 2.046167337 - Force torq = Vector3::element_mult(rotTorqueCoeff,w2) -
Vector3::element_mult(t->rotDamping, angularMomentum) * 41867.999435; Vector3::element_mult(t->rotDamping, angularMomentum) * 10000;
f = orientation * f; f = orientation * f;
torq = orientation * torq; torq = orientation * torq;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment