From d5c79720354b57e1cb8d36c8fc875ee8d2557f95 Mon Sep 17 00:00:00 2001 From: Chris Maffeo <cmaffeo2@illinois.edu> Date: Mon, 4 Jan 2016 17:47:06 -0600 Subject: [PATCH] fixed RB time units (from fs to ns) --- RigidBody.cu | 5 +++-- RigidBodyType.cu | 15 ++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/RigidBody.cu b/RigidBody.cu index 0477a27..1ea6148 100644 --- a/RigidBody.cu +++ b/RigidBody.cu @@ -12,8 +12,9 @@ RigidBody::RigidBody(const Configuration& cref, RigidBodyType& tref) - : c(&cref), t(&tref), impulse_to_momentum(0.0004184) { - + : c(&cref), t(&tref), impulse_to_momentum(4.184e8f) { + // units "(kcal_mol/AA) * ns" "amu AA/ns" * 4.184e+08 + timestep = c->timestep; // RBTODO: fix this Temp = 295; diff --git a/RigidBodyType.cu b/RigidBodyType.cu index 88720bb..15c892c 100644 --- a/RigidBodyType.cu +++ b/RigidBodyType.cu @@ -70,17 +70,18 @@ void RigidBodyType::setDampingCoeffs(float timestep) { /* MUST ONLY BE CALLED ON | | | f[kcal/mol AA] = - dampingCoeff * momentum[amu AA/fs] | | | - | units "(1/ps) * (amu AA/fs)" "kcal_mol/AA" * 2.3900574 | + | units "(1/ps) * (amu AA/ns)" "kcal_mol/AA" * 2.390e-06 | `–––––––––––––––––––––––––––––––––––––––––––––––––––––––*/ /*––––––––––––––––––––––––––––––––––––––––––––––––––––. | < f(t) f(t') > = 2 kT dampingCoeff mass delta(t-t') | | | - | units "sqrt( k K (1/ps) amu / fs )" "kcal_mol/AA" | - | * 0.068916889 | + | units "sqrt( k K (1/ps) amu / ns )" "kcal_mol/AA" | + | * 6.8916889e-05 | `––––––––––––––––––––––––––––––––––––––––––––––––––––*/ + // RBTODO: make units consistent with rest of RB code float Temp = 295; /* RBTODO: temperature should be read from grid? Or set in uniformly in config file */ - transForceCoeff = 0.068916889 * Vector3::element_sqrt( 2*Temp*mass*transDamping/timestep ); + transForceCoeff = 6.8916889e-05 * Vector3::element_sqrt( 2*Temp*mass*transDamping/timestep ); // setup for langevin // langevin = rbParams->langevin; @@ -88,12 +89,12 @@ void RigidBodyType::setDampingCoeffs(float timestep) { /* MUST ONLY BE CALLED ON // T = - dampingCoeff * angularMomentum // < f(t) f(t') > = 2 kT dampingCoeff inertia delta(t-t') - rotTorqueCoeff = 0.068916889 * + rotTorqueCoeff = 6.8916889e-05 * Vector3::element_sqrt( 2*Temp* Vector3::element_mult(inertia,rotDamping) / timestep ); - transDamping = 2.3900574 * transDamping; - rotDamping = 2.3900574 * rotDamping; + transDamping = 2.3900574e-6 * transDamping; + rotDamping = 2.3900574e-6 * rotDamping; // Also apply scale factors applyScaleFactors(); -- GitLab