Skip to content
Snippets Groups Projects
Commit e467d9da authored by Studer Gabriel's avatar Studer Gabriel
Browse files

Hack to make context reinitialization openmm version agnostic

parent fc873db9
No related branches found
No related tags found
No related merge requests found
......@@ -900,12 +900,13 @@ void Simulation::ReinitializeContext() {
// reinitializing requires to reset all those things!
// Be aware, state of random number generators etc might not be
// preserved!
OpenMM::State state = context_->getState(OpenMM::State::Positions |
OpenMM::State::Velocities |
OpenMM::State::Forces |
OpenMM::State::Energy |
OpenMM::State::Parameters |
OpenMM::State::ParameterDerivatives);
// openmm uses bitmasks to selectively extract data from the context.
// The context data might change with different OpenMM versions.
// Passing -1 automagically sets all bits to true => ALL available
// data gets extracted.
int true_bitmask = -1;
OpenMM::State state = context_->getState(true_bitmask);
context_->reinitialize();
context_->setState(state);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment