Gromacs  2023.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::RestraintManager Class Referencefinal

#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.

This should be generalized as work description and factory functions in Context.

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.
RestraintManageroperator= (const RestraintManager &)=default
 RestraintManager (RestraintManager &&) noexcept=default
RestraintManageroperator= (RestraintManager &&) noexcept=default

Member Function Documentation

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.

restraintshared ownership of a restraint potential interface.
namekey by which to reference the restraint.
unsigned long gmx::RestraintManager::countRestraints ( )

Get the number of currently managed restraints.

number of 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.

a copy of the list of restraint potentials.

The documentation for this class was generated from the following files: