Gromacs
2020-beta1
|
#include <gromacs/restraint/manager.h>
Manage the Restraint potentials available for Molecular Dynamics.
A simulation runner owns one manager resource to hold restraint objects used in the simulation. In the case of thread MPI simulations, multiple runner instances will have handles to the same underlying resource. With further factoring of the mdrun call stack, this facility can be combined with others into a simulation context object from which simulation code can retrieve support code for a user-configured simulation.
Calling code provides the manager with a means to access the various required input data to be used when restraints are computed.
Public Member Functions | |
RestraintManager () | |
Create new restraint manager resources with empty set of restraints. | |
void | clear () noexcept |
Clear registered restraints and reset the manager. | |
unsigned long | countRestraints () noexcept |
Get the number of currently managed restraints. More... | |
void | addToSpec (std::shared_ptr< gmx::IRestraintPotential > restraint, const std::string &name) |
Obtain the ability to create a restraint MDModule. More... | |
std::vector< std::shared_ptr < IRestraintPotential > > | getRestraints () const |
Get a copy of the current set of restraints to be applied. More... | |
RestraintManager (const RestraintManager &)=default | |
Client code can access the shared resource by copying or moving a handle. | |
RestraintManager & | operator= (const RestraintManager &)=default |
RestraintManager (RestraintManager &&) noexcept=default | |
RestraintManager & | operator= (RestraintManager &&) noexcept=default |
void gmx::RestraintManager::addToSpec | ( | std::shared_ptr< gmx::IRestraintPotential > | restraint, |
const std::string & | name | ||
) |
Obtain the ability to create a restraint MDModule.
Though the name is reminiscent of the evolving idea of a work specification, the Spec here is just a list of restraint modules.
restraint | shared ownership of a restraint potential interface. |
name | key by which to reference the restraint. |
|
noexcept |
Get the number of currently managed restraints.
std::vector< std::shared_ptr< IRestraintPotential > > gmx::RestraintManager::getRestraints | ( | ) | const |
Get a copy of the current set of restraints to be applied.
This function is to be used when launching a simulation to get the restraint handles to bind, so it is not performance sensitive. A new vector is returned with each call because it is unspecified whether the set of handles point to the same objects on all threads or between calls to getRestraints.