Gromacs
2020.4
|
#include <gromacs/mdlib/constr.h>
Inherited by gmx::Constraints::CreationHelper.
Handles constraints.
Public Member Functions | |
int | numFlexibleConstraints () const |
Returns the total number of flexible constraints in the system. | |
bool | havePerturbedConstraints () const |
Returns whether the system contains perturbed constraints. | |
void | setConstraints (const gmx_localtop_t &top, const t_mdatoms &md) |
Set up all the local constraints for the domain. More... | |
bool | apply (bool bLog, bool bEner, int64_t step, int delta_step, real step_scaling, rvec *x, rvec *xprime, rvec *min_proj, const matrix box, real lambda, real *dvdlambda, rvec *v, tensor *vir, ConstraintVariable econq) |
Applies constraints to coordinates. More... | |
void | saveEdsamPointer (gmx_edsam *ed) |
Links the essentialdynamics and constraint code. | |
ArrayRef< const t_blocka > | atom2constraints_moltype () const |
Getter for use by domain decomposition. | |
ArrayRef< const std::vector < int > > | atom2settle_moltype () const |
Getter for use by domain decomposition. | |
ArrayRef< real > | rmsdData () const |
Return the data for reduction for determining constraint RMS relative deviations, or an empty ArrayRef when not supported for any active constraints. | |
real | rmsd () const |
Return the RMSD of the constraints when available. | |
int | numConstraintsTotal () |
Get the total number of constraints. More... | |
bool gmx::Constraints::apply | ( | bool | bLog, |
bool | bEner, | ||
int64_t | step, | ||
int | delta_step, | ||
real | step_scaling, | ||
rvec * | x, | ||
rvec * | xprime, | ||
rvec * | min_proj, | ||
const matrix | box, | ||
real | lambda, | ||
real * | dvdlambda, | ||
rvec * | v, | ||
tensor * | vir, | ||
ConstraintVariable | econq | ||
) |
Applies constraints to coordinates.
When econq=ConstraintVariable::Positions constrains coordinates xprime using th directions in x, min_proj is not used.
When econq=ConstraintVariable::Derivative, calculates the components xprime in the constraint directions and subtracts these components from min_proj. So when min_proj=xprime, the constraint components are projected out.
When econq=ConstraintVariable::Deriv_FlexCon, the same is done as with ConstraintVariable::Derivative, but only the components of the flexible constraints are stored.
delta_step is used for determining the constraint reference lengths when lenA != lenB or will the pull code with a pulling rate. step + delta_step is the step at which the final configuration is meant to be; for update delta_step = 1.
step_scaling can be used to update coordinates based on the time step multiplied by this factor. Thus, normally 1.0 is passed. The SD1 integrator uses 0.5 in one of its calls, to correct positions for half a step of changed velocities.
If v!=NULL also constrain v by adding the constraint corrections / dt.
If vir!=NULL calculate the constraint virial.
Return whether the application of constraints succeeded without error.
int gmx::Constraints::numConstraintsTotal | ( | ) |
Get the total number of constraints.
void gmx::Constraints::setConstraints | ( | const gmx_localtop_t & | top, |
const t_mdatoms & | md | ||
) |
Set up all the local constraints for the domain.