diff --git a/3rdparty/expreval/except.h b/3rdparty/expreval/except.h index ff8a9be2..d3d3a025 100644 --- a/3rdparty/expreval/except.h +++ b/3rdparty/expreval/except.h @@ -69,7 +69,7 @@ namespace ExprEval class NotFoundException : public Exception { public: - NotFoundException(const ::std::string &name); + explicit NotFoundException(const ::std::string &name); }; // Already exists exception (function or value already exists) @@ -77,7 +77,7 @@ namespace ExprEval class AlreadyExistsException : public Exception { public: - AlreadyExistsException(const ::std::string &name); + explicit AlreadyExistsException(const ::std::string &name); }; // A null pointer was passed @@ -85,7 +85,7 @@ namespace ExprEval class NullPointerException : public Exception { public: - NullPointerException(const ::std::string &method); + explicit NullPointerException(const ::std::string &method); }; // A bad math error occured @@ -93,7 +93,7 @@ namespace ExprEval class MathException : public Exception { public: - MathException(const ::std::string &function); + explicit MathException(const ::std::string &function); }; // Divide by zero exception @@ -150,7 +150,7 @@ namespace ExprEval class InvalidArgumentCountException : public Exception { public: - InvalidArgumentCountException(const ::std::string &function); + explicit InvalidArgumentCountException(const ::std::string &function); }; // Assign to a constant @@ -158,7 +158,7 @@ namespace ExprEval class ConstantAssignException : public Exception { public: - ConstantAssignException(const ::std::string &value); + explicit ConstantAssignException(const ::std::string &value); }; // Pass constant by reference @@ -166,7 +166,7 @@ namespace ExprEval class ConstantReferenceException : public Exception { public: - ConstantReferenceException(const ::std::string &value); + explicit ConstantReferenceException(const ::std::string &value); }; // A general syntax exception diff --git a/3rdparty/expreval/node.h b/3rdparty/expreval/node.h index 9929207b..c16545a7 100644 --- a/3rdparty/expreval/node.h +++ b/3rdparty/expreval/node.h @@ -25,7 +25,7 @@ namespace ExprEval class Node { public: - Node(Expression *expr); + explicit Node(Expression *expr); virtual ~Node(); virtual double DoEvaluate() = 0; @@ -43,7 +43,7 @@ namespace ExprEval class FunctionNode : public Node { public: - FunctionNode(Expression *expr); + explicit FunctionNode(Expression *expr); ~FunctionNode(); // Parse nodes and references @@ -81,7 +81,7 @@ namespace ExprEval class MultiNode : public Node { public: - MultiNode(Expression *expr); + explicit MultiNode(Expression *expr); ~MultiNode(); double DoEvaluate(); @@ -97,7 +97,7 @@ namespace ExprEval class AssignNode : public Node { public: - AssignNode(Expression *expr); + explicit AssignNode(Expression *expr); ~AssignNode(); double DoEvaluate(); @@ -114,7 +114,7 @@ namespace ExprEval class AddNode : public Node { public: - AddNode(Expression *expr); + explicit AddNode(Expression *expr); ~AddNode(); double DoEvaluate(); @@ -131,7 +131,7 @@ namespace ExprEval class SubtractNode : public Node { public: - SubtractNode(Expression *expr); + explicit SubtractNode(Expression *expr); ~SubtractNode(); double DoEvaluate(); @@ -148,7 +148,7 @@ namespace ExprEval class MultiplyNode : public Node { public: - MultiplyNode(Expression *expr); + explicit MultiplyNode(Expression *expr); ~MultiplyNode(); double DoEvaluate(); @@ -165,7 +165,7 @@ namespace ExprEval class DivideNode : public Node { public: - DivideNode(Expression *expr); + explicit DivideNode(Expression *expr); ~DivideNode(); double DoEvaluate(); @@ -182,7 +182,7 @@ namespace ExprEval class NegateNode : public Node { public: - NegateNode(Expression *expr); + explicit NegateNode(Expression *expr); ~NegateNode(); double DoEvaluate(); @@ -198,7 +198,7 @@ namespace ExprEval class ExponentNode : public Node { public: - ExponentNode(Expression *expr); + explicit ExponentNode(Expression *expr); ~ExponentNode(); double DoEvaluate(); @@ -215,7 +215,7 @@ namespace ExprEval class VariableNode : public Node { public: - VariableNode(Expression *expr); + explicit VariableNode(Expression *expr); ~VariableNode(); double DoEvaluate(); @@ -231,7 +231,7 @@ namespace ExprEval class ValueNode : public Node { public: - ValueNode(Expression *expr); + explicit ValueNode(Expression *expr); ~ValueNode(); double DoEvaluate(); diff --git a/3rdparty/expreval/parser.h b/3rdparty/expreval/parser.h index af9da7a1..e7253821 100644 --- a/3rdparty/expreval/parser.h +++ b/3rdparty/expreval/parser.h @@ -75,7 +75,7 @@ namespace ExprEval public: typedef ::std::vector::size_type size_type; - Parser(Expression *expr); + explicit Parser(Expression *expr); ~Parser(); Node *Parse(const ::std::string &exstr); diff --git a/src/ASM/ASMbase.h b/src/ASM/ASMbase.h index a79b587e..8cd0becf 100644 --- a/src/ASM/ASMbase.h +++ b/src/ASM/ASMbase.h @@ -68,7 +68,7 @@ public: char RY; //!< Boundary condition code for Y-rotation char RZ; //!< Boundary condition code for Z-rotation //! \brief Constructor initializing a BC instance. - BC(int n) : node(n), CX(1), CY(1), CZ(1), RX(1), RY(1), RZ(1) {} + explicit BC(int n) : node(n), CX(1), CY(1), CZ(1), RX(1), RY(1), RZ(1) {} }; typedef std::vector BCVec; //!< Nodal boundary condition container diff --git a/src/ASM/ASMmxBase.h b/src/ASM/ASMmxBase.h index 24484d74..c4b3bf2e 100644 --- a/src/ASM/ASMmxBase.h +++ b/src/ASM/ASMmxBase.h @@ -32,7 +32,7 @@ class ASMmxBase protected: //! \brief The constructor sets the number of field variables. //! \param[in] n_f Number of nodal variables in each field - ASMmxBase(const std::vector& n_f); + explicit ASMmxBase(const std::vector& n_f); //! \brief Initializes the patch level MADOF array. //! \param[in] MLGN Matrix of local-to-global node numbers diff --git a/src/ASM/ASMs2D.h b/src/ASM/ASMs2D.h index a93b218c..87c4af7c 100644 --- a/src/ASM/ASMs2D.h +++ b/src/ASM/ASMs2D.h @@ -91,7 +91,7 @@ protected: const ASMs2D& myPatch; //!< Reference to the patch being integrated public: //! \brief The constructor initialises the reference to current patch. - InterfaceChecker(const ASMs2D& pch) : myPatch(pch) {} + explicit InterfaceChecker(const ASMs2D& pch) : myPatch(pch) {} //! \brief Empty destructor. virtual ~InterfaceChecker() {} //! \brief Returns non-zero if the specified element have contributions. diff --git a/src/ASM/ASMs3D.h b/src/ASM/ASMs3D.h index d477917a..3d6acb48 100644 --- a/src/ASM/ASMs3D.h +++ b/src/ASM/ASMs3D.h @@ -110,7 +110,7 @@ protected: const ASMs3D& myPatch; //!< Reference to the patch being integrated public: //! \brief The constructor initialises the reference to current patch. - InterfaceChecker(const ASMs3D& pch) : myPatch(pch) {} + explicit InterfaceChecker(const ASMs3D& pch) : myPatch(pch) {} //! \brief Empty destructor. virtual ~InterfaceChecker() {} //! \brief Returns non-zero if the specified element have contributions. @@ -122,7 +122,7 @@ protected: public: //! \brief Default constructor. - ASMs3D(unsigned char n_f = 3); + explicit ASMs3D(unsigned char n_f = 3); //! \brief Special copy constructor for sharing of FE data. ASMs3D(const ASMs3D& patch, unsigned char n_f); //! \brief Default copy constructor copying everything. diff --git a/src/ASM/ASMs3DLag.h b/src/ASM/ASMs3DLag.h index cc5e97ff..64aac7b1 100644 --- a/src/ASM/ASMs3DLag.h +++ b/src/ASM/ASMs3DLag.h @@ -27,7 +27,7 @@ class ASMs3DLag : public ASMs3D { public: //! \brief Default constructor. - ASMs3DLag(unsigned char n_f = 3); + explicit ASMs3DLag(unsigned char n_f = 3); //! \brief Special copy constructor for sharing of FE data. ASMs3DLag(const ASMs3DLag& patch, unsigned char n_f); //! \brief Default copy constructor copying everything. diff --git a/src/ASM/ASMs3DSpec.h b/src/ASM/ASMs3DSpec.h index eedaa520..a61a2136 100644 --- a/src/ASM/ASMs3DSpec.h +++ b/src/ASM/ASMs3DSpec.h @@ -26,7 +26,7 @@ class ASMs3DSpec : public ASMs3DLag { public: //! \brief Default constructor. - ASMs3DSpec(unsigned char n_f = 3) : ASMs3DLag(n_f) {} + explicit ASMs3DSpec(unsigned char n_f = 3) : ASMs3DLag(n_f) {} //! \brief Copy constructor. ASMs3DSpec(const ASMs3DSpec& patch, unsigned char n_f = 0) : ASMs3DLag(patch,n_f) {} diff --git a/src/ASM/ASMs3Dmx.h b/src/ASM/ASMs3Dmx.h index 342b350b..e0c909b2 100644 --- a/src/ASM/ASMs3Dmx.h +++ b/src/ASM/ASMs3Dmx.h @@ -33,7 +33,7 @@ class ASMs3Dmx : public ASMs3D, private ASMmxBase { public: //! \brief The constructor initializes the dimension of each basis. - ASMs3Dmx(const CharVec& n_f); + explicit ASMs3Dmx(const CharVec& n_f); //! \brief Copy constructor. ASMs3Dmx(const ASMs3Dmx& patch, const CharVec& n_f = CharVec(2,0)); //! \brief Empty destructor. diff --git a/src/ASM/ASMs3DmxLag.h b/src/ASM/ASMs3DmxLag.h index eb3f4b59..d66f40ef 100644 --- a/src/ASM/ASMs3DmxLag.h +++ b/src/ASM/ASMs3DmxLag.h @@ -30,7 +30,7 @@ class ASMs3DmxLag : public ASMs3DLag, private ASMmxBase { public: //! \brief The constructor initializes the dimension of each basis. - ASMs3DmxLag(const CharVec& n_f); + explicit ASMs3DmxLag(const CharVec& n_f); //! \brief Copy constructor. ASMs3DmxLag(const ASMs3DmxLag& patch, const CharVec& n_f = CharVec(2,0)); //! \brief Empty destructor. diff --git a/src/ASM/ASMunstruct.h b/src/ASM/ASMunstruct.h index a46e1d5f..e1e6e1d9 100644 --- a/src/ASM/ASMunstruct.h +++ b/src/ASM/ASMunstruct.h @@ -47,7 +47,7 @@ namespace LR //! Utilities for LR-splines. RealArray errors; //!< List of error indicators for the elements //! \brief Default constructor. - RefineData(bool rs = false) : refShare(rs) {} + explicit RefineData(bool rs = false) : refShare(rs) {} }; //! \brief Expands the basis coefficients of an LR-spline object. diff --git a/src/ASM/BDFMats.h b/src/ASM/BDFMats.h index ea5bece8..9f42e153 100644 --- a/src/ASM/BDFMats.h +++ b/src/ASM/BDFMats.h @@ -28,7 +28,7 @@ class BDFMats : public NewmarkMats public: //! \brief The constructor initializes the time integration parameters. //! param[in] bdfscheme BDF time discretization scheme - BDFMats(const TimeIntegration::BDFD2& bdfscheme) : bdf(bdfscheme) {} + explicit BDFMats(const TimeIntegration::BDFD2& bdfscheme) : bdf(bdfscheme) {} //! \brief Empty destructor. virtual ~BDFMats() {} diff --git a/src/ASM/DomainDecomposition.h b/src/ASM/DomainDecomposition.h index 7057aef4..1f11a201 100644 --- a/src/ASM/DomainDecomposition.h +++ b/src/ASM/DomainDecomposition.h @@ -48,7 +48,7 @@ public: class SlaveOrder { public: //! \brief The constructor initializes the DomainDecomposition reference. - SlaveOrder(const DomainDecomposition& dd_) : dd(dd_) {} + explicit SlaveOrder(const DomainDecomposition& dd_) : dd(dd_) {} //! \brief Hide ill-formed default assignment operator. SlaveOrder& operator=(const SlaveOrder&) { return *this; } //! \brief Compare interfaces. diff --git a/src/ASM/ElmNorm.h b/src/ASM/ElmNorm.h index 38d7e99e..11286287 100644 --- a/src/ASM/ElmNorm.h +++ b/src/ASM/ElmNorm.h @@ -39,7 +39,7 @@ public: //! by the application, but are only used to assembly the global norms. //! To avoid the need for a global array of element norms in that case, //! an internal array is then used instead. - ElmNorm(size_t n) : buf(n,0.0), nnv(n) { ptr = &buf.front(); } + explicit ElmNorm(size_t n) : buf(n,0.0), nnv(n) { ptr = &buf.front(); } //! \brief Empty destructor. virtual ~ElmNorm() {} diff --git a/src/ASM/Field.h b/src/ASM/Field.h index 6617fcaf..7349d868 100644 --- a/src/ASM/Field.h +++ b/src/ASM/Field.h @@ -31,7 +31,7 @@ class Field protected: //! \brief The constructor sets the field name. //! \param[in] name Optional name of field - Field(const char* name = nullptr) { if (name) fname = name; } + explicit Field(const char* name = nullptr) { if (name) fname = name; } public: //! \brief Empty destructor. diff --git a/src/ASM/FieldBase.h b/src/ASM/FieldBase.h index 0b62f142..4201a7a1 100644 --- a/src/ASM/FieldBase.h +++ b/src/ASM/FieldBase.h @@ -31,7 +31,7 @@ class FieldBase : public Field protected: //! \brief The constructor sets the field name. //! \param[in] name Optional name of field - FieldBase(const char* name = nullptr) : Field(name) { nelm = nno = 0; } + explicit FieldBase(const char* name = nullptr) : Field(name) { nelm = nno = 0; } public: //! \brief Empty destructor. diff --git a/src/ASM/Fields.h b/src/ASM/Fields.h index e7ef3c1c..82997384 100644 --- a/src/ASM/Fields.h +++ b/src/ASM/Fields.h @@ -36,7 +36,7 @@ class Fields protected: //! \brief The constructor sets the field name. //! \param[in] name Name of field - Fields(const char* name = 0) : nf(0), nelm(0), nno(0) + explicit Fields(const char* name = 0) : nf(0), nelm(0), nno(0) { if (name) fname = name; } public: diff --git a/src/ASM/GlbForceVec.h b/src/ASM/GlbForceVec.h index d86fe1df..77c5fd73 100644 --- a/src/ASM/GlbForceVec.h +++ b/src/ASM/GlbForceVec.h @@ -31,7 +31,7 @@ class GlbForceVec : public GlobalIntegral { public: //! \brief The constructor only sets its reference to the SAM object. - GlbForceVec(const SAM& _sam) : sam(_sam) {} + explicit GlbForceVec(const SAM& _sam) : sam(_sam) {} //! \brief Empty destructor. virtual ~GlbForceVec() {} diff --git a/src/ASM/IBGeometries.h b/src/ASM/IBGeometries.h index 488aada4..b4374c99 100644 --- a/src/ASM/IBGeometries.h +++ b/src/ASM/IBGeometries.h @@ -93,7 +93,7 @@ public: //! \brief Default constructor. PerforatedPlate2D() {} //! \brief Constructor creating a single hole. - PerforatedPlate2D(Hole2D* hole) { holes.resize(1,hole); } + explicit PerforatedPlate2D(Hole2D* hole) { holes.resize(1,hole); } //! \brief The destructor deletes the holes. virtual ~PerforatedPlate2D(); diff --git a/src/ASM/ImmersedBoundaries.C b/src/ASM/ImmersedBoundaries.C index 6b3814ac..b621c9a7 100644 --- a/src/ASM/ImmersedBoundaries.C +++ b/src/ASM/ImmersedBoundaries.C @@ -63,7 +63,7 @@ struct cell vertex CellVerts[4]; //!< Global coordinates of the cell vertices //! \brief Default constructor. - cell(int level = 0) : depth(level), xi(0.0), eta(0.0) {} + explicit cell(int level = 0) : depth(level), xi(0.0), eta(0.0) {} }; diff --git a/src/ASM/IntegrandBase.h b/src/ASM/IntegrandBase.h index 9ee6f681..48b3ed90 100644 --- a/src/ASM/IntegrandBase.h +++ b/src/ASM/IntegrandBase.h @@ -41,7 +41,7 @@ class IntegrandBase : public Integrand { protected: //! \brief The default constructor is protected to allow sub-classes only. - IntegrandBase(unsigned short int n = 0) : nsd(n), npv(1), m_mode(SIM::INIT) {} + explicit IntegrandBase(unsigned short int n = 0) : nsd(n), npv(1), m_mode(SIM::INIT) {} public: //! \brief Empty destructor. @@ -285,8 +285,8 @@ class NormBase : public Integrand { protected: //! \brief The default constructor is protected to allow sub-classes only. - NormBase(IntegrandBase& p) : myProblem(p), projBou(false), nrcmp(0), - lints(nullptr), finalOp(ASM::SQRT) {} + explicit NormBase(IntegrandBase& p) : myProblem(p), projBou(false), nrcmp(0), + lints(nullptr), finalOp(ASM::SQRT) {} public: //! \brief Empty destructor. @@ -392,7 +392,7 @@ class ForceBase : public Integrand { protected: //! \brief The constructor is protected to allow sub-classes only. - ForceBase(IntegrandBase& p) : myProblem(p), eBuffer(nullptr) {} + explicit ForceBase(IntegrandBase& p) : myProblem(p), eBuffer(nullptr) {} public: //! \brief The destructor frees the internally allocated objects. diff --git a/src/ASM/LR/ASMu3D.h b/src/ASM/LR/ASMu3D.h index 9b5e18ce..fd668522 100644 --- a/src/ASM/LR/ASMu3D.h +++ b/src/ASM/LR/ASMu3D.h @@ -39,7 +39,7 @@ class ASMu3D : public ASMunstruct, public ASM3D { public: //! \brief Default constructor. - ASMu3D(unsigned char n_f = 3); + explicit ASMu3D(unsigned char n_f = 3); //! \brief Copy constructor. ASMu3D(const ASMu3D& patch, unsigned char n_f = 0); //! \brief Empty destructor. diff --git a/src/ASM/Lagrange.h b/src/ASM/Lagrange.h index 4b082eed..2bcb31af 100644 --- a/src/ASM/Lagrange.h +++ b/src/ASM/Lagrange.h @@ -26,7 +26,7 @@ class Lagrange public: //! \brief Constructor initializing the reference to natural coordinates. //! \param[in] p Natural interpolation point coordinates in range [-1,1] - Lagrange(const RealArray& p) : points(p) {} + explicit Lagrange(const RealArray& p) : points(p) {} //! \brief Evaluates a 1D Lagrange polynomial. //! \param[in] polnum Which polynomial of the basis to evaluate diff --git a/src/LinAlg/ISTLMatrix.h b/src/LinAlg/ISTLMatrix.h index 1e68d6a7..9f00a152 100644 --- a/src/LinAlg/ISTLMatrix.h +++ b/src/LinAlg/ISTLMatrix.h @@ -33,7 +33,7 @@ class ISTLVector : public StdVector { public: //! \brief Constructor creating an empty vector. - ISTLVector(const ProcessAdm& padm); + explicit ISTLVector(const ProcessAdm& padm); //! \brief Constructor creating a vector of length \a n. ISTLVector(const ProcessAdm& padm, size_t n); //! \brief Constructor creating a vector from an array. diff --git a/src/LinAlg/ISTLSupport.h b/src/LinAlg/ISTLSupport.h index c9fafaad..d86949ad 100644 --- a/src/LinAlg/ISTLSupport.h +++ b/src/LinAlg/ISTLSupport.h @@ -43,7 +43,7 @@ namespace ISTL class IOp2Pre : public Dune::InverseOperator2Preconditioner, Dune::SolverCategory::sequential> { typedef Dune::InverseOperator2Preconditioner, Dune::SolverCategory::sequential> SolverType; public: - IOp2Pre(Pre* iop) : SolverType(*iop) + explicit IOp2Pre(Pre* iop) : SolverType(*iop) { m_op.reset(iop); } diff --git a/src/LinAlg/PETScMatrix.h b/src/LinAlg/PETScMatrix.h index 88a332f5..e5e8a184 100644 --- a/src/LinAlg/PETScMatrix.h +++ b/src/LinAlg/PETScMatrix.h @@ -39,7 +39,7 @@ class PETScVector : public StdVector { public: //! \brief Constructor creating an empty vector. - PETScVector(const ProcessAdm& padm); + explicit PETScVector(const ProcessAdm& padm); //! \brief Constructor creating a vector of length \a n. PETScVector(const ProcessAdm& padm, size_t n); //! \brief Constructor creating a vector from an array. diff --git a/src/LinAlg/ProcessAdm.h b/src/LinAlg/ProcessAdm.h index 73004f21..a46565b1 100644 --- a/src/LinAlg/ProcessAdm.h +++ b/src/LinAlg/ProcessAdm.h @@ -48,13 +48,13 @@ public: ProcessAdm(); #if defined(HAS_PETSC) || defined(HAVE_MPI) //! \brief Construct a parallel process administrator. - ProcessAdm(MPI_Comm& mpi_comm); + explicit ProcessAdm(MPI_Comm& mpi_comm); #endif #ifdef HAVE_MPI //! \brief Construct a parallel process administrator. //! \details This overload is necessary due to MPI_COMM_WORLD being .. ickily. - ProcessAdm(bool hack); + explicit ProcessAdm(bool hack); #endif //! \brief The destructor releases the process administrator. diff --git a/src/LinAlg/SparseMatrix.C b/src/LinAlg/SparseMatrix.C index ae464374..162af2c3 100644 --- a/src/LinAlg/SparseMatrix.C +++ b/src/LinAlg/SparseMatrix.C @@ -59,7 +59,7 @@ struct SuperLUdata Real rpg; //!< Reciprocal pivot growth //! \brief The constructor initializes the default input options. - SuperLUdata(int numThreads = 0) + explicit SuperLUdata(int numThreads = 0) { R = C = 0; perm_r = perm_c = etree = 0; diff --git a/src/LinAlg/SystemMatrix.h b/src/LinAlg/SystemMatrix.h index f085df5e..a04478ea 100644 --- a/src/LinAlg/SystemMatrix.h +++ b/src/LinAlg/SystemMatrix.h @@ -126,11 +126,11 @@ public: //! \brief Constructor creating an empty vector. StdVector() {} //! \brief Constructor creating a vector of length \a n. - StdVector(size_t n) : utl::vector(n) {} + explicit StdVector(size_t n) : utl::vector(n) {} //! \brief Constructor creating a vector from an array. StdVector(const Real* values, size_t n) : utl::vector(values,n) {} //! \brief Overloaded copy constructor. - StdVector(const std::vector& vec) + explicit StdVector(const std::vector& vec) { this->insert(this->end(),vec.begin(),vec.end()); } //! \brief Returns the vector type. diff --git a/src/LinAlg/matrix.h b/src/LinAlg/matrix.h index fbe95e89..a2db0452 100644 --- a/src/LinAlg/matrix.h +++ b/src/LinAlg/matrix.h @@ -61,7 +61,7 @@ namespace utl //! General utility classes and functions. //! \brief Constructor creating an empty vector. vector() {} //! \brief Constructor creating a vector of length \a n. - vector(size_t n) { this->resize(n); } + explicit vector(size_t n) { this->resize(n); } //! \brief Constructor creating a vector from an array. vector(const T* values, size_t n) { this->fill(values,n); } diff --git a/src/SIM/EigenModeSIM.h b/src/SIM/EigenModeSIM.h index a5d19712..a0d2bd2c 100644 --- a/src/SIM/EigenModeSIM.h +++ b/src/SIM/EigenModeSIM.h @@ -26,7 +26,7 @@ class EigenModeSIM : public MultiStepSIM { public: //! \brief The constructor initializes the FE model reference. - EigenModeSIM(SIMbase& sim); + explicit EigenModeSIM(SIMbase& sim); //! \brief Empty destructor. virtual ~EigenModeSIM() {} diff --git a/src/SIM/GenAlphaSIM.h b/src/SIM/GenAlphaSIM.h index a2480d97..9d9204d0 100644 --- a/src/SIM/GenAlphaSIM.h +++ b/src/SIM/GenAlphaSIM.h @@ -25,7 +25,7 @@ class GenAlphaSIM : public NewmarkSIM { public: //! \brief The constructor initializes default solution parameters. - GenAlphaSIM(SIMbase& s); + explicit GenAlphaSIM(SIMbase& s); //! \brief Empty destructor. virtual ~GenAlphaSIM() {} diff --git a/src/SIM/HHTSIM.h b/src/SIM/HHTSIM.h index c5d6791a..e490f9e8 100644 --- a/src/SIM/HHTSIM.h +++ b/src/SIM/HHTSIM.h @@ -175,7 +175,7 @@ class HHTSIM : public NewmarkSIM { public: //! \brief The constructor initializes default solution parameters. - HHTSIM(SIMbase& sim); + explicit HHTSIM(SIMbase& sim); //! \brief Empty destructor. virtual ~HHTSIM() {} diff --git a/src/SIM/ModelGenerator.h b/src/SIM/ModelGenerator.h index a41bfdf4..1f9f0beb 100644 --- a/src/SIM/ModelGenerator.h +++ b/src/SIM/ModelGenerator.h @@ -31,7 +31,7 @@ class ModelGenerator public: //! \brief The constructor initializes the common members. //!\ param elem XML element to parse - ModelGenerator(const TiXmlElement* elem) : geo(elem) {} + explicit ModelGenerator(const TiXmlElement* elem) : geo(elem) {} //! \brief Empty destructor. virtual ~ModelGenerator() {} @@ -69,7 +69,7 @@ class DefaultGeometry1D : public ModelGenerator public: //! \brief The constructor forwards to the base class. //! \param[in] geo XML element containing geometry definition - DefaultGeometry1D(const TiXmlElement* geo) : ModelGenerator(geo) {} + explicit DefaultGeometry1D(const TiXmlElement* geo) : ModelGenerator(geo) {} //! \brief Empty destructor. virtual ~DefaultGeometry1D() {} @@ -93,7 +93,7 @@ class DefaultGeometry2D : public ModelGenerator public: //! \brief The constructor forwards to the base class. //! \param[in] geo XML element containing geometry definition - DefaultGeometry2D(const TiXmlElement* geo) : ModelGenerator(geo) {} + explicit DefaultGeometry2D(const TiXmlElement* geo) : ModelGenerator(geo) {} //! \brief Empty destructor. virtual ~DefaultGeometry2D() {} @@ -117,7 +117,7 @@ class DefaultGeometry3D : public ModelGenerator public: //! \brief The constructor forwards to the base class. //! \param[in] geo XML element containing geometry definition - DefaultGeometry3D(const TiXmlElement* geo) : ModelGenerator(geo) {} + explicit DefaultGeometry3D(const TiXmlElement* geo) : ModelGenerator(geo) {} //! \brief Empty destructor. virtual ~DefaultGeometry3D() {} diff --git a/src/SIM/MultiStepSIM.h b/src/SIM/MultiStepSIM.h index a7fecc61..4dac203a 100644 --- a/src/SIM/MultiStepSIM.h +++ b/src/SIM/MultiStepSIM.h @@ -36,7 +36,7 @@ protected: //! \brief The constructor initializes the FE model reference. //! \param sim The FE model - MultiStepSIM(SIMbase& sim); + explicit MultiStepSIM(SIMbase& sim); public: //! \brief Empty destructor. diff --git a/src/SIM/NewmarkNLSIM.h b/src/SIM/NewmarkNLSIM.h index 79085f3b..daacd71d 100644 --- a/src/SIM/NewmarkNLSIM.h +++ b/src/SIM/NewmarkNLSIM.h @@ -175,7 +175,7 @@ class NewmarkNLSIM : public NewmarkSIM { public: //! \brief The constructor initializes default solution parameters. - NewmarkNLSIM(SIMbase& sim); + explicit NewmarkNLSIM(SIMbase& sim); //! \brief Empty destructor. virtual ~NewmarkNLSIM() {} diff --git a/src/SIM/NewmarkSIM.h b/src/SIM/NewmarkSIM.h index e36acffb..c2ea057b 100644 --- a/src/SIM/NewmarkSIM.h +++ b/src/SIM/NewmarkSIM.h @@ -25,7 +25,7 @@ class NewmarkSIM : public MultiStepSIM { public: //! \brief The constructor initializes default solution parameters. - NewmarkSIM(SIMbase& sim); + explicit NewmarkSIM(SIMbase& sim); //! \brief Empty destructor. virtual ~NewmarkSIM() {} diff --git a/src/SIM/SIMadmin.h b/src/SIM/SIMadmin.h index a68f058d..8bf4652d 100644 --- a/src/SIM/SIMadmin.h +++ b/src/SIM/SIMadmin.h @@ -32,7 +32,7 @@ class SIMadmin : public XMLInputBase { protected: //! \brief The default constructor initializes the process administrator. - SIMadmin(const char* heading = nullptr); + explicit SIMadmin(const char* heading = nullptr); //! \brief Copy constructor. SIMadmin(SIMadmin& anotherSIM); diff --git a/src/SIM/SIMbase.h b/src/SIM/SIMbase.h index 7c6c53dc..ccf5c7f8 100644 --- a/src/SIM/SIMbase.h +++ b/src/SIM/SIMbase.h @@ -62,7 +62,7 @@ class SIMbase : public SIMadmin, public SIMdependency { protected: //! \brief The constructor initializes the pointers to dynamic data members. - SIMbase(IntegrandBase* itg = nullptr); + explicit SIMbase(IntegrandBase* itg = nullptr); public: //! \brief The destructor frees the dynamically allocated objects. diff --git a/src/SIM/SIMgeneric.h b/src/SIM/SIMgeneric.h index a933e583..2b6293e5 100644 --- a/src/SIM/SIMgeneric.h +++ b/src/SIM/SIMgeneric.h @@ -28,7 +28,7 @@ class SIMgeneric : public SIMoutput { protected: //! \brief Default constructor. - SIMgeneric(IntegrandBase* itg = nullptr) : SIMoutput(itg) {} + explicit SIMgeneric(IntegrandBase* itg = nullptr) : SIMoutput(itg) {} public: //! \brief Empty destructor. diff --git a/src/SIM/SIMinput.h b/src/SIM/SIMinput.h index 9d5736f1..9d434a6e 100644 --- a/src/SIM/SIMinput.h +++ b/src/SIM/SIMinput.h @@ -47,16 +47,16 @@ public: //! \brief Default constructor. ICInfo() : file_level(-1), geo_level(0), basis(1), component(0) {} //! \brief Constructor providing the field name. - ICInfo(const std::string& f) : file_level(-1), geo_level(0), - basis(1), component(0), - sim_field(f), file_field(f) {} + explicit ICInfo(const std::string& f) : file_level(-1), geo_level(0), + basis(1), component(0), + sim_field(f), file_field(f) {} }; typedef std::vector InitialCondVec; //!< Convenience declaration typedef std::vector CharVec; //!< Convenience declaration protected: //! \brief The constructor just forwards to the base class constructor. - SIMinput(IntegrandBase* itg = nullptr) : SIMbase(itg), myGen(nullptr) {} + explicit SIMinput(IntegrandBase* itg = nullptr) : SIMbase(itg), myGen(nullptr) {} public: //! \brief Empty destructor. diff --git a/src/SIM/SIMoutput.h b/src/SIM/SIMoutput.h index f1e39688..4452e27f 100644 --- a/src/SIM/SIMoutput.h +++ b/src/SIM/SIMoutput.h @@ -34,7 +34,7 @@ class SIMoutput : public SIMinput { protected: //! \brief The constructor just forwards to the base class constructor. - SIMoutput(IntegrandBase* itg); + explicit SIMoutput(IntegrandBase* itg); public: //! \brief The destructor frees the dynamically allocated VTF object. diff --git a/src/Utility/AnaSol.h b/src/Utility/AnaSol.h index ef1b0a05..8c7a7127 100644 --- a/src/Utility/AnaSol.h +++ b/src/Utility/AnaSol.h @@ -65,7 +65,7 @@ public: //! \brief Constructor initializing the symmetric stress tensor field only. //! \param[in] sigma Symmetric stress tensor field - AnaSol(STensorFunc* sigma) + explicit AnaSol(STensorFunc* sigma) : vecSol(nullptr), vecSecSol(nullptr), stressSol(sigma) {} //! \brief Constructor initializing expression functions by parsing a stream. diff --git a/src/Utility/BDF.h b/src/Utility/BDF.h index cd8e3486..021dfb08 100644 --- a/src/Utility/BDF.h +++ b/src/Utility/BDF.h @@ -29,7 +29,7 @@ namespace TimeIntegration //! Utilities for time integration. public: //! \brief Default constructor. //! \param[in] order The order of the BDF scheme - BDF(int order = 0) : step(0), coefs1(1,1.0) { this->setOrder(order); } + explicit BDF(int order = 0) : step(0), coefs1(1,1.0) { this->setOrder(order); } //! \brief Empty destructor. virtual ~BDF() {} diff --git a/src/Utility/ElementBlock.h b/src/Utility/ElementBlock.h index 2e219999..08464dfc 100644 --- a/src/Utility/ElementBlock.h +++ b/src/Utility/ElementBlock.h @@ -25,7 +25,7 @@ class ElementBlock { public: //! The constructor defines the number of nodes per element \a nenod. - ElementBlock(size_t nenod = 8); + explicit ElementBlock(size_t nenod = 8); //! \brief Reallocates the internal arrays to fit a structured grid. //! \param[in] nI Number of element in I-direction diff --git a/src/Utility/FieldFunctions.h b/src/Utility/FieldFunctions.h index 396a8082..8e0b1927 100644 --- a/src/Utility/FieldFunctions.h +++ b/src/Utility/FieldFunctions.h @@ -32,7 +32,7 @@ class FieldFunction : public RealFunc public: //! \brief Default constructor. - FieldFunction(Field* f = nullptr) : field(f), pch(nullptr) {} + explicit FieldFunction(Field* f = nullptr) : field(f), pch(nullptr) {} //! \brief Constructor creating a field from a provided HDF5 file. //! \param[in] fileName Name of the HDF5-file //! \param[in] basisName Name of the basis which the field values refer to diff --git a/src/Utility/Function.h b/src/Utility/Function.h index 83b5cd5a..cd1cf38f 100644 --- a/src/Utility/Function.h +++ b/src/Utility/Function.h @@ -100,7 +100,7 @@ namespace utl { protected: //! \brief The constructor is protected to allow sub-class instances only. - SpatialFunction(const Result& val) : zero(val) {} + explicit SpatialFunction(const Result& val) : zero(val) {} public: //! \brief Empty destructor. @@ -246,9 +246,9 @@ class TractionField : public TractionFunc public: //! \brief Constructor initializing the symmetric tensor function pointer. - TractionField(const STensorFunc& field); + explicit TractionField(const STensorFunc& field); //! \brief Constructor initializing the tensor function pointer. - TractionField(const TensorFunc& field); + explicit TractionField(const TensorFunc& field); //! \brief Empty destructor. virtual ~TractionField() {} diff --git a/src/Utility/Functions.h b/src/Utility/Functions.h index 8db8f559..677f72f9 100644 --- a/src/Utility/Functions.h +++ b/src/Utility/Functions.h @@ -27,7 +27,7 @@ class ConstantFunc : public ScalarFunc public: //! \brief Constructor initializing the function value. - ConstantFunc(Real v) : fval(v) {} + explicit ConstantFunc(Real v) : fval(v) {} //! \brief Returns whether the function is identically zero or not. virtual bool isZero() const { return fval == Real(0); } @@ -48,7 +48,7 @@ class LinearFunc : public ScalarFunc public: //! \brief Constructor initializing the function parameter. - LinearFunc(Real s = Real(1)) : scale(s) {} + explicit LinearFunc(Real s = Real(1)) : scale(s) {} //! \brief Returns whether the function is identically zero or not. virtual bool isZero() const { return scale == Real(0); } @@ -159,7 +159,7 @@ class ConstFunc : public RealFunc public: //! \brief Constructor initializing the function value. - ConstFunc(Real v) : fval(v) {} + explicit ConstFunc(Real v) : fval(v) {} //! \brief Returns whether the function is identically zero or not. virtual bool isZero() const { return fval == Real(0); } @@ -180,7 +180,7 @@ class ConstTimeFunc : public RealFunc public: //! \brief Constructor initializing the function value. - ConstTimeFunc(const ScalarFunc* f) : tfunc(f) {} + explicit ConstTimeFunc(const ScalarFunc* f) : tfunc(f) {} //! \brief The destructor frees the time function. virtual ~ConstTimeFunc() { delete tfunc; } @@ -517,7 +517,7 @@ class ConstVecFunc : public VecFunc public: //! \brief Constructor initializing the function value. - ConstVecFunc(const Vec3& v) : fval(v) {} + explicit ConstVecFunc(const Vec3& v) : fval(v) {} //! \brief Returns whether the function is identically zero or not. virtual bool isZero() const { return fval.isZero(0.0); } diff --git a/src/Utility/LagrangeInterpolator.h b/src/Utility/LagrangeInterpolator.h index 25d9f3b2..4c22e9b8 100644 --- a/src/Utility/LagrangeInterpolator.h +++ b/src/Utility/LagrangeInterpolator.h @@ -6,7 +6,7 @@ class LagrangeInterpolator { public: - LagrangeInterpolator(const std::vector& grid_) : + explicit LagrangeInterpolator(const std::vector& grid_) : grid(grid_) { } diff --git a/src/Utility/LogStream.h b/src/Utility/LogStream.h index 5683d47a..9521c57f 100644 --- a/src/Utility/LogStream.h +++ b/src/Utility/LogStream.h @@ -27,7 +27,7 @@ class LogStream public: //! \brief Default constructor. //! \param out The output stream to wrap - LogStream(std::ostream* out = nullptr) : m_out(out) { m_ppid = m_pid = 0; } + explicit LogStream(std::ostream* out) : m_out(out) { m_ppid = m_pid = 0; } //! \brief Constructor initializing the output stream from a reference. //! \param out The output stream to wrap //! \param ppid The PID to print on diff --git a/src/Utility/Profiler.h b/src/Utility/Profiler.h index cd359645..218ebb76 100644 --- a/src/Utility/Profiler.h +++ b/src/Utility/Profiler.h @@ -42,7 +42,7 @@ public: //! \details The constructor also updates the global static pointer //! utl::profiler to point to \a *this, deleting any already pointed-to //! object first. This means, only one Profiler object can exist at any time. - Profiler(const std::string& name); + explicit Profiler(const std::string& name); //! \brief The destructor prints the profiling report to the console. ~Profiler(); @@ -106,7 +106,7 @@ namespace utl const char* name; //!< Name tag on the local scope to profile public: //! \brief The constructor starts the profiling of the named task. - prof(const char* tag) : name(tag) { if (profiler) profiler->start(name); } + explicit prof(const char* tag) : name(tag) { if (profiler) profiler->start(name); } //! \brief The destructor stops the profiling. ~prof() { if (profiler) profiler->stop(name); } }; diff --git a/src/Utility/TensorFunction.h b/src/Utility/TensorFunction.h index 3ef9e7a0..28a9866c 100644 --- a/src/Utility/TensorFunction.h +++ b/src/Utility/TensorFunction.h @@ -26,7 +26,7 @@ class TensorFunc : public utl::SpatialFunction, public FunctionBase { protected: //! \brief The constructor is protected to allow sub-class instances only. - TensorFunc(size_t n = 0) : utl::SpatialFunction(Tensor(n)) + explicit TensorFunc(size_t n = 0) : utl::SpatialFunction(Tensor(n)) { ncmp = zero.size(); } diff --git a/src/Utility/Utilities.C b/src/Utility/Utilities.C index 5cf4cff4..8c8b3f4a 100644 --- a/src/Utility/Utilities.C +++ b/src/Utility/Utilities.C @@ -438,7 +438,7 @@ namespace utl int myValue; //!< The integer value to search for public: //! The constructor initializes the value to search for. - cmpInt(int value) : myValue(value) {} + explicit cmpInt(int value) : myValue(value) {} //! \brief Returns \e true if \a value.second equals \a myValue. bool operator()(const std::pair& value) const {