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 class FunctionBoundaryConditions : public PeriodicConditionHandler
{ {
public: public:
FunctionBoundaryConditions(BoundaryFunc bfunc) explicit FunctionBoundaryConditions(BoundaryFunc bfunc)
: bfunc_(bfunc) : bfunc_(bfunc)
{ {
} }

View File

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

View File

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

View File

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

View File

@ -24,7 +24,7 @@ struct OperatorApplier
{ {
//! \brief Constructor //! \brief Constructor
//! \param[in] t The preconditioner or inverse operator //! \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 //! \brief The default constructor
//! \param[in] gv_ The grid the operator is assembled over //! \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 { struct VertexLess {
//! \brief Default constructor. //! \brief Default constructor.
//! \param[in] comp Direction to use for comparison. -1 to use index //! \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 //! \brief The comparison operator
bool operator()(const Vertex& q1, const Vertex& q2) bool operator()(const Vertex& q1, const Vertex& q2)
@ -215,7 +215,7 @@ class BoundaryGrid {
struct BoundedPredicate { struct BoundedPredicate {
//! \brief Default constructor //! \brief Default constructor
//! \param[in] coord_ The coordinates to check //! \param[in] coord_ The coordinates to check
BoundedPredicate(const FaceCoord& coord_) : coord(coord_) {} explicit BoundedPredicate(const FaceCoord& coord_) : coord(coord_) {}
//! \brief The comparison operator //! \brief The comparison operator
bool operator()(const Quad& q) bool operator()(const Quad& q)
@ -345,7 +345,7 @@ class HexGeometry<2, cdim, GridImp>
//! \brief Construct integration element //! \brief Construct integration element
//! \param[in] q Quad describing 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) for (int i=0;i<4;++i)
c[i] = q.v[i].c; c[i] = q.v[i].c;

View File

@ -29,7 +29,7 @@ class Elasticity {
//! \brief Default constructor //! \brief Default constructor
//! \param[in] gv_ The grid we are doing the calculations on //! \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 //! \brief Returns the B matrix in a quadrature point
//! \param[in] point (Reference) coordinates of quadrature point //! \param[in] point (Reference) coordinates of quadrature point

View File

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

View File

@ -150,7 +150,7 @@ class TensorProductFunction
//! \brief Construct a tensor-product function //! \brief Construct a tensor-product function
//! \param[in] funcs_ The functions //! \param[in] funcs_ The functions
TensorProductFunction(const Dune::FieldVector<ftype, dim>& funcs_) explicit TensorProductFunction(const Dune::FieldVector<ftype, dim>& funcs_)
: funcs(funcs_) {} : funcs(funcs_) {}
//! \brief Evaluate the function //! \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), : periodic_partner_bid_(num_different_boundary_ids, 0),
canonical_bid_(num_different_boundary_ids, 0) canonical_bid_(num_different_boundary_ids, 0)
{ {
@ -333,7 +333,7 @@ namespace Opm
{ {
public: public:
DummyVec() {} DummyVec() {}
DummyVec(int) {} explicit DummyVec(int) {}
void resize(int) {} void resize(int) {}
void clear() {} 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), : PeriodicConditionHandler(num_different_boundary_ids),
FlowConds(num_different_boundary_ids), FlowConds(num_different_boundary_ids),
SatConds(num_different_boundary_ids), SatConds(num_different_boundary_ids),

View File

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

View File

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

View File

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

View File

@ -699,7 +699,7 @@ namespace Opm {
class FaceFluxes class FaceFluxes
{ {
public: public:
FaceFluxes(int sz) explicit FaceFluxes(int sz)
: fluxes_(sz, 0.0), visited_(sz, 0), max_modification_(0.0) : 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 /// in the model. Used to set the size of certain internal
/// working std::arrays. A cell with @f$n_f@f$ faces results in /// 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$. /// 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 ), : max_nf_ (max_nf ),
fa_ (max_nf * max_nf), fa_ (max_nf * max_nf),
t1_ (max_nf * dim ), t1_ (max_nf * dim ),

View File

@ -115,7 +115,7 @@ namespace Opm {
/// in the model. Used to set the size of certain internal /// in the model. Used to set the size of certain internal
/// working std::arrays. A cell with @f$n_f@f$ faces results in /// 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$. /// 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 ), : max_nf_(max_nf ),
fa_ (max_nf * max_nf), fa_ (max_nf * max_nf),
t1_ (max_nf * dim ), t1_ (max_nf * dim ),

View File

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