Gromacs
2024.4
|
#include "gmxpre.h"
#include "shake.h"
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include "gromacs/gmxlib/nrnb.h"
#include "gromacs/math/functions.h"
#include "gromacs/math/vec.h"
#include "gromacs/mdlib/constr.h"
#include "gromacs/mdlib/splitter.h"
#include "gromacs/mdtypes/inputrec.h"
#include "gromacs/mdtypes/md_enums.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/topology/invblock.h"
#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/listoflists.h"
Defines SHAKE code.
Functions | |
static int | gmx::pcomp (const void *p1, const void *p2) |
Compares sort blocks. | |
static void | gmx::pr_sortblock (FILE *fp, const char *title, gmx::ArrayRef< const t_sortblock > sb) |
Prints sortblocks. | |
static void | gmx::resizeLagrangianData (shakedata *shaked, int ncons) |
Reallocates a vector. | |
void | gmx::make_shake_sblock_serial (shakedata *shaked, InteractionDefinitions *idef, int numAtoms) |
Make SHAKE blocks when not using DD. | |
void | gmx::make_shake_sblock_dd (shakedata *shaked, const InteractionList &ilcon) |
Make SHAKE blocks when using DD. | |
void | gmx::cshake (const int iatom[], int ncon, int *nnit, int maxnit, ArrayRef< const real > constraint_distance_squared, ArrayRef< RVec > positions, const t_pbc *pbc, ArrayRef< const RVec > initial_displacements, ArrayRef< const real > half_of_reduced_mass, real omega, ArrayRef< const real > invmass, ArrayRef< const real > distance_squared_tolerance, ArrayRef< real > scaled_lagrange_multiplier, int *nerror) |
Inner kernel for SHAKE constraints. More... | |
static void | gmx::crattle (const int iatom[], int ncon, int *nnit, int maxnit, ArrayRef< const real > constraint_distance_squared, ArrayRef< RVec > vp, ArrayRef< const RVec > rij, ArrayRef< const real > m2, real omega, ArrayRef< const real > invmass, ArrayRef< const real > distance_squared_tolerance, ArrayRef< real > scaled_lagrange_multiplier, int *nerror, real invdt) |
Implements RATTLE (ie. SHAKE for velocity verlet integrators) | |
static int | gmx::vec_shakef (FILE *fplog, shakedata *shaked, ArrayRef< const real > invmass, int ncon, ArrayRef< const t_iparams > ip, const int *iatom, real tol, ArrayRef< const RVec > x, ArrayRef< RVec > prime, const t_pbc *pbc, real omega, bool bFEP, real lambda, ArrayRef< real > scaled_lagrange_multiplier, real invdt, ArrayRef< RVec > v, bool bCalcVir, tensor vir_r_m_dr, ConstraintVariable econq) |
Applies SHAKE. | |
static void | gmx::check_cons (FILE *log, int nc, ArrayRef< const RVec > x, ArrayRef< const RVec > prime, ArrayRef< const RVec > v, const t_pbc *pbc, ArrayRef< const t_iparams > ip, const int *iatom, ArrayRef< const real > invmass, ConstraintVariable econq) |
Check that constraints are satisfied. | |
static bool | gmx::bshakef (FILE *log, shakedata *shaked, ArrayRef< const real > invmass, const InteractionDefinitions &idef, const t_inputrec &ir, ArrayRef< const RVec > x_s, ArrayRef< RVec > prime, const t_pbc *pbc, t_nrnb *nrnb, real lambda, real *dvdlambda, real invdt, ArrayRef< RVec > v, bool bCalcVir, tensor vir_r_m_dr, bool bDumpOnError, ConstraintVariable econq) |
Applies SHAKE. | |
bool | gmx::constrain_shake (FILE *log,shakedata *shaked,gmx::ArrayRef< const real > invmass,const InteractionDefinitions &idef,const t_inputrec &ir,ArrayRef< const RVec > x_s,ArrayRef< RVec > xprime,ArrayRef< RVec > vprime,const t_pbc *pbc,t_nrnb *nrnb,real lambda,real *dvdlambda,real invdt,ArrayRef< RVec > v,bool bCalcVir,tensor vir_r_m_dr,bool bDumpOnError,ConstraintVariable econq) |
Shake all the atoms blockwise. It is assumed that all the constraints in the idef->shakes field are sorted, to ascending block nr. The sblock array points into the idef->shakes.iatoms field, with block 0 starting at sblock[0] and running to ( < ) sblock[1], block n running from sblock[n] to sblock[n+1]. Array sblock should be large enough. Return TRUE when OK, FALSE when shake-error. | |