From 6d964c1370bfb74a7acc8820e961eb9b73550196 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 21 Jan 2025 10:54:54 +0100 Subject: [PATCH] mark constructors explicit --- examples/problems/co2injectionproblem.hh | 2 +- examples/problems/cuvetteproblem.hh | 2 +- examples/problems/diffusionproblem.hh | 2 +- examples/problems/fingerproblem.hh | 2 +- examples/problems/fractureproblem.hh | 2 +- examples/problems/groundwaterproblem.hh | 2 +- examples/problems/infiltrationproblem.hh | 2 +- examples/problems/lensproblem.hh | 2 +- examples/problems/obstacleproblem.hh | 2 +- examples/problems/outflowproblem.hh | 2 +- examples/problems/powerinjectionproblem.hh | 2 +- examples/problems/reservoirproblem.hh | 2 +- examples/problems/richardslensproblem.hh | 2 +- examples/problems/waterairproblem.hh | 2 +- examples/tutorial1problem.hh | 2 +- flowexperimental/comp/EmptyModel.hpp | 2 +- opm/models/blackoil/blackoilmodel.hh | 2 +- opm/models/blackoil/blackoilnewtonmethod.hpp | 2 +- .../blackoil/blackoilprimaryvariables.hh | 2 +- opm/models/blackoil/blackoilproblem.hh | 2 +- opm/models/common/multiphasebasemodel.hh | 2 +- opm/models/common/multiphasebaseproblem.hh | 2 +- opm/models/common/quantitycallbacks.hh | 16 ++++++++-------- .../discretefracture/discretefracturemodel.hh | 2 +- .../discretefractureproblem.hh | 2 +- .../common/fvbasediscretization.hh | 4 ++-- .../common/fvbasediscretizationfemadapt.hh | 2 +- .../common/fvbasenewtonconvergencewriter.hh | 2 +- .../common/fvbasenewtonmethod.hh | 2 +- .../discretization/common/fvbaseproblem.hh | 2 +- .../discretization/ecfv/ecfvdiscretization.hh | 6 +++--- opm/models/discretization/ecfv/ecfvstencil.hh | 2 +- .../discretization/vcfv/vcfvdiscretization.hh | 6 +++--- opm/models/flash/flashmodel.hh | 2 +- opm/models/flash/flashratevector.hh | 2 +- opm/models/immiscible/immisciblemodel.hh | 2 +- opm/models/immiscible/immiscibleratevector.hh | 2 +- opm/models/io/basevanguard.hh | 2 +- opm/models/io/cubegridvanguard.hh | 2 +- opm/models/io/dgfvanguard.hh | 2 +- opm/models/io/structuredgridvanguard.hh | 2 +- opm/models/io/vtkblackoilenergymodule.hpp | 2 +- opm/models/io/vtkblackoilmicpmodule.hpp | 2 +- opm/models/io/vtkblackoilmodule.hpp | 2 +- opm/models/io/vtkblackoilpolymermodule.hpp | 2 +- opm/models/io/vtkblackoilsolventmodule.hpp | 2 +- opm/models/io/vtkcompositionmodule.hpp | 2 +- opm/models/io/vtkdiffusionmodule.hpp | 2 +- opm/models/io/vtkdiscretefracturemodule.hpp | 2 +- opm/models/io/vtkenergymodule.hpp | 2 +- opm/models/io/vtkmultiphasemodule.hpp | 2 +- opm/models/io/vtkmultiwriter.hh | 2 +- opm/models/io/vtkphasepresencemodule.hpp | 2 +- opm/models/io/vtkprimaryvarsmodule.hpp | 2 +- opm/models/io/vtktemperaturemodule.hpp | 2 +- opm/models/ncp/ncpmodel.hh | 2 +- opm/models/ncp/ncpnewtonmethod.hh | 2 +- opm/models/ncp/ncpratevector.hh | 2 +- opm/models/nonlinear/newtonmethod.hh | 2 +- opm/models/nonlinear/nullconvergencewriter.hh | 2 +- opm/models/parallel/mpibuffer.hh | 2 +- opm/models/parallel/tasklets.hpp | 6 +++--- opm/models/parallel/threadedentityiterator.hh | 2 +- opm/models/ptflash/flashnewtonmethod.hh | 2 +- opm/models/pvs/pvsmodel.hh | 2 +- opm/models/pvs/pvsnewtonmethod.hh | 2 +- opm/models/pvs/pvsratevector.hh | 2 +- opm/models/richards/richardsmodel.hh | 2 +- opm/models/richards/richardsnewtonmethod.hh | 2 +- opm/models/richards/richardsratevector.hh | 2 +- opm/models/utils/genericguard.hh | 2 +- opm/models/utils/simulator.hh | 4 ++-- opm/models/utils/timerguard.hh | 2 +- opm/simulators/aquifers/AquiferGridUtils.hpp | 4 ++-- opm/simulators/flow/AluGridVanguard.hpp | 2 +- opm/simulators/flow/BaseAquiferModel.hpp | 2 +- opm/simulators/flow/BlackoilModelNldd.hpp | 2 +- opm/simulators/flow/CpGridVanguard.hpp | 2 +- opm/simulators/flow/DamarisWriter.hpp | 2 +- opm/simulators/flow/EclWriter.hpp | 2 +- opm/simulators/flow/FIBlackoilModel.hpp | 2 +- opm/simulators/flow/FlowBaseVanguard.hpp | 2 +- opm/simulators/flow/FlowThresholdPressure.hpp | 2 +- opm/simulators/flow/Main.hpp | 2 +- opm/simulators/flow/MixingRateControls.hpp | 2 +- opm/simulators/flow/PolyhedralGridVanguard.hpp | 2 +- opm/simulators/flow/TracerModel.hpp | 2 +- opm/simulators/flow/VtkTracerModule.hpp | 2 +- opm/simulators/linalg/DILU.hpp | 2 +- opm/simulators/linalg/MILU.hpp | 2 +- .../linalg/ParallelIstlInformation.hpp | 6 +++--- .../linalg/ParallelOverlappingILU0.hpp | 2 +- .../linalg/PreconditionerWithUpdate.hpp | 6 +++--- opm/simulators/linalg/PropertyTree.hpp | 2 +- opm/simulators/linalg/combinedcriterion.hh | 8 ++++---- opm/simulators/linalg/globalindices.hh | 2 +- .../linalg/gpuistl/GpuOwnerOverlapCopy.hpp | 6 +++--- .../linalg/istlsparsematrixadapter.hh | 2 +- .../linalg/overlappingblockvector.hh | 2 +- opm/simulators/linalg/overlappingoperator.hh | 2 +- .../linalg/overlappingscalarproduct.hh | 2 +- opm/simulators/linalg/parallelamgbackend.hh | 2 +- opm/simulators/linalg/parallelbasebackend.hh | 2 +- .../linalg/parallelbicgstabbackend.hh | 2 +- opm/simulators/linalg/parallelistlbackend.hh | 2 +- .../linalg/residreductioncriterion.hh | 2 +- opm/simulators/linalg/twolevelmethodcpr.hh | 2 +- .../timestepping/AdaptiveTimeStepping.hpp | 7 +++++-- .../timestepping/TimeStepControl.cpp | 2 +- .../timestepping/TimeStepControl.hpp | 18 +++++++++--------- opm/simulators/utils/MPIPacker.hpp | 2 +- opm/simulators/utils/MPISerializer.hpp | 2 +- opm/simulators/utils/ParallelEclipseState.hpp | 2 +- opm/simulators/wells/BlackoilWellModel.hpp | 2 +- .../wells/BlackoilWellModelConstraints.hpp | 2 +- .../wells/BlackoilWellModelGuideRates.hpp | 2 +- .../wells/BlackoilWellModelRestart.hpp | 2 +- opm/simulators/wells/BlackoilWellModelWBP.hpp | 2 +- .../wells/GasLiftSingleWellGeneric.hpp | 2 +- .../wells/MultisegmentWellAssemble.cpp | 2 +- .../wells/MultisegmentWellAssemble.hpp | 2 +- .../wells/MultisegmentWellGeneric.hpp | 2 +- .../wells/MultisegmentWellPrimaryVariables.hpp | 2 +- opm/simulators/wells/ParallelWellInfo.hpp | 4 ++-- .../wells/RegionAttributeHelpers.hpp | 2 +- opm/simulators/wells/StandardWellAssemble.cpp | 2 +- opm/simulators/wells/StandardWellAssemble.hpp | 2 +- .../wells/StandardWellConnections.hpp | 2 +- opm/simulators/wells/StandardWellEquations.hpp | 2 +- opm/simulators/wells/StandardWellEval.hpp | 2 +- .../wells/StandardWellPrimaryVariables.hpp | 2 +- opm/simulators/wells/WGState.hpp | 2 +- opm/simulators/wells/WellAssemble.hpp | 2 +- opm/simulators/wells/WellBhpThpCalculator.hpp | 2 +- opm/simulators/wells/WellConstraints.hpp | 2 +- opm/simulators/wells/WellConvergence.hpp | 2 +- opm/simulators/wells/WellGroupConstraints.hpp | 2 +- opm/simulators/wells/WellGroupControls.hpp | 2 +- opm/simulators/wells/WellTest.hpp | 2 +- tests/models/test_tasklets.cpp | 2 +- tests/models/test_tasklets_failure.cpp | 2 +- tests/test_LogOutputHelper.cpp | 2 +- tests/test_openclSolver.cpp | 2 +- tests/test_tuning_XXXMBE.cpp | 4 ++-- tests/test_wellstate.cpp | 2 +- 145 files changed, 184 insertions(+), 181 deletions(-) diff --git a/examples/problems/co2injectionproblem.hh b/examples/problems/co2injectionproblem.hh index 46a9ed998..d2cc86c77 100644 --- a/examples/problems/co2injectionproblem.hh +++ b/examples/problems/co2injectionproblem.hh @@ -235,7 +235,7 @@ public: /*! * \copydoc Doxygen::defaultProblemConstructor */ - Co2InjectionProblem(Simulator& simulator) + explicit Co2InjectionProblem(Simulator& simulator) : ParentType(simulator) { } diff --git a/examples/problems/cuvetteproblem.hh b/examples/problems/cuvetteproblem.hh index b3af92b57..f23442a66 100644 --- a/examples/problems/cuvetteproblem.hh +++ b/examples/problems/cuvetteproblem.hh @@ -184,7 +184,7 @@ public: /*! * \copydoc Doxygen::defaultProblemConstructor */ - CuvetteProblem(Simulator& simulator) + explicit CuvetteProblem(Simulator& simulator) : ParentType(simulator) , eps_(1e-6) { } diff --git a/examples/problems/diffusionproblem.hh b/examples/problems/diffusionproblem.hh index 879a7152e..4a6f664ce 100644 --- a/examples/problems/diffusionproblem.hh +++ b/examples/problems/diffusionproblem.hh @@ -164,7 +164,7 @@ public: /*! * \copydoc Doxygen::defaultProblemConstructor */ - DiffusionProblem(Simulator& simulator) + explicit DiffusionProblem(Simulator& simulator) : ParentType(simulator) { } diff --git a/examples/problems/fingerproblem.hh b/examples/problems/fingerproblem.hh index f4b6acbb2..06acf4a7c 100644 --- a/examples/problems/fingerproblem.hh +++ b/examples/problems/fingerproblem.hh @@ -215,7 +215,7 @@ public: /*! * \copydoc Doxygen::defaultProblemConstructor */ - FingerProblem(Simulator& simulator) + explicit FingerProblem(Simulator& simulator) : ParentType(simulator), materialParams_( simulator.vanguard().grid(), codim ) { diff --git a/examples/problems/fractureproblem.hh b/examples/problems/fractureproblem.hh index e0f34907b..052bd0764 100644 --- a/examples/problems/fractureproblem.hh +++ b/examples/problems/fractureproblem.hh @@ -224,7 +224,7 @@ public: /*! * \copydoc Doxygen::defaultProblemConstructor */ - FractureProblem(Simulator& simulator) + explicit FractureProblem(Simulator& simulator) : ParentType(simulator) { } diff --git a/examples/problems/groundwaterproblem.hh b/examples/problems/groundwaterproblem.hh index 28cf81971..1b0e9383f 100644 --- a/examples/problems/groundwaterproblem.hh +++ b/examples/problems/groundwaterproblem.hh @@ -168,7 +168,7 @@ public: /*! * \copydoc Doxygen::defaultProblemConstructor */ - GroundWaterProblem(Simulator& simulator) + explicit GroundWaterProblem(Simulator& simulator) : ParentType(simulator) { } diff --git a/examples/problems/infiltrationproblem.hh b/examples/problems/infiltrationproblem.hh index cbae93e5a..0e7a454f9 100644 --- a/examples/problems/infiltrationproblem.hh +++ b/examples/problems/infiltrationproblem.hh @@ -166,7 +166,7 @@ public: /*! * \copydoc Doxygen::defaultProblemConstructor */ - InfiltrationProblem(Simulator& simulator) + explicit InfiltrationProblem(Simulator& simulator) : ParentType(simulator) , eps_(1e-6) { } diff --git a/examples/problems/lensproblem.hh b/examples/problems/lensproblem.hh index 542546e5c..33b4c97b7 100644 --- a/examples/problems/lensproblem.hh +++ b/examples/problems/lensproblem.hh @@ -217,7 +217,7 @@ public: /*! * \copydoc Doxygen::defaultProblemConstructor */ - LensProblem(Simulator& simulator) + explicit LensProblem(Simulator& simulator) : ParentType(simulator) { } diff --git a/examples/problems/obstacleproblem.hh b/examples/problems/obstacleproblem.hh index 306833f80..244e747eb 100644 --- a/examples/problems/obstacleproblem.hh +++ b/examples/problems/obstacleproblem.hh @@ -180,7 +180,7 @@ public: /*! * \copydoc Doxygen::defaultProblemConstructor */ - ObstacleProblem(Simulator& simulator) + explicit ObstacleProblem(Simulator& simulator) : ParentType(simulator) { } diff --git a/examples/problems/outflowproblem.hh b/examples/problems/outflowproblem.hh index 4e52b5365..6e5231256 100644 --- a/examples/problems/outflowproblem.hh +++ b/examples/problems/outflowproblem.hh @@ -129,7 +129,7 @@ public: /*! * \copydoc Doxygen::defaultProblemConstructor */ - OutflowProblem(Simulator& simulator) + explicit OutflowProblem(Simulator& simulator) : ParentType(simulator) , eps_(1e-6) { } diff --git a/examples/problems/powerinjectionproblem.hh b/examples/problems/powerinjectionproblem.hh index 1bda5db62..94e640db5 100644 --- a/examples/problems/powerinjectionproblem.hh +++ b/examples/problems/powerinjectionproblem.hh @@ -179,7 +179,7 @@ public: /*! * \copydoc Doxygen::defaultProblemConstructor */ - PowerInjectionProblem(Simulator& simulator) + explicit PowerInjectionProblem(Simulator& simulator) : ParentType(simulator) { } diff --git a/examples/problems/reservoirproblem.hh b/examples/problems/reservoirproblem.hh index 0f5fd9537..5eef62fb7 100644 --- a/examples/problems/reservoirproblem.hh +++ b/examples/problems/reservoirproblem.hh @@ -205,7 +205,7 @@ public: /*! * \copydoc Doxygen::defaultProblemConstructor */ - ReservoirProblem(Simulator& simulator) + explicit ReservoirProblem(Simulator& simulator) : ParentType(simulator) { } diff --git a/examples/problems/richardslensproblem.hh b/examples/problems/richardslensproblem.hh index 0e8b24e26..98adfac9d 100644 --- a/examples/problems/richardslensproblem.hh +++ b/examples/problems/richardslensproblem.hh @@ -162,7 +162,7 @@ public: /*! * \copydoc Doxygen::defaultProblemConstructor */ - RichardsLensProblem(Simulator& simulator) + explicit RichardsLensProblem(Simulator& simulator) : ParentType(simulator) , pnRef_(1e5) { diff --git a/examples/problems/waterairproblem.hh b/examples/problems/waterairproblem.hh index e675624a6..0626385f9 100644 --- a/examples/problems/waterairproblem.hh +++ b/examples/problems/waterairproblem.hh @@ -221,7 +221,7 @@ public: /*! * \copydoc Doxygen::defaultProblemConstructor */ - WaterAirProblem(Simulator& simulator) + explicit WaterAirProblem(Simulator& simulator) : ParentType(simulator) { } diff --git a/examples/tutorial1problem.hh b/examples/tutorial1problem.hh index f7e7a13a5..b26b824dc 100644 --- a/examples/tutorial1problem.hh +++ b/examples/tutorial1problem.hh @@ -164,7 +164,7 @@ class Tutorial1Problem public: //! The constructor of the problem. This only _allocates_ the memory required by the //! problem. The constructor is supposed to _never ever_ throw an exception. - Tutorial1Problem(Simulator& simulator) + explicit Tutorial1Problem(Simulator& simulator) : ParentType(simulator) , eps_(3e-6) { } diff --git a/flowexperimental/comp/EmptyModel.hpp b/flowexperimental/comp/EmptyModel.hpp index 9b772320c..827de7f7f 100644 --- a/flowexperimental/comp/EmptyModel.hpp +++ b/flowexperimental/comp/EmptyModel.hpp @@ -39,7 +39,7 @@ class EmptyModel : public BaseAuxiliaryModule public: using Simulator = GetPropType; - EmptyModel(Simulator& /*simulator*/) + explicit EmptyModel(Simulator& /*simulator*/) { } diff --git a/opm/models/blackoil/blackoilmodel.hh b/opm/models/blackoil/blackoilmodel.hh index c469ebcab..0f875f7aa 100644 --- a/opm/models/blackoil/blackoilmodel.hh +++ b/opm/models/blackoil/blackoilmodel.hh @@ -307,7 +307,7 @@ public: using LocalResidual = GetPropType; - BlackOilModel(Simulator& simulator) + explicit BlackOilModel(Simulator& simulator) : ParentType(simulator) { eqWeights_.resize(numEq, 1.0); diff --git a/opm/models/blackoil/blackoilnewtonmethod.hpp b/opm/models/blackoil/blackoilnewtonmethod.hpp index 125aedab0..cbbc1bdbd 100644 --- a/opm/models/blackoil/blackoilnewtonmethod.hpp +++ b/opm/models/blackoil/blackoilnewtonmethod.hpp @@ -71,7 +71,7 @@ class BlackOilNewtonMethod : public GetPropType(); public: - BlackOilNewtonMethod(Simulator& simulator) : ParentType(simulator) + explicit BlackOilNewtonMethod(Simulator& simulator) : ParentType(simulator) { bparams_.read(); } diff --git a/opm/models/blackoil/blackoilprimaryvariables.hh b/opm/models/blackoil/blackoilprimaryvariables.hh index ee3a4d047..d8c1324a3 100644 --- a/opm/models/blackoil/blackoilprimaryvariables.hh +++ b/opm/models/blackoil/blackoilprimaryvariables.hh @@ -166,7 +166,7 @@ public: /*! * \copydoc ImmisciblePrimaryVariables::ImmisciblePrimaryVariables(Scalar) */ - BlackOilPrimaryVariables(Scalar value) + explicit BlackOilPrimaryVariables(Scalar value) : ParentType(value) { Valgrind::SetUndefined(primaryVarsMeaningWater_); diff --git a/opm/models/blackoil/blackoilproblem.hh b/opm/models/blackoil/blackoilproblem.hh index e7cd3246b..88a9a8726 100644 --- a/opm/models/blackoil/blackoilproblem.hh +++ b/opm/models/blackoil/blackoilproblem.hh @@ -54,7 +54,7 @@ public: * * \param simulator The manager object of the simulation */ - BlackOilProblem(Simulator& simulator) + explicit BlackOilProblem(Simulator& simulator) : ParentType(simulator) {} diff --git a/opm/models/common/multiphasebasemodel.hh b/opm/models/common/multiphasebasemodel.hh index 885e96d1f..2764a0a8d 100644 --- a/opm/models/common/multiphasebasemodel.hh +++ b/opm/models/common/multiphasebasemodel.hh @@ -169,7 +169,7 @@ class MultiPhaseBaseModel : public GetPropType::type>::type; using ResultValueType = typename MathToolbox::ValueType; - TemperatureCallback(const ElementContext& elemCtx) + explicit TemperatureCallback(const ElementContext& elemCtx) : elemCtx_(elemCtx) {} @@ -92,7 +92,7 @@ public: using ResultType = typename std::remove_const::type>::type; using ResultValueType = typename MathToolbox::ValueType; - PressureCallback(const ElementContext& elemCtx) + explicit PressureCallback(const ElementContext& elemCtx) : elemCtx_(elemCtx) { Valgrind::SetUndefined(phaseIdx_); } @@ -203,7 +203,7 @@ public: using ResultType = typename std::remove_const::type>::type; using ResultValueType = typename MathToolbox::ValueType; - DensityCallback(const ElementContext& elemCtx) + explicit DensityCallback(const ElementContext& elemCtx) : elemCtx_(elemCtx) { Valgrind::SetUndefined(phaseIdx_); } @@ -251,7 +251,7 @@ public: using ResultType = decltype(std::declval().molarDensity(0)); using ResultValueType = typename MathToolbox::ValueType; - MolarDensityCallback(const ElementContext& elemCtx) + explicit MolarDensityCallback(const ElementContext& elemCtx) : elemCtx_(elemCtx) { Valgrind::SetUndefined(phaseIdx_); } @@ -300,7 +300,7 @@ public: using ResultType = typename std::remove_const::type>::type; using ResultValueType = typename MathToolbox::ValueType; - ViscosityCallback(const ElementContext& elemCtx) + explicit ViscosityCallback(const ElementContext& elemCtx) : elemCtx_(elemCtx) { Valgrind::SetUndefined(phaseIdx_); } @@ -352,7 +352,7 @@ public: using ResultFieldType = typename ResultType::field_type; using ResultFieldValueType = typename MathToolbox::ValueType; - VelocityCallback(const ElementContext& elemCtx) + explicit VelocityCallback(const ElementContext& elemCtx) : elemCtx_(elemCtx) {} @@ -384,7 +384,7 @@ public: using ResultType = typename std::remove_const::type>::type; using ResultValueType = typename MathToolbox::ValueType; - VelocityComponentCallback(const ElementContext& elemCtx) + explicit VelocityComponentCallback(const ElementContext& elemCtx) : elemCtx_(elemCtx) { Valgrind::SetUndefined(dimIdx_); } @@ -433,7 +433,7 @@ public: using ResultType = typename std::remove_const::type>::type; using ResultValueType = typename MathToolbox::ValueType; - MoleFractionCallback(const ElementContext& elemCtx) + explicit MoleFractionCallback(const ElementContext& elemCtx) : elemCtx_(elemCtx) { Valgrind::SetUndefined(phaseIdx_); diff --git a/opm/models/discretefracture/discretefracturemodel.hh b/opm/models/discretefracture/discretefracturemodel.hh index ac7bcc2eb..3505b6074 100644 --- a/opm/models/discretefracture/discretefracturemodel.hh +++ b/opm/models/discretefracture/discretefracturemodel.hh @@ -121,7 +121,7 @@ class DiscreteFractureModel : public ImmiscibleModel using Simulator = GetPropType; public: - DiscreteFractureModel(Simulator& simulator) + explicit DiscreteFractureModel(Simulator& simulator) : ParentType(simulator) { if (Parameters::Get()) { diff --git a/opm/models/discretefracture/discretefractureproblem.hh b/opm/models/discretefracture/discretefractureproblem.hh index f5bab0af0..57c2e9042 100644 --- a/opm/models/discretefracture/discretefractureproblem.hh +++ b/opm/models/discretefracture/discretefractureproblem.hh @@ -62,7 +62,7 @@ public: /*! * \copydoc Problem::FvBaseProblem(Simulator& ) */ - DiscreteFractureProblem(Simulator& simulator) + explicit DiscreteFractureProblem(Simulator& simulator) : ParentType(simulator) {} diff --git a/opm/models/discretization/common/fvbasediscretization.hh b/opm/models/discretization/common/fvbasediscretization.hh index cab111475..f718e09ca 100644 --- a/opm/models/discretization/common/fvbasediscretization.hh +++ b/opm/models/discretization/common/fvbasediscretization.hh @@ -389,7 +389,7 @@ public: // this constructor required to be explicitly specified because // we've defined a constructor above which deletes all implicitly // generated constructors in C++. - FvBaseDiscretization(Simulator& simulator) + explicit FvBaseDiscretization(Simulator& simulator) : simulator_(simulator) , gridView_(simulator.gridView()) , elementMapper_(gridView_, Dune::mcmgElementLayout()) @@ -1962,7 +1962,7 @@ public: } }; - FvBaseDiscretizationNoAdapt(Simulator& simulator) + explicit FvBaseDiscretizationNoAdapt(Simulator& simulator) : ParentType(simulator) { if (this->enableGridAdaptation_) { diff --git a/opm/models/discretization/common/fvbasediscretizationfemadapt.hh b/opm/models/discretization/common/fvbasediscretizationfemadapt.hh index 015c3a47e..a914afa80 100644 --- a/opm/models/discretization/common/fvbasediscretizationfemadapt.hh +++ b/opm/models/discretization/common/fvbasediscretizationfemadapt.hh @@ -101,7 +101,7 @@ public: } }; - FvBaseDiscretizationFemAdapt(Simulator& simulator) + explicit FvBaseDiscretizationFemAdapt(Simulator& simulator) : ParentType(simulator) , space_(simulator.vanguard().gridPart()) { diff --git a/opm/models/discretization/common/fvbasenewtonconvergencewriter.hh b/opm/models/discretization/common/fvbasenewtonconvergencewriter.hh index bdff9b075..557031617 100644 --- a/opm/models/discretization/common/fvbasenewtonconvergencewriter.hh +++ b/opm/models/discretization/common/fvbasenewtonconvergencewriter.hh @@ -69,7 +69,7 @@ class FvBaseNewtonConvergenceWriter using VtkMultiWriter = ::Opm::VtkMultiWriter; public: - FvBaseNewtonConvergenceWriter(NewtonMethod& nm) + explicit FvBaseNewtonConvergenceWriter(NewtonMethod& nm) : newtonMethod_(nm) { timeStepIdx_ = 0; diff --git a/opm/models/discretization/common/fvbasenewtonmethod.hh b/opm/models/discretization/common/fvbasenewtonmethod.hh index f02904dfc..6c3ab0ee1 100644 --- a/opm/models/discretization/common/fvbasenewtonmethod.hh +++ b/opm/models/discretization/common/fvbasenewtonmethod.hh @@ -96,7 +96,7 @@ class FvBaseNewtonMethod : public NewtonMethod public: - FvBaseNewtonMethod(Simulator& simulator) + explicit FvBaseNewtonMethod(Simulator& simulator) : ParentType(simulator) { } diff --git a/opm/models/discretization/common/fvbaseproblem.hh b/opm/models/discretization/common/fvbaseproblem.hh index 278c8e5fb..21667b4ca 100644 --- a/opm/models/discretization/common/fvbaseproblem.hh +++ b/opm/models/discretization/common/fvbaseproblem.hh @@ -114,7 +114,7 @@ public: * \param gridView The view on the DUNE grid which ought to be * used (normally the leaf grid view) */ - FvBaseProblem(Simulator& simulator) + explicit FvBaseProblem(Simulator& simulator) : nextTimeStepSize_(0.0) , gridView_(simulator.gridView()) , elementMapper_(gridView_, Dune::mcmgElementLayout()) diff --git a/opm/models/discretization/ecfv/ecfvdiscretization.hh b/opm/models/discretization/ecfv/ecfvdiscretization.hh index 89c511422..7f26d5d09 100644 --- a/opm/models/discretization/ecfv/ecfvdiscretization.hh +++ b/opm/models/discretization/ecfv/ecfvdiscretization.hh @@ -102,8 +102,8 @@ public: template struct DummySpaceEcfv { using DiscreteFunctionSpace = GetPropType; - DummySpaceEcfv(const DiscreteFunctionSpace&) {}; - DummySpaceEcfv(const int&) {}; + explicit DummySpaceEcfv(const DiscreteFunctionSpace&) {}; + explicit DummySpaceEcfv(const int&) {}; }; template @@ -154,7 +154,7 @@ class EcfvDiscretization : public GetPropType; public: - EcfvDiscretization(Simulator& simulator) + explicit EcfvDiscretization(Simulator& simulator) : ParentType(simulator) { } diff --git a/opm/models/discretization/ecfv/ecfvstencil.hh b/opm/models/discretization/ecfv/ecfvstencil.hh index a83cfd9e3..d100bd4b8 100644 --- a/opm/models/discretization/ecfv/ecfvstencil.hh +++ b/opm/models/discretization/ecfv/ecfvstencil.hh @@ -93,7 +93,7 @@ public: SubControlVolume() {} - SubControlVolume(const Element& element) + explicit SubControlVolume(const Element& element) : element_(element) { update(); } diff --git a/opm/models/discretization/vcfv/vcfvdiscretization.hh b/opm/models/discretization/vcfv/vcfvdiscretization.hh index 540bb3944..2395a5a95 100644 --- a/opm/models/discretization/vcfv/vcfvdiscretization.hh +++ b/opm/models/discretization/vcfv/vcfvdiscretization.hh @@ -114,8 +114,8 @@ public: template struct DummySpaceVcfv { using DiscreteFunctionSpace = GetPropType; - DummySpaceVcfv(const DiscreteFunctionSpace&) {}; - DummySpaceVcfv(const int&) {}; + explicit DummySpaceVcfv(const DiscreteFunctionSpace&) {}; + explicit DummySpaceVcfv(const int&) {}; }; template @@ -162,7 +162,7 @@ class VcfvDiscretization : public GetPropType; public: - FlashModel(Simulator& simulator) + explicit FlashModel(Simulator& simulator) : ParentType(simulator) {} diff --git a/opm/models/flash/flashratevector.hh b/opm/models/flash/flashratevector.hh index 5f027a411..90a9b9145 100644 --- a/opm/models/flash/flashratevector.hh +++ b/opm/models/flash/flashratevector.hh @@ -65,7 +65,7 @@ public: /*! * \copydoc ImmiscibleRateVector::ImmiscibleRateVector(Scalar) */ - FlashRateVector(const Evaluation& value) : ParentType(value) + explicit FlashRateVector(const Evaluation& value) : ParentType(value) {} /*! diff --git a/opm/models/immiscible/immisciblemodel.hh b/opm/models/immiscible/immisciblemodel.hh index 65349002c..a437af7d1 100644 --- a/opm/models/immiscible/immisciblemodel.hh +++ b/opm/models/immiscible/immisciblemodel.hh @@ -226,7 +226,7 @@ class ImmiscibleModel using EnergyModule = Opm::EnergyModule; public: - ImmiscibleModel(Simulator& simulator) + explicit ImmiscibleModel(Simulator& simulator) : ParentType(simulator) {} diff --git a/opm/models/immiscible/immiscibleratevector.hh b/opm/models/immiscible/immiscibleratevector.hh index dc3aafe8a..cb166933c 100644 --- a/opm/models/immiscible/immiscibleratevector.hh +++ b/opm/models/immiscible/immiscibleratevector.hh @@ -74,7 +74,7 @@ public: * * \param value The scalar value to which all entries of the vector will be set. */ - ImmiscibleRateVector(const Evaluation& value) + explicit ImmiscibleRateVector(const Evaluation& value) : ParentType(value) {} diff --git a/opm/models/io/basevanguard.hh b/opm/models/io/basevanguard.hh index d232be028..c0fbf8d99 100644 --- a/opm/models/io/basevanguard.hh +++ b/opm/models/io/basevanguard.hh @@ -57,7 +57,7 @@ class BaseVanguard #endif public: - BaseVanguard(Simulator& simulator) + explicit BaseVanguard(Simulator& simulator) : simulator_(simulator) {} diff --git a/opm/models/io/cubegridvanguard.hh b/opm/models/io/cubegridvanguard.hh index a60c214a8..ed0b99127 100644 --- a/opm/models/io/cubegridvanguard.hh +++ b/opm/models/io/cubegridvanguard.hh @@ -95,7 +95,7 @@ public: /*! * \brief Create the grid */ - CubeGridVanguard(Simulator& simulator) + explicit CubeGridVanguard(Simulator& simulator) : ParentType(simulator) { std::array cellRes; diff --git a/opm/models/io/dgfvanguard.hh b/opm/models/io/dgfvanguard.hh index b91726bdd..68a7a5ae7 100644 --- a/opm/models/io/dgfvanguard.hh +++ b/opm/models/io/dgfvanguard.hh @@ -72,7 +72,7 @@ public: /*! * \brief Load the grid from the file. */ - DgfVanguard(Simulator& simulator) + explicit DgfVanguard(Simulator& simulator) : ParentType(simulator) { const std::string dgfFileName = Parameters::Get(); diff --git a/opm/models/io/structuredgridvanguard.hh b/opm/models/io/structuredgridvanguard.hh index 519493b67..cb4257452 100644 --- a/opm/models/io/structuredgridvanguard.hh +++ b/opm/models/io/structuredgridvanguard.hh @@ -132,7 +132,7 @@ public: /*! * \brief Create the grid for the lens problem */ - StructuredGridVanguard(Simulator& simulator) + explicit StructuredGridVanguard(Simulator& simulator) : ParentType(simulator) { Dune::FieldVector cellRes; diff --git a/opm/models/io/vtkblackoilenergymodule.hpp b/opm/models/io/vtkblackoilenergymodule.hpp index 589584393..a0be58142 100644 --- a/opm/models/io/vtkblackoilenergymodule.hpp +++ b/opm/models/io/vtkblackoilenergymodule.hpp @@ -71,7 +71,7 @@ class VtkBlackOilEnergyModule : public BaseOutputModule using PhaseBuffer = typename ParentType::PhaseBuffer; public: - VtkBlackOilEnergyModule(const Simulator& simulator) + explicit VtkBlackOilEnergyModule(const Simulator& simulator) : ParentType(simulator) { if constexpr (enableEnergy) { diff --git a/opm/models/io/vtkblackoilmicpmodule.hpp b/opm/models/io/vtkblackoilmicpmodule.hpp index 6c862c5e9..26fbf3500 100644 --- a/opm/models/io/vtkblackoilmicpmodule.hpp +++ b/opm/models/io/vtkblackoilmicpmodule.hpp @@ -67,7 +67,7 @@ class VtkBlackOilMICPModule : public BaseOutputModule using ScalarBuffer = typename ParentType::ScalarBuffer; public: - VtkBlackOilMICPModule(const Simulator& simulator) + explicit VtkBlackOilMICPModule(const Simulator& simulator) : ParentType(simulator) { if constexpr (enableMICP) { diff --git a/opm/models/io/vtkblackoilmodule.hpp b/opm/models/io/vtkblackoilmodule.hpp index 4d23ff2f6..2ffd5cd16 100644 --- a/opm/models/io/vtkblackoilmodule.hpp +++ b/opm/models/io/vtkblackoilmodule.hpp @@ -75,7 +75,7 @@ class VtkBlackOilModule : public BaseOutputModule using ScalarBuffer = typename ParentType::ScalarBuffer; public: - VtkBlackOilModule(const Simulator& simulator) + explicit VtkBlackOilModule(const Simulator& simulator) : ParentType(simulator) { params_.read(); diff --git a/opm/models/io/vtkblackoilpolymermodule.hpp b/opm/models/io/vtkblackoilpolymermodule.hpp index ac6d9f43e..4e4007491 100644 --- a/opm/models/io/vtkblackoilpolymermodule.hpp +++ b/opm/models/io/vtkblackoilpolymermodule.hpp @@ -75,7 +75,7 @@ class VtkBlackOilPolymerModule : public BaseOutputModule using ScalarBuffer = typename ParentType::ScalarBuffer; public: - VtkBlackOilPolymerModule(const Simulator& simulator) + explicit VtkBlackOilPolymerModule(const Simulator& simulator) : ParentType(simulator) { if constexpr (enablePolymer) { diff --git a/opm/models/io/vtkblackoilsolventmodule.hpp b/opm/models/io/vtkblackoilsolventmodule.hpp index 0fdb69a7c..cdfa96f18 100644 --- a/opm/models/io/vtkblackoilsolventmodule.hpp +++ b/opm/models/io/vtkblackoilsolventmodule.hpp @@ -68,7 +68,7 @@ class VtkBlackOilSolventModule : public BaseOutputModule using ScalarBuffer = typename ParentType::ScalarBuffer; public: - VtkBlackOilSolventModule(const Simulator& simulator) + explicit VtkBlackOilSolventModule(const Simulator& simulator) : ParentType(simulator) { if constexpr (enableSolvent) { diff --git a/opm/models/io/vtkcompositionmodule.hpp b/opm/models/io/vtkcompositionmodule.hpp index 962bfdb7c..a3f00a1af 100644 --- a/opm/models/io/vtkcompositionmodule.hpp +++ b/opm/models/io/vtkcompositionmodule.hpp @@ -74,7 +74,7 @@ class VtkCompositionModule : public BaseOutputModule using PhaseComponentBuffer = typename ParentType::PhaseComponentBuffer; public: - VtkCompositionModule(const Simulator& simulator) + explicit VtkCompositionModule(const Simulator& simulator) : ParentType(simulator) { params_.read(); diff --git a/opm/models/io/vtkdiffusionmodule.hpp b/opm/models/io/vtkdiffusionmodule.hpp index 3d02fa069..0b8999705 100644 --- a/opm/models/io/vtkdiffusionmodule.hpp +++ b/opm/models/io/vtkdiffusionmodule.hpp @@ -75,7 +75,7 @@ class VtkDiffusionModule : public BaseOutputModule enum { numComponents = getPropValue() }; public: - VtkDiffusionModule(const Simulator& simulator) + explicit VtkDiffusionModule(const Simulator& simulator) : ParentType(simulator) { params_.read(); diff --git a/opm/models/io/vtkdiscretefracturemodule.hpp b/opm/models/io/vtkdiscretefracturemodule.hpp index 0a2718e9c..02bf28969 100644 --- a/opm/models/io/vtkdiscretefracturemodule.hpp +++ b/opm/models/io/vtkdiscretefracturemodule.hpp @@ -84,7 +84,7 @@ class VtkDiscreteFractureModule : public BaseOutputModule using PhaseVectorBuffer = typename ParentType::PhaseVectorBuffer; public: - VtkDiscreteFractureModule(const Simulator& simulator) + explicit VtkDiscreteFractureModule(const Simulator& simulator) : ParentType(simulator) { params_.read(); diff --git a/opm/models/io/vtkenergymodule.hpp b/opm/models/io/vtkenergymodule.hpp index 394d3af6b..866286c63 100644 --- a/opm/models/io/vtkenergymodule.hpp +++ b/opm/models/io/vtkenergymodule.hpp @@ -74,7 +74,7 @@ class VtkEnergyModule : public BaseOutputModule using VtkMultiWriter = Opm::VtkMultiWriter; public: - VtkEnergyModule(const Simulator& simulator) + explicit VtkEnergyModule(const Simulator& simulator) : ParentType(simulator) { params_.read(); diff --git a/opm/models/io/vtkmultiphasemodule.hpp b/opm/models/io/vtkmultiphasemodule.hpp index c8342ae04..fa43ca3f1 100644 --- a/opm/models/io/vtkmultiphasemodule.hpp +++ b/opm/models/io/vtkmultiphasemodule.hpp @@ -92,7 +92,7 @@ class VtkMultiPhaseModule : public BaseOutputModule using PhaseVectorBuffer = std::array; public: - VtkMultiPhaseModule(const Simulator& simulator) + explicit VtkMultiPhaseModule(const Simulator& simulator) : ParentType(simulator) { params_.read(); diff --git a/opm/models/io/vtkmultiwriter.hh b/opm/models/io/vtkmultiwriter.hh index edf79d1bd..e6fe724f2 100644 --- a/opm/models/io/vtkmultiwriter.hh +++ b/opm/models/io/vtkmultiwriter.hh @@ -67,7 +67,7 @@ class VtkMultiWriter : public BaseOutputWriter class WriteDataTasklet : public TaskletInterface { public: - WriteDataTasklet(VtkMultiWriter& multiWriter) + explicit WriteDataTasklet(VtkMultiWriter& multiWriter) : multiWriter_(multiWriter) { } diff --git a/opm/models/io/vtkphasepresencemodule.hpp b/opm/models/io/vtkphasepresencemodule.hpp index 2de0e4010..0b10b1b8a 100644 --- a/opm/models/io/vtkphasepresencemodule.hpp +++ b/opm/models/io/vtkphasepresencemodule.hpp @@ -60,7 +60,7 @@ class VtkPhasePresenceModule : public BaseOutputModule public: - VtkPhasePresenceModule(const Simulator& simulator) + explicit VtkPhasePresenceModule(const Simulator& simulator) : ParentType(simulator) { params_.read(); diff --git a/opm/models/io/vtkprimaryvarsmodule.hpp b/opm/models/io/vtkprimaryvarsmodule.hpp index 830e1300b..1e833813c 100644 --- a/opm/models/io/vtkprimaryvarsmodule.hpp +++ b/opm/models/io/vtkprimaryvarsmodule.hpp @@ -61,7 +61,7 @@ class VtkPrimaryVarsModule : public BaseOutputModule enum { numEq = getPropValue() }; public: - VtkPrimaryVarsModule(const Simulator& simulator) + explicit VtkPrimaryVarsModule(const Simulator& simulator) : ParentType(simulator) { params_.read(); diff --git a/opm/models/io/vtktemperaturemodule.hpp b/opm/models/io/vtktemperaturemodule.hpp index 34242a39e..3d1055a0d 100644 --- a/opm/models/io/vtktemperaturemodule.hpp +++ b/opm/models/io/vtktemperaturemodule.hpp @@ -63,7 +63,7 @@ class VtkTemperatureModule : public BaseOutputModule using VtkMultiWriter = ::Opm::VtkMultiWriter; public: - VtkTemperatureModule(const Simulator& simulator) + explicit VtkTemperatureModule(const Simulator& simulator) : ParentType(simulator) { params_.read(); diff --git a/opm/models/ncp/ncpmodel.hh b/opm/models/ncp/ncpmodel.hh index ec02ca373..a97be399e 100644 --- a/opm/models/ncp/ncpmodel.hh +++ b/opm/models/ncp/ncpmodel.hh @@ -250,7 +250,7 @@ class NcpModel using DiffusionModule = Opm::DiffusionModule; public: - NcpModel(Simulator& simulator) + explicit NcpModel(Simulator& simulator) : ParentType(simulator) {} diff --git a/opm/models/ncp/ncpnewtonmethod.hh b/opm/models/ncp/ncpnewtonmethod.hh index b21760c1f..b8fc36a3b 100644 --- a/opm/models/ncp/ncpnewtonmethod.hh +++ b/opm/models/ncp/ncpnewtonmethod.hh @@ -75,7 +75,7 @@ public: /*! * \copydoc FvBaseNewtonMethod::FvBaseNewtonMethod(Problem& ) */ - NcpNewtonMethod(Simulator& simulator) : ParentType(simulator) + explicit NcpNewtonMethod(Simulator& simulator) : ParentType(simulator) {} protected: diff --git a/opm/models/ncp/ncpratevector.hh b/opm/models/ncp/ncpratevector.hh index 5c1abdf12..62bbf5eea 100644 --- a/opm/models/ncp/ncpratevector.hh +++ b/opm/models/ncp/ncpratevector.hh @@ -71,7 +71,7 @@ public: /*! * \copydoc ImmiscibleRateVector::ImmiscibleRateVector(Scalar) */ - NcpRateVector(const Evaluation& value) + explicit NcpRateVector(const Evaluation& value) : ParentType(value) {} diff --git a/opm/models/nonlinear/newtonmethod.hh b/opm/models/nonlinear/newtonmethod.hh index aefaea00b..30086e82b 100644 --- a/opm/models/nonlinear/newtonmethod.hh +++ b/opm/models/nonlinear/newtonmethod.hh @@ -109,7 +109,7 @@ class NewtonMethod using CollectiveCommunication = typename Dune::Communication; public: - NewtonMethod(Simulator& simulator) + explicit NewtonMethod(Simulator& simulator) : simulator_(simulator) , endIterMsgStream_(std::ostringstream::out) , linearSolver_(simulator) diff --git a/opm/models/nonlinear/nullconvergencewriter.hh b/opm/models/nonlinear/nullconvergencewriter.hh index 9fce0d4eb..fb28d6647 100644 --- a/opm/models/nonlinear/nullconvergencewriter.hh +++ b/opm/models/nonlinear/nullconvergencewriter.hh @@ -55,7 +55,7 @@ class NullConvergenceWriter using GlobalEqVector = GetPropType; public: - NullConvergenceWriter(NewtonMethod&) + explicit NullConvergenceWriter(NewtonMethod&) {} /*! diff --git a/opm/models/parallel/mpibuffer.hh b/opm/models/parallel/mpibuffer.hh index 1725574f9..9eb7d9e6e 100644 --- a/opm/models/parallel/mpibuffer.hh +++ b/opm/models/parallel/mpibuffer.hh @@ -54,7 +54,7 @@ public: updateMpiDataSize_(); } - MpiBuffer(size_t size) + explicit MpiBuffer(size_t size) { data_ = new DataType[size]; dataSize_ = size; diff --git a/opm/models/parallel/tasklets.hpp b/opm/models/parallel/tasklets.hpp index 8a952a327..aa88827ab 100644 --- a/opm/models/parallel/tasklets.hpp +++ b/opm/models/parallel/tasklets.hpp @@ -43,7 +43,7 @@ namespace Opm { class TaskletInterface { public: - TaskletInterface(int refCount = 1) + explicit TaskletInterface(int refCount = 1) : referenceCount_(refCount) {} virtual ~TaskletInterface() {} @@ -92,7 +92,7 @@ class TaskletRunner class BarrierTasklet : public TaskletInterface { public: - BarrierTasklet(unsigned numWorkers); + explicit BarrierTasklet(unsigned numWorkers); void run(); @@ -128,7 +128,7 @@ public: * The number of worker threads may be 0. In this case, all work is done by the main * thread (synchronous mode). */ - TaskletRunner(unsigned numWorkers); + explicit TaskletRunner(unsigned numWorkers); /*! * \brief Destructor diff --git a/opm/models/parallel/threadedentityiterator.hh b/opm/models/parallel/threadedentityiterator.hh index e57f29180..f9af31ca8 100644 --- a/opm/models/parallel/threadedentityiterator.hh +++ b/opm/models/parallel/threadedentityiterator.hh @@ -44,7 +44,7 @@ class ThreadedEntityIterator using Entity = typename GridView::template Codim::Entity; using EntityIterator = typename GridView::template Codim::Iterator; public: - ThreadedEntityIterator(const GridView& gridView) + explicit ThreadedEntityIterator(const GridView& gridView) : sequentialIt_(gridView.template begin()) , sequentialEnd_(gridView.template end()) { } diff --git a/opm/models/ptflash/flashnewtonmethod.hh b/opm/models/ptflash/flashnewtonmethod.hh index 9682a4e6d..32500f38b 100644 --- a/opm/models/ptflash/flashnewtonmethod.hh +++ b/opm/models/ptflash/flashnewtonmethod.hh @@ -67,7 +67,7 @@ public: /*! * \copydoc FvBaseNewtonMethod::FvBaseNewtonMethod(Problem& ) */ - FlashNewtonMethod(Simulator& simulator) : ParentType(simulator) + explicit FlashNewtonMethod(Simulator& simulator) : ParentType(simulator) {} protected: diff --git a/opm/models/pvs/pvsmodel.hh b/opm/models/pvs/pvsmodel.hh index f5c600d76..8b93d9f20 100644 --- a/opm/models/pvs/pvsmodel.hh +++ b/opm/models/pvs/pvsmodel.hh @@ -285,7 +285,7 @@ class PvsModel using EnergyModule = Opm::EnergyModule; public: - PvsModel(Simulator& simulator) + explicit PvsModel(Simulator& simulator) : ParentType(simulator) { verbosity_ = Parameters::Get(); diff --git a/opm/models/pvs/pvsnewtonmethod.hh b/opm/models/pvs/pvsnewtonmethod.hh index 99ff25345..93b4cb2be 100644 --- a/opm/models/pvs/pvsnewtonmethod.hh +++ b/opm/models/pvs/pvsnewtonmethod.hh @@ -66,7 +66,7 @@ class PvsNewtonMethod : public GetPropType; public: - RichardsNewtonMethod(Simulator& simulator) : ParentType(simulator) + explicit RichardsNewtonMethod(Simulator& simulator) : ParentType(simulator) {} protected: diff --git a/opm/models/richards/richardsratevector.hh b/opm/models/richards/richardsratevector.hh index 22e80aade..5f52bcc47 100644 --- a/opm/models/richards/richardsratevector.hh +++ b/opm/models/richards/richardsratevector.hh @@ -69,7 +69,7 @@ public: /*! * \copydoc ImmiscibleRateVector::ImmiscibleRateVector(Scalar) */ - RichardsRateVector(const Evaluation& value) + explicit RichardsRateVector(const Evaluation& value) : ParentType(value) {} diff --git a/opm/models/utils/genericguard.hh b/opm/models/utils/genericguard.hh index 7e9e87983..ea1712667 100644 --- a/opm/models/utils/genericguard.hh +++ b/opm/models/utils/genericguard.hh @@ -42,7 +42,7 @@ template class GenericGuard { public: - GenericGuard(Callback& callback) + explicit GenericGuard(Callback& callback) : callback_(callback) , isEnabled_(true) { } diff --git a/opm/models/utils/simulator.hh b/opm/models/utils/simulator.hh index 2ebbce92b..1fb9852be 100644 --- a/opm/models/utils/simulator.hh +++ b/opm/models/utils/simulator.hh @@ -103,12 +103,12 @@ public: // do not allow to copy simulators around Simulator(const Simulator& ) = delete; - Simulator(bool verbose = true) + explicit Simulator(bool verbose = true) :Simulator(Communication(), verbose) { } - Simulator(Communication comm, bool verbose = true) + explicit Simulator(Communication comm, bool verbose = true) { TimerGuard setupTimerGuard(setupTimer_); diff --git a/opm/models/utils/timerguard.hh b/opm/models/utils/timerguard.hh index c2d89e13a..59c8106a2 100644 --- a/opm/models/utils/timerguard.hh +++ b/opm/models/utils/timerguard.hh @@ -40,7 +40,7 @@ namespace Opm { class TimerGuard { public: - TimerGuard(Timer& timer) + explicit TimerGuard(Timer& timer) : timer_(timer) { } diff --git a/opm/simulators/aquifers/AquiferGridUtils.hpp b/opm/simulators/aquifers/AquiferGridUtils.hpp index 52275c08e..7f3f78f3c 100644 --- a/opm/simulators/aquifers/AquiferGridUtils.hpp +++ b/opm/simulators/aquifers/AquiferGridUtils.hpp @@ -33,7 +33,7 @@ namespace Opm { template struct IsNumericalAquiferCell { - IsNumericalAquiferCell(const Grid&) + explicit IsNumericalAquiferCell(const Grid&) {} template @@ -42,7 +42,7 @@ struct IsNumericalAquiferCell { template<> struct IsNumericalAquiferCell { - IsNumericalAquiferCell(const Dune::CpGrid& grid) + explicit IsNumericalAquiferCell(const Dune::CpGrid& grid) : grid_(grid) {} diff --git a/opm/simulators/flow/AluGridVanguard.hpp b/opm/simulators/flow/AluGridVanguard.hpp index 52b01ab0a..d2f590da0 100644 --- a/opm/simulators/flow/AluGridVanguard.hpp +++ b/opm/simulators/flow/AluGridVanguard.hpp @@ -116,7 +116,7 @@ public: static constexpr int dimension = Grid::dimension; static constexpr int dimensionworld = Grid::dimensionworld; - AluGridVanguard(Simulator& simulator) + explicit AluGridVanguard(Simulator& simulator) : FlowBaseVanguard(simulator) { this->mpiRank = FlowGenericVanguard::comm().rank(); diff --git a/opm/simulators/flow/BaseAquiferModel.hpp b/opm/simulators/flow/BaseAquiferModel.hpp index ba32fe5d5..683e4170d 100644 --- a/opm/simulators/flow/BaseAquiferModel.hpp +++ b/opm/simulators/flow/BaseAquiferModel.hpp @@ -52,7 +52,7 @@ class BaseAquiferModel using RateVector = GetPropType; public: - BaseAquiferModel(Simulator& simulator) + explicit BaseAquiferModel(Simulator& simulator) : simulator_(simulator) {} diff --git a/opm/simulators/flow/BlackoilModelNldd.hpp b/opm/simulators/flow/BlackoilModelNldd.hpp index 1ee045655..ea00499cb 100644 --- a/opm/simulators/flow/BlackoilModelNldd.hpp +++ b/opm/simulators/flow/BlackoilModelNldd.hpp @@ -97,7 +97,7 @@ public: //! \param model BlackOil model to solve for //! \param param param Model parameters //! \param compNames Names of the solution components - BlackoilModelNldd(BlackoilModel& model) + explicit BlackoilModelNldd(BlackoilModel& model) : model_(model), rank_(model_.simulator().vanguard().grid().comm().rank()) { // Create partitions. diff --git a/opm/simulators/flow/CpGridVanguard.hpp b/opm/simulators/flow/CpGridVanguard.hpp index e56ce51c2..c147014c0 100644 --- a/opm/simulators/flow/CpGridVanguard.hpp +++ b/opm/simulators/flow/CpGridVanguard.hpp @@ -110,7 +110,7 @@ private: using Element = typename GridView::template Codim<0>::Entity; public: - CpGridVanguard(Simulator& simulator) + explicit CpGridVanguard(Simulator& simulator) : FlowBaseVanguard(simulator) { this->checkConsistency(); diff --git a/opm/simulators/flow/DamarisWriter.hpp b/opm/simulators/flow/DamarisWriter.hpp index 6b3eff833..44233b77d 100644 --- a/opm/simulators/flow/DamarisWriter.hpp +++ b/opm/simulators/flow/DamarisWriter.hpp @@ -111,7 +111,7 @@ public: // The Simulator object should preferably have been const - the // only reason that is not the case is due to the SummaryState // object owned deep down by the vanguard. - DamarisWriter(Simulator& simulator) + explicit DamarisWriter(Simulator& simulator) : BaseType(simulator.vanguard().schedule(), simulator.vanguard().eclState(), simulator.vanguard().summaryConfig(), diff --git a/opm/simulators/flow/EclWriter.hpp b/opm/simulators/flow/EclWriter.hpp index 45902db38..e74b90b1f 100644 --- a/opm/simulators/flow/EclWriter.hpp +++ b/opm/simulators/flow/EclWriter.hpp @@ -148,7 +148,7 @@ public: // The Simulator object should preferably have been const - the // only reason that is not the case is due to the SummaryState // object owned deep down by the vanguard. - EclWriter(Simulator& simulator) + explicit EclWriter(Simulator& simulator) : BaseType(simulator.vanguard().schedule(), simulator.vanguard().eclState(), simulator.vanguard().summaryConfig(), diff --git a/opm/simulators/flow/FIBlackoilModel.hpp b/opm/simulators/flow/FIBlackoilModel.hpp index 5c7c67be0..9d41aad07 100644 --- a/opm/simulators/flow/FIBlackoilModel.hpp +++ b/opm/simulators/flow/FIBlackoilModel.hpp @@ -70,7 +70,7 @@ class FIBlackOilModel : public BlackOilModel static constexpr bool gridIsUnchanging = std::is_same_v, Dune::CpGrid>; public: - FIBlackOilModel(Simulator& simulator) + explicit FIBlackOilModel(Simulator& simulator) : BlackOilModel(simulator) { if constexpr (gridIsUnchanging) { diff --git a/opm/simulators/flow/FlowBaseVanguard.hpp b/opm/simulators/flow/FlowBaseVanguard.hpp index 32a88a7f2..2339e1944 100644 --- a/opm/simulators/flow/FlowBaseVanguard.hpp +++ b/opm/simulators/flow/FlowBaseVanguard.hpp @@ -114,7 +114,7 @@ public: * This is the file format used by the commercial ECLiPSE simulator. Usually it uses * a cornerpoint description of the grid. */ - FlowBaseVanguard(Simulator& simulator) + explicit FlowBaseVanguard(Simulator& simulator) : ParentType(simulator) { #if HAVE_MPI diff --git a/opm/simulators/flow/FlowThresholdPressure.hpp b/opm/simulators/flow/FlowThresholdPressure.hpp index f974e17eb..8b3dd5594 100644 --- a/opm/simulators/flow/FlowThresholdPressure.hpp +++ b/opm/simulators/flow/FlowThresholdPressure.hpp @@ -70,7 +70,7 @@ class FlowThresholdPressure : public GenericThresholdPressure; - PolyhedralGridVanguard(Simulator& simulator) + explicit PolyhedralGridVanguard(Simulator& simulator) : FlowBaseVanguard(simulator) , simulator_(simulator) { diff --git a/opm/simulators/flow/TracerModel.hpp b/opm/simulators/flow/TracerModel.hpp index 497419a05..23bb2a16d 100644 --- a/opm/simulators/flow/TracerModel.hpp +++ b/opm/simulators/flow/TracerModel.hpp @@ -94,7 +94,7 @@ class TracerModel : public GenericTracerModel& ordering) + explicit RealReorderer(const std::vector& ordering) : ordering_(&ordering) {} virtual std::size_t operator[](std::size_t i) const diff --git a/opm/simulators/linalg/ParallelIstlInformation.hpp b/opm/simulators/linalg/ParallelIstlInformation.hpp index 2eb047fb2..44a02e460 100644 --- a/opm/simulators/linalg/ParallelIstlInformation.hpp +++ b/opm/simulators/linalg/ParallelIstlInformation.hpp @@ -53,7 +53,7 @@ public: /// \brief Constructs an empty parallel information object using a communicator. /// \param communicator The communicator to use. - ParallelISTLInformation(MPI_Comm communicator); + explicit ParallelISTLInformation(MPI_Comm communicator); /// \brief Constructs a parallel information object from the specified information. /// \param indexSet The parallel index set to use. @@ -234,7 +234,7 @@ private: typename std::remove_const::type >::type Result; - MaskToMinOperator(BinaryOperator b) + explicit MaskToMinOperator(BinaryOperator b) : b_(b) {} /// \brief Apply the underlying binary operator according to the mask. @@ -298,7 +298,7 @@ private: typename std::remove_reference::type >::type Result; - MaskToMaxOperator(BinaryOperator b) + explicit MaskToMaxOperator(BinaryOperator b) : b_(b) {} /// \brief Apply the underlying binary operator according to the mask. diff --git a/opm/simulators/linalg/ParallelOverlappingILU0.hpp b/opm/simulators/linalg/ParallelOverlappingILU0.hpp index 7c0714558..2ca1ca752 100644 --- a/opm/simulators/linalg/ParallelOverlappingILU0.hpp +++ b/opm/simulators/linalg/ParallelOverlappingILU0.hpp @@ -41,7 +41,7 @@ class ParallelOverlappingILU0Args : public Dune::Amg::DefaultSmootherArgs { public: - ParallelOverlappingILU0Args(MILU_VARIANT milu = MILU_VARIANT::ILU ) + explicit ParallelOverlappingILU0Args(MILU_VARIANT milu = MILU_VARIANT::ILU ) : milu_(milu), n_(0) {} void setMilu(MILU_VARIANT milu) diff --git a/opm/simulators/linalg/PreconditionerWithUpdate.hpp b/opm/simulators/linalg/PreconditionerWithUpdate.hpp index 9efa9532d..2c46af296 100644 --- a/opm/simulators/linalg/PreconditionerWithUpdate.hpp +++ b/opm/simulators/linalg/PreconditionerWithUpdate.hpp @@ -43,7 +43,7 @@ class DummyUpdatePreconditioner : public PreconditionerWithUpdate - DummyUpdatePreconditioner(Args&&... args) + explicit DummyUpdatePreconditioner(Args&&... args) : orig_precond_(std::forward(args)...) { } @@ -109,7 +109,7 @@ template struct PreconditionerMaker : public GeneralPreconditionerMaker { using GenericPreconditioner = Preconditioner; - PreconditionerMaker(Args&&... args) + explicit PreconditionerMaker(Args&&... args) : args_(args...) { } @@ -134,7 +134,7 @@ class RebuildOnUpdatePreconditioner : public PreconditionerWithUpdate - RebuildOnUpdatePreconditioner(Args... args) + explicit RebuildOnUpdatePreconditioner(Args... args) : preconditioner_maker_(std::make_unique>(std::forward(args)...)) { update(); diff --git a/opm/simulators/linalg/PropertyTree.hpp b/opm/simulators/linalg/PropertyTree.hpp index 238225310..3c32b2227 100644 --- a/opm/simulators/linalg/PropertyTree.hpp +++ b/opm/simulators/linalg/PropertyTree.hpp @@ -37,7 +37,7 @@ namespace Opm class PropertyTree { public: PropertyTree(); - PropertyTree(const std::string& jsonFile); + explicit PropertyTree(const std::string& jsonFile); PropertyTree(const PropertyTree& tree); ~PropertyTree(); diff --git a/opm/simulators/linalg/combinedcriterion.hh b/opm/simulators/linalg/combinedcriterion.hh index 09a6f06fe..75eb3e1bd 100644 --- a/opm/simulators/linalg/combinedcriterion.hh +++ b/opm/simulators/linalg/combinedcriterion.hh @@ -58,14 +58,14 @@ class CombinedCriterion : public ConvergenceCriterion using BlockType = typename Vector::block_type; public: - CombinedCriterion(const CollectiveCommunication& comm) + explicit CombinedCriterion(const CollectiveCommunication& comm) : comm_(comm) {} CombinedCriterion(const CollectiveCommunication& comm, - Scalar residualReductionTolerance, - Scalar absResidualTolerance = 0.0, - Scalar maxResidual = 0.0) + Scalar residualReductionTolerance, + Scalar absResidualTolerance = 0.0, + Scalar maxResidual = 0.0) : comm_(comm), residualReductionTolerance_(residualReductionTolerance), absResidualTolerance_(absResidualTolerance), diff --git a/opm/simulators/linalg/globalindices.hh b/opm/simulators/linalg/globalindices.hh index ea3ce881f..61fe0a89a 100644 --- a/opm/simulators/linalg/globalindices.hh +++ b/opm/simulators/linalg/globalindices.hh @@ -60,7 +60,7 @@ class GlobalIndices using DomesticToGlobalMap = std::map; public: - GlobalIndices(const ForeignOverlap& foreignOverlap) + explicit GlobalIndices(const ForeignOverlap& foreignOverlap) : foreignOverlap_(foreignOverlap) { myRank_ = 0; diff --git a/opm/simulators/linalg/gpuistl/GpuOwnerOverlapCopy.hpp b/opm/simulators/linalg/gpuistl/GpuOwnerOverlapCopy.hpp index fca80613a..fbebeb636 100644 --- a/opm/simulators/linalg/gpuistl/GpuOwnerOverlapCopy.hpp +++ b/opm/simulators/linalg/gpuistl/GpuOwnerOverlapCopy.hpp @@ -117,7 +117,7 @@ class GPUObliviousMPISender : public GPUSender; - GPUObliviousMPISender(const OwnerOverlapCopyCommunicationType& cpuOwnerOverlapCopy) + explicit GPUObliviousMPISender(const OwnerOverlapCopyCommunicationType& cpuOwnerOverlapCopy) : GPUSender(cpuOwnerOverlapCopy) { } @@ -172,7 +172,7 @@ class GPUAwareMPISender : public GPUSender; - GPUAwareMPISender(const OwnerOverlapCopyCommunicationType& cpuOwnerOverlapCopy) + explicit GPUAwareMPISender(const OwnerOverlapCopyCommunicationType& cpuOwnerOverlapCopy) : GPUSender(cpuOwnerOverlapCopy) { } @@ -385,7 +385,7 @@ class GpuOwnerOverlapCopy public: using X = GpuVector; - GpuOwnerOverlapCopy(std::shared_ptr> sender) : m_sender(sender){} + explicit GpuOwnerOverlapCopy(std::shared_ptr> sender) : m_sender(sender){} void copyOwnerToAll(const X& source, X& dest) const { m_sender->copyOwnerToAll(source, dest); diff --git a/opm/simulators/linalg/istlsparsematrixadapter.hh b/opm/simulators/linalg/istlsparsematrixadapter.hh index a2b8a44d0..360a14b6d 100644 --- a/opm/simulators/linalg/istlsparsematrixadapter.hh +++ b/opm/simulators/linalg/istlsparsematrixadapter.hh @@ -66,7 +66,7 @@ public: * \brief Constructor taking simulator and creating an empty matrix . */ template - IstlSparseMatrixAdapter(const Simulator& simulator) + explicit IstlSparseMatrixAdapter(const Simulator& simulator) : IstlSparseMatrixAdapter(simulator.model().numTotalDof(), simulator.model().numTotalDof()) {} diff --git a/opm/simulators/linalg/overlappingblockvector.hh b/opm/simulators/linalg/overlappingblockvector.hh index 8217da0f6..2ea89f82d 100644 --- a/opm/simulators/linalg/overlappingblockvector.hh +++ b/opm/simulators/linalg/overlappingblockvector.hh @@ -56,7 +56,7 @@ public: * \brief Given a domestic overlap object, create an overlapping * block vector coherent to it. */ - OverlappingBlockVector(const Overlap& overlap) + explicit OverlappingBlockVector(const Overlap& overlap) : ParentType(overlap.numDomestic()), overlap_(&overlap) { createBuffers_(); } diff --git a/opm/simulators/linalg/overlappingoperator.hh b/opm/simulators/linalg/overlappingoperator.hh index 93a3fa472..30ab11a08 100644 --- a/opm/simulators/linalg/overlappingoperator.hh +++ b/opm/simulators/linalg/overlappingoperator.hh @@ -47,7 +47,7 @@ public: using domain_type = DomainVector; using field_type = typename domain_type::field_type; - OverlappingOperator(const OverlappingMatrix& A) : A_(A) + explicit OverlappingOperator(const OverlappingMatrix& A) : A_(A) {} //! the kind of computations supported by the operator. Either overlapping or non-overlapping diff --git a/opm/simulators/linalg/overlappingscalarproduct.hh b/opm/simulators/linalg/overlappingscalarproduct.hh index 0b8469a3c..103893f41 100644 --- a/opm/simulators/linalg/overlappingscalarproduct.hh +++ b/opm/simulators/linalg/overlappingscalarproduct.hh @@ -50,7 +50,7 @@ public: Dune::SolverCategory::Category category() const override { return Dune::SolverCategory::overlapping; } - OverlappingScalarProduct(const Overlap& overlap) + explicit OverlappingScalarProduct(const Overlap& overlap) : overlap_(overlap), comm_( Dune::MPIHelper::getCommunication() ) {} diff --git a/opm/simulators/linalg/parallelamgbackend.hh b/opm/simulators/linalg/parallelamgbackend.hh index 17523090a..457e9731e 100644 --- a/opm/simulators/linalg/parallelamgbackend.hh +++ b/opm/simulators/linalg/parallelamgbackend.hh @@ -143,7 +143,7 @@ class ParallelAmgBackend : public ParallelBaseBackend "The ParallelAmgBackend linear solver backend requires the IstlSparseMatrixAdapter"); public: - ParallelAmgBackend(const Simulator& simulator) + explicit ParallelAmgBackend(const Simulator& simulator) : ParentType(simulator) { } diff --git a/opm/simulators/linalg/parallelbasebackend.hh b/opm/simulators/linalg/parallelbasebackend.hh index 606cfc295..52ede634d 100644 --- a/opm/simulators/linalg/parallelbasebackend.hh +++ b/opm/simulators/linalg/parallelbasebackend.hh @@ -134,7 +134,7 @@ protected: enum { dimWorld = GridView::dimensionworld }; public: - ParallelBaseBackend(const Simulator& simulator) + explicit ParallelBaseBackend(const Simulator& simulator) : simulator_(simulator) , gridSequenceNumber_( -1 ) , lastIterations_( -1 ) diff --git a/opm/simulators/linalg/parallelbicgstabbackend.hh b/opm/simulators/linalg/parallelbicgstabbackend.hh index 8b581990d..4d43f111d 100644 --- a/opm/simulators/linalg/parallelbicgstabbackend.hh +++ b/opm/simulators/linalg/parallelbicgstabbackend.hh @@ -112,7 +112,7 @@ class ParallelBiCGStabSolverBackend : public ParallelBaseBackend "The ParallelIstlSolverBackend linear solver backend requires the IstlSparseMatrixAdapter"); public: - ParallelBiCGStabSolverBackend(const Simulator& simulator) + explicit ParallelBiCGStabSolverBackend(const Simulator& simulator) : ParentType(simulator) { } diff --git a/opm/simulators/linalg/parallelistlbackend.hh b/opm/simulators/linalg/parallelistlbackend.hh index 314c3a1e9..52077b07e 100644 --- a/opm/simulators/linalg/parallelistlbackend.hh +++ b/opm/simulators/linalg/parallelistlbackend.hh @@ -99,7 +99,7 @@ class ParallelIstlSolverBackend : public ParallelBaseBackend "The ParallelIstlSolverBackend linear solver backend requires the IstlSparseMatrixAdapter"); public: - ParallelIstlSolverBackend(const Simulator& simulator) + explicit ParallelIstlSolverBackend(const Simulator& simulator) : ParentType(simulator) { } diff --git a/opm/simulators/linalg/residreductioncriterion.hh b/opm/simulators/linalg/residreductioncriterion.hh index 6d1875abc..65249be1c 100644 --- a/opm/simulators/linalg/residreductioncriterion.hh +++ b/opm/simulators/linalg/residreductioncriterion.hh @@ -53,7 +53,7 @@ class ResidReductionCriterion : public ConvergenceCriterion using Scalar = typename Vector::field_type; public: - ResidReductionCriterion(Dune::ScalarProduct& scalarProduct, + explicit ResidReductionCriterion(Dune::ScalarProduct& scalarProduct, Scalar tolerance = 1e-6) : scalarProduct_(scalarProduct), tolerance_(tolerance) {} diff --git a/opm/simulators/linalg/twolevelmethodcpr.hh b/opm/simulators/linalg/twolevelmethodcpr.hh index fbf8638ed..d689c5d2e 100644 --- a/opm/simulators/linalg/twolevelmethodcpr.hh +++ b/opm/simulators/linalg/twolevelmethodcpr.hh @@ -158,7 +158,7 @@ public: typedef C Criterion; typedef SequentialInformation ParallelInformation; - AggregationLevelTransferPolicyCpr(const Criterion& crit) + explicit AggregationLevelTransferPolicyCpr(const Criterion& crit) : criterion_(crit) {} diff --git a/opm/simulators/timestepping/AdaptiveTimeStepping.hpp b/opm/simulators/timestepping/AdaptiveTimeStepping.hpp index a90aefd8e..3c5fc805c 100644 --- a/opm/simulators/timestepping/AdaptiveTimeStepping.hpp +++ b/opm/simulators/timestepping/AdaptiveTimeStepping.hpp @@ -67,10 +67,12 @@ struct StepReport; namespace detail { void logTimer(const AdaptiveSimulatorTimer& substep_timer); + std::set consistentlyFailingWells(const std::vector& sr); void registerAdaptiveParameters(); + std::tuple, bool> - createController(const UnitSystem& unitSystem); + createController(const UnitSystem& unitSystem); } template @@ -82,8 +84,9 @@ private: class SolutionTimeErrorSolverWrapper : public RelativeChangeInterface { public: - SolutionTimeErrorSolverWrapper(const Solver& solver); + explicit SolutionTimeErrorSolverWrapper(const Solver& solver); double relativeChange() const; + private: const Solver& solver_; }; diff --git a/opm/simulators/timestepping/TimeStepControl.cpp b/opm/simulators/timestepping/TimeStepControl.cpp index c88dd433c..30aa2bc62 100644 --- a/opm/simulators/timestepping/TimeStepControl.cpp +++ b/opm/simulators/timestepping/TimeStepControl.cpp @@ -245,7 +245,7 @@ namespace Opm PIDAndIterationCountTimeStepControl PIDAndIterationCountTimeStepControl::serializationTestObject() { - return {1, 2.0, 3.0, 4.0, 5.0, true}; + return PIDAndIterationCountTimeStepControl{1, 2.0, 3.0, 4.0, 5.0, true}; } double PIDAndIterationCountTimeStepControl:: diff --git a/opm/simulators/timestepping/TimeStepControl.hpp b/opm/simulators/timestepping/TimeStepControl.hpp index 78e9e82b5..4f50c78ab 100644 --- a/opm/simulators/timestepping/TimeStepControl.hpp +++ b/opm/simulators/timestepping/TimeStepControl.hpp @@ -101,8 +101,8 @@ namespace Opm /// \param tol tolerance for the relative changes of the numerical solution to be accepted /// in one time step (default is 1e-3) /// \param verbose if true get some output (default = false) - PIDTimeStepControl( const double tol = 1e-3, - const bool verbose = false ); + explicit PIDTimeStepControl(const double tol = 1e-3, + const bool verbose = false); static PIDTimeStepControl serializationTestObject(); @@ -143,12 +143,12 @@ namespace Opm /// \param tol tolerance for the relative changes of the numerical solution to be accepted /// in one time step (default is 1e-3) /// \param verbose if true get some output (default = false) - PIDAndIterationCountTimeStepControl( const int target_iterations = 20, - const double decayDampingFactor = 1.0, - const double growthDampingFactor = 1.0/1.2, - const double tol = 1e-3, - const double minTimeStepBasedOnIterations = 0., - const bool verbose = false); + explicit PIDAndIterationCountTimeStepControl(const int target_iterations = 20, + const double decayDampingFactor = 1.0, + const double growthDampingFactor = 1.0/1.2, + const double tol = 1e-3, + const double minTimeStepBasedOnIterations = 0., + const bool verbose = false); static PIDAndIterationCountTimeStepControl serializationTestObject(); @@ -191,7 +191,7 @@ namespace Opm /// \brief constructor /// \param filename filename contaning the timesteps - explicit HardcodedTimeStepControl( const std::string& filename); + explicit HardcodedTimeStepControl(const std::string& filename); static HardcodedTimeStepControl serializationTestObject(); diff --git a/opm/simulators/utils/MPIPacker.hpp b/opm/simulators/utils/MPIPacker.hpp index 25e91bdb8..63c381a1b 100644 --- a/opm/simulators/utils/MPIPacker.hpp +++ b/opm/simulators/utils/MPIPacker.hpp @@ -192,7 +192,7 @@ struct Packer { //! \brief Constructor. //! \param comm The communicator to use - Packer(Parallel::Communication comm) + explicit Packer(Parallel::Communication comm) : m_comm(comm) {} diff --git a/opm/simulators/utils/MPISerializer.hpp b/opm/simulators/utils/MPISerializer.hpp index 1a12f07dd..07aa9e1f1 100644 --- a/opm/simulators/utils/MPISerializer.hpp +++ b/opm/simulators/utils/MPISerializer.hpp @@ -30,7 +30,7 @@ namespace Opm::Parallel { //! \brief Class for serializing and broadcasting data using MPI. class MpiSerializer : public Serializer { public: - MpiSerializer(Parallel::Communication comm) + explicit MpiSerializer(Parallel::Communication comm) : Serializer(m_packer) , m_packer(comm) , m_comm(comm) diff --git a/opm/simulators/utils/ParallelEclipseState.hpp b/opm/simulators/utils/ParallelEclipseState.hpp index ab82251d6..95c05a1f9 100644 --- a/opm/simulators/utils/ParallelEclipseState.hpp +++ b/opm/simulators/utils/ParallelEclipseState.hpp @@ -48,7 +48,7 @@ public: //! \brief Constructor. //! \param manager The field property manager to wrap. - ParallelFieldPropsManager(FieldPropsManager& manager); + explicit ParallelFieldPropsManager(FieldPropsManager& manager); //! \brief Constructor. //! \param manager The field property manager to wrap. diff --git a/opm/simulators/wells/BlackoilWellModel.hpp b/opm/simulators/wells/BlackoilWellModel.hpp index 8ba10a1e9..2f957ed91 100644 --- a/opm/simulators/wells/BlackoilWellModel.hpp +++ b/opm/simulators/wells/BlackoilWellModel.hpp @@ -134,7 +134,7 @@ template class WellContributions; using Domain = SubDomain; - BlackoilWellModel(Simulator& simulator); + explicit BlackoilWellModel(Simulator& simulator); void init(); void initWellContainer(const int reportStepIdx) override; diff --git a/opm/simulators/wells/BlackoilWellModelConstraints.hpp b/opm/simulators/wells/BlackoilWellModelConstraints.hpp index 420e1fc97..a6c5c4237 100644 --- a/opm/simulators/wells/BlackoilWellModelConstraints.hpp +++ b/opm/simulators/wells/BlackoilWellModelConstraints.hpp @@ -41,7 +41,7 @@ class BlackoilWellModelConstraints { public: //! \brief Constructor initializes reference to the well model. - BlackoilWellModelConstraints(const BlackoilWellModelGeneric& wellModel) + explicit BlackoilWellModelConstraints(const BlackoilWellModelGeneric& wellModel) : wellModel_(wellModel) {} diff --git a/opm/simulators/wells/BlackoilWellModelGuideRates.hpp b/opm/simulators/wells/BlackoilWellModelGuideRates.hpp index 32e1ba031..33530464f 100644 --- a/opm/simulators/wells/BlackoilWellModelGuideRates.hpp +++ b/opm/simulators/wells/BlackoilWellModelGuideRates.hpp @@ -46,7 +46,7 @@ class BlackoilWellModelGuideRates { public: //! \brief Constructor initializes reference to the well model. - BlackoilWellModelGuideRates(const BlackoilWellModelGeneric& wellModel) + explicit BlackoilWellModelGuideRates(const BlackoilWellModelGeneric& wellModel) : wellModel_(wellModel) {} diff --git a/opm/simulators/wells/BlackoilWellModelRestart.hpp b/opm/simulators/wells/BlackoilWellModelRestart.hpp index d78c925bd..990e09f59 100644 --- a/opm/simulators/wells/BlackoilWellModelRestart.hpp +++ b/opm/simulators/wells/BlackoilWellModelRestart.hpp @@ -49,7 +49,7 @@ class BlackoilWellModelRestart { public: //! \brief Constructor initializes reference to the well model. - BlackoilWellModelRestart(const BlackoilWellModelGeneric& wellModel) + explicit BlackoilWellModelRestart(const BlackoilWellModelGeneric& wellModel) : wellModel_(wellModel) {} diff --git a/opm/simulators/wells/BlackoilWellModelWBP.hpp b/opm/simulators/wells/BlackoilWellModelWBP.hpp index fae790fb5..423136d66 100644 --- a/opm/simulators/wells/BlackoilWellModelWBP.hpp +++ b/opm/simulators/wells/BlackoilWellModelWBP.hpp @@ -41,7 +41,7 @@ template class BlackoilWellModelWBP { public: - BlackoilWellModelWBP(BlackoilWellModelGeneric& well_model); + explicit BlackoilWellModelWBP(BlackoilWellModelGeneric& well_model); void initializeSources(typename ParallelWBPCalculation::GlobalToLocal index, typename ParallelWBPCalculation::Evaluator eval); diff --git a/opm/simulators/wells/GasLiftSingleWellGeneric.hpp b/opm/simulators/wells/GasLiftSingleWellGeneric.hpp index 6034eb34f..8ffc6182d 100644 --- a/opm/simulators/wells/GasLiftSingleWellGeneric.hpp +++ b/opm/simulators/wells/GasLiftSingleWellGeneric.hpp @@ -158,7 +158,7 @@ protected: // This copy constructor cannot be defined inline here since LimitedRates // has not been defined yet (it is defined below). Instead it is defined in // in the .cpp file - BasicRates(const LimitedRates& rates); + explicit BasicRates(const LimitedRates& rates); Scalar operator[](Rate rate_type) const { diff --git a/opm/simulators/wells/MultisegmentWellAssemble.cpp b/opm/simulators/wells/MultisegmentWellAssemble.cpp index d199aeebe..82ba31d7b 100644 --- a/opm/simulators/wells/MultisegmentWellAssemble.cpp +++ b/opm/simulators/wells/MultisegmentWellAssemble.cpp @@ -46,7 +46,7 @@ template class MultisegmentWellEquationAccess { public: //! \brief Constructor initializes reference to the equation system. - MultisegmentWellEquationAccess(MultisegmentWellEquations& eqns) + explicit MultisegmentWellEquationAccess(MultisegmentWellEquations& eqns) : eqns_(eqns) {} diff --git a/opm/simulators/wells/MultisegmentWellAssemble.hpp b/opm/simulators/wells/MultisegmentWellAssemble.hpp index 4fc94128c..4b38c86c6 100644 --- a/opm/simulators/wells/MultisegmentWellAssemble.hpp +++ b/opm/simulators/wells/MultisegmentWellAssemble.hpp @@ -57,7 +57,7 @@ public: using EvalWell = DenseAd::Evaluation; //! \brief Constructor initializes reference to well. - MultisegmentWellAssemble(const WellInterfaceIndices& well) + explicit MultisegmentWellAssemble(const WellInterfaceIndices& well) : well_(well) {} diff --git a/opm/simulators/wells/MultisegmentWellGeneric.hpp b/opm/simulators/wells/MultisegmentWellGeneric.hpp index bb66f0a8c..d594ec6e8 100644 --- a/opm/simulators/wells/MultisegmentWellGeneric.hpp +++ b/opm/simulators/wells/MultisegmentWellGeneric.hpp @@ -52,7 +52,7 @@ public: int numberOfSegments() const; protected: - MultisegmentWellGeneric(WellInterfaceGeneric& baseif); + explicit MultisegmentWellGeneric(WellInterfaceGeneric& baseif); // scale the segment rates and pressure based on well rates and bhp void scaleSegmentRatesWithWellRates(const std::vector>& segment_inlets, diff --git a/opm/simulators/wells/MultisegmentWellPrimaryVariables.hpp b/opm/simulators/wells/MultisegmentWellPrimaryVariables.hpp index 8f5cbb017..3dd05a61c 100644 --- a/opm/simulators/wells/MultisegmentWellPrimaryVariables.hpp +++ b/opm/simulators/wells/MultisegmentWellPrimaryVariables.hpp @@ -74,7 +74,7 @@ public: using Equations = MultisegmentWellEquations; using BVectorWell = typename Equations::BVectorWell; - MultisegmentWellPrimaryVariables(const WellInterfaceIndices& well) + explicit MultisegmentWellPrimaryVariables(const WellInterfaceIndices& well) : well_(well) {} diff --git a/opm/simulators/wells/ParallelWellInfo.hpp b/opm/simulators/wells/ParallelWellInfo.hpp index 8262d930c..04bdeacda 100644 --- a/opm/simulators/wells/ParallelWellInfo.hpp +++ b/opm/simulators/wells/ParallelWellInfo.hpp @@ -197,8 +197,8 @@ public: static constexpr int INVALID_ECL_INDEX = -1; /// \brief Constructs object using MPI_COMM_SELF - ParallelWellInfo(const std::string& name = {""}, - bool hasLocalCells = true); + explicit ParallelWellInfo(const std::string& name = {""}, + bool hasLocalCells = true); /// \brief Constructs object with communication between all rank sharing /// a well diff --git a/opm/simulators/wells/RegionAttributeHelpers.hpp b/opm/simulators/wells/RegionAttributeHelpers.hpp index ac676135c..3745ee90a 100644 --- a/opm/simulators/wells/RegionAttributeHelpers.hpp +++ b/opm/simulators/wells/RegionAttributeHelpers.hpp @@ -148,7 +148,7 @@ namespace Opm { * representative cell. */ struct Value { - Value(const Attributes& attr) + explicit Value(const Attributes& attr) : attr_(attr) , cell_(-1) {} diff --git a/opm/simulators/wells/StandardWellAssemble.cpp b/opm/simulators/wells/StandardWellAssemble.cpp index bf1d1273e..f53e9df46 100644 --- a/opm/simulators/wells/StandardWellAssemble.cpp +++ b/opm/simulators/wells/StandardWellAssemble.cpp @@ -45,7 +45,7 @@ template class StandardWellEquationAccess { public: //! \brief Constructor initializes reference to the equation system. - StandardWellEquationAccess(StandardWellEquations& eqns) + explicit StandardWellEquationAccess(StandardWellEquations& eqns) : eqns_(eqns) {} diff --git a/opm/simulators/wells/StandardWellAssemble.hpp b/opm/simulators/wells/StandardWellAssemble.hpp index 41c166363..32dc31687 100644 --- a/opm/simulators/wells/StandardWellAssemble.hpp +++ b/opm/simulators/wells/StandardWellAssemble.hpp @@ -47,7 +47,7 @@ public: using EvalWell = typename PrimaryVariables::EvalWell; //! \brief Constructor initializes reference to well. - StandardWellAssemble(const WellInterfaceFluidSystem& well) + explicit StandardWellAssemble(const WellInterfaceFluidSystem& well) : well_(well) {} diff --git a/opm/simulators/wells/StandardWellConnections.hpp b/opm/simulators/wells/StandardWellConnections.hpp index 774ebc6d0..56016732f 100644 --- a/opm/simulators/wells/StandardWellConnections.hpp +++ b/opm/simulators/wells/StandardWellConnections.hpp @@ -45,7 +45,7 @@ class StandardWellConnections { public: using Scalar = typename FluidSystem::Scalar; - StandardWellConnections(const WellInterfaceIndices& well); + explicit StandardWellConnections(const WellInterfaceIndices& well); struct Properties { diff --git a/opm/simulators/wells/StandardWellEquations.hpp b/opm/simulators/wells/StandardWellEquations.hpp index 4075d282a..40fcce165 100644 --- a/opm/simulators/wells/StandardWellEquations.hpp +++ b/opm/simulators/wells/StandardWellEquations.hpp @@ -65,7 +65,7 @@ public: // block vector type using BVector = Dune::BlockVector>; - StandardWellEquations(const ParallelWellInfo& parallel_well_info); + explicit StandardWellEquations(const ParallelWellInfo& parallel_well_info); //! \brief Setup sparsity pattern for the matrices. //! \param numWellEq Number of well equations diff --git a/opm/simulators/wells/StandardWellEval.hpp b/opm/simulators/wells/StandardWellEval.hpp index f8967a9f9..f4bc35c71 100644 --- a/opm/simulators/wells/StandardWellEval.hpp +++ b/opm/simulators/wells/StandardWellEval.hpp @@ -68,7 +68,7 @@ public: { return linSys_; } protected: - StandardWellEval(const WellInterfaceIndices& baseif); + explicit StandardWellEval(const WellInterfaceIndices& baseif); const WellInterfaceIndices& baseif_; diff --git a/opm/simulators/wells/StandardWellPrimaryVariables.hpp b/opm/simulators/wells/StandardWellPrimaryVariables.hpp index b381cd5e0..f482af12e 100644 --- a/opm/simulators/wells/StandardWellPrimaryVariables.hpp +++ b/opm/simulators/wells/StandardWellPrimaryVariables.hpp @@ -88,7 +88,7 @@ public: using BVectorWell = typename StandardWellEquations::BVectorWell; //! \brief Constructor initializes reference to well interface. - StandardWellPrimaryVariables(const WellInterfaceIndices& well) + explicit StandardWellPrimaryVariables(const WellInterfaceIndices& well) : well_(well) {} diff --git a/opm/simulators/wells/WGState.hpp b/opm/simulators/wells/WGState.hpp index 6846dba99..a50e4cbaa 100644 --- a/opm/simulators/wells/WGState.hpp +++ b/opm/simulators/wells/WGState.hpp @@ -39,7 +39,7 @@ struct PhaseUsage; template struct WGState { - WGState(const PhaseUsage& pu); + explicit WGState(const PhaseUsage& pu); static WGState serializationTestObject(const ParallelWellInfo& pinfo); diff --git a/opm/simulators/wells/WellAssemble.hpp b/opm/simulators/wells/WellAssemble.hpp index e4df1c152..095a56b45 100644 --- a/opm/simulators/wells/WellAssemble.hpp +++ b/opm/simulators/wells/WellAssemble.hpp @@ -52,7 +52,7 @@ class WellAssemble { using Scalar = typename FluidSystem::Scalar; public: - WellAssemble(const WellInterfaceFluidSystem& well); + explicit WellAssemble(const WellInterfaceFluidSystem& well); template void assembleControlEqProd(const WellState& well_state, diff --git a/opm/simulators/wells/WellBhpThpCalculator.hpp b/opm/simulators/wells/WellBhpThpCalculator.hpp index 4ece9168a..f6a3c5934 100644 --- a/opm/simulators/wells/WellBhpThpCalculator.hpp +++ b/opm/simulators/wells/WellBhpThpCalculator.hpp @@ -41,7 +41,7 @@ template class WellBhpThpCalculator { public: //! \brief Constructor sets reference to well. - WellBhpThpCalculator(const WellInterfaceGeneric& well) : well_(well) {} + explicit WellBhpThpCalculator(const WellInterfaceGeneric& well) : well_(well) {} //! \brief Checks if well has THP constraints. bool wellHasTHPConstraints(const SummaryState& summaryState) const; diff --git a/opm/simulators/wells/WellConstraints.hpp b/opm/simulators/wells/WellConstraints.hpp index 056a67b32..ae6991a35 100644 --- a/opm/simulators/wells/WellConstraints.hpp +++ b/opm/simulators/wells/WellConstraints.hpp @@ -47,7 +47,7 @@ template class WellConstraints { public: //! \brief Constructor sets reference to well. - WellConstraints(const WellInterfaceGeneric& well) : well_(well) {} + explicit WellConstraints(const WellInterfaceGeneric& well) : well_(well) {} using RateConvFunc = std::function&, diff --git a/opm/simulators/wells/WellConvergence.hpp b/opm/simulators/wells/WellConvergence.hpp index 13fb744c9..0f9fc5a76 100644 --- a/opm/simulators/wells/WellConvergence.hpp +++ b/opm/simulators/wells/WellConvergence.hpp @@ -37,7 +37,7 @@ template class WellConvergence { public: - WellConvergence(const WellInterfaceGeneric& well) + explicit WellConvergence(const WellInterfaceGeneric& well) : well_(well) {} diff --git a/opm/simulators/wells/WellGroupConstraints.hpp b/opm/simulators/wells/WellGroupConstraints.hpp index 122757cac..dd26162f2 100644 --- a/opm/simulators/wells/WellGroupConstraints.hpp +++ b/opm/simulators/wells/WellGroupConstraints.hpp @@ -48,7 +48,7 @@ template class WellGroupConstraints { public: //! \brief Constructor sets reference to well. - WellGroupConstraints(const WellInterfaceGeneric& well) : well_(well) {} + explicit WellGroupConstraints(const WellInterfaceGeneric& well) : well_(well) {} using RateConvFunc = std::function class WellGroupControls { public: //! \brief Constructor sets reference to well. - WellGroupControls(const WellInterfaceGeneric& well) : well_(well) {} + explicit WellGroupControls(const WellInterfaceGeneric& well) : well_(well) {} using RateConvFunc = std::function&, std::vector&)>; diff --git a/opm/simulators/wells/WellTest.hpp b/opm/simulators/wells/WellTest.hpp index 38933c0c0..644fd390c 100644 --- a/opm/simulators/wells/WellTest.hpp +++ b/opm/simulators/wells/WellTest.hpp @@ -42,7 +42,7 @@ template class WellTest { public: //! \brief Constructor sets reference to well. - WellTest(const WellInterfaceGeneric& well) : well_(well) {} + explicit WellTest(const WellInterfaceGeneric& well) : well_(well) {} void updateWellTestStateEconomic(const SingleWellState& ws, const double simulation_time, diff --git a/tests/models/test_tasklets.cpp b/tests/models/test_tasklets.cpp index 838f7fccc..6127940fa 100644 --- a/tests/models/test_tasklets.cpp +++ b/tests/models/test_tasklets.cpp @@ -42,7 +42,7 @@ std::unique_ptr runner{}; class SleepTasklet : public Opm::TaskletInterface { public: - SleepTasklet(int mseconds) + explicit SleepTasklet(int mseconds) : mseconds_(mseconds) { n_ = numInstantiated_; diff --git a/tests/models/test_tasklets_failure.cpp b/tests/models/test_tasklets_failure.cpp index b41e95906..2ce0c31be 100644 --- a/tests/models/test_tasklets_failure.cpp +++ b/tests/models/test_tasklets_failure.cpp @@ -70,7 +70,7 @@ private: class FailingSleepTasklet : public Opm::TaskletInterface { public: - FailingSleepTasklet(int mseconds) + explicit FailingSleepTasklet(int mseconds) : mseconds_(mseconds) {} void run() override diff --git a/tests/test_LogOutputHelper.cpp b/tests/test_LogOutputHelper.cpp index 87611bcad..d5f8d31ce 100644 --- a/tests/test_LogOutputHelper.cpp +++ b/tests/test_LogOutputHelper.cpp @@ -106,7 +106,7 @@ END { LogFixture() : LogFixture { deck() } {} - LogFixture(const Opm::Deck& deck) + explicit LogFixture(const Opm::Deck& deck) : eclState { deck } , schedule { deck, eclState } { diff --git a/tests/test_openclSolver.cpp b/tests/test_openclSolver.cpp index 608963e03..99050fa63 100644 --- a/tests/test_openclSolver.cpp +++ b/tests/test_openclSolver.cpp @@ -39,7 +39,7 @@ class PlatformInitException : public std::logic_error { public: - PlatformInitException(std::string msg) : logic_error(msg){}; + explicit PlatformInitException(const std::string& msg) : logic_error(msg){}; }; template diff --git a/tests/test_tuning_XXXMBE.cpp b/tests/test_tuning_XXXMBE.cpp index 9a0b2eb92..7ed633db7 100644 --- a/tests/test_tuning_XXXMBE.cpp +++ b/tests/test_tuning_XXXMBE.cpp @@ -11,7 +11,7 @@ #include struct Column : public std::vector { - Column(const std::string& name_, const int size = 0, const int num_rows_estimate = 1000) : + explicit Column(const std::string& name_, const int size = 0, const int num_rows_estimate = 1000) : std::vector(size), name(name_) { this->reserve(num_rows_estimate); @@ -60,7 +60,7 @@ struct Column : public std::vector { struct ColumnData { - ColumnData(const std::string& file_name, const int num_columns_estimate=20) { + explicit ColumnData(const std::string& file_name, const int num_columns_estimate=20) { raw_columns.reserve(num_columns_estimate); load_file(file_name); } diff --git a/tests/test_wellstate.cpp b/tests/test_wellstate.cpp index fefd6d8ca..9787d2e9f 100644 --- a/tests/test_wellstate.cpp +++ b/tests/test_wellstate.cpp @@ -171,7 +171,7 @@ namespace { for (const auto& well : wells) { - *pw = {well.name()}; + *pw = Opm::ParallelWellInfo{well.name()}; ppinfos.push_back(std::ref(*pw)); pw->communicateFirstPerforation(true); ++pw;