Merge pull request #391 from akva2/janitorin_sca

Quell some low-hanging SCA warnings
This commit is contained in:
Bård Skaflestad 2024-08-27 12:11:45 +02:00 committed by GitHub
commit 2a38ff2a3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 24 additions and 23 deletions

View File

@ -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<double,dim> 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&) {}
};
}

View File

@ -44,12 +44,12 @@ Schwarz::type* Schwarz::setup2(std::shared_ptr<Operator>& 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<int, 3> 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<Operator>& op,
for (size_t q=0;q<mpc->getNoMaster();++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));
}
}
}

View File

@ -16,7 +16,7 @@
#include <opm/grid/CpGrid.hpp>
#ifdef HAVE_OPENMP
#if _OPENMP
#include <omp.h>
#endif
@ -26,12 +26,12 @@ void MeshColorizer<Dune::CpGrid>::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<Dune::CpGrid>::calcGroups()
<< "\n\tstripsize " << stripsize
<< "\n\t# of strips " << els/stripsize
<< "\n\tremainder " << remainder << std::endl;
#else
threads = 1;
#endif
if (threads == 1) {

View File

@ -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<double>
@ -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();
}
}