diff --git a/opm/elasticity/elasticity_preconditioners.cpp b/opm/elasticity/elasticity_preconditioners.cpp index 2fc128b..dc500fb 100644 --- a/opm/elasticity/elasticity_preconditioners.cpp +++ b/opm/elasticity/elasticity_preconditioners.cpp @@ -49,7 +49,7 @@ Schwarz::type* Schwarz::setup2(std::shared_ptr& op, it != e; ++it) { std::array ijk; gv.getIJK(set.index(*it), ijk); - const int rowix = (ijk[0]/cps) + (nel1/cps)*(ijk[1]/cps); + auto rowix = [&ijk,nel1]{ return (ijk[0]/cps) + (nel1/cps)*(ijk[1]/cps); }; // loop over nodes for (int n=0;n<8;++n) { int idx = set.subIndex(*it, n, 3); @@ -59,11 +59,11 @@ Schwarz::type* Schwarz::setup2(std::shared_ptr& op, for (size_t q=0;qgetNoMaster();++q) { int idx2 = A.getEquationForDof(mpc->getMaster(q).node, m); if (idx2 > -1) - rows[rowix].insert(idx2); + rows[rowix()].insert(idx2); } } else { if (A.getEquationForDof(idx, m) > -1) - rows[rowix].insert(A.getEquationForDof(idx, m)); + rows[rowix()].insert(A.getEquationForDof(idx, m)); } } }