diff --git a/Apps/Common/SIMMultiPatchModelGen.h b/Apps/Common/SIMMultiPatchModelGen.h index a6fa81b9..c1925234 100644 --- a/Apps/Common/SIMMultiPatchModelGen.h +++ b/Apps/Common/SIMMultiPatchModelGen.h @@ -31,13 +31,13 @@ public: //! \brief Constructor for standard problems. //! \param[in] n1 Dimension of the primary solution field //! \param[in] checkRHS If \e true, ensure the model is in a right-hand system - SIMMultiPatchModelGen(int n1, bool checkRHS = false) : Dim(n1,checkRHS) {} + explicit SIMMultiPatchModelGen(int n1, bool checkRHS = false) : Dim(n1,checkRHS) {} //! \brief Constructor for mixed problems. //! \param[in] unf Dimension of the primary solution field //! \param[in] checkRHS If \e true, ensure the model is in a right-hand system - SIMMultiPatchModelGen(const std::vector& unf, - bool checkRHS = false) : Dim(unf,checkRHS) {} + explicit SIMMultiPatchModelGen(const std::vector& unf, + bool checkRHS = false) : Dim(unf,checkRHS) {} //! \brief Empty destructor. virtual ~SIMMultiPatchModelGen() {} diff --git a/Apps/Common/SIMSolver.h b/Apps/Common/SIMSolver.h index 99863803..93af4ed4 100644 --- a/Apps/Common/SIMSolver.h +++ b/Apps/Common/SIMSolver.h @@ -32,7 +32,7 @@ template class SIMSolverStat : public SIMadmin { public: //! \brief The constructor initializes the reference to the actual solver. - SIMSolverStat(T1& s1, const char* head = nullptr) : SIMadmin(head), S1(s1) + explicit SIMSolverStat(T1& s1, const char* head = nullptr) : SIMadmin(head), S1(s1) { exporter = nullptr; startExpLevel = 0; diff --git a/src/ASM/ASMs2DIB.h b/src/ASM/ASMs2DIB.h index b9f3694c..4ce21256 100644 --- a/src/ASM/ASMs2DIB.h +++ b/src/ASM/ASMs2DIB.h @@ -37,7 +37,7 @@ class ASMs2DIB : public ASMs2D bool alsoSW; //!< If \e true, consider south/west neighbors too public: //! \brief The constructor initialises the reference to current patch. - Intersected(const ASMs2DIB& pch, bool all = false, bool sw = false) + explicit Intersected(const ASMs2DIB& pch, bool all = false, bool sw = false) : InterfaceChecker(pch), myAll(all), alsoSW(sw) {} //! \brief Empty destructor. virtual ~Intersected() {} diff --git a/src/ASM/AlgEqSystem.h b/src/ASM/AlgEqSystem.h index 7e97c33d..9da8da7b 100644 --- a/src/ASM/AlgEqSystem.h +++ b/src/ASM/AlgEqSystem.h @@ -26,7 +26,7 @@ class AlgEqSystem : public GlobalIntegral { public: //! \brief The constructor sets its reference to SAM and ProcessAdm objects. - AlgEqSystem(const SAM& s, const ProcessAdm* a = nullptr); + explicit AlgEqSystem(const SAM& s, const ProcessAdm* a = nullptr); //! \brief The destructor frees the dynamically allocated objects. virtual ~AlgEqSystem() { this->clear(); } diff --git a/src/ASM/BlockElmMats.h b/src/ASM/BlockElmMats.h index d3bd2659..bfbc214a 100644 --- a/src/ASM/BlockElmMats.h +++ b/src/ASM/BlockElmMats.h @@ -32,7 +32,7 @@ public: //! \brief The constructor initializes the block information arrays. //! \param[in] nBlk Number of matrix blocks (in each direction, row & column) //! \param[in] nb Number of bases (> 1 for mixed problems) - BlockElmMats(size_t nBlk, size_t nb = 1) : blockInfo(nBlk), basisInfo(nb) {} + explicit BlockElmMats(size_t nBlk, size_t nb = 1) : blockInfo(nBlk), basisInfo(nb) {} //! \brief Empty destructor. virtual ~BlockElmMats() {} diff --git a/src/ASM/FiniteElement.h b/src/ASM/FiniteElement.h index 8038972f..469b2505 100644 --- a/src/ASM/FiniteElement.h +++ b/src/ASM/FiniteElement.h @@ -98,7 +98,7 @@ class MxFiniteElement : public FiniteElement { public: //! \brief The constructor initializes the size of each basis. - MxFiniteElement(const std::vector& n, size_t ip = 0); + explicit MxFiniteElement(const std::vector& n, size_t ip = 0); //! \brief Empty destructor. virtual ~MxFiniteElement() {} diff --git a/src/ASM/GlbNorm.h b/src/ASM/GlbNorm.h index d5601f02..63e07e71 100644 --- a/src/ASM/GlbNorm.h +++ b/src/ASM/GlbNorm.h @@ -31,7 +31,7 @@ public: //! \brief The constructor initializes a reference to the global norm vector. //! \param[in] v Vector of global norm quantities //! \param[in] op Operation to be performed after accumulating element norms - GlbNorm(Vectors& v, ASM::FinalNormOp op = ASM::NONE); + explicit GlbNorm(Vectors& v, ASM::FinalNormOp op = ASM::NONE); //! \brief The destructor applies the operation \a myOp on \a myVals. virtual ~GlbNorm(); diff --git a/src/LinAlg/DenseMatrix.h b/src/LinAlg/DenseMatrix.h index 3915c0e9..49cf5a77 100644 --- a/src/LinAlg/DenseMatrix.h +++ b/src/LinAlg/DenseMatrix.h @@ -31,9 +31,9 @@ public: //! \brief Copy constructor. DenseMatrix(const DenseMatrix& A); //! \brief Special constructor taking data from a one-dimensional array. - DenseMatrix(const RealArray& data, size_t nrows = 0); + explicit DenseMatrix(const RealArray& data, size_t nrows = 0); //! \brief Special constructor, type conversion from Matrix. - DenseMatrix(const Matrix& A, bool s = false); + explicit DenseMatrix(const Matrix& A, bool s = false); //! \brief The destructor frees the dynamically allocated arrays. virtual ~DenseMatrix() { if (ipiv) delete[] ipiv; } diff --git a/src/LinAlg/SparseMatrix.h b/src/LinAlg/SparseMatrix.h index 163e689b..373485e3 100644 --- a/src/LinAlg/SparseMatrix.h +++ b/src/LinAlg/SparseMatrix.h @@ -44,7 +44,7 @@ public: //! \brief Default constructor creating an empty matrix. SparseMatrix(SparseSolver eqSolver = NONE, int nt = 1); //! \brief Constructor creating a \f$m \times n\f$ matrix. - SparseMatrix(size_t m, size_t n = 0); + explicit SparseMatrix(size_t m, size_t n = 0); //! \brief Copy constructor. SparseMatrix(const SparseMatrix& B); //! \brief The destructor frees the dynamically allocated arrays. diff --git a/src/LinAlg/matrixnd.h b/src/LinAlg/matrixnd.h index 90e587dc..f90ad519 100644 --- a/src/LinAlg/matrixnd.h +++ b/src/LinAlg/matrixnd.h @@ -39,7 +39,7 @@ namespace utl //! \brief Copy constructor. matrix3d(const matrix3d& mat) : matrixBase(mat) {} //! \brief Constructor to read a matrix from a stream. - matrix3d(std::istream& is, std::streamsize max = 10) + explicit matrix3d(std::istream& is, std::streamsize max = 10) { // Read size size_t n0 = 0, n1 = 0, n2 = 0; diff --git a/src/SIM/FunctionSum.h b/src/SIM/FunctionSum.h index 416adf28..b9a82171 100644 --- a/src/SIM/FunctionSum.h +++ b/src/SIM/FunctionSum.h @@ -33,7 +33,7 @@ public: //! \brief The constructor specifies the first function to sum. //! \param[in] f Pointer to a function to sum //! \param[in] w Weighting factor. If negative, take max value instead. - FunctionSum(FunctionBase* f, double w = 1.0) { this->add(f,w); } + explicit FunctionSum(FunctionBase* f, double w = 1.0) { this->add(f,w); } //! \brief Empty destructor. virtual ~FunctionSum() {} diff --git a/src/SIM/NonLinSIM.h b/src/SIM/NonLinSIM.h index 97ffdf5c..56a02d75 100644 --- a/src/SIM/NonLinSIM.h +++ b/src/SIM/NonLinSIM.h @@ -39,7 +39,7 @@ public: //! \brief The constructor initializes default solution parameters. //! \param sim Pointer to the spline FE model //! \param[in] n Which type of iteration norm to use in convergence checks - NonLinSIM(SIMbase& sim, CNORM n = ENERGY); + explicit NonLinSIM(SIMbase& sim, CNORM n = ENERGY); //! \brief The destructor prints out the slow-converging nodes, if any. virtual ~NonLinSIM(); diff --git a/src/SIM/SIM1D.h b/src/SIM/SIM1D.h index 75442fb2..c3b5f8b6 100644 --- a/src/SIM/SIM1D.h +++ b/src/SIM/SIM1D.h @@ -32,11 +32,11 @@ public: SIM1D(unsigned char n1 = 1, bool = false); //! \brief Constructor used for mixed problems. //! \param[in] unf Dimension of the primary solution fields - SIM1D(const CharVec& unf, bool = false); + explicit SIM1D(const CharVec& unf, bool = false); //! \brief Constructor that also initializes the integrand pointer. //! \param[in] itg Pointer to the integrand of the problem to solve //! \param[in] n Dimension of the primary solution field - SIM1D(IntegrandBase* itg, unsigned char n = 1); + explicit SIM1D(IntegrandBase* itg, unsigned char n = 1); //! \brief Empty destructor. virtual ~SIM1D() {} diff --git a/src/SIM/SIM2D.h b/src/SIM/SIM2D.h index 96886198..911dbc4a 100644 --- a/src/SIM/SIM2D.h +++ b/src/SIM/SIM2D.h @@ -36,12 +36,12 @@ public: //! \brief Constructor used for mixed problems. //! \param[in] unf Dimension of the primary solution fields //! \param[in] check If \e true, ensure the model is in a right-hand system - SIM2D(const CharVec& unf, bool check = false); + explicit SIM2D(const CharVec& unf, bool check = false); //! \brief Constructor that also initializes the integrand pointer. //! \param[in] itg Pointer to the integrand of the problem to solve //! \param[in] n Dimension of the primary solution field //! \param[in] check If \e true, ensure the model is in a right-hand system - SIM2D(IntegrandBase* itg, unsigned char n = 2, bool check = false); + explicit SIM2D(IntegrandBase* itg, unsigned char n = 2, bool check = false); //! \brief Empty destructor. virtual ~SIM2D() {} diff --git a/src/SIM/SIM3D.h b/src/SIM/SIM3D.h index d50e1211..9e7ea089 100644 --- a/src/SIM/SIM3D.h +++ b/src/SIM/SIM3D.h @@ -36,12 +36,12 @@ public: //! \brief Constructor used for mixed problems. //! \param[in] unf Dimension of the primary solution fields //! \param[in] check If \e true, ensure the model is in a right-hand system - SIM3D(const CharVec& unf, bool check = false); + explicit SIM3D(const CharVec& unf, bool check = false); //! \brief Constructor that also initializes the integrand pointer. //! \param[in] itg Pointer to the integrand of the problem to solve //! \param[in] n Dimension of the primary solution field //! \param[in] check If \e true, ensure the model is in a right-hand system - SIM3D(IntegrandBase* itg, unsigned char n = 3, bool check = false); + explicit SIM3D(IntegrandBase* itg, unsigned char n = 3, bool check = false); //! \brief Empty destructor. virtual ~SIM3D() {} diff --git a/src/SIM/SIMmultiCpl.h b/src/SIM/SIMmultiCpl.h index 03afca1f..87d18032 100644 --- a/src/SIM/SIMmultiCpl.h +++ b/src/SIM/SIMmultiCpl.h @@ -29,7 +29,7 @@ class SIMmultiCpl : public SIMadmin { public: //! \brief The constructor initializes the array of base %SIM objects. - SIMmultiCpl(const std::vector& sims); + explicit SIMmultiCpl(const std::vector& sims); //! \brief The destructor deletes the base %SIM objects. virtual ~SIMmultiCpl(); diff --git a/src/Utility/ExprFunctions.h b/src/Utility/ExprFunctions.h index 53d336ac..5757e680 100644 --- a/src/Utility/ExprFunctions.h +++ b/src/Utility/ExprFunctions.h @@ -50,7 +50,7 @@ public: static int numError; //!< Error counter - set by the exception handler //! \brief The constructor parses the expression string. - EvalFunc(const char* function, const char* x = "x", Real eps = Real(1.0e-8)); + explicit EvalFunc(const char* function, const char* x = "x", Real eps = Real(1.0e-8)); //! \brief The destructor frees the dynamically allocated objects. virtual ~EvalFunc(); diff --git a/src/Utility/Functions.h b/src/Utility/Functions.h index 2dc33937..585b4075 100644 --- a/src/Utility/Functions.h +++ b/src/Utility/Functions.h @@ -170,7 +170,7 @@ class StepFunc : public ScalarFunc public: //! \brief Constructor initializing the function parameters. - StepFunc(Real a, Real x = Real(0)) : amp(a), xmax(x) {} + explicit StepFunc(Real a, Real x = Real(0)) : amp(a), xmax(x) {} //! \brief Returns whether the function is identically zero or not. virtual bool isZero() const { return amp == Real(0); } @@ -298,7 +298,7 @@ class LinearXFunc : public RealFunc public: //! \brief Constructor initializing the function parameters. - LinearXFunc(Real A, Real B = Real(0)) : a(A), b(B) {} + explicit LinearXFunc(Real A, Real B = Real(0)) : a(A), b(B) {} //! \brief Returns whether the function is identically zero or not. virtual bool isZero() const { return a == Real(0) && b == Real(0); } @@ -323,7 +323,7 @@ class LinearYFunc : public RealFunc public: //! \brief Constructor initializing the function parameters. - LinearYFunc(Real A, Real B = Real(0)) : a(A), b(B) {} + explicit LinearYFunc(Real A, Real B = Real(0)) : a(A), b(B) {} //! \brief Returns whether the function is identically zero or not. virtual bool isZero() const { return a == Real(0) && b == Real(0); } @@ -348,7 +348,7 @@ class LinearZFunc : public RealFunc public: //! \brief Constructor initializing the function parameters. - LinearZFunc(Real A, Real B = Real(0)) : a(A), b(B) {} + explicit LinearZFunc(Real A, Real B = Real(0)) : a(A), b(B) {} //! \brief Returns whether the function is identically zero or not. virtual bool isZero() const { return a == Real(0) && b == Real(0); } @@ -497,7 +497,7 @@ class StepXFunc : public RealFunc public: //! \brief Constructor initializing the function parameters. - StepXFunc(Real v, Real X0 = Real(0), Real X1 = Real(1), char dir = 'X') + explicit StepXFunc(Real v, Real X0 = Real(0), Real X1 = Real(1), char dir = 'X') : fv(v), x0(X0), x1(X1), d(dir) {} //! \brief Returns whether the function is identically zero or not. @@ -523,7 +523,7 @@ class StepXYFunc : public RealFunc public: //! \brief Constructor initializing the function parameters. - StepXYFunc(Real v, + explicit StepXYFunc(Real v, Real X1 = Real(1), Real Y1 = Real(1), Real X0 = Real(-1), Real Y0 = Real(-1)) : fv(v), x0(X0), y0(Y0), x1(X1), y1(Y1) {} diff --git a/src/Utility/LogStream.h b/src/Utility/LogStream.h index 5c7a3d3b..98d5cfbf 100644 --- a/src/Utility/LogStream.h +++ b/src/Utility/LogStream.h @@ -32,7 +32,7 @@ public: //! \param out The output stream to wrap //! \param ppid The PID to print on //! \param mypid The PID of this process - LogStream(std::ostream& out, int ppid = 0, int mypid = 0); + explicit LogStream(std::ostream& out, int ppid = 0, int mypid = 0); //! \brief Nullifies the output stream. void setNull() { m_out = nullptr; } diff --git a/src/Utility/Point.h b/src/Utility/Point.h index f8edbdfe..983e6d4e 100644 --- a/src/Utility/Point.h +++ b/src/Utility/Point.h @@ -34,7 +34,7 @@ namespace utl Point() : Vec4(par) { par[0] = par[1] = par[2] = Real(0); } //! \brief Constructor creating a point at the specified location. - Point(const Vec3& X) : Vec4(X,Real(0),par) + explicit Point(const Vec3& X) : Vec4(X,Real(0),par) { par[0] = par[1] = par[2] = Real(0); } @@ -54,7 +54,7 @@ namespace utl } //! \brief Constructor creating a point from the given \a std::vector. - Point(const std::vector& X) : Vec4(X,par) + explicit Point(const std::vector& X) : Vec4(X,par) { for (size_t i = 0; i < 3; i++) par[i] = 3+i < X.size() ? X[3+i] : 0.0;