Use ArrayRef in signatures of constraints and some pulling
[alexxy/gromacs.git] / src / gromacs / domdec / mdsetup.cpp
index ccf793b0bd7088f25841b0422862ae151c61c746..0baae937e79f05204e5e1410c47b64e49f3b78a1 100644 (file)
@@ -52,6 +52,7 @@
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/topology/mtop_util.h"
 #include "gromacs/topology/topology.h"
+#include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
@@ -105,7 +106,7 @@ void mdAlgorithmsSetupAtomData(const t_commrec*     cr,
              numHomeAtoms,
              mdAtoms);
 
-    auto mdatoms = mdAtoms->mdatoms();
+    t_mdatoms* mdatoms = mdAtoms->mdatoms();
     if (usingDomDec)
     {
         dd_sort_local_top(*cr->dd, mdatoms, top);
@@ -150,11 +151,12 @@ void mdAlgorithmsSetupAtomData(const t_commrec*     cr,
         constr->setConstraints(top,
                                mdatoms->nr,
                                mdatoms->homenr,
-                               mdatoms->massT,
-                               mdatoms->invmass,
+                               gmx::arrayRefFromArray(mdatoms->massT, mdatoms->nr),
+                               gmx::arrayRefFromArray(mdatoms->invmass, mdatoms->nr),
                                mdatoms->nMassPerturbed != 0,
                                mdatoms->lambda,
-                               mdatoms->cFREEZE);
+                               mdatoms->cFREEZE ? gmx::arrayRefFromArray(mdatoms->cFREEZE, mdatoms->nr)
+                                                : gmx::ArrayRef<const unsigned short>());
     }
 }