Bulk change to const ref for mtop
[alexxy/gromacs.git] / src / gromacs / selection / sm_simple.cpp
index 2083f1203302decf93cb9f99661731200426c55f..1dbc4f0fafa857086fd99ea6aeb93ece5960e269 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2009,2010,2011,2012,2013 by the GROMACS development team.
  * Copyright (c) 2014,2015,2016,2017,2018 by the GROMACS development team.
- * Copyright (c) 2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020,2021, 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.
@@ -470,7 +470,7 @@ static void evaluate_resnr(const gmx::SelMethodEvalContext& context,
     int molb = 0;
     for (int i = 0; i < g->isize; ++i)
     {
-        mtopGetAtomAndResidueName(context.top, g->index[i], &molb, nullptr, &out->u.i[i], nullptr, nullptr);
+        mtopGetAtomAndResidueName(*context.top, g->index[i], &molb, nullptr, &out->u.i[i], nullptr, nullptr);
     }
 }
 
@@ -490,7 +490,7 @@ static void evaluate_resindex(const gmx::SelMethodEvalContext& context,
     for (int i = 0; i < g->isize; ++i)
     {
         int resind;
-        mtopGetAtomAndResidueName(context.top, g->index[i], &molb, nullptr, nullptr, nullptr, &resind);
+        mtopGetAtomAndResidueName(*context.top, g->index[i], &molb, nullptr, nullptr, nullptr, &resind);
         out->u.i[i] = resind + 1;
     }
 }
@@ -521,7 +521,7 @@ static void evaluate_molindex(const gmx::SelMethodEvalContext& context,
     int molb = 0;
     for (int i = 0; i < g->isize; ++i)
     {
-        out->u.i[i] = mtopGetMoleculeIndex(context.top, g->index[i], &molb) + 1;
+        out->u.i[i] = mtopGetMoleculeIndex(*context.top, g->index[i], &molb) + 1;
     }
 }
 
@@ -541,7 +541,7 @@ static void evaluate_atomname(const gmx::SelMethodEvalContext& context,
     for (int i = 0; i < g->isize; ++i)
     {
         const char* atom_name;
-        mtopGetAtomAndResidueName(context.top, g->index[i], &molb, &atom_name, nullptr, nullptr, nullptr);
+        mtopGetAtomAndResidueName(*context.top, g->index[i], &molb, &atom_name, nullptr, nullptr, nullptr);
         out->u.s[i] = const_cast<char*>(atom_name);
     }
 }
@@ -561,7 +561,7 @@ static void evaluate_pdbatomname(const gmx::SelMethodEvalContext& context,
     int molb = 0;
     for (int i = 0; i < g->isize; ++i)
     {
-        const char* s = mtopGetAtomPdbInfo(context.top, g->index[i], &molb).atomnm;
+        const char* s = mtopGetAtomPdbInfo(*context.top, g->index[i], &molb).atomnm;
         while (std::isspace(*s))
         {
             ++s;
@@ -595,7 +595,7 @@ static void evaluate_atomtype(const gmx::SelMethodEvalContext& context,
     for (int i = 0; i < g->isize; ++i)
     {
         int atomIndexInMolecule;
-        mtopGetMolblockIndex(context.top, g->index[i], &molb, nullptr, &atomIndexInMolecule);
+        mtopGetMolblockIndex(*context.top, g->index[i], &molb, nullptr, &atomIndexInMolecule);
         const gmx_moltype_t& moltype = context.top->moltype[context.top->molblock[molb].type];
         out->u.s[i]                  = *moltype.atoms.atomtype[atomIndexInMolecule];
     }
@@ -616,7 +616,7 @@ static void evaluate_resname(const gmx::SelMethodEvalContext& context,
     int molb = 0;
     for (int i = 0; i < g->isize; ++i)
     {
-        out->u.s[i] = *mtopGetResidueInfo(context.top, g->index[i], &molb).name;
+        out->u.s[i] = *mtopGetResidueInfo(*context.top, g->index[i], &molb).name;
     }
 }
 
@@ -635,7 +635,7 @@ static void evaluate_insertcode(const gmx::SelMethodEvalContext& context,
     int molb = 0;
     for (int i = 0; i < g->isize; ++i)
     {
-        out->u.s[i][0] = mtopGetResidueInfo(context.top, g->index[i], &molb).ic;
+        out->u.s[i][0] = mtopGetResidueInfo(*context.top, g->index[i], &molb).ic;
     }
 }
 
@@ -654,7 +654,7 @@ static void evaluate_chain(const gmx::SelMethodEvalContext& context,
     int molb = 0;
     for (int i = 0; i < g->isize; ++i)
     {
-        out->u.s[i][0] = mtopGetResidueInfo(context.top, g->index[i], &molb).chainid;
+        out->u.s[i][0] = mtopGetResidueInfo(*context.top, g->index[i], &molb).chainid;
     }
 }
 
@@ -674,7 +674,7 @@ static void evaluate_mass(const gmx::SelMethodEvalContext& context,
     int molb = 0;
     for (int i = 0; i < g->isize; ++i)
     {
-        out->u.r[i] = mtopGetAtomMass(context.top, g->index[i], &molb);
+        out->u.r[i] = mtopGetAtomMass(*context.top, g->index[i], &molb);
     }
 }
 
@@ -702,7 +702,7 @@ static void evaluate_charge(const gmx::SelMethodEvalContext& context,
     int molb = 0;
     for (int i = 0; i < g->isize; ++i)
     {
-        out->u.r[i] = mtopGetAtomParameters(context.top, g->index[i], &molb).q;
+        out->u.r[i] = mtopGetAtomParameters(*context.top, g->index[i], &molb).q;
     }
 }
 
@@ -729,7 +729,7 @@ static void evaluate_altloc(const gmx::SelMethodEvalContext& context,
     int molb = 0;
     for (int i = 0; i < g->isize; ++i)
     {
-        out->u.s[i][0] = mtopGetAtomPdbInfo(context.top, g->index[i], &molb).altloc;
+        out->u.s[i][0] = mtopGetAtomPdbInfo(*context.top, g->index[i], &molb).altloc;
     }
 }
 
@@ -749,7 +749,7 @@ static void evaluate_occupancy(const gmx::SelMethodEvalContext& context,
     int molb = 0;
     for (int i = 0; i < g->isize; ++i)
     {
-        out->u.r[i] = mtopGetAtomPdbInfo(context.top, g->index[i], &molb).occup;
+        out->u.r[i] = mtopGetAtomPdbInfo(*context.top, g->index[i], &molb).occup;
     }
 }
 
@@ -769,7 +769,7 @@ static void evaluate_betafactor(const gmx::SelMethodEvalContext& context,
     int molb = 0;
     for (int i = 0; i < g->isize; ++i)
     {
-        out->u.r[i] = mtopGetAtomPdbInfo(context.top, g->index[i], &molb).bfac;
+        out->u.r[i] = mtopGetAtomPdbInfo(*context.top, g->index[i], &molb).bfac;
     }
 }