"openmmapi/src/ForceImpl.cpp" did not exist on "9ed2c870058ff6c5b7a008afb419967f51ce53fc"
Unverified Commit 862e6ac7 authored by Peter Eastman's avatar Peter Eastman Committed by GitHub
Browse files

Fixed error in checking for circular virtual site definitions (#4822)

parent 8879bbf5
......@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2009-2022 Stanford University and the Authors. *
* Portions copyright (c) 2009-2025 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -543,6 +543,7 @@ IntegrationUtilities::IntegrationUtilities(ComputeContext& context, const System
while (sites.size() > 0) {
if (sites.size() == remainingSites)
throw OpenMMException("Virtual site definitions are circular");
remainingSites = sites.size();
for (auto index = sites.begin(); index != sites.end();) {
const VirtualSite& site = system.getVirtualSite(*index);
bool canCompute = true;
......
......@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2012-2017 Stanford University and the Authors. *
* Portions copyright (c) 2012-2025 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -47,6 +47,7 @@ ReferenceVirtualSites::ReferenceVirtualSites(const System& system) {
while (sites.size() > 0) {
if (sites.size() == remainingSites)
throw OpenMMException("Virtual site definitions are circular");
remainingSites = sites.size();
for (auto index = sites.begin(); index != sites.end();) {
const VirtualSite& site = system.getVirtualSite(*index);
bool canCompute = true;
......
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