*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
void init_orires(FILE *fplog, const gmx_mtop_t *mtop,
rvec xref[],
const t_inputrec *ir,
- const gmx_multisim_t *ms, t_oriresdata *od,
- t_state *state)
+ const t_commrec *cr, t_oriresdata *od,
+ t_state *state, gmx_bool bIsParticleDecomposition)
{
- int i, j, d, ex, nmol, nr, *nr_ex;
+ int i, j, d, ex, nmol, *nr_ex;
double mtot;
rvec com;
gmx_mtop_ilistloop_t iloop;
t_ilist *il;
gmx_mtop_atomloop_all_t aloop;
t_atom *atom;
+ const gmx_multisim_t *ms;
+
+ od->nr = gmx_mtop_ftype_count(mtop, F_ORIRES);
+ if (0 == od->nr)
+ {
+ /* Not doing orientation restraints */
+ return;
+ }
+
+ if (PAR(cr) && !bIsParticleDecomposition)
+ {
+ gmx_fatal(FARGS, "Orientation restraints do not work (yet) with domain decomposition, use particle decomposition (mdrun option -pd)");
+ }
+ /* Orientation restraints */
+ if (!MASTER(cr))
+ {
+ /* Nothing to do */
+ return;
+ }
+ ms = cr->ms;
od->fc = ir->orires_fc;
od->nex = 0;
od->S = NULL;
-
od->M = NULL;
od->eig = NULL;
od->v = NULL;
- od->nr = gmx_mtop_ftype_count(mtop, F_ORIRES);
- if (od->nr == 0)
- {
- return;
- }
-
nr_ex = NULL;
iloop = gmx_mtop_ilistloop_init(mtop);
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
void init_orires(FILE *fplog, const gmx_mtop_t *mtop,
rvec x[],
const t_inputrec *ir,
- const gmx_multisim_t *ms, t_oriresdata *od,
- t_state *state);
-/* Initializes all the orientation restraint stuff in *od */
+ const t_commrec *cr, t_oriresdata *od,
+ t_state *state,
+ gmx_bool bIsParticleDecomposition);
+/* Decides whether orientation restraints can work, and initializes
+ all the orientation restraint stuff in *od (and assumes *od is
+ already allocated. */
real calc_orires_dev(const gmx_multisim_t *ms,
int nfa, const t_iatom fa[], const t_iparams ip[],
/* This needs to be called before read_checkpoint to extend the state */
init_disres(fplog, mtop, inputrec, cr, Flags & MD_PARTDEC, fcd, state, repl_ex_nst > 0);
- if (gmx_mtop_ftype_count(mtop, F_ORIRES) > 0)
- {
- if (PAR(cr) && !(Flags & MD_PARTDEC))
- {
- gmx_fatal(FARGS, "Orientation restraints do not work (yet) with domain decomposition, use particle decomposition (mdrun option -pd)");
- }
- /* Orientation restraints */
- if (MASTER(cr))
- {
- init_orires(fplog, mtop, state->x, inputrec, cr->ms, &(fcd->orires),
- state);
- }
- }
+ init_orires(fplog, mtop, state->x, inputrec, cr, &(fcd->orires),
+ state, Flags & MD_PARTDEC);
if (DEFORM(*inputrec))
{