#ifndef _constr_h
#define _constr_h
#include "typedefs.h"
+#include "types/commrec.h"
#ifdef __cplusplus
extern "C" {
int sblock[], /* The shake blocks */
t_idef *idef, /* The interaction def */
t_inputrec *ir, /* Input record */
- matrix box, /* The box */
rvec x_s[], /* Coords before update */
rvec prime[], /* Output coords */
t_nrnb *nrnb, /* Performance measure */
/* Initializes and returns a structure with SETTLE parameters */
void csettle(gmx_settledata_t settled,
- int nsettle, /* Number of settles */
- t_iatom iatoms[], /* The settle iatom list */
- real b4[], /* Old coordinates */
- real after[], /* New coords, to be settled */
- real invdt, /* 1/delta_t */
- real *v, /* Also constrain v if v!=NULL */
- gmx_bool bCalcVir, /* Calculate r x m delta_r */
- tensor rmdr, /* sum r x m delta_r */
- int *xerror,
- t_vetavars *vetavar /* variables for pressure control */
+ int nsettle, /* Number of settles */
+ t_iatom iatoms[], /* The settle iatom list */
+ const t_pbc *pbc, /* PBC data pointer, can be NULL */
+ real b4[], /* Old coordinates */
+ real after[], /* New coords, to be settled */
+ real invdt, /* 1/delta_t */
+ real *v, /* Also constrain v if v!=NULL */
+ int calcvir_atom_end, /* Calculate r x m delta_r up to this atom */
+ tensor rmdr, /* sum r x m delta_r */
+ int *xerror,
+ t_vetavars *vetavar /* variables for pressure control */
);
void settle_proj(FILE *fp,
- gmx_settledata_t settled,int econq,
- int nsettle, t_iatom iatoms[],rvec x[],
- rvec *der,rvec *derp,
- gmx_bool bCalcVir,tensor rmdder, t_vetavars *vetavar);
+ gmx_settledata_t settled,int econq,
+ int nsettle, t_iatom iatoms[],
+ const t_pbc *pbc, /* PBC data pointer, can be NULL */
+ rvec x[],
+ rvec *der,rvec *derp,
+ int CalcVirAtomEnd,tensor rmdder, t_vetavars *vetavar);
/* Analytical algorithm to subtract the components of derivatives
* of coordinates working on settle type constraint.
*/
real invmass[],real tt[],real lagr[],int *nerror,real invdt,t_vetavars *vetavar);
gmx_bool constrain(FILE *log,gmx_bool bLog,gmx_bool bEner,
- gmx_constr_t constr,
- t_idef *idef,
- t_inputrec *ir,
- gmx_ekindata_t *ekind,
- t_commrec *cr,
- gmx_large_int_t step,int delta_step,
- t_mdatoms *md,
- rvec *x,rvec *xprime,rvec *min_proj,matrix box,
- real lambda,real *dvdlambda,
- rvec *v,tensor *vir,
- t_nrnb *nrnb,int econq, gmx_bool bPscal, real veta, real vetanew);
+ gmx_constr_t constr,
+ t_idef *idef,
+ t_inputrec *ir,
+ gmx_ekindata_t *ekind,
+ t_commrec *cr,
+ gmx_large_int_t step,int delta_step,
+ t_mdatoms *md,
+ rvec *x,rvec *xprime,rvec *min_proj,
+ gmx_bool bMolPBC,matrix box,
+ real lambda,real *dvdlambda,
+ rvec *v,tensor *vir,
+ t_nrnb *nrnb,int econq, gmx_bool bPscal, real veta, real vetanew);
/*
* When econq=econqCoord constrains coordinates xprime using th
* directions in x, min_proj is not used.
* When econq=econqDeriv_FlexCon, the same is done as with econqDeriv,
* but only the components of the flexible constraints are stored.
*
+ * When bMolPBC=TRUE, assume that molecules might be broken: correct PBC.
+ *
* 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
gmx_bool bDynamics,int *nflexiblecons);
/* Returns a block struct to go from atoms to constraints */
-t_blocka *atom2constraints_moltype(gmx_constr_t constr);
-/* Returns the an arry of atom to constraints lists for the moltypes */
+const t_blocka *atom2constraints_moltype(gmx_constr_t constr);
+/* Returns the an array of atom to constraints lists for the moltypes */
+
+const int **atom2settle_moltype(gmx_constr_t constr);
+/* Returns the an array of atom to settle for the moltypes */
#define constr_iatomptr(nconstr,iatom_constr,iatom_constrnc,con) ((con) < (nconstr) ? (iatom_constr)+(con)*3 : (iatom_constrnc)+(con-nconstr)*3)
/* Macro for getting the constraint iatoms for a constraint number con
* are concatenated.
*/
-gmx_bool inter_charge_group_constraints(gmx_mtop_t *mtop);
+gmx_bool inter_charge_group_constraints(const gmx_mtop_t *mtop);
/* Returns if there are inter charge group constraints */
+gmx_bool inter_charge_group_settles(const gmx_mtop_t *mtop);
+/* Returns if there are inter charge group settles */
+
real *constr_rmsd_data(gmx_constr_t constr);
/* Return the data for determining constraint RMS relative deviations.
* Returns NULL when LINCS is not used.
* required for LINCS.
*/
-gmx_bool constrain_lincs(FILE *log,gmx_bool bLog,gmx_bool bEner,
+gmx_bool
+constrain_lincs(FILE *log,gmx_bool bLog,gmx_bool bEner,
t_inputrec *ir,
gmx_large_int_t step,
gmx_lincsdata_t lincsd,t_mdatoms *md,
- t_commrec *cr,
- rvec *x,rvec *xprime,rvec *min_proj,matrix box,
+ t_commrec *cr,
+ rvec *x,rvec *xprime,rvec *min_proj,
+ matrix box,t_pbc *pbc,
real lambda,real *dvdlambda,
real invdt,rvec *v,
gmx_bool bCalcVir,tensor rmdr,