Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlumedForce and periodic boundary conditions #83

Open
varun-go opened this issue Apr 16, 2024 · 2 comments
Open

PlumedForce and periodic boundary conditions #83

varun-go opened this issue Apr 16, 2024 · 2 comments

Comments

@varun-go
Copy link

I would like to clarify if PlumedForce uses periodic boundary conditions by default.

I noticed that when I created a breakpoint and inspected the PlumedForce instance the only available method is usesPeriodicBoundaryConditions. The returned value from this method is False. Additionally, since the setUsesPeriodicBoundaryConditions method is not available, one cannot change this aspect of the force.

Does this mean that the Plumed script dictates the use of periodic boundary conditions? For example, if one uses the RESTRAINT keyword in Plumed, the default option is that PBCs are used; so does PlumedForce use PBCs even though the usesPeriodicBoundaryConditions returns False?

@peastman
Copy link
Member

It looks like the handling is a bit inconsistent. PlumedForce always reports that it does not use periodic boundary conditions:

bool usesPeriodicBoundaryConditions() const {
return false;
}

But when it comes to actually computing the force, it checks system.usesPeriodicBoundaryConditions(), that is, whether any other force in the system applies periodic boundary conditions. If so, it passes the box vectors to Plumed:

if (usesPeriodic) {
Vec3 boxVectors[3];
context.getPeriodicBoxVectors(boxVectors[0], boxVectors[1], boxVectors[2]);
plumed_cmd(plumedmain, "setBox", &boxVectors[0][0]);
}

That means Plumed could potentially make use of periodic boundary conditions, depending on your script.

Ideally it would check whether your script involves periodic boundary conditions, but I'm not sure if there's a way to do that.

@varun-go
Copy link
Author

I see, thank you. I have other forces in my OpenMM script that use periodic boundary conditions, so the PlumedForce should get the box vectors from those forces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants