diff --git a/BaseLib/Histogram.h b/BaseLib/Histogram.h index 4a6159f1495101518e86a8b6e3705d9549185a9a..9a7bdea1704246dcde186294f1a48a66234423cf 100644 --- a/BaseLib/Histogram.h +++ b/BaseLib/Histogram.h @@ -61,8 +61,8 @@ public: * \param computeHistogram Compute histogram if set. If not set user must call * \c update() before accessing data. */ - Histogram(std::vector<T> data, const unsigned int nr_bins = 16, - const bool computeHistogram = true) + explicit Histogram(std::vector<T> data, const unsigned int nr_bins = 16, + const bool computeHistogram = true) : _data(std::move(data)), _nr_bins(nr_bins) { init(computeHistogram); diff --git a/GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.h b/GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.h index b02b118cc2e6e7ebf818d9fdaf64c2dd37c98ddc..775e51ec8fbfefac6bf1e3b9fa2e12a8d65a600a 100644 --- a/GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.h +++ b/GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.h @@ -35,7 +35,7 @@ namespace IO class BoostXmlGmlInterface : public BaseLib::IO::XMLInterface { public: - BoostXmlGmlInterface(GeoLib::GEOObjects& geo_objs); + explicit BoostXmlGmlInterface(GeoLib::GEOObjects& geo_objs); ~BoostXmlGmlInterface() override = default; /// Reads an xml-file containing OGS geometry diff --git a/GeoLib/MinimalBoundingSphere.h b/GeoLib/MinimalBoundingSphere.h index adb9b6e5836d4a97ca4a0b24e4d65660e489dc77..2973dd5a5fbcad80fe0821035fb5e81d87886a21 100644 --- a/GeoLib/MinimalBoundingSphere.h +++ b/GeoLib/MinimalBoundingSphere.h @@ -30,7 +30,9 @@ class MinimalBoundingSphere { public: /// Point-Sphere - MinimalBoundingSphere(MathLib::Point3d const& p, double radius = std::numeric_limits<double>::epsilon()); + explicit MinimalBoundingSphere( + MathLib::Point3d const& p, + double radius = std::numeric_limits<double>::epsilon()); /// Bounding sphere using two points MinimalBoundingSphere(MathLib::Point3d const& p, MathLib::Point3d const& q); /// Bounding sphere using three points @@ -42,7 +44,8 @@ public: MathLib::Point3d const& r, MathLib::Point3d const& s); /// Bounding sphere of n points - MinimalBoundingSphere(std::vector<MathLib::Point3d*> const& points); + explicit MinimalBoundingSphere( + std::vector<MathLib::Point3d*> const& points); /// Returns the center point of the sphere MathLib::Point3d getCenter() const { return MathLib::Point3d(_center); } diff --git a/GeoLib/Point.h b/GeoLib/Point.h index f8af4d5f3ad221b5ece622a37fd16c5a1fa93e95..4e0160ac77f7a8aade02761db68de99779973a14 100644 --- a/GeoLib/Point.h +++ b/GeoLib/Point.h @@ -46,9 +46,9 @@ public: MathLib::Point3dWithID(x, id), GeoLib::GeoObject() {} - Point(std::array<double,3> const& x, - std::size_t id = std::numeric_limits<std::size_t>::max()) : - MathLib::Point3dWithID(x, id), GeoLib::GeoObject() + explicit Point(std::array<double, 3> const& x, + std::size_t id = std::numeric_limits<std::size_t>::max()) + : MathLib::Point3dWithID(x, id), GeoLib::GeoObject() {} /// return a geometry type diff --git a/GeoLib/Polygon.h b/GeoLib/Polygon.h index 9729480fb8d48073845c283b466b6833ff73eba4..930ec7b900863786b04c26d196928946f9615259 100644 --- a/GeoLib/Polygon.h +++ b/GeoLib/Polygon.h @@ -49,7 +49,7 @@ public: * @param ply closed Polyline * @param init if true, check if polyline is closed, calculate bounding box */ - Polygon(const Polyline &ply, bool init = true); + explicit Polygon(const Polyline& ply, bool init = true); Polygon(Polygon const& other); Polygon& operator=(Polygon const& rhs) = delete; diff --git a/GeoLib/Polyline.h b/GeoLib/Polyline.h index a37a258a61506c535098a0902733d0b110d05679..8373e14fc0c2170c41ffd72c1098552e7a83f15b 100644 --- a/GeoLib/Polyline.h +++ b/GeoLib/Polyline.h @@ -93,7 +93,7 @@ public: /** constructor * \param pnt_vec a reference to the point vector */ - Polyline(const std::vector<Point*>& pnt_vec); + explicit Polyline(const std::vector<Point*>& pnt_vec); /** * Copy constructor * @param ply Polyline diff --git a/GeoLib/SensorData.h b/GeoLib/SensorData.h index 4c4bec67999b89fe56cdbf6910351934c38e156f..0ca95fa8c0bb2906c9c1fbcbc70421750afb863f 100644 --- a/GeoLib/SensorData.h +++ b/GeoLib/SensorData.h @@ -62,10 +62,10 @@ class SensorData { public: /// Constructor using file name (automatically reads the file and fills all data structures) - SensorData(const std::string &file_name); + explicit SensorData(const std::string& file_name); /// Constructor using a time step vector valid for all time series that will be added later - SensorData(std::vector<std::size_t> time_steps); + explicit SensorData(std::vector<std::size_t> time_steps); /// Constructor using time step bounds for all time series that will be added later SensorData(std::size_t first_timestep, std::size_t last_timestep, std::size_t step_size); diff --git a/GeoLib/Station.h b/GeoLib/Station.h index 1f50b59723ebf1d33e03145ed47d0f6b4ac5dfa0..0e0eca668d5588d971e084cc180b01edf7be3aaa 100644 --- a/GeoLib/Station.h +++ b/GeoLib/Station.h @@ -52,12 +52,12 @@ public: * \param z The z-coordinate of the station. * \param name The name of the station. */ - Station(double x = 0.0, - double y = 0.0, - double z = 0.0, - std::string name = ""); + explicit Station(double x = 0.0, + double y = 0.0, + double z = 0.0, + std::string name = ""); - Station(Point* coords, std::string name = ""); + explicit Station(Point* coords, std::string name = ""); /** * Constructor copies the source object diff --git a/GeoLib/StationBorehole.h b/GeoLib/StationBorehole.h index e8861b01f6cfd7aabc5a7ee27f4c23590bbcbc18..506acbbe59ee61e01502f75f891778f3c8a32533 100644 --- a/GeoLib/StationBorehole.h +++ b/GeoLib/StationBorehole.h @@ -32,7 +32,10 @@ class StationBorehole : public Station { public: /** constructor initialises the borehole with the given coordinates */ - StationBorehole(double x = 0.0, double y = 0.0, double z = 0.0, const std::string &name = ""); + explicit StationBorehole(double x = 0.0, + double y = 0.0, + double z = 0.0, + const std::string& name = ""); ~StationBorehole(void) override; /// Creates a StationBorehole-object from a string (assuming the string has the right format) diff --git a/MaterialLib/PorousMedium/UnsaturatedProperty/CapillaryPressure/CapillaryPressureSaturationCurve.h b/MaterialLib/PorousMedium/UnsaturatedProperty/CapillaryPressure/CapillaryPressureSaturationCurve.h index 7362a2b4e423fd02c9a7f10163141815e7868be5..88f7e9455abf8a6661ba7e055efa87cae17bf485 100644 --- a/MaterialLib/PorousMedium/UnsaturatedProperty/CapillaryPressure/CapillaryPressureSaturationCurve.h +++ b/MaterialLib/PorousMedium/UnsaturatedProperty/CapillaryPressure/CapillaryPressureSaturationCurve.h @@ -27,7 +27,7 @@ class CapillaryPressureSaturationCurve final : public CapillaryPressureSaturation { public: - CapillaryPressureSaturationCurve( + explicit CapillaryPressureSaturationCurve( std::unique_ptr<MathLib::PiecewiseLinearMonotonicCurve>&& curve_data) : CapillaryPressureSaturation( curve_data->getSupportMin(), diff --git a/MaterialLib/PorousMedium/UnsaturatedProperty/RelativePermeability/RelativePermeabilityCurve.h b/MaterialLib/PorousMedium/UnsaturatedProperty/RelativePermeability/RelativePermeabilityCurve.h index d4676428ef43584cb2f439d8fd958c100a972cc5..7edb0e8017e61d8933993477653a9f975a028faf 100644 --- a/MaterialLib/PorousMedium/UnsaturatedProperty/RelativePermeability/RelativePermeabilityCurve.h +++ b/MaterialLib/PorousMedium/UnsaturatedProperty/RelativePermeability/RelativePermeabilityCurve.h @@ -25,7 +25,7 @@ namespace PorousMedium class RelativePermeabilityCurve final : public RelativePermeability { public: - RelativePermeabilityCurve( + explicit RelativePermeabilityCurve( std::unique_ptr<MathLib::PiecewiseLinearInterpolation>&& curve_data) : RelativePermeability(curve_data->getSupportMin(), curve_data->getSupportMax()), diff --git a/MathLib/ODE/ConcreteODESolver.h b/MathLib/ODE/ConcreteODESolver.h index 09ddd4935c7b9b6962cae8559923e91fa0240aa6..29db9127fee739dc97531a937cf2b362aa838326 100644 --- a/MathLib/ODE/ConcreteODESolver.h +++ b/MathLib/ODE/ConcreteODESolver.h @@ -104,7 +104,7 @@ public: private: //! Instances of this class shall only be constructed by createODESolver(). - ConcreteODESolver(BaseLib::ConfigTree const& config) + explicit ConcreteODESolver(BaseLib::ConfigTree const& config) : Implementation{config, NumEquations} { } diff --git a/MathLib/Point3dWithID.h b/MathLib/Point3dWithID.h index 87f8fe8a99eb3da226bb7dddd84a8a496d977291..cca3e48c0a7643da9b94e1955e5d0580c3da9fa3 100644 --- a/MathLib/Point3dWithID.h +++ b/MathLib/Point3dWithID.h @@ -40,7 +40,8 @@ public: /// the provided id. /// @param coords coordinates of the point /// @param id the id of the object [default: max of std::size_t] - Point3dWithID(std::array<double,3> const& coords, + explicit Point3dWithID( + std::array<double, 3> const& coords, std::size_t id = std::numeric_limits<std::size_t>::max()) : Point3d(coords), _id(id) {} diff --git a/MeshGeoToolsLib/HeuristicSearchLength.h b/MeshGeoToolsLib/HeuristicSearchLength.h index 34af6a5ca07edf753a443fa0b38648318979998e..d16dc653a9801b384b193d1454f86ae61cd7bfaf 100644 --- a/MeshGeoToolsLib/HeuristicSearchLength.h +++ b/MeshGeoToolsLib/HeuristicSearchLength.h @@ -41,8 +41,8 @@ public: * @param mesh mesh object * @param length_type length type to be sampled */ - HeuristicSearchLength(MeshLib::Mesh const& mesh, - LengthType length_type = LengthType::Edge); + explicit HeuristicSearchLength(MeshLib::Mesh const& mesh, + LengthType length_type = LengthType::Edge); private: MeshLib::Mesh const& _mesh; diff --git a/MeshLib/Elements/TemplateElement.h b/MeshLib/Elements/TemplateElement.h index ef7d53d33f8404747ea330e12247f175371b3c50..3505a95e15153c76f08f1938deb8b7741f550960 100644 --- a/MeshLib/Elements/TemplateElement.h +++ b/MeshLib/Elements/TemplateElement.h @@ -46,7 +46,9 @@ public: * @param nodes an array of pointers of mesh nodes which form this element * @param id element id */ - TemplateElement(Node* nodes[n_all_nodes], std::size_t id = std::numeric_limits<std::size_t>::max()); + explicit TemplateElement( + Node* nodes[n_all_nodes], + std::size_t id = std::numeric_limits<std::size_t>::max()); /** * Constructor with an array of mesh nodes @@ -54,7 +56,9 @@ public: * @param nodes an array of pointers of mesh nodes which form this element * @param id element id */ - TemplateElement(std::array<Node*, n_all_nodes> const& nodes, std::size_t id = std::numeric_limits<std::size_t>::max()); + explicit TemplateElement( + std::array<Node*, n_all_nodes> const& nodes, + std::size_t id = std::numeric_limits<std::size_t>::max()); /// Copy constructor TemplateElement(const TemplateElement &e); diff --git a/MeshLib/IO/VtkIO/VtuInterface.h b/MeshLib/IO/VtkIO/VtuInterface.h index cc3c6debdc0934b3de99f3c7101adf5df687cbe4..c21776ee1e3764a6c5a2b86a0def4c911d0b93d0 100644 --- a/MeshLib/IO/VtkIO/VtuInterface.h +++ b/MeshLib/IO/VtkIO/VtuInterface.h @@ -37,7 +37,9 @@ class VtuInterface final { public: /// Provide the mesh to write and set if compression should be used. - VtuInterface(const MeshLib::Mesh* mesh, int dataMode = vtkXMLWriter::Binary, bool compressed = false); + explicit VtuInterface(const MeshLib::Mesh* mesh, + int dataMode = vtkXMLWriter::Binary, + bool compressed = false); /// Read an unstructured grid from a VTU file /// \return The converted mesh or a nullptr if reading failed diff --git a/MeshLib/MeshEditing/MeshRevision.h b/MeshLib/MeshEditing/MeshRevision.h index adcaa308d6536b3b632ae8cf47293b62c172c8a3..e2d6267399d1494dc7737adc7da15428615f64ec 100644 --- a/MeshLib/MeshEditing/MeshRevision.h +++ b/MeshLib/MeshEditing/MeshRevision.h @@ -39,7 +39,7 @@ public: * Constructor * @param mesh The mesh which is being revised. Note that node IDs in mesh are changed during computation but are resetted after the algorithms implemented here are finished */ - MeshRevision(MeshLib::Mesh &mesh); + explicit MeshRevision(MeshLib::Mesh& mesh); virtual ~MeshRevision() = default; diff --git a/MeshLib/MeshQuality/AngleSkewMetric.h b/MeshLib/MeshQuality/AngleSkewMetric.h index cbf721f3f3991ef2411156ad3a1d91bba7ad7ecb..4fe5b43d7f151d72c246708373e729286b05c82d 100644 --- a/MeshLib/MeshQuality/AngleSkewMetric.h +++ b/MeshLib/MeshQuality/AngleSkewMetric.h @@ -25,7 +25,7 @@ namespace MeshLib class AngleSkewMetric final : public ElementQualityMetric { public: - AngleSkewMetric(Mesh const& mesh); + explicit AngleSkewMetric(Mesh const& mesh); void calculateQuality() override; diff --git a/MeshLib/MeshQuality/EdgeRatioMetric.h b/MeshLib/MeshQuality/EdgeRatioMetric.h index 6ef677f5a8800de6bfd89d5c8598bf77dbdc2e1f..84dbfb08ed49e96100eb124473362d7149cb8166 100644 --- a/MeshLib/MeshQuality/EdgeRatioMetric.h +++ b/MeshLib/MeshQuality/EdgeRatioMetric.h @@ -26,7 +26,7 @@ namespace MeshLib class EdgeRatioMetric : public ElementQualityMetric { public: - EdgeRatioMetric(Mesh const& mesh); + explicit EdgeRatioMetric(Mesh const& mesh); ~EdgeRatioMetric() override = default; void calculateQuality() override; diff --git a/MeshLib/MeshQuality/ElementQualityMetric.h b/MeshLib/MeshQuality/ElementQualityMetric.h index 88d62720291d3811f5a9f08cf88f5c2ce1f390f1..de83ac683d8fdf3ac18ca144ecc80dba0f5c894e 100644 --- a/MeshLib/MeshQuality/ElementQualityMetric.h +++ b/MeshLib/MeshQuality/ElementQualityMetric.h @@ -32,7 +32,7 @@ namespace MeshLib class ElementQualityMetric { public: - ElementQualityMetric(Mesh const& mesh); + explicit ElementQualityMetric(Mesh const& mesh); virtual ~ElementQualityMetric() = default; diff --git a/MeshLib/MeshQuality/ElementSizeMetric.h b/MeshLib/MeshQuality/ElementSizeMetric.h index 87730d76ad359f416201a0a7d56792a2d9edb9d1..2277f41d12bd6a34cc0be780c79b475093ce9557 100644 --- a/MeshLib/MeshQuality/ElementSizeMetric.h +++ b/MeshLib/MeshQuality/ElementSizeMetric.h @@ -25,7 +25,7 @@ namespace MeshLib class ElementSizeMetric : public ElementQualityMetric { public: - ElementSizeMetric(Mesh const& mesh); + explicit ElementSizeMetric(Mesh const& mesh); ~ElementSizeMetric() override = default; void calculateQuality() override; diff --git a/MeshLib/MeshQuality/MeshValidation.h b/MeshLib/MeshQuality/MeshValidation.h index ce7ccea4c3c1eb6d940a06894afc7f4ec2dd10f9..9a0717d7fda535373c69441c950cc080b592a2bb 100644 --- a/MeshLib/MeshQuality/MeshValidation.h +++ b/MeshLib/MeshQuality/MeshValidation.h @@ -32,7 +32,7 @@ class MeshValidation public: /// Constructor /// \warning This might change the mesh when removing unused mesh nodes. - MeshValidation(MeshLib::Mesh &mesh); + explicit MeshValidation(MeshLib::Mesh& mesh); ~MeshValidation() = default; /** diff --git a/MeshLib/MeshQuality/RadiusEdgeRatioMetric.h b/MeshLib/MeshQuality/RadiusEdgeRatioMetric.h index 67a96afb40163e29d6107e1b4b9b1014a590eb46..8a91a84273b36790d314a130f821d2e32cee47e9 100644 --- a/MeshLib/MeshQuality/RadiusEdgeRatioMetric.h +++ b/MeshLib/MeshQuality/RadiusEdgeRatioMetric.h @@ -26,7 +26,7 @@ namespace MeshLib class RadiusEdgeRatioMetric : public ElementQualityMetric { public: - RadiusEdgeRatioMetric(Mesh const& mesh); + explicit RadiusEdgeRatioMetric(Mesh const& mesh); ~RadiusEdgeRatioMetric() override = default; void calculateQuality() override; diff --git a/MeshLib/MeshQuality/SizeDifferenceMetric.h b/MeshLib/MeshQuality/SizeDifferenceMetric.h index f05754b9bb9a3c7f140254f4d50af72cc9b0270a..f6af7c9a7b5337464f05a96588d436e2dfc29220 100644 --- a/MeshLib/MeshQuality/SizeDifferenceMetric.h +++ b/MeshLib/MeshQuality/SizeDifferenceMetric.h @@ -26,7 +26,7 @@ namespace MeshLib class SizeDifferenceMetric : public ElementQualityMetric { public: - SizeDifferenceMetric(Mesh const& mesh); + explicit SizeDifferenceMetric(Mesh const& mesh); ~SizeDifferenceMetric() override = default; void calculateQuality() override; diff --git a/MeshLib/Node.h b/MeshLib/Node.h index e3470fff3f2d4c0a39479487a64519b4a076a8d3..657aba03a802931c80855f9f4cd504d59e040d3b 100644 --- a/MeshLib/Node.h +++ b/MeshLib/Node.h @@ -44,10 +44,12 @@ class Node : public MathLib::Point3dWithID public: /// Constructor using a coordinate array - Node(const double coords[3], std::size_t id = std::numeric_limits<std::size_t>::max()); + explicit Node(const double coords[3], + std::size_t id = std::numeric_limits<std::size_t>::max()); /// Constructor using a coordinate array - Node(std::array<double, 3> const& coords, std::size_t id = std::numeric_limits<std::size_t>::max()); + explicit Node(std::array<double, 3> const& coords, + std::size_t id = std::numeric_limits<std::size_t>::max()); /// Constructor using single coordinates Node(double x, double y, double z, std::size_t id = std::numeric_limits<std::size_t>::max()); diff --git a/NumLib/Fem/FiniteElement/TemplateIsoparametric.h b/NumLib/Fem/FiniteElement/TemplateIsoparametric.h index 9a09121fc05b43f4d21711015bf9a1d2021e3eb7..cdbe4fd08a5c05cc652b1231c4911b8954219ffd 100644 --- a/NumLib/Fem/FiniteElement/TemplateIsoparametric.h +++ b/NumLib/Fem/FiniteElement/TemplateIsoparametric.h @@ -55,7 +55,7 @@ public: * * @param e Mesh element object */ - TemplateIsoparametric(const MeshElementType& e) : _ele(&e) {} + explicit TemplateIsoparametric(const MeshElementType& e) : _ele(&e) {} ~TemplateIsoparametric() = default; /// return current mesh element diff --git a/NumLib/Function/TemplateSpatialFunction.h b/NumLib/Function/TemplateSpatialFunction.h index f645ace89e37a494ad7e46274a4676993278d964..6535669311b7a6fe52d15644d5f5102a383f7796 100644 --- a/NumLib/Function/TemplateSpatialFunction.h +++ b/NumLib/Function/TemplateSpatialFunction.h @@ -32,7 +32,7 @@ public: * Constructor * @param f a function object */ - TemplateSpatialFunction(T_FUNCTION f) : _f(std::move(f)) {} + explicit TemplateSpatialFunction(T_FUNCTION f) : _f(std::move(f)) {} /** * evaluate a function * @param pnt a point object diff --git a/NumLib/NamedFunctionCaller.h b/NumLib/NamedFunctionCaller.h index 365b1907a373a68141597ec30e994d4fc7f4d9c3..6c98637c2bf377cfd9cb44f338579d0cf6f14535 100644 --- a/NumLib/NamedFunctionCaller.h +++ b/NumLib/NamedFunctionCaller.h @@ -22,7 +22,7 @@ class NamedFunctionCaller final { public: //! Constructs an instance whose unbound arguments have the given names. - explicit NamedFunctionCaller( + NamedFunctionCaller( std::initializer_list<std::string> unbound_argument_names); //! Adds the given named function diff --git a/NumLib/ODESolver/ConvergenceCriterion.h b/NumLib/ODESolver/ConvergenceCriterion.h index a60f0a2f446266db6000120a06ce9a20455692f0..2f139d7ddf56e52ac33a8d5e3ad384d9a6da9030 100644 --- a/NumLib/ODESolver/ConvergenceCriterion.h +++ b/NumLib/ODESolver/ConvergenceCriterion.h @@ -28,7 +28,7 @@ namespace NumLib class ConvergenceCriterion { public: - ConvergenceCriterion(const MathLib::VecNormType norm_type) + explicit ConvergenceCriterion(const MathLib::VecNormType norm_type) : _norm_type(norm_type) { } diff --git a/NumLib/ODESolver/ConvergenceCriterionPerComponent.h b/NumLib/ODESolver/ConvergenceCriterionPerComponent.h index 59f2bfb681a739d9b33ae98e3f2619698bb4aa9c..6bc194c42c4da7d8d7bed1a920695ecdae5b2e37 100644 --- a/NumLib/ODESolver/ConvergenceCriterionPerComponent.h +++ b/NumLib/ODESolver/ConvergenceCriterionPerComponent.h @@ -28,7 +28,8 @@ class LocalToGlobalIndexMap; class ConvergenceCriterionPerComponent : public ConvergenceCriterion { public: - ConvergenceCriterionPerComponent(const MathLib::VecNormType norm_type) + explicit ConvergenceCriterionPerComponent( + const MathLib::VecNormType norm_type) : ConvergenceCriterion(norm_type) { } diff --git a/NumLib/ODESolver/MatrixTranslator.h b/NumLib/ODESolver/MatrixTranslator.h index b82b508e5a6641311465c05758c30bbd348de5dd..9e30705e864d87b0fe89bed38bb47e0179f01ba1 100644 --- a/NumLib/ODESolver/MatrixTranslator.h +++ b/NumLib/ODESolver/MatrixTranslator.h @@ -102,7 +102,7 @@ public: * * \param timeDisc the time discretization scheme to be used. */ - MatrixTranslatorGeneral(TimeDiscretization const& timeDisc) + explicit MatrixTranslatorGeneral(TimeDiscretization const& timeDisc) : _time_disc(timeDisc) { } @@ -159,7 +159,7 @@ public: * * \param timeDisc the time discretization scheme to be used. */ - MatrixTranslatorForwardEuler(ForwardEuler const& timeDisc) + explicit MatrixTranslatorForwardEuler(ForwardEuler const& timeDisc) : _fwd_euler(timeDisc) { } @@ -215,12 +215,10 @@ public: * * \param timeDisc the time discretization scheme to be used. */ - MatrixTranslatorCrankNicolson(CrankNicolson const& timeDisc) + explicit MatrixTranslatorCrankNicolson(CrankNicolson const& timeDisc) : _crank_nicolson(timeDisc), - _M_bar(NumLib::GlobalMatrixProvider::provider - .getMatrix()), - _b_bar( - NumLib::GlobalVectorProvider::provider.getVector()) + _M_bar(NumLib::GlobalMatrixProvider::provider.getMatrix()), + _b_bar(NumLib::GlobalVectorProvider::provider.getVector()) { } diff --git a/ProcessLib/BoundaryCondition/BHEBottomDirichletBoundaryCondition.h b/ProcessLib/BoundaryCondition/BHEBottomDirichletBoundaryCondition.h index 705d78527477bcb88137365e82863125b0fed30e..73c8edde3a53cde50073ed1a5365a52b17ad11cc 100644 --- a/ProcessLib/BoundaryCondition/BHEBottomDirichletBoundaryCondition.h +++ b/ProcessLib/BoundaryCondition/BHEBottomDirichletBoundaryCondition.h @@ -17,7 +17,7 @@ namespace ProcessLib class BHEBottomDirichletBoundaryCondition final : public BoundaryCondition { public: - BHEBottomDirichletBoundaryCondition( + explicit BHEBottomDirichletBoundaryCondition( std::pair<GlobalIndexType, GlobalIndexType>&& in_out_global_indices) : _in_out_global_indices(std::move(in_out_global_indices)) { diff --git a/ProcessLib/BoundaryCondition/BoundaryConditionCollection.h b/ProcessLib/BoundaryCondition/BoundaryConditionCollection.h index d957ef0e18d6d37773661f665525cbe0b7d7fa27..b6bebef421be6022d3a1e7b8d146e77e8e86a873 100644 --- a/ProcessLib/BoundaryCondition/BoundaryConditionCollection.h +++ b/ProcessLib/BoundaryCondition/BoundaryConditionCollection.h @@ -19,7 +19,7 @@ namespace ProcessLib class BoundaryConditionCollection final { public: - BoundaryConditionCollection( + explicit BoundaryConditionCollection( std::vector<std::unique_ptr<ParameterBase>> const& parameters) : _parameters(parameters) { diff --git a/ProcessLib/Output/Output.h b/ProcessLib/Output/Output.h index 4b09525757df84f7aa27103e8f6d7a3e1475c088..4f5b828213cba7c7906ab64d386115e7816770a8 100644 --- a/ProcessLib/Output/Output.h +++ b/ProcessLib/Output/Output.h @@ -83,7 +83,9 @@ public: private: struct ProcessData { - ProcessData(std::string const& filename) : pvd_file(filename) {} + explicit ProcessData(std::string const& filename) : pvd_file(filename) + { + } MeshLib::IO::PVDFile pvd_file; }; diff --git a/ProcessLib/SourceTerms/SourceTermCollection.h b/ProcessLib/SourceTerms/SourceTermCollection.h index 7de8a0747fcada3397143160c1235e0981341d52..b27a51e878868f7458f1d4305867847ab2bf20a2 100644 --- a/ProcessLib/SourceTerms/SourceTermCollection.h +++ b/ProcessLib/SourceTerms/SourceTermCollection.h @@ -17,7 +17,7 @@ namespace ProcessLib class SourceTermCollection final { public: - SourceTermCollection( + explicit SourceTermCollection( std::vector<std::unique_ptr<ParameterBase>> const& parameters) : _parameters(parameters) { diff --git a/Tests/AutoCheckTools.h b/Tests/AutoCheckTools.h index 1b121bf50c73fc43dac71c18c2e222e968847598..f28ebd5ab2ddeb8ff754c434591162257e9e3806 100644 --- a/Tests/AutoCheckTools.h +++ b/Tests/AutoCheckTools.h @@ -143,7 +143,8 @@ struct progressivelySmallerGenerator using result_type = T; - progressivelySmallerGenerator(T max_value = T{1}) : _max_value(max_value) + explicit progressivelySmallerGenerator(T max_value = T{1}) + : _max_value(max_value) { } diff --git a/Tests/BaseLib/TestFunctional.cpp b/Tests/BaseLib/TestFunctional.cpp index 015f37606fb7e8116b11bc742d117efe1e062ed7..afa519ac9963d8d43f1914bee63390527ce96bd3 100644 --- a/Tests/BaseLib/TestFunctional.cpp +++ b/Tests/BaseLib/TestFunctional.cpp @@ -16,7 +16,7 @@ class A : private InstanceCounter<A> { public: - A(const double value) : _value(value) {} + explicit A(const double value) : _value(value) {} A(A const& other) = default; A(A&& other) : InstanceCounter(std::move(other)), _value(other._value) {} A& operator=(A const& other) { _value = other._value; return *this; } diff --git a/Tests/GeoLib/AutoCheckGenerators.h b/Tests/GeoLib/AutoCheckGenerators.h index 627acf88c67476ef51d3e31990073139831e52c7..8d9d73f7681b6b7ca3a11022ffd1cc3551dcd691 100644 --- a/Tests/GeoLib/AutoCheckGenerators.h +++ b/Tests/GeoLib/AutoCheckGenerators.h @@ -25,8 +25,9 @@ namespace autocheck template <typename Gen = generator<double>> struct RandomCirclePointGeneratorXY { - RandomCirclePointGeneratorXY( - MathLib::Point3d const& c = MathLib::Point3d{std::array<double, 3>{{0, 0, 0}}}, + explicit RandomCirclePointGeneratorXY( + MathLib::Point3d const& c = MathLib::Point3d{std::array<double, 3>{ + {0, 0, 0}}}, double r = 1.0) : center(c), radius(r) {} diff --git a/Tests/MaterialLib/TestMPLParseMaterial.cpp b/Tests/MaterialLib/TestMPLParseMaterial.cpp index ab25e27913678667b82709034eb93a8eb6554e57..91c5b74c11f94c585c6013aec79c308c3185d078 100644 --- a/Tests/MaterialLib/TestMPLParseMaterial.cpp +++ b/Tests/MaterialLib/TestMPLParseMaterial.cpp @@ -35,7 +35,7 @@ struct Phase { std::vector<Component> component; std::vector<std::string> property; - Phase(std::size_t const componentNumber) + explicit Phase(std::size_t const componentNumber) : component(componentNumber), property(MPL::number_of_properties) { } @@ -47,7 +47,7 @@ struct Medium { std::vector<Phase> phases; std::vector<std::string> property; - Medium(std::vector<std::size_t> const& phases_) + explicit Medium(std::vector<std::size_t> const& phases_) : property(MPL::number_of_properties) { for (auto p : phases_) diff --git a/Tests/MathLib/TestGaussLegendreIntegration.cpp b/Tests/MathLib/TestGaussLegendreIntegration.cpp index aa74b68729751dce88ec5ba994b3a543de710cae..da34158d39b5ff2c4ca7eeaa6282255d784c10fe 100644 --- a/Tests/MathLib/TestGaussLegendreIntegration.cpp +++ b/Tests/MathLib/TestGaussLegendreIntegration.cpp @@ -168,7 +168,10 @@ private: } public: - FBase(std::size_t const num_coeffs) : coeffs(initCoeffs(num_coeffs)) {} + explicit FBase(std::size_t const num_coeffs) + : coeffs(initCoeffs(num_coeffs)) + { + } virtual double operator()( std::array<double, 3> const& /*coords*/) const = 0; @@ -247,7 +250,7 @@ struct FQuad final : FBase struct F3DSeparablePolynomial final : FBase { - F3DSeparablePolynomial(unsigned polynomial_degree) + explicit F3DSeparablePolynomial(unsigned polynomial_degree) : FBase(3 * polynomial_degree + 3), _degree(polynomial_degree) { } @@ -324,7 +327,7 @@ struct F3DNonseparablePolynomial final : FBase // The number of coefficients/monomials are obtained as follows: Compute the // number of combinations with repititions when drawing // polynomial_degree times from the set { x, y, z, 1 } - F3DNonseparablePolynomial(unsigned polynomial_degree) + explicit F3DNonseparablePolynomial(unsigned polynomial_degree) : FBase(binomial_coefficient(4 + polynomial_degree - 1, 4 - 1)), _degree(polynomial_degree) { diff --git a/Tests/NumLib/TestNamedFunction.cpp b/Tests/NumLib/TestNamedFunction.cpp index 481e23aa886fbd8d02c10730d276825ebb637772..2fd5a402b9bfb52b41cfaa174c395b64e1a2bd5d 100644 --- a/Tests/NumLib/TestNamedFunction.cpp +++ b/Tests/NumLib/TestNamedFunction.cpp @@ -48,7 +48,7 @@ public: class H : public InstanceCounter<H> { public: - H(double const z) : _z(z) {} + explicit H(double const z) : _z(z) {} double h(double arg_x, double arg_y) { return arg_x * arg_y - _z; } double setZ(double const z) {