mark constructors explicit

quells static analyzer warnings
This commit is contained in:
Arne Morten Kvarving 2024-08-16 14:18:24 +02:00
parent 3c468c6112
commit 41bcc182bb
18 changed files with 24 additions and 24 deletions

View File

@ -99,7 +99,7 @@ namespace Opm
class FunctionBoundaryConditions : public PeriodicConditionHandler
{
public:
FunctionBoundaryConditions(BoundaryFunc bfunc)
explicit FunctionBoundaryConditions(BoundaryFunc bfunc)
: bfunc_(bfunc)
{
}

View File

@ -46,7 +46,7 @@ namespace Opm {
enum { DofPerCell = Model::DofPerCell };
public:
ImplicitAssembly(Model& model)
explicit ImplicitAssembly(Model& model)
: model_(model),
nconn_(-1) ,
asm_buffer_()

View File

@ -104,7 +104,7 @@ namespace Opm {
template <class> class VAsgn >
class ImplicitTransport {
public:
ImplicitTransport(Model& model)
explicit ImplicitTransport(Model& model)
: model_(model),
asm_ (model)
{}

View File

@ -126,7 +126,7 @@ namespace Opm {
template <class BaseVec>
class VectorSizeSetter {
public:
VectorSizeSetter(BaseVec& v) : v_(v) {}
explicit VectorSizeSetter(BaseVec& v) : v_(v) {}
void
setSize(::std::size_t ndof, ::std::size_t m) {

View File

@ -24,7 +24,7 @@ struct OperatorApplier
{
//! \brief Constructor
//! \param[in] t The preconditioner or inverse operator
OperatorApplier(T& t) : A(t)
explicit OperatorApplier(T& t) : A(t)
{
}

View File

@ -45,7 +45,7 @@ class ASMHandler {
//! \brief The default constructor
//! \param[in] gv_ The grid the operator is assembled over
ASMHandler(const GridType& gv_) : gv(gv_), maxeqn(0)
explicit ASMHandler(const GridType& gv_) : gv(gv_), maxeqn(0)
{
}

View File

@ -197,7 +197,7 @@ class BoundaryGrid {
struct VertexLess {
//! \brief Default constructor.
//! \param[in] comp Direction to use for comparison. -1 to use index
VertexLess(int comp) : dir(comp) {}
explicit VertexLess(int comp) : dir(comp) {}
//! \brief The comparison operator
bool operator()(const Vertex& q1, const Vertex& q2)
@ -215,7 +215,7 @@ class BoundaryGrid {
struct BoundedPredicate {
//! \brief Default constructor
//! \param[in] coord_ The coordinates to check
BoundedPredicate(const FaceCoord& coord_) : coord(coord_) {}
explicit BoundedPredicate(const FaceCoord& coord_) : coord(coord_) {}
//! \brief The comparison operator
bool operator()(const Quad& q)
@ -345,7 +345,7 @@ class HexGeometry<2, cdim, GridImp>
//! \brief Construct integration element
//! \param[in] q Quad describing element
HexGeometry(const BoundaryGrid::Quad& q)
explicit HexGeometry(const BoundaryGrid::Quad& q)
{
for (int i=0;i<4;++i)
c[i] = q.v[i].c;

View File

@ -29,7 +29,7 @@ class Elasticity {
//! \brief Default constructor
//! \param[in] gv_ The grid we are doing the calculations on
Elasticity(const GridType& gv_) : gv(gv_) {}
explicit Elasticity(const GridType& gv_) : gv(gv_) {}
//! \brief Returns the B matrix in a quadrature point
//! \param[in] point (Reference) coordinates of quadrature point

View File

@ -30,7 +30,7 @@ class MeshColorizer {
public:
//! \brief Default constructor
//! \param[in] grid_ The grid to colorize
MeshColorizer(const GridType& grid_) :
explicit MeshColorizer(const GridType& grid_) :
grid(grid_)
{
calcGroups();

View File

@ -150,7 +150,7 @@ class TensorProductFunction
//! \brief Construct a tensor-product function
//! \param[in] funcs_ The functions
TensorProductFunction(const Dune::FieldVector<ftype, dim>& funcs_)
explicit TensorProductFunction(const Dune::FieldVector<ftype, dim>& funcs_)
: funcs(funcs_) {}
//! \brief Evaluate the function

View File

@ -248,7 +248,7 @@ namespace Opm
{
}
PeriodicConditionHandler(int num_different_boundary_ids)
explicit PeriodicConditionHandler(int num_different_boundary_ids)
: periodic_partner_bid_(num_different_boundary_ids, 0),
canonical_bid_(num_different_boundary_ids, 0)
{
@ -333,7 +333,7 @@ namespace Opm
{
public:
DummyVec() {}
DummyVec(int) {}
explicit DummyVec(int) {}
void resize(int) {}
void clear() {}
};
@ -356,7 +356,7 @@ namespace Opm
{
}
BasicBoundaryConditions(int num_different_boundary_ids)
explicit BasicBoundaryConditions(int num_different_boundary_ids)
: PeriodicConditionHandler(num_different_boundary_ids),
FlowConds(num_different_boundary_ids),
SatConds(num_different_boundary_ids),

View File

@ -51,7 +51,7 @@ namespace Opm {
template <int np = 2>
class ReservoirState {
public:
ReservoirState(const UnstructuredGrid* g)
explicit ReservoirState(const UnstructuredGrid* g)
: press_ (g->number_of_cells),
fpress_(g->number_of_faces),
flux_ (g->number_of_faces),
@ -114,7 +114,7 @@ namespace Opm {
class TwophaseFluidWrapper {
public:
TwophaseFluidWrapper(const Opm::ReservoirPropertyCapillary<3>& r)
explicit TwophaseFluidWrapper(const Opm::ReservoirPropertyCapillary<3>& r)
: r_(r)
{}

View File

@ -45,7 +45,7 @@ namespace Opm {
template <class Mobility>
class ReservoirPropertyFixedMobility {
public:
ReservoirPropertyFixedMobility(const std::vector<Mobility>& mobs)
explicit ReservoirPropertyFixedMobility(const std::vector<Mobility>& mobs)
: mobs_(mobs)
{
}

View File

@ -289,7 +289,7 @@ namespace Opm
struct IndirectRange
{
typedef Iter Iterator;
IndirectRange(const std::vector<Iter>& iters)
explicit IndirectRange(const std::vector<Iter>& iters)
: iters_(iters), beg_(0), end_(iters_.size() - 1)
{
assert(iters_.size() >= 2);
@ -329,7 +329,7 @@ namespace Opm
template <class Updater>
struct UpdateLoopBody
{
UpdateLoopBody(const Updater& upd)
explicit UpdateLoopBody(const Updater& upd)
: updater(upd)
{
}

View File

@ -699,7 +699,7 @@ namespace Opm {
class FaceFluxes
{
public:
FaceFluxes(int sz)
explicit FaceFluxes(int sz)
: fluxes_(sz, 0.0), visited_(sz, 0), max_modification_(0.0)
{
}

View File

@ -111,7 +111,7 @@ namespace Opm {
/// in the model. Used to set the size of certain internal
/// working std::arrays. A cell with @f$n_f@f$ faces results in
/// an inner product matrix of size @f$n_f \times n_f@f$.
MimeticIPAnisoRelpermEvaluator(const int max_nf)
explicit MimeticIPAnisoRelpermEvaluator(const int max_nf)
: max_nf_ (max_nf ),
fa_ (max_nf * max_nf),
t1_ (max_nf * dim ),

View File

@ -115,7 +115,7 @@ namespace Opm {
/// in the model. Used to set the size of certain internal
/// working std::arrays. A cell with @f$n_f@f$ faces results in
/// an inner product matrix of size @f$n_f \times n_f@f$.
MimeticIPEvaluator(const int max_nf)
explicit MimeticIPEvaluator(const int max_nf)
: max_nf_(max_nf ),
fa_ (max_nf * max_nf),
t1_ (max_nf * dim ),

View File

@ -39,7 +39,7 @@ namespace Opm
class CornerPointChopper
{
public:
CornerPointChopper(const std::string& file) :
explicit CornerPointChopper(const std::string& file) :
parser_(Parser{}),
deck_(parser_.parseFile(file)),
metricUnits_(Opm::UnitSystem::newMETRIC())