Commit 283b1acd authored by John Chodera (MSKCC)'s avatar John Chodera (MSKCC)
Browse files

Fix precision issue in MTSIntegrator

parent 69d5e8b8
...@@ -98,10 +98,11 @@ class MTSIntegrator(CustomIntegrator): ...@@ -98,10 +98,11 @@ class MTSIntegrator(CustomIntegrator):
for i in range(stepsPerParentStep): for i in range(stepsPerParentStep):
self.addComputePerDof("v", "v+0.5*(dt/"+str(substeps)+")*f"+str(group)+"/m") self.addComputePerDof("v", "v+0.5*(dt/"+str(substeps)+")*f"+str(group)+"/m")
if len(groups) == 1: if len(groups) == 1:
self.addComputePerDof("x1", "x")
self.addComputePerDof("x", "x+(dt/"+str(substeps)+")*v") self.addComputePerDof("x", "x+(dt/"+str(substeps)+")*v")
self.addComputePerDof("x1", "x")
self.addConstrainPositions(); self.addConstrainPositions();
self.addComputePerDof("v", "(x-x1)/(dt/"+str(substeps)+")"); self.addComputePerDof("v", "v+(x-x1)/(dt/"+str(substeps)+")");
self.addConstrainVelocities()
else: else:
self._createSubsteps(substeps, groups[1:]) self._createSubsteps(substeps, groups[1:])
self.addComputePerDof("v", "v+0.5*(dt/"+str(substeps)+")*f"+str(group)+"/m") self.addComputePerDof("v", "v+0.5*(dt/"+str(substeps)+")*f"+str(group)+"/m")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment