"plugins/amoeba/vscode:/vscode.git/clone" did not exist on "6c0f3fbda18630bc42a8a111e7b98da81d0c0ee5"
Unverified Commit e4a743ad authored by peastman's avatar peastman Committed by GitHub
Browse files

Merge pull request #2639 from peastman/dof

Improved counting of degrees of freedom
parents 089384df 954b7fc6
...@@ -6,7 +6,7 @@ Simbios, the NIH National Center for Physics-Based Simulation of ...@@ -6,7 +6,7 @@ Simbios, the NIH National Center for Physics-Based Simulation of
Biological Structures at Stanford, funded under the NIH Roadmap for Biological Structures at Stanford, funded under the NIH Roadmap for
Medical Research, grant U54 GM072970. See https://simtk.org. Medical Research, grant U54 GM072970. See https://simtk.org.
Portions copyright (c) 2012-2013 Stanford University and the Authors. Portions copyright (c) 2012-2020 Stanford University and the Authors.
Authors: Peter Eastman Authors: Peter Eastman
Contributors: Robert McGibbon Contributors: Robert McGibbon
...@@ -289,7 +289,10 @@ class StateDataReporter(object): ...@@ -289,7 +289,10 @@ class StateDataReporter(object):
for i in range(system.getNumParticles()): for i in range(system.getNumParticles()):
if system.getParticleMass(i) > 0*unit.dalton: if system.getParticleMass(i) > 0*unit.dalton:
dof += 3 dof += 3
dof -= system.getNumConstraints() for i in range(system.getNumConstraints()):
p1, p2, distance = system.getConstraintParameters(i)
if system.getParticleMass(p1) > 0*unit.dalton or system.getParticleMass(p2) > 0*unit.dalton:
dof -= 1
if any(type(system.getForce(i)) == mm.CMMotionRemover for i in range(system.getNumForces())): if any(type(system.getForce(i)) == mm.CMMotionRemover for i in range(system.getNumForces())):
dof -= 3 dof -= 3
self._dof = dof self._dof = dof
......
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