diff --git a/opm/elasticity/asmhandler.hpp b/opm/elasticity/asmhandler.hpp index 0ef737b..64b9dc1 100644 --- a/opm/elasticity/asmhandler.hpp +++ b/opm/elasticity/asmhandler.hpp @@ -56,6 +56,12 @@ class ASMHandler { delete it->second; } + //! \brief No copying of this class + ASMHandler(const ASMHandler&) = delete; + + //! \brief No copying of this class + ASMHandler& operator=(const ASMHandler&) = delete; + //! \brief A vectorial node value typedef Dune::FieldVector NodeValue; @@ -227,11 +233,6 @@ class ASMHandler { //! \brief The number of equations in the system size_t maxeqn; - private: - //! \brief No copying of this class - ASMHandler(const ASMHandler&) {} - //! \brief No copying of this class - ASMHandler& operator=(const ASMHandler&) {} }; } diff --git a/opm/elasticity/elasticity_preconditioners.cpp b/opm/elasticity/elasticity_preconditioners.cpp index b6d9dec..dc500fb 100644 --- a/opm/elasticity/elasticity_preconditioners.cpp +++ b/opm/elasticity/elasticity_preconditioners.cpp @@ -44,12 +44,12 @@ Schwarz::type* Schwarz::setup2(std::shared_ptr& op, int nel2 = gv.logicalCartesianSize()[1]; rows.resize(nel1/cps*nel2/cps); - auto set = gv.leafGridView().indexSet(); + const auto& set = gv.leafGridView().indexSet(); for (auto it = gv.leafGridView().begin<0>(), e = gv.leafGridView().end<0>(); 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)); } } } diff --git a/opm/elasticity/meshcolorizer.cpp b/opm/elasticity/meshcolorizer.cpp index 3cc417b..5409015 100644 --- a/opm/elasticity/meshcolorizer.cpp +++ b/opm/elasticity/meshcolorizer.cpp @@ -16,7 +16,7 @@ #include -#ifdef HAVE_OPENMP +#if _OPENMP #include #endif @@ -26,12 +26,12 @@ void MeshColorizer::calcGroups() int nel1 = grid.logicalCartesianSize()[0]; int nel2 = grid.logicalCartesianSize()[1]; int nel3 = grid.logicalCartesianSize()[2]; - int threads=1; - int stripsize=0; - int remainder=0; - int dir=0, mul=1; + int threads; + int stripsize; + int remainder = 0; + int dir, mul; -#ifdef HAVE_OPENMP +#if _OPENMP threads = omp_get_max_threads(); int parts = threads > 1 ? 2*threads : 1; dir = getStripDirection(nel1,nel2,nel3,parts); @@ -53,6 +53,8 @@ void MeshColorizer::calcGroups() << "\n\tstripsize " << stripsize << "\n\t# of strips " << els/stripsize << "\n\tremainder " << remainder << std::endl; +#else + threads = 1; #endif if (threads == 1) { diff --git a/opm/upscaling/writeECLData.cpp b/opm/upscaling/writeECLData.cpp index 6073e60..7faab14 100644 --- a/opm/upscaling/writeECLData.cpp +++ b/opm/upscaling/writeECLData.cpp @@ -54,7 +54,7 @@ namespace { createIntehead(const int nx, const int ny, const int nz, const int nactive, const time_t time_stamp) { - const auto ih = ::Opm::RestartIO::InteHEAD{} + return ::Opm::RestartIO::InteHEAD{} .dimensions (nx, ny, nz) .numActive (nactive) .unitConventions (Opm::UnitSystem::newMETRIC()) @@ -62,9 +62,8 @@ namespace { .wellTableDimensions({ 0, 0, 0, 0, 0, 0, 0 }) .calendarDate (timeStamp(time_stamp)) .activePhases (phases()) - .variousParam (201702, 100); - - return ih.data(); + .variousParam (201702, 100) + .data(); } std::vector @@ -82,10 +81,9 @@ namespace { >(start), dur }; - const auto dh = ::Opm::RestartIO::DoubHEAD{} - .timeStamp(ts); - - return dh.data(); + return ::Opm::RestartIO::DoubHEAD{} + .timeStamp(ts) + .data(); } }