From 72c873b118e967a5dfbc2cbb4493f080be261752 Mon Sep 17 00:00:00 2001 From: acrovato <a.crovato@uliege.be> Date: Wed, 12 Oct 2022 16:04:44 +0200 Subject: [PATCH] Correct typos and format --- fwk/wutils.py | 2 +- tbox/src/wDss.h | 2 +- tbox/src/wElement.cpp | 14 +++++++------- tbox/src/wElement.h | 8 ++++---- tbox/src/wGmres.h | 2 +- tbox/src/wGmshExport.h | 2 +- tbox/src/wGmshImport.cpp | 14 +++++++------- tbox/src/wHex8.h | 2 +- tbox/src/wLine2.h | 2 +- tbox/src/wLinearSolver.h | 4 ++-- tbox/src/wMshCrack.cpp | 4 ++-- tbox/src/wMshExport.h | 4 ++-- tbox/src/wMumps.h | 2 +- tbox/src/wPardiso.h | 2 +- tbox/src/wPoint1.h | 2 +- tbox/src/wQuad4.h | 2 +- tbox/src/wSparseLu.h | 2 +- tbox/src/wTag.cpp | 2 +- tbox/src/wTetra4.h | 2 +- tbox/src/wTri3.h | 2 +- tbox/src/wUnitTest.cpp | 2 +- tboxVtk/src/wVtkExport.cpp | 12 ++++++------ tboxVtk/src/wVtkExport.h | 2 +- 23 files changed, 46 insertions(+), 46 deletions(-) diff --git a/fwk/wutils.py b/fwk/wutils.py index ba1c3a8..d5baa08 100644 --- a/fwk/wutils.py +++ b/fwk/wutils.py @@ -134,7 +134,7 @@ def initDLL(): # ------------------------------------------------------------------------------ def initMKL(verb=False): - """Initilize the environment for MKL + """Initialize the environment for MKL Since we use the SDL for MKL, we need to configure it at runtime. This is MUST be performed before any calls to MKL. Could be improved by performing the init from the C++ and actually checking that the threading layer is the one we want, instead of using env var. diff --git a/tbox/src/wDss.h b/tbox/src/wDss.h index 6a92000..da42e4a 100644 --- a/tbox/src/wDss.h +++ b/tbox/src/wDss.h @@ -40,7 +40,7 @@ class TBOX_API Dss : public LinearSolver public: Dss(); ~Dss(); - virtual LSOLTYPE type() const override { return LSOLTYPE::DSS; } + virtual LSolType type() const override { return LSolType::DSS; } #ifndef SWIG virtual void analyze(Eigen::SparseMatrix<double> const &A) override; diff --git a/tbox/src/wElement.cpp b/tbox/src/wElement.cpp index f2755ff..38b1c78 100644 --- a/tbox/src/wElement.cpp +++ b/tbox/src/wElement.cpp @@ -26,26 +26,26 @@ namespace tbox { TBOX_API std::ostream & -operator<<(std::ostream &out, ELTYPE const &obj) +operator<<(std::ostream &out, ElType const &obj) { switch (obj) { - case ELTYPE::LINE2: + case ElType::LINE2: out << "LINE2"; break; - case ELTYPE::TRI3: + case ElType::TRI3: out << "TRI3"; break; - case ELTYPE::QUAD4: + case ElType::QUAD4: out << "QUAD4"; break; - case ELTYPE::TETRA4: + case ElType::TETRA4: out << "TETRA4"; break; - case ELTYPE::HEX8: + case ElType::HEX8: out << "HEX8"; break; - case ELTYPE::POINT1: + case ElType::POINT1: out << "POINT1"; break; default: diff --git a/tbox/src/wElement.h b/tbox/src/wElement.h index 3c02267..000c0fc 100644 --- a/tbox/src/wElement.h +++ b/tbox/src/wElement.h @@ -29,7 +29,7 @@ namespace tbox * @brief element types (from gmsh) * @authors Romain Boman */ -enum class ELTYPE +enum class ElType { UNKNOWN = 0, LINE2 = 1, @@ -40,7 +40,7 @@ enum class ELTYPE POINT1 = 15 }; #ifndef SWIG -TBOX_API std::ostream &operator<<(std::ostream &out, ELTYPE const &obj); +TBOX_API std::ostream &operator<<(std::ostream &out, ElType const &obj); #endif /** @@ -81,9 +81,9 @@ public: Element(int n, Tag *_ptag, Tag *_etag, std::vector<Tag *> &_parts, std::vector<Node *> &nods); virtual ~Element() {} #endif - virtual ELTYPE type() const + virtual ElType type() const { - return ELTYPE::UNKNOWN; + return ElType::UNKNOWN; } #ifndef SWIG diff --git a/tbox/src/wGmres.h b/tbox/src/wGmres.h index 2a0de15..928bf34 100644 --- a/tbox/src/wGmres.h +++ b/tbox/src/wGmres.h @@ -41,7 +41,7 @@ public: Gmres(int _fill = 1, double _tsh = 1e-6, int _rst = 30, double _tol = 1e-8, int _mit = 1000); Gmres(const Gmres &gmres) : Gmres(gmres.fill, gmres.tsh, gmres.rst, gmres.tol, gmres.mit) {} virtual ~Gmres() {} - virtual LSOLTYPE type() const override { return LSOLTYPE::GMRES_ILUT; } + virtual LSolType type() const override { return LSolType::GMRES_ILUT; } #ifndef SWIG virtual void analyze(Eigen::SparseMatrix<double> const &A) override; diff --git a/tbox/src/wGmshExport.h b/tbox/src/wGmshExport.h index 0ba8b0b..dc74bf3 100644 --- a/tbox/src/wGmshExport.h +++ b/tbox/src/wGmshExport.h @@ -34,7 +34,7 @@ class TBOX_API GmshExport : public MshExport public: GmshExport(std::shared_ptr<MshData> _msh); virtual ~GmshExport(); - virtual WRTTYPE type() const override { return WRTTYPE::GMSH; } + virtual WrtType type() const override { return WrtType::GMSH; } virtual void save(std::string const &fname) const override; #ifndef SWIG diff --git a/tbox/src/wGmshImport.cpp b/tbox/src/wGmshImport.cpp index 3ea091d..4a03444 100644 --- a/tbox/src/wGmshImport.cpp +++ b/tbox/src/wGmshImport.cpp @@ -256,7 +256,7 @@ void GmshImport::readMshElements(FILE *file, int myrank) belongsToPart = true; } } - if (static_cast<ELTYPE>(type) == ELTYPE::POINT1) + if (static_cast<ElType>(type) == ElType::POINT1) belongsToPart = true; bool skipline = true; @@ -265,32 +265,32 @@ void GmshImport::readMshElements(FILE *file, int myrank) { skipline = false; std::vector<Node *> nods; - if (static_cast<ELTYPE>(type) == ELTYPE::HEX8) // 8-node hexa + if (static_cast<ElType>(type) == ElType::HEX8) // 8-node hexa { readElNods(file, 8, nods); msh->elems.push_back(new Hex8(no, ptag, etag, prts, nods)); } - else if (static_cast<ELTYPE>(type) == ELTYPE::QUAD4) // 4-node quad + else if (static_cast<ElType>(type) == ElType::QUAD4) // 4-node quad { readElNods(file, 4, nods); msh->elems.push_back(new Quad4(no, ptag, etag, prts, nods)); } - else if (static_cast<ELTYPE>(type) == ELTYPE::TETRA4) // 4-node tetra + else if (static_cast<ElType>(type) == ElType::TETRA4) // 4-node tetra { readElNods(file, 4, nods); msh->elems.push_back(new Tetra4(no, ptag, etag, prts, nods)); } - else if (static_cast<ELTYPE>(type) == ELTYPE::LINE2) // 2-node line + else if (static_cast<ElType>(type) == ElType::LINE2) // 2-node line { readElNods(file, 2, nods); msh->elems.push_back(new Line2(no, ptag, etag, prts, nods)); } - else if (static_cast<ELTYPE>(type) == ELTYPE::POINT1) // 1-node point + else if (static_cast<ElType>(type) == ElType::POINT1) // 1-node point { readElNods(file, 1, nods); msh->elems.push_back(new Point1(no, ptag, etag, prts, nods)); } - else if (static_cast<ELTYPE>(type) == ELTYPE::TRI3) // 3-node triangle + else if (static_cast<ElType>(type) == ElType::TRI3) // 3-node triangle { readElNods(file, 3, nods); msh->elems.push_back(new Tri3(no, ptag, etag, prts, nods)); diff --git a/tbox/src/wHex8.h b/tbox/src/wHex8.h index 391b73d..fb3e427 100644 --- a/tbox/src/wHex8.h +++ b/tbox/src/wHex8.h @@ -43,7 +43,7 @@ protected: public: Hex8(int n, Tag *_ptag, Tag *_etag, std::vector<Tag *> &_parts, std::vector<Node *> &nods); virtual ~Hex8() {} - virtual ELTYPE type() const override { return ELTYPE::HEX8; } + virtual ElType type() const override { return ElType::HEX8; } #ifndef SWIG virtual void initValues(bool isvol, int ordr = 2) override; diff --git a/tbox/src/wLine2.h b/tbox/src/wLine2.h index 6b07660..d87928f 100644 --- a/tbox/src/wLine2.h +++ b/tbox/src/wLine2.h @@ -49,7 +49,7 @@ protected: public: Line2(int n, Tag *_ptag, Tag *_etag, std::vector<Tag *> &_parts, std::vector<Node *> &nods); virtual ~Line2() {} - virtual ELTYPE type() const override { return ELTYPE::LINE2; } + virtual ElType type() const override { return ElType::LINE2; } #ifndef SWIG virtual void initValues(bool isvol, int ordr = 2) override; diff --git a/tbox/src/wLinearSolver.h b/tbox/src/wLinearSolver.h index 575f0c2..b717b8c 100644 --- a/tbox/src/wLinearSolver.h +++ b/tbox/src/wLinearSolver.h @@ -28,7 +28,7 @@ namespace tbox * @brief Solver type * @authors Adrien Crovato */ -enum class LSOLTYPE +enum class LSolType { UNDEFINED = 0, SPARSE_LU = 1, @@ -47,7 +47,7 @@ class TBOX_API LinearSolver : public fwk::wSharedObject public: LinearSolver() {} virtual ~LinearSolver() {} - virtual LSOLTYPE type() const { return LSOLTYPE::UNDEFINED; } + virtual LSolType type() const { return LSolType::UNDEFINED; } #ifndef SWIG virtual void analyze(Eigen::SparseMatrix<double> const &A); diff --git a/tbox/src/wMshCrack.cpp b/tbox/src/wMshCrack.cpp index 60f82df..6ab84c0 100644 --- a/tbox/src/wMshCrack.cpp +++ b/tbox/src/wMshCrack.cpp @@ -202,9 +202,9 @@ void MshCrack::openCrack() nods[j] = e->nodes[e->nodes.size() - j - 1]; } } - if (e->type() == ELTYPE::LINE2 && nDim == 2) + if (e->type() == ElType::LINE2 && nDim == 2) msh->elems.push_back(new Line2(static_cast<int>(i), tagp, tage, e->parts, nods)); - else if (e->type() == ELTYPE::TRI3 && nDim == 3) + else if (e->type() == ElType::TRI3 && nDim == 3) msh->elems.push_back(new Tri3(static_cast<int>(i), tagp, tage, e->parts, nods)); else { diff --git a/tbox/src/wMshExport.h b/tbox/src/wMshExport.h index fad7cf4..19d6e3a 100644 --- a/tbox/src/wMshExport.h +++ b/tbox/src/wMshExport.h @@ -29,7 +29,7 @@ namespace tbox * @brief Writer type * @authors Adrien Crovato */ -enum class WRTTYPE +enum class WrtType { UNDEFINED = 0, GMSH = 1, @@ -49,7 +49,7 @@ public: MshExport(std::shared_ptr<MshData> _msh); virtual ~MshExport() {} - virtual WRTTYPE type() const { return WRTTYPE::UNDEFINED; } + virtual WrtType type() const { return WrtType::UNDEFINED; } virtual void save(std::string const &fname) const; #ifndef SWIG diff --git a/tbox/src/wMumps.h b/tbox/src/wMumps.h index 518fc4d..535aa6f 100644 --- a/tbox/src/wMumps.h +++ b/tbox/src/wMumps.h @@ -53,7 +53,7 @@ private: public: Mumps(); ~Mumps(); - virtual LSOLTYPE type() const override { return LSOLTYPE::MUMPS; } + virtual LSolType type() const override { return LSolType::MUMPS; } #ifndef SWIG virtual void analyze(Eigen::SparseMatrix<double> const &A) override; diff --git a/tbox/src/wPardiso.h b/tbox/src/wPardiso.h index e8cdd63..3e6c576 100644 --- a/tbox/src/wPardiso.h +++ b/tbox/src/wPardiso.h @@ -38,7 +38,7 @@ class TBOX_API Pardiso : public LinearSolver public: Pardiso() : LinearSolver() {} virtual ~Pardiso() {} - virtual LSOLTYPE type() const override { return LSOLTYPE::PARDISO; } + virtual LSolType type() const override { return LSolType::PARDISO; } #ifndef SWIG virtual void analyze(Eigen::SparseMatrix<double> const &A) override; diff --git a/tbox/src/wPoint1.h b/tbox/src/wPoint1.h index fc78eb3..b905db0 100644 --- a/tbox/src/wPoint1.h +++ b/tbox/src/wPoint1.h @@ -31,7 +31,7 @@ class TBOX_API Point1 : public Element { public: Point1(int n, Tag *_ptag, Tag *_etag, std::vector<Tag *> &_parts, std::vector<Node *> &nods); - virtual ELTYPE type() const override { return ELTYPE::POINT1; } + virtual ElType type() const override { return ElType::POINT1; } private: static CachePoint1 &getCache(int n); diff --git a/tbox/src/wQuad4.h b/tbox/src/wQuad4.h index 75cde41..e50f121 100644 --- a/tbox/src/wQuad4.h +++ b/tbox/src/wQuad4.h @@ -47,7 +47,7 @@ protected: public: Quad4(int n, Tag *_ptag, Tag *_etag, std::vector<Tag *> &_parts, std::vector<Node *> &nods); virtual ~Quad4() {} - virtual ELTYPE type() const override { return ELTYPE::QUAD4; } + virtual ElType type() const override { return ElType::QUAD4; } #ifndef SWIG virtual void initValues(bool isvol, int ordr = 2) override; diff --git a/tbox/src/wSparseLu.h b/tbox/src/wSparseLu.h index 16768ee..84e7abe 100644 --- a/tbox/src/wSparseLu.h +++ b/tbox/src/wSparseLu.h @@ -38,7 +38,7 @@ class TBOX_API SparseLu : public LinearSolver public: SparseLu() : LinearSolver() {} virtual ~SparseLu() {} - virtual LSOLTYPE type() const override { return LSOLTYPE::SPARSE_LU; } + virtual LSolType type() const override { return LSolType::SPARSE_LU; } #ifndef SWIG virtual void analyze(Eigen::SparseMatrix<double> const &A) override; diff --git a/tbox/src/wTag.cpp b/tbox/src/wTag.cpp index e0089e7..acc8151 100644 --- a/tbox/src/wTag.cpp +++ b/tbox/src/wTag.cpp @@ -26,7 +26,7 @@ void Tag::write(std::ostream &out) const out << "D) named \"" << name << "\" (" << elems.size() << " elements) "; // count each type - std::map<ELTYPE, int> types; + std::map<ElType, int> types; for (auto e : elems) types[e->type()] += 1; diff --git a/tbox/src/wTetra4.h b/tbox/src/wTetra4.h index 371dcba..af66938 100644 --- a/tbox/src/wTetra4.h +++ b/tbox/src/wTetra4.h @@ -45,7 +45,7 @@ protected: public: Tetra4(int n, Tag *_ptag, Tag *_etag, std::vector<Tag *> &_parts, std::vector<Node *> &nods); virtual ~Tetra4() {} - virtual ELTYPE type() const override { return ELTYPE::TETRA4; } + virtual ElType type() const override { return ElType::TETRA4; } #ifndef SWIG virtual void initValues(bool isvol, int ordr = 2) override; diff --git a/tbox/src/wTri3.h b/tbox/src/wTri3.h index c042c4c..6dab1db 100644 --- a/tbox/src/wTri3.h +++ b/tbox/src/wTri3.h @@ -51,7 +51,7 @@ protected: public: Tri3(int n, Tag *_ptag, Tag *_etag, std::vector<Tag *> &_parts, std::vector<Node *> &nods); virtual ~Tri3() {} - virtual ELTYPE type() const override { return ELTYPE::TRI3; } + virtual ElType type() const override { return ElType::TRI3; } #ifndef SWIG virtual void initValues(bool isvol, int ordr = 2) override; diff --git a/tbox/src/wUnitTest.cpp b/tbox/src/wUnitTest.cpp index 7b886c2..cc91f80 100644 --- a/tbox/src/wUnitTest.cpp +++ b/tbox/src/wUnitTest.cpp @@ -82,7 +82,7 @@ void UnitTest::mshDeform(MshDeform *mshDef, int d) { // Initialize memory (volume element only) for (auto e : mshDef->msh->elems) - if ((d == 2 && e->type() == ELTYPE::TRI3) || (d == 3 && e->type() == ELTYPE::TETRA4)) + if ((d == 2 && e->type() == ElType::TRI3) || (d == 3 && e->type() == ElType::TETRA4)) e->initValues(true); // Call deform mshDef->deform(); diff --git a/tboxVtk/src/wVtkExport.cpp b/tboxVtk/src/wVtkExport.cpp index 322eff8..26d1750 100644 --- a/tboxVtk/src/wVtkExport.cpp +++ b/tboxVtk/src/wVtkExport.cpp @@ -190,42 +190,42 @@ void VtkExport::create() // Create elements for (auto e : msh->elems) { - if (e->type() == ELTYPE::HEX8) + if (e->type() == ElType::HEX8) { vtkHexaP cell = vtkHexaP::New(); for (size_t i = 0; i < e->nodes.size(); ++i) cell->GetPointIds()->SetId(i, e->nodes[i]->no - 1); grid->InsertNextCell(cell->GetCellType(), cell->GetPointIds()); } - else if (e->type() == ELTYPE::TETRA4) + else if (e->type() == ElType::TETRA4) { vtkTetraP cell = vtkTetraP::New(); for (size_t i = 0; i < e->nodes.size(); ++i) cell->GetPointIds()->SetId(i, e->nodes[i]->no - 1); grid->InsertNextCell(cell->GetCellType(), cell->GetPointIds()); } - else if (e->type() == ELTYPE::QUAD4) + else if (e->type() == ElType::QUAD4) { vtkQuadP cell = vtkQuadP::New(); for (size_t i = 0; i < e->nodes.size(); ++i) cell->GetPointIds()->SetId(i, e->nodes[i]->no - 1); grid->InsertNextCell(cell->GetCellType(), cell->GetPointIds()); } - else if (e->type() == ELTYPE::TRI3) + else if (e->type() == ElType::TRI3) { vtkTriP cell = vtkTriP::New(); for (size_t i = 0; i < e->nodes.size(); ++i) cell->GetPointIds()->SetId(i, e->nodes[i]->no - 1); grid->InsertNextCell(cell->GetCellType(), cell->GetPointIds()); } - else if (e->type() == ELTYPE::LINE2) + else if (e->type() == ElType::LINE2) { vtkLineP cell = vtkLineP::New(); for (size_t i = 0; i < e->nodes.size(); ++i) cell->GetPointIds()->SetId(i, e->nodes[i]->no - 1); grid->InsertNextCell(cell->GetCellType(), cell->GetPointIds()); } - else if (e->type() == ELTYPE::POINT1) + else if (e->type() == ElType::POINT1) { vtkVtxP cell = vtkVtxP::New(); for (size_t i = 0; i < e->nodes.size(); ++i) diff --git a/tboxVtk/src/wVtkExport.h b/tboxVtk/src/wVtkExport.h index 81d0deb..eca8b73 100644 --- a/tboxVtk/src/wVtkExport.h +++ b/tboxVtk/src/wVtkExport.h @@ -44,7 +44,7 @@ class TBOXVTK_API VtkExport : public tbox::MshExport public: VtkExport(std::shared_ptr<tbox::MshData> _msh); virtual ~VtkExport(); - virtual tbox::WRTTYPE type() const override { return tbox::WRTTYPE::VTK; } + virtual tbox::WrtType type() const override { return tbox::WrtType::VTK; } virtual void save(std::string const &fname) const override; #ifndef SWIG -- GitLab