Commit 24dd6efa authored by peastman's avatar peastman Committed by GitHub
Browse files

Merge pull request #1861 from peastman/periodiccv

Fixed an incorrect exception in CustomCVForce
parents 0827ad50 6520515f
...@@ -53,6 +53,9 @@ void CustomCVForceImpl::initialize(ContextImpl& context) { ...@@ -53,6 +53,9 @@ void CustomCVForceImpl::initialize(ContextImpl& context) {
// Construct the inner system used to evaluate collective variables. // Construct the inner system used to evaluate collective variables.
const System& system = context.getSystem(); const System& system = context.getSystem();
Vec3 a, b, c;
system.getDefaultPeriodicBoxVectors(a, b, c);
innerSystem.setDefaultPeriodicBoxVectors(a, b, c);
for (int i = 0; i < system.getNumParticles(); i++) for (int i = 0; i < system.getNumParticles(); i++)
innerSystem.addParticle(system.getParticleMass(i)); innerSystem.addParticle(system.getParticleMass(i));
for (int i = 0; i < owner.getNumCollectiveVariables(); i++) { for (int i = 0; i < owner.getNumCollectiveVariables(); i++) {
......
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