From 020f87a203f07a99ac1a32869ca874df0b4a2d7e Mon Sep 17 00:00:00 2001 From: vdweide Date: Wed, 5 Feb 2025 15:52:24 +0100 Subject: [PATCH] Result of running pre-commit --- Common/include/geometry/CPhysicalGeometry.hpp | 21 +- .../geometry/meshreader/CBoxMeshReaderFEM.hpp | 11 +- .../geometry/meshreader/CCGNSElementType.hpp | 203 +-- .../meshreader/CCGNSMeshReaderFEM.hpp | 24 +- .../geometry/meshreader/CMeshReaderBase.hpp | 20 +- .../meshreader/CSU2ASCIIMeshReaderFEM.hpp | 5 +- .../primal_grid/CPrimalGridBoundFEM.hpp | 2 +- .../geometry/primal_grid/CPrimalGridFEM.hpp | 3 +- Common/src/fem/fem_geometry_structure.cpp | 9 +- .../src/fem/geometry_structure_fem_part.cpp | 113 +- Common/src/geometry/CPhysicalGeometry.cpp | 31 +- .../geometry/meshreader/CBoxMeshReaderFEM.cpp | 215 ++- .../geometry/meshreader/CCGNSElementType.cpp | 1253 +++++++++++------ .../meshreader/CCGNSMeshReaderBase.cpp | 68 +- .../meshreader/CCGNSMeshReaderFEM.cpp | 237 ++-- .../meshreader/CCGNSMeshReaderFVM.cpp | 3 +- .../geometry/meshreader/CMeshReaderBase.cpp | 43 +- .../meshreader/CRectangularMeshReaderFEM.cpp | 120 +- .../meshreader/CSU2ASCIIMeshReaderBase.cpp | 3 +- .../meshreader/CSU2ASCIIMeshReaderFEM.cpp | 183 ++- .../meshreader/CSU2ASCIIMeshReaderFVM.cpp | 3 +- .../primal_grid/CPrimalGridBoundFEM.cpp | 17 +- .../geometry/primal_grid/CPrimalGridFEM.cpp | 18 +- 23 files changed, 1436 insertions(+), 1169 deletions(-) diff --git a/Common/include/geometry/CPhysicalGeometry.hpp b/Common/include/geometry/CPhysicalGeometry.hpp index 2e90f374ca7..e6a871bb977 100644 --- a/Common/include/geometry/CPhysicalGeometry.hpp +++ b/Common/include/geometry/CPhysicalGeometry.hpp @@ -285,8 +285,7 @@ class CPhysicalGeometry final : public CGeometry { * \param[in] val_iZone - Domain to be read from the grid file. * \param[in] val_nZone - Total number of domains in the grid file. */ - void Read_Mesh(CConfig* config, const string& val_mesh_filename, unsigned short val_iZone, - unsigned short val_nZone); + void Read_Mesh(CConfig* config, const string& val_mesh_filename, unsigned short val_iZone, unsigned short val_nZone); /*! * \brief Routine to load the CGNS grid points from a single zone into the proper SU2 data structures. @@ -300,7 +299,7 @@ class CPhysicalGeometry final : public CGeometry { * \param[in] config - definition of the particular problem. * \param[in] mesh - mesh reader object containing the current zone data. */ - void LoadLinearlyPartitionedPointsFEM(CConfig *config, CMeshReaderBase *mesh); + void LoadLinearlyPartitionedPointsFEM(CConfig* config, CMeshReaderBase* mesh); /*! * \brief Loads the interior volume elements from the mesh reader object into the primal element data structures. @@ -310,11 +309,11 @@ class CPhysicalGeometry final : public CGeometry { void LoadLinearlyPartitionedVolumeElements(CConfig* config, CMeshReaderBase* mesh); /*! - * \brief Loads the interior volume elements from the mesh reader object into the primal element data structures for the FEM solver. - * \param[in] config - definition of the particular problem. - * \param[in] mesh - mesh reader object containing the current zone data. + * \brief Loads the interior volume elements from the mesh reader object into the primal element data structures for + * the FEM solver. \param[in] config - definition of the particular problem. \param[in] mesh - mesh reader object + * containing the current zone data. */ - void LoadLinearlyPartitionedVolumeElementsFEM(CConfig *config, CMeshReaderBase *mesh); + void LoadLinearlyPartitionedVolumeElementsFEM(CConfig* config, CMeshReaderBase* mesh); /*! * \brief Loads the boundary elements (markers) from the mesh reader object into the primal element data structures. @@ -324,11 +323,11 @@ class CPhysicalGeometry final : public CGeometry { void LoadUnpartitionedSurfaceElements(CConfig* config, CMeshReaderBase* mesh); /*! - * \brief Loads the boundary elements (markers) from the mesh reader object into the primal element data structures for the FEM solver. - * \param[in] config - definition of the particular problem. - * \param[in] mesh - mesh reader object containing the current zone data. + * \brief Loads the boundary elements (markers) from the mesh reader object into the primal element data structures + * for the FEM solver. \param[in] config - definition of the particular problem. \param[in] mesh - mesh reader + * object containing the current zone data. */ - void LoadLinearlyPartitionedSurfaceElementsFEM(CConfig *config, CMeshReaderBase *mesh); + void LoadLinearlyPartitionedSurfaceElementsFEM(CConfig* config, CMeshReaderBase* mesh); /*! * \brief Prepares the grid point adjacency based on a linearly partitioned mesh object needed by ParMETIS for graph diff --git a/Common/include/geometry/meshreader/CBoxMeshReaderFEM.hpp b/Common/include/geometry/meshreader/CBoxMeshReaderFEM.hpp index acfafef6365..f5a0e53934b 100644 --- a/Common/include/geometry/meshreader/CBoxMeshReaderFEM.hpp +++ b/Common/include/geometry/meshreader/CBoxMeshReaderFEM.hpp @@ -35,10 +35,8 @@ * \brief Reads a 3D box grid into linear partitions for the finite element solver (FEM). * \author: T. Economon, E. van der Weide */ -class CBoxMeshReaderFEM final: public CMeshReaderBase { - -private: - +class CBoxMeshReaderFEM final : public CMeshReaderBase { + private: unsigned long nNode; /*!< \brief Number of grid nodes in the x-direction. */ unsigned long mNode; /*!< \brief Number of grid nodes in the y-direction. */ unsigned long pNode; /*!< \brief Number of grid nodes in the z-direction. */ @@ -71,12 +69,11 @@ class CBoxMeshReaderFEM final: public CMeshReaderBase { */ void ComputeBoxSurfaceConnectivity(); -public: - + public: /*! * \brief Constructor of the CBoxMeshReaderFEM class. */ - CBoxMeshReaderFEM(const CConfig *val_config, unsigned short val_iZone, unsigned short val_nZone); + CBoxMeshReaderFEM(const CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone); /*! * \brief Destructor of the CBoxMeshReaderFEM class. diff --git a/Common/include/geometry/meshreader/CCGNSElementType.hpp b/Common/include/geometry/meshreader/CCGNSElementType.hpp index e081347be1b..fbe944f0114 100644 --- a/Common/include/geometry/meshreader/CCGNSElementType.hpp +++ b/Common/include/geometry/meshreader/CCGNSElementType.hpp @@ -41,19 +41,17 @@ using namespace std; /*! * \class CCGNSElementType * \brief Class used to convert the CGNS format to SU2 format for high order elements. -* \author: E. van der Weide + * \author: E. van der Weide */ class CCGNSElementType { -private: - - vector CGNSTypeStored; /*!< \brief CGNS element types for which the data is stored. */ - vector VTKTypeStored; /*!< \brief VTK type of the element. */ - vector nPolyStored; /*!< \brief Polynomial degree of the element. */ - vector nDOFsStored; /*!< \brief Number of DOFs of the element. */ - vector > SU2ToCGNSStored; /*!< \brief Double vector, which stores the conversion + private: + vector CGNSTypeStored; /*!< \brief CGNS element types for which the data is stored. */ + vector VTKTypeStored; /*!< \brief VTK type of the element. */ + vector nPolyStored; /*!< \brief Polynomial degree of the element. */ + vector nDOFsStored; /*!< \brief Number of DOFs of the element. */ + vector > SU2ToCGNSStored; /*!< \brief Double vector, which stores the conversion from SU2 to CGNS for the type in local numbering. */ -public: - + public: /*--- Standard constructor, nothing to be done. ---*/ CCGNSElementType() = default; @@ -67,13 +65,10 @@ class CCGNSElementType { * \param[in] connCGNS - Array with the connectivity of the element in CGNS format. * \param[out] connSU2 - Vector with the connectivity and meta data in SU2 format. */ - void CGNSToSU2(const ElementType_t val_elemType, - const unsigned long val_globalID, - const cgsize_t *connCGNS, - std::vector &connSU2); - -private: + void CGNSToSU2(const ElementType_t val_elemType, const unsigned long val_globalID, const cgsize_t* connCGNS, + std::vector& connSU2); + private: /*! * \brief Converts the connectivity from CGNS to SU2 for a node. * \param[out] VTK_Type - Corresponding VTK type @@ -81,10 +76,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataNODE(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataNODE(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Bar2 element. @@ -93,10 +86,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataBAR_2(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataBAR_2(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Bar3 element. @@ -105,22 +96,18 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataBAR_3(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataBAR_3(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); - /*! + /*! * \brief Converts the connectivity from CGNS to SU2 for a Bar4 element. * \param[out] VTK_Type - Corresponding VTK type * \param[out] nPoly - Polynomial degree * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataBAR_4(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataBAR_4(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Bar5 element. @@ -129,10 +116,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataBAR_5(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataBAR_5(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Tri3 element. @@ -141,10 +126,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataTRI_3(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataTRI_3(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Tri6 element. @@ -153,10 +136,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataTRI_6(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataTRI_6(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Tri10 element. @@ -165,10 +146,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataTRI_10(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataTRI_10(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Tri15 element. @@ -177,10 +156,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataTRI_15(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataTRI_15(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Quad4 element. @@ -189,10 +166,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataQUAD_4(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataQUAD_4(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Quad9 element. @@ -201,10 +176,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataQUAD_9(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataQUAD_9(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Quad16 element. @@ -213,10 +186,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataQUAD_16(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataQUAD_16(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Quad25 element. @@ -225,10 +196,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataQUAD_25(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataQUAD_25(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Tetra4 element. @@ -237,10 +206,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataTETRA_4(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataTETRA_4(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Tetra10 element. @@ -249,10 +216,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataTETRA_10(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataTETRA_10(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Tetra20 element. @@ -261,10 +226,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataTETRA_20(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataTETRA_20(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Tetra35 element. @@ -273,10 +236,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataTETRA_35(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataTETRA_35(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Pyra5 element. @@ -285,10 +246,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataPYRA_5(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataPYRA_5(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Pyra14 element. @@ -297,10 +256,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataPYRA_14(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataPYRA_14(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Pyra30 element. @@ -309,10 +266,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataPYRA_30(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataPYRA_30(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Pyra55 element. @@ -321,10 +276,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataPYRA_55(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataPYRA_55(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Penta6 element. @@ -333,10 +286,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataPENTA_6(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataPENTA_6(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Penta18 element. @@ -345,10 +296,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataPENTA_18(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataPENTA_18(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Penta40 element. @@ -357,10 +306,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataPENTA_40(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataPENTA_40(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Penta75 element. @@ -369,10 +316,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataPENTA_75(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataPENTA_75(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Hexa8 element. @@ -381,10 +326,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataHEXA_8(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataHEXA_8(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Hexa27 element. @@ -393,10 +336,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataHEXA_27(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataHEXA_27(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Hexa64 element. @@ -405,10 +346,8 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataHEXA_64(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataHEXA_64(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); /*! * \brief Converts the connectivity from CGNS to SU2 for a Hexa125 element. @@ -417,9 +356,7 @@ class CCGNSElementType { * \param[out] nDOFs - Number of DOFs of the element. * \param[out] SU2ToCGNS - Vector containing the mapping from SU2 to CGNS. */ - void CreateDataHEXA_125(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS); + void CreateDataHEXA_125(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS); }; #endif diff --git a/Common/include/geometry/meshreader/CCGNSMeshReaderFEM.hpp b/Common/include/geometry/meshreader/CCGNSMeshReaderFEM.hpp index a07bf969f4c..cb7fcd404e8 100644 --- a/Common/include/geometry/meshreader/CCGNSMeshReaderFEM.hpp +++ b/Common/include/geometry/meshreader/CCGNSMeshReaderFEM.hpp @@ -37,7 +37,6 @@ */ class CCGNSMeshReaderFEM final : public CCGNSMeshReaderBase { private: - /*! * \brief Communicates the grid points to the MPI rank where they are needed. */ @@ -54,20 +53,18 @@ class CCGNSMeshReaderFEM final : public CCGNSMeshReaderBase { * \param[inout] localElemCount - Counter, which keeps track how many local elements are stored. * \param[inout] localConn - Vector where the connectivity must be stored. */ - void ReadCGNSConnectivityRangeSection(const int val_section, - const unsigned long val_firstIndex, - const unsigned long val_lastIndex, - unsigned long &elemCount, - unsigned long &localElemCount, - vector &localConn); + void ReadCGNSConnectivityRangeSection(const int val_section, const unsigned long val_firstIndex, + const unsigned long val_lastIndex, unsigned long& elemCount, + unsigned long& localElemCount, vector& localConn); -/*! + /*! * \brief Reads the interior volume elements from one section of a CGNS zone into linear partitions across all ranks. */ void ReadCGNSVolumeElementConnectivity(); /*! - * \brief Reads the surface (boundary) elements from one section of a CGNS zone into linear partitions across all ranks. + * \brief Reads the surface (boundary) elements from one section of a CGNS zone into linear partitions across all + * ranks. */ void ReadCGNSSurfaceElementConnectivity(); @@ -78,18 +75,15 @@ class CCGNSMeshReaderFEM final : public CCGNSMeshReaderBase { * \param[out] nSurfElem - Number of local surface elements stored for this surface section. * \param[out] surfConn - Vector to store the connectivity of the surface elements to be stored. */ - void ReadCGNSSurfaceSection(const int val_section, - const vector &localFaces, - unsigned long &nSurfElem, - vector &surfConn); + void ReadCGNSSurfaceSection(const int val_section, const vector& localFaces, unsigned long& nSurfElem, + vector& surfConn); #endif public: - /*! * \brief Constructor of the CCGNSMeshReaderFEM class. */ - CCGNSMeshReaderFEM(const CConfig *val_config, unsigned short val_iZone, unsigned short val_nZone); + CCGNSMeshReaderFEM(const CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone); /*! * \brief Destructor of the CCGNSMeshReaderFEM class. diff --git a/Common/include/geometry/meshreader/CMeshReaderBase.hpp b/Common/include/geometry/meshreader/CMeshReaderBase.hpp index da3f72c48cc..622b48db4c8 100644 --- a/Common/include/geometry/meshreader/CMeshReaderBase.hpp +++ b/Common/include/geometry/meshreader/CMeshReaderBase.hpp @@ -66,16 +66,18 @@ class CMeshReaderBase { unsigned long numberOfMarkers = 0; /*!< \brief Total number of markers contained within the mesh file. */ vector markerNames; /*!< \brief String names for all markers in the mesh file. */ - vector numberOfLocalSurfaceElements; /*!< \brief Vector containing the number of local surface elements. */ + vector + numberOfLocalSurfaceElements; /*!< \brief Vector containing the number of local surface elements. */ vector > surfaceElementConnectivity; /*!< \brief Vector containing the surface element connectivity from the mesh file on a - per-marker basis. For FVM, only the master node reads and stores this connectivity. */ + per-marker basis. For FVM, only the master node reads and stores this connectivity. + */ /*! * \brief Function, which determines the faces of the local volume elements. * \param[out] localFaces - The faces of the locally stored volume elements. */ - void DetermineFacesVolumeElements(vector &localFaces); + void DetermineFacesVolumeElements(vector& localFaces); /*! * \brief Get all the corner points of all the faces of the given element. It must @@ -84,10 +86,8 @@ class CMeshReaderBase { * \param[out] nPointsPerFace - Number of corner points for each of the faces. * \param[out] faceConn - Global IDs of the corner points of the faces. */ - void GetCornerPointsAllFaces(const unsigned long *elemInfo, - unsigned short &numFaces, - unsigned short nPointsPerFace[], - unsigned long faceConn[6][4]); + void GetCornerPointsAllFaces(const unsigned long* elemInfo, unsigned short& numFaces, unsigned short nPointsPerFace[], + unsigned long faceConn[6][4]); public: /*! @@ -110,9 +110,7 @@ class CMeshReaderBase { * \brief Get the global IDs of the local points. * \returns Reference to the vector containing the global points IDs. */ - inline const vector &GetGlobalPointIDs() const { - return globalPointIDs; - } + inline const vector& GetGlobalPointIDs() const { return globalPointIDs; } /*! * \brief Get the local point coordinates (linearly partitioned). @@ -133,7 +131,7 @@ class CMeshReaderBase { * \brief Get the number surface elements for all markers. * \returns Reference to the vector containing the number of surface elements for all markers. */ - inline const vector &GetNumberOfSurfaceElementsAllMarkers() const { + inline const vector& GetNumberOfSurfaceElementsAllMarkers() const { return numberOfLocalSurfaceElements; } diff --git a/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFEM.hpp b/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFEM.hpp index 3b4759a9301..d92cf336103 100644 --- a/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFEM.hpp +++ b/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFEM.hpp @@ -50,7 +50,8 @@ class CSU2ASCIIMeshReaderFEM : public CSU2ASCIIMeshReaderBase { void ReadVolumeElementConnectivity(); /*! - * \brief Reads the surface (boundary) elements from one section of an SU2 zone into linear partitions across all ranks. + * \brief Reads the surface (boundary) elements from one section of an SU2 zone into linear partitions across all + * ranks. */ void ReadSurfaceElementConnectivity(); @@ -58,7 +59,7 @@ class CSU2ASCIIMeshReaderFEM : public CSU2ASCIIMeshReaderBase { /*! * \brief Constructor of the CSU2ASCIIMeshReaderFEM class. */ - CSU2ASCIIMeshReaderFEM(CConfig *val_config, unsigned short val_iZone, unsigned short val_nZone); + CSU2ASCIIMeshReaderFEM(CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone); /*! * \brief Destructor of the CSU2ASCIIMeshReaderFEM class. diff --git a/Common/include/geometry/primal_grid/CPrimalGridBoundFEM.hpp b/Common/include/geometry/primal_grid/CPrimalGridBoundFEM.hpp index 3a2233246cf..3975d1debba 100644 --- a/Common/include/geometry/primal_grid/CPrimalGridBoundFEM.hpp +++ b/Common/include/geometry/primal_grid/CPrimalGridBoundFEM.hpp @@ -53,7 +53,7 @@ class CPrimalGridBoundFEM final : public CPrimalGrid { * \brief Constructor using data to initialize the boundary element. * \param[in] dataElem - Meta and connectivity data for this element. */ - CPrimalGridBoundFEM(const unsigned long *dataElem); + CPrimalGridBoundFEM(const unsigned long* dataElem); /*! * \brief Get the number of nodes that composes a face of an element. diff --git a/Common/include/geometry/primal_grid/CPrimalGridFEM.hpp b/Common/include/geometry/primal_grid/CPrimalGridFEM.hpp index 5caa92e0d87..77e1a5fc3b9 100644 --- a/Common/include/geometry/primal_grid/CPrimalGridFEM.hpp +++ b/Common/include/geometry/primal_grid/CPrimalGridFEM.hpp @@ -53,13 +53,12 @@ class CPrimalGridFEM final : public CPrimalGrid { is (almost) constant. */ public: - /*! * \brief Constructor using data to initialize the element. * \param[in] dataElem - Meta and connectivity data for this element. * \param[in,out] offsetDOFs - The offset of the solution DOFs for this element. */ - CPrimalGridFEM(const unsigned long *dataElem, unsigned long &offsetSolDOFs); + CPrimalGridFEM(const unsigned long* dataElem, unsigned long& offsetSolDOFs); /*! * \brief Get the number of nodes that composes a face of an element. diff --git a/Common/src/fem/fem_geometry_structure.cpp b/Common/src/fem/fem_geometry_structure.cpp index 1f1c7495b2c..e5580de752e 100644 --- a/Common/src/fem/fem_geometry_structure.cpp +++ b/Common/src/fem/fem_geometry_structure.cpp @@ -379,8 +379,8 @@ CMeshFEM::CMeshFEM(CGeometry* geometry, CConfig* config) { /* Loop over the local boundary elements in geometry for this marker. */ for (unsigned long i = 0; i < geometry->GetnElem_Bound(iMarker); ++i) { /* Determine the local ID of the corresponding domain element. */ - unsigned long elemID = geometry->bound[iMarker][i]->GetDomainElement() - - elemPartitioner.GetFirstIndexOnRank(rank); + unsigned long elemID = + geometry->bound[iMarker][i]->GetDomainElement() - elemPartitioner.GetFirstIndexOnRank(rank); /* Determine to which rank this boundary element must be sent. That is the same as its corresponding domain element. @@ -672,8 +672,7 @@ CMeshFEM::CMeshFEM(CGeometry* geometry, CConfig* config) { /* Determine the number of elements per rank of the originally partitioned grid stored in cumulative storage format. */ vector nElemPerRankOr(size + 1); - for (int i = 0; i <= size; ++i) - nElemPerRankOr[i] = elemPartitioner.GetCumulativeSizeBeforeRank(i); + for (int i = 0; i <= size; ++i) nElemPerRankOr[i] = elemPartitioner.GetCumulativeSizeBeforeRank(i); /* Determine to which ranks I have to send messages to find out the information of the halos stored on this rank. */ @@ -809,7 +808,7 @@ CMeshFEM::CMeshFEM(CGeometry* geometry, CConfig* config) { /* Determine the local index of the element in the original partitioning. Check if the index is valid. */ const long localID = globalID - elemPartitioner.GetFirstIndexOnRank(rank); - if(elemPartitioner.GetRankContainingIndex(globalID) != static_cast(rank)) { + if (elemPartitioner.GetRankContainingIndex(globalID) != static_cast(rank)) { ostringstream message; message << "Invalid local element ID: " << localID; SU2_MPI::Error(message.str(), CURRENT_FUNCTION); diff --git a/Common/src/fem/geometry_structure_fem_part.cpp b/Common/src/fem/geometry_structure_fem_part.cpp index 5bbf731eef8..1babb698f7d 100644 --- a/Common/src/fem/geometry_structure_fem_part.cpp +++ b/Common/src/fem/geometry_structure_fem_part.cpp @@ -361,11 +361,10 @@ void CMatchingFace::Copy(const CMatchingFace& other) { tolForMatching = other.tolForMatching; } -void CPhysicalGeometry::LoadLinearlyPartitionedPointsFEM(CConfig *config, CMeshReaderBase *mesh) { - +void CPhysicalGeometry::LoadLinearlyPartitionedPointsFEM(CConfig* config, CMeshReaderBase* mesh) { /*--- Get the partitioned coordinates and their global IDs from the mesh object. ---*/ - const auto &gridCoords = mesh->GetLocalPointCoordinates(); - const auto &globalPointIDs = mesh->GetGlobalPointIDs(); + const auto& gridCoords = mesh->GetLocalPointCoordinates(); + const auto& globalPointIDs = mesh->GetGlobalPointIDs(); /*--- Initialize point counts and the grid node data structure. ---*/ @@ -373,32 +372,28 @@ void CPhysicalGeometry::LoadLinearlyPartitionedPointsFEM(CConfig *config, CMeshR /*--- Loop over the points and set the coordinates and global index. ---*/ for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) { - for (unsigned short iDim = 0; iDim < nDim; ++iDim) - nodes->SetCoord(iPoint, iDim, gridCoords[iDim][iPoint]); + for (unsigned short iDim = 0; iDim < nDim; ++iDim) nodes->SetCoord(iPoint, iDim, gridCoords[iDim][iPoint]); nodes->SetGlobalIndex(iPoint, globalPointIDs[iPoint]); } } -void CPhysicalGeometry::LoadLinearlyPartitionedVolumeElementsFEM(CConfig *config, - CMeshReaderBase *mesh) { - +void CPhysicalGeometry::LoadLinearlyPartitionedVolumeElementsFEM(CConfig* config, CMeshReaderBase* mesh) { /*--- Reset the global to local element mapping. ---*/ Global_to_Local_Elem.clear(); /*--- Get the volume connectivity from the mesh object. ---*/ - const auto &dataElems = mesh->GetLocalVolumeElementConnectivity(); + const auto& dataElems = mesh->GetLocalVolumeElementConnectivity(); /*--- Allocate space for the interior elements in our SU2 data structure. Note that we only instantiate our rank's local set. ---*/ - elem = new CPrimalGrid*[nElem] (); + elem = new CPrimalGrid*[nElem](); /*--- Loop over all of the internal, local volumetric elements. ---*/ unsigned long ind = 0; unsigned long offsetSolDOFs = 0; - for (unsigned long jElem=0; jElem nSolDOFsPerRank(size); - SU2_MPI::Allgather(&offsetSolDOFs, 1, MPI_UNSIGNED_LONG, nSolDOFsPerRank.data(), - 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); + SU2_MPI::Allgather(&offsetSolDOFs, 1, MPI_UNSIGNED_LONG, nSolDOFsPerRank.data(), 1, MPI_UNSIGNED_LONG, + SU2_MPI::GetComm()); /* Determine the offset for the DOFs on this rank. */ unsigned long offsetRank = 0; for (int i = 0; i < rank; ++i) offsetRank += nSolDOFsPerRank[i]; /* Loop over the local elements to correct the global offset of the DOFs. */ - for (unsigned long jElem=0; jElemAddOffsetGlobalDOFs(offsetRank); + for (unsigned long jElem = 0; jElem < nElem; ++jElem) elem[jElem]->AddOffsetGlobalDOFs(offsetRank); #endif } -void CPhysicalGeometry::LoadLinearlyPartitionedSurfaceElementsFEM(CConfig *config, - CMeshReaderBase *mesh) { - +void CPhysicalGeometry::LoadLinearlyPartitionedSurfaceElementsFEM(CConfig* config, CMeshReaderBase* mesh) { /*--- Store the number of markers and print to the screen. ---*/ nMarker = mesh->GetNumberOfMarkers(); config->SetnMarker_All(nMarker); - if (rank == MASTER_NODE) - cout << nMarker << " surface markers." << endl; + if (rank == MASTER_NODE) cout << nMarker << " surface markers." << endl; /*--- Create the data structure for boundary elements. ---*/ - bound = new CPrimalGrid**[nMarker]; - nElem_Bound = new unsigned long [nMarker]; - Tag_to_Marker = new string [config->GetnMarker_Max()]; + bound = new CPrimalGrid**[nMarker]; + nElem_Bound = new unsigned long[nMarker]; + Tag_to_Marker = new string[config->GetnMarker_Max()]; /*--- Retrieve the name of the surface markers as well as the number of surface elements for every marker. ---*/ - const auto §ionNames = mesh->GetMarkerNames(); - const auto &nSurfElemPerMarker = mesh->GetNumberOfSurfaceElementsAllMarkers(); + const auto& sectionNames = mesh->GetMarkerNames(); + const auto& nSurfElemPerMarker = mesh->GetNumberOfSurfaceElementsAllMarkers(); /*--- Loop over all sections that we extracted from the grid file that were identified as boundary element sections so that we can store those elements into our SU2 data structures. ---*/ for (int iMarker = 0; iMarker < nMarker; ++iMarker) { - /*--- Get the string name and set the number of surface elements for this marker. ---*/ - string Marker_Tag = sectionNames[iMarker]; + string Marker_Tag = sectionNames[iMarker]; nElem_Bound[iMarker] = nSurfElemPerMarker[iMarker]; /*--- Allocate the memory of the pointers for the surface @@ -459,14 +449,13 @@ void CPhysicalGeometry::LoadLinearlyPartitionedSurfaceElementsFEM(CConfig *confi bound[iMarker] = new CPrimalGrid*[nElem_Bound[iMarker]]; /*--- Retrieve the boundary element data for this marker. ---*/ - const auto &dataElems = mesh->GetSurfaceElementConnectivityForMarker(iMarker); + const auto& dataElems = mesh->GetSurfaceElementConnectivityForMarker(iMarker); /*--- Loop over the number of boundary elements for this marker. ---*/ unsigned long ind = 0; - for (unsigned long jElem=0; jElemGetTimeLevel(); /*--- Determine the time level of Elem1, which is either owned or external. Hence a distinction must be made. ---*/ unsigned short timeLevel1; - if(elemPartitioner.GetRankContainingIndex(localFaces[i].elemID1) == static_cast(rank)) { + if (elemPartitioner.GetRankContainingIndex(localFaces[i].elemID1) == static_cast(rank)) { const unsigned long elemID1 = localFaces[i].elemID1 - elemPartitioner.GetFirstIndexOnRank(rank); timeLevel1 = elem[elemID1]->GetTimeLevel(); } else { @@ -974,7 +962,6 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig* config) { of the graph. First the faces. ---*/ vector > adjacency(nElem, vector(0)); for (unsigned long i = 0; i < nFacesLoc; ++i) { - /*--- Determine the local index of elem0, which is always stored locally, and add elemID1 to the adjacency list. ---*/ const unsigned long elem0 = localFaces[i].elemID0 - elemPartitioner.GetFirstIndexOnRank(rank); @@ -983,7 +970,7 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig* config) { /*--- Check if this is not a periodic face and if the second element is also a local element. If so, add elemID0 to the adjacency list ---*/ if (localFaces[i].periodicIndex == 0) { - if(elemPartitioner.GetRankContainingIndex(localFaces[i].elemID1) == static_cast(rank)) { + if (elemPartitioner.GetRankContainingIndex(localFaces[i].elemID1) == static_cast(rank)) { const unsigned long elem1 = localFaces[i].elemID1 - elemPartitioner.GetFirstIndexOnRank(rank); adjacency[elem1].push_back(localFaces[i].elemID0); } @@ -1004,7 +991,7 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig* config) { are present. ParMETIS is not able to deal with self entries, hence they must be removed as well. */ for (unsigned long i = 0; i < nElem; ++i) { - const unsigned long globalElemID = i + + elemPartitioner.GetFirstIndexOnRank(rank); + const unsigned long globalElemID = i + +elemPartitioner.GetFirstIndexOnRank(rank); unsigned long nEntriesNew = adjacency[i].size(); for (unsigned long j = 0; j < adjacency[i].size(); ++j) { @@ -1045,7 +1032,7 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig* config) { sort(adjacency[elemID].begin(), adjacency[elemID].end()); /* Check if the donor element is stored locally. */ - if(elemPartitioner.GetRankContainingIndex(donors[i]) == static_cast(rank)) { + if (elemPartitioner.GetRankContainingIndex(donors[i]) == static_cast(rank)) { /* Donor is stored locally. Add the entry to the graph and sort it afterwards. */ const unsigned long localDonorID = donors[i] - elemPartitioner.GetFirstIndexOnRank(rank); @@ -1070,7 +1057,6 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig* config) { vector sendToRank(size, 0); for (unsigned long i = 0; i < additionalExternalEntriesGraph.size(); i += 2) { - /*--- Determine the rank where this external is stored and update the corresponding communication buffers accordingly. ---*/ const unsigned long rankElem = elemPartitioner.GetRankContainingIndex(additionalExternalEntriesGraph[i]); @@ -1162,8 +1148,7 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig* config) { /*--- Determine the array, which stores the distribution of the graph nodes over the ranks. ---*/ vector vtxdist(size + 1); - for (int i = 0; i <= size; ++i) - vtxdist[i] = static_cast(elemPartitioner.GetCumulativeSizeBeforeRank(i)); + for (int i = 0; i <= size; ++i) vtxdist[i] = static_cast(elemPartitioner.GetCumulativeSizeBeforeRank(i)); /* Create the array xadjPar, which contains the number of edges for each vertex of the graph in ParMETIS format. */ @@ -1995,7 +1980,8 @@ void CPhysicalGeometry::DetermineDonorElementsWallFunctions(CConfig* config) { /* Easier storage of the element type, the corresponding volume element and the polynomial degree for the solution and grid. */ const unsigned short VTK_Type = bound[iMarker][l]->GetVTK_Type(); - const unsigned long elemID = bound[iMarker][l]->GetDomainElement() - elemPartitioner.GetFirstIndexOnRank(rank); + const unsigned long elemID = + bound[iMarker][l]->GetDomainElement() - elemPartitioner.GetFirstIndexOnRank(rank); const unsigned short nPolyGrid = bound[iMarker][l]->GetNPolyGrid(); const unsigned short nPolySol = elem[elemID]->GetNPolySol(); const unsigned short VTK_Elem = elem[elemID]->GetVTK_Type(); @@ -2426,7 +2412,6 @@ void CPhysicalGeometry::DetermineDonorElementsWallFunctions(CConfig* config) { void CPhysicalGeometry::DetermineTimeLevelElements(CConfig* config, const vector& localFaces, map& mapExternalElemIDToTimeLevel) { - /*--- Define the linear partitioning of the elements. ---*/ CLinearPartitioner elemPartitioner(Global_nElem, 0); @@ -2442,8 +2427,7 @@ void CPhysicalGeometry::DetermineTimeLevelElements(CConfig* config, const vector /*--- Check for external element. This is done by checking the local elements and if it is not found, it is an external. ---*/ const auto UMI = Global_to_Local_Elem.find(FI->elemID1); - if(UMI == Global_to_Local_Elem.end()) { - + if (UMI == Global_to_Local_Elem.end()) { /* This element is an external element. Store it in the map mapExternalElemIDToTimeLevel if not already done so. */ map::iterator MI; @@ -2471,12 +2455,10 @@ void CPhysicalGeometry::DetermineTimeLevelElements(CConfig* config, const vector const unsigned long* donors = bound[iMarker][l]->GetDonorsWallFunctions(); /*--- Loop over the number of donors for this boundary element. ---*/ - for(unsigned short i=0; ifirst); @@ -2711,8 +2692,7 @@ void CPhysicalGeometry::DetermineTimeLevelElements(CConfig* config, const vector SU2_MPI::Recv(sendElem[i].data(), sizeMess, MPI_UNSIGNED_LONG, sendRank[i], rank, SU2_MPI::GetComm(), &status); - for (int j = 0; j < sizeMess; ++j) - sendElem[i][j] -= elemPartitioner.GetFirstIndexOnRank(rank); + for (int j = 0; j < sizeMess; ++j) sendElem[i][j] -= elemPartitioner.GetFirstIndexOnRank(rank); } /* Complete the non-blocking sends. Synchronize the processors afterwards, @@ -2803,8 +2783,8 @@ void CPhysicalGeometry::DetermineTimeLevelElements(CConfig* config, const vector for (unsigned short iMarker = 0; iMarker < nMarker; ++iMarker) { for (unsigned long l = 0; l < nElem_Bound[iMarker]; ++l) { /* Determine the ID of the adjacent element. */ - const unsigned long elemID = bound[iMarker][l]->GetDomainElement() - - elemPartitioner.GetFirstIndexOnRank(rank); + const unsigned long elemID = + bound[iMarker][l]->GetDomainElement() - elemPartitioner.GetFirstIndexOnRank(rank); /* Get the number of donor elements for the wall function treatment and the pointer to the array which stores this info. */ @@ -2813,14 +2793,11 @@ void CPhysicalGeometry::DetermineTimeLevelElements(CConfig* config, const vector /* Loop over the number of donors and check the time levels. */ for (unsigned short i = 0; i < nDonors; ++i) { - /* Determine the status of the donor element. */ - if(elemPartitioner.GetRankContainingIndex(donors[i]) == static_cast(rank)) { - + if (elemPartitioner.GetRankContainingIndex(donors[i]) == static_cast(rank)) { /* Donor is stored locally. Determine its local ID and get the time levels of both elements. */ - const unsigned long donorID = donors[i] - - elemPartitioner.GetFirstIndexOnRank(rank); + const unsigned long donorID = donors[i] - elemPartitioner.GetFirstIndexOnRank(rank); const unsigned short timeLevelB = elem[elemID]->GetTimeLevel(); const unsigned short timeLevelD = elem[donorID]->GetTimeLevel(); const unsigned short timeLevel = min(timeLevelB, timeLevelD); @@ -2871,12 +2848,11 @@ void CPhysicalGeometry::DetermineTimeLevelElements(CConfig* config, const vector if (FI->elemID1 < Global_nElem) { /* Local element ID of the first element. Per definition this is always a locally stored element. Also store its time level. */ - const unsigned long elemID0 = FI->elemID0 - - elemPartitioner.GetFirstIndexOnRank(rank); + const unsigned long elemID0 = FI->elemID0 - elemPartitioner.GetFirstIndexOnRank(rank); const unsigned short timeLevel0 = elem[elemID0]->GetTimeLevel(); /* Determine the status of the second element. */ - if(elemPartitioner.GetRankContainingIndex(FI->elemID1) == static_cast(rank)) { + if (elemPartitioner.GetRankContainingIndex(FI->elemID1) == static_cast(rank)) { /* Both elements are stored locally. Determine the local element of the second element and determine the minimum time level. */ @@ -3028,7 +3004,6 @@ void CPhysicalGeometry::ComputeFEMGraphWeights(CConfig* config, const vector >& adjacency, const map& mapExternalElemIDToTimeLevel, vector& vwgt, vector >& adjwgt) { - /*--- Define the linear partitioning of the elements. ---*/ CLinearPartitioner elemPartitioner(Global_nElem, 0); @@ -3212,8 +3187,8 @@ void CPhysicalGeometry::ComputeFEMGraphWeights(CConfig* config, const vectorGetVTK_Type(); - const unsigned long elemID = bound[iMarker][l]->GetDomainElement() - - elemPartitioner.GetFirstIndexOnRank(rank); + const unsigned long elemID = + bound[iMarker][l]->GetDomainElement() - elemPartitioner.GetFirstIndexOnRank(rank); const unsigned short nPolySol = elem[elemID]->GetNPolySol(); const unsigned short VTK_Type_Elem = elem[elemID]->GetVTK_Type(); const bool JacIsConstant = bound[iMarker][l]->GetJacobianConsideredConstant(); @@ -3294,7 +3269,7 @@ void CPhysicalGeometry::ComputeFEMGraphWeights(CConfig* config, const vector(rank)) { + if (elemPartitioner.GetRankContainingIndex(adjacency[i][j]) == static_cast(rank)) { /* Locally stored element. Determine its local ID and set the time level and number of solution DOFs. */ unsigned long elemID1 = adjacency[i][j] - elemPartitioner.GetFirstIndexOnRank(rank); diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index b97e6399df2..20c2b247510 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -3452,20 +3452,28 @@ void CPhysicalGeometry::Read_Mesh(CConfig* config, const string& val_mesh_filena CMeshReaderBase* Mesh = nullptr; switch (val_format) { case SU2: - if (fem_solver) Mesh = new CSU2ASCIIMeshReaderFEM(config, val_iZone, val_nZone); - else Mesh = new CSU2ASCIIMeshReaderFVM(config, val_iZone, val_nZone); + if (fem_solver) + Mesh = new CSU2ASCIIMeshReaderFEM(config, val_iZone, val_nZone); + else + Mesh = new CSU2ASCIIMeshReaderFVM(config, val_iZone, val_nZone); break; case CGNS_GRID: - if (fem_solver) Mesh = new CCGNSMeshReaderFEM(config, val_iZone, val_nZone); - else Mesh = new CCGNSMeshReaderFVM(config, val_iZone, val_nZone); + if (fem_solver) + Mesh = new CCGNSMeshReaderFEM(config, val_iZone, val_nZone); + else + Mesh = new CCGNSMeshReaderFVM(config, val_iZone, val_nZone); break; case RECTANGLE: - if (fem_solver) Mesh = new CRectangularMeshReaderFEM(config, val_iZone, val_nZone); - else Mesh = new CRectangularMeshReaderFVM(config, val_iZone, val_nZone); + if (fem_solver) + Mesh = new CRectangularMeshReaderFEM(config, val_iZone, val_nZone); + else + Mesh = new CRectangularMeshReaderFVM(config, val_iZone, val_nZone); break; case BOX: - if (fem_solver) Mesh = new CBoxMeshReaderFEM(config, val_iZone, val_nZone); - else Mesh = new CBoxMeshReaderFVM(config, val_iZone, val_nZone); + if (fem_solver) + Mesh = new CBoxMeshReaderFEM(config, val_iZone, val_nZone); + else + Mesh = new CBoxMeshReaderFVM(config, val_iZone, val_nZone); break; default: SU2_MPI::Error("Unrecognized mesh format specified!", CURRENT_FUNCTION); @@ -3507,17 +3515,14 @@ void CPhysicalGeometry::Read_Mesh(CConfig* config, const string& val_mesh_filena /*--- Make a distinction between the FVM solver and FEM solver how to load the grid data in the member variables of CPhysicalGeometry. ---*/ - if( fem_solver ) { - + if (fem_solver) { /*--- Load the grid points, volume elements, and surface elements from the mesh object into the proper SU2 data structures. ---*/ LoadLinearlyPartitionedPointsFEM(config, Mesh); LoadLinearlyPartitionedVolumeElementsFEM(config, Mesh); LoadLinearlyPartitionedSurfaceElementsFEM(config, Mesh); - } - else { - + } else { /*--- Load the grid points, volume elements, and surface elements from the mesh object into the proper SU2 data structures. ---*/ diff --git a/Common/src/geometry/meshreader/CBoxMeshReaderFEM.cpp b/Common/src/geometry/meshreader/CBoxMeshReaderFEM.cpp index 56551341517..44dfde1dc7f 100644 --- a/Common/src/geometry/meshreader/CBoxMeshReaderFEM.cpp +++ b/Common/src/geometry/meshreader/CBoxMeshReaderFEM.cpp @@ -29,15 +29,13 @@ #include "../../../include/toolboxes/CLinearPartitioner.hpp" #include "../../../include/geometry/meshreader/CBoxMeshReaderFEM.hpp" -CBoxMeshReaderFEM::CBoxMeshReaderFEM(const CConfig *val_config, unsigned short val_iZone, - unsigned short val_nZone) +CBoxMeshReaderFEM::CBoxMeshReaderFEM(const CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone) : CMeshReaderBase(val_config, val_iZone, val_nZone) { - /* The box mesh is always 3D. */ dimension = 3; /* Set the VTK type for the interior elements and the boundary elements. */ - KindElem = HEXAHEDRON; + KindElem = HEXAHEDRON; KindBound = QUADRILATERAL; /* The number of grid nodes in the i, j and k directions. */ @@ -68,24 +66,22 @@ CBoxMeshReaderFEM::CBoxMeshReaderFEM(const CConfig *val_config, unsigned short v CBoxMeshReaderFEM::~CBoxMeshReaderFEM() = default; void CBoxMeshReaderFEM::ComputeBoxPointCoordinates() { - /*--- Set the global count of points based on the grid dimensions. ---*/ - numberOfGlobalPoints = nNode*mNode*pNode; + numberOfGlobalPoints = nNode * mNode * pNode; /*--- Loop over the local elements to determine the global point IDs to be stored on this rank. --*/ unsigned long ind = 0; - for(unsigned long i=0; i(rank)) { - + const unsigned long globalElemID = kNode * nElemIJ + jNode * nElemI; + if (elemPartitioner.GetRankContainingIndex(globalElemID) == static_cast(rank)) { /*--- The corresponding volume element is stored on this rank, hence store the surface element as well. ---*/ surfaceElementConnectivity[0].push_back(KindBound); // VTK type. @@ -201,10 +190,10 @@ void CBoxMeshReaderFEM::ComputeBoxSurfaceConnectivity() { surfaceElementConnectivity[0].push_back(ind); // Global surface element ID. surfaceElementConnectivity[0].push_back(globalElemID); // Global volume element ID. - surfaceElementConnectivity[0].push_back(kNode*mNode*nNode + jNode*nNode); - surfaceElementConnectivity[0].push_back((kNode+1)*mNode*nNode + jNode*nNode); - surfaceElementConnectivity[0].push_back(kNode*mNode*nNode + (jNode+1)*nNode); - surfaceElementConnectivity[0].push_back((kNode+1)*mNode*nNode + (jNode+1)*nNode); + surfaceElementConnectivity[0].push_back(kNode * mNode * nNode + jNode * nNode); + surfaceElementConnectivity[0].push_back((kNode + 1) * mNode * nNode + jNode * nNode); + surfaceElementConnectivity[0].push_back(kNode * mNode * nNode + (jNode + 1) * nNode); + surfaceElementConnectivity[0].push_back((kNode + 1) * mNode * nNode + (jNode + 1) * nNode); /*--- Update the number of surface elements for this marker. ---*/ ++numberOfLocalSurfaceElements[0]; @@ -216,14 +205,12 @@ void CBoxMeshReaderFEM::ComputeBoxSurfaceConnectivity() { markerNames[1] = "x_plus"; ind = 0; - for(unsigned long kNode = 0; kNode < pNode-1; ++kNode) { - for(unsigned long jNode = 0; jNode < mNode-1; ++jNode, ++ind) { - + for (unsigned long kNode = 0; kNode < pNode - 1; ++kNode) { + for (unsigned long jNode = 0; jNode < mNode - 1; ++jNode, ++ind) { /*--- Determine the corresponding global element ID and check if it is stored on this rank. ---*/ - const unsigned long globalElemID = kNode*nElemIJ + jNode*nElemI + nElemI-1; - if(elemPartitioner.GetRankContainingIndex(globalElemID) == static_cast(rank)) { - + const unsigned long globalElemID = kNode * nElemIJ + jNode * nElemI + nElemI - 1; + if (elemPartitioner.GetRankContainingIndex(globalElemID) == static_cast(rank)) { /*--- The corresponding volume element is stored on this rank, hence store the surface element as well. ---*/ surfaceElementConnectivity[1].push_back(KindBound); // VTK type. @@ -232,10 +219,10 @@ void CBoxMeshReaderFEM::ComputeBoxSurfaceConnectivity() { surfaceElementConnectivity[1].push_back(ind); // Global surface element ID. surfaceElementConnectivity[1].push_back(globalElemID); // Global volume element ID. - surfaceElementConnectivity[1].push_back(kNode*mNode*nNode + jNode*nNode + (nNode-1)); - surfaceElementConnectivity[1].push_back(kNode*mNode*nNode + (jNode+1)*nNode + (nNode-1)); - surfaceElementConnectivity[1].push_back((kNode+1)*mNode*nNode + jNode*nNode + (nNode-1)); - surfaceElementConnectivity[1].push_back((kNode+1)*mNode*nNode + (jNode+1)*nNode + (nNode-1)); + surfaceElementConnectivity[1].push_back(kNode * mNode * nNode + jNode * nNode + (nNode - 1)); + surfaceElementConnectivity[1].push_back(kNode * mNode * nNode + (jNode + 1) * nNode + (nNode - 1)); + surfaceElementConnectivity[1].push_back((kNode + 1) * mNode * nNode + jNode * nNode + (nNode - 1)); + surfaceElementConnectivity[1].push_back((kNode + 1) * mNode * nNode + (jNode + 1) * nNode + (nNode - 1)); /*--- Update the number of surface elements for this marker. ---*/ ++numberOfLocalSurfaceElements[1]; @@ -247,14 +234,12 @@ void CBoxMeshReaderFEM::ComputeBoxSurfaceConnectivity() { markerNames[2] = "y_minus"; ind = 0; - for (unsigned long kNode = 0; kNode < pNode-1; ++kNode) { - for (unsigned long iNode = 0; iNode < nNode-1; ++iNode, ++ind) { - - /*--- Determine the corresponding global element ID and check - if it is stored on this rank. ---*/ - const unsigned long globalElemID = kNode*nElemIJ + iNode; - if(elemPartitioner.GetRankContainingIndex(globalElemID) == static_cast(rank)) { - + for (unsigned long kNode = 0; kNode < pNode - 1; ++kNode) { + for (unsigned long iNode = 0; iNode < nNode - 1; ++iNode, ++ind) { + /*--- Determine the corresponding global element ID and check + if it is stored on this rank. ---*/ + const unsigned long globalElemID = kNode * nElemIJ + iNode; + if (elemPartitioner.GetRankContainingIndex(globalElemID) == static_cast(rank)) { /*--- The corresponding volume element is stored on this rank, hence store the surface element as well. ---*/ surfaceElementConnectivity[2].push_back(KindBound); // VTK type. @@ -263,10 +248,10 @@ void CBoxMeshReaderFEM::ComputeBoxSurfaceConnectivity() { surfaceElementConnectivity[2].push_back(ind); // Global surface element ID. surfaceElementConnectivity[2].push_back(globalElemID); // Global volume element ID. - surfaceElementConnectivity[2].push_back(kNode*mNode*nNode + iNode); - surfaceElementConnectivity[2].push_back(kNode*mNode*nNode + iNode+1); - surfaceElementConnectivity[2].push_back((kNode+1)*mNode*nNode + iNode); - surfaceElementConnectivity[2].push_back((kNode+1)*mNode*nNode + iNode+1); + surfaceElementConnectivity[2].push_back(kNode * mNode * nNode + iNode); + surfaceElementConnectivity[2].push_back(kNode * mNode * nNode + iNode + 1); + surfaceElementConnectivity[2].push_back((kNode + 1) * mNode * nNode + iNode); + surfaceElementConnectivity[2].push_back((kNode + 1) * mNode * nNode + iNode + 1); /*--- Update the number of surface elements for this marker. ---*/ ++numberOfLocalSurfaceElements[2]; @@ -278,14 +263,12 @@ void CBoxMeshReaderFEM::ComputeBoxSurfaceConnectivity() { markerNames[3] = "y_plus"; ind = 0; - for (unsigned long kNode = 0; kNode < pNode-1; ++kNode) { - for (unsigned long iNode = 0; iNode < nNode-1; ++iNode, ++ind) { - - /*--- Determine the corresponding global element ID and check - if it is stored on this rank. ---*/ - const unsigned long globalElemID = kNode*nElemIJ + (mNode-2)*nElemI + iNode; - if(elemPartitioner.GetRankContainingIndex(globalElemID) == static_cast(rank)) { - + for (unsigned long kNode = 0; kNode < pNode - 1; ++kNode) { + for (unsigned long iNode = 0; iNode < nNode - 1; ++iNode, ++ind) { + /*--- Determine the corresponding global element ID and check + if it is stored on this rank. ---*/ + const unsigned long globalElemID = kNode * nElemIJ + (mNode - 2) * nElemI + iNode; + if (elemPartitioner.GetRankContainingIndex(globalElemID) == static_cast(rank)) { /*--- The corresponding volume element is stored on this rank, hence store the surface element as well. ---*/ surfaceElementConnectivity[3].push_back(KindBound); // VTK type. @@ -294,10 +277,10 @@ void CBoxMeshReaderFEM::ComputeBoxSurfaceConnectivity() { surfaceElementConnectivity[3].push_back(ind); // Global surface element ID. surfaceElementConnectivity[3].push_back(globalElemID); // Global volume element ID. - surfaceElementConnectivity[3].push_back(kNode*mNode*nNode + (mNode-1)*nNode + iNode); - surfaceElementConnectivity[3].push_back(kNode*mNode*nNode + (mNode-1)*nNode + iNode+1); - surfaceElementConnectivity[3].push_back((kNode+1)*mNode*nNode + (mNode-1)*nNode + iNode); - surfaceElementConnectivity[3].push_back((kNode+1)*mNode*nNode + (mNode-1)*nNode + iNode+1); + surfaceElementConnectivity[3].push_back(kNode * mNode * nNode + (mNode - 1) * nNode + iNode); + surfaceElementConnectivity[3].push_back(kNode * mNode * nNode + (mNode - 1) * nNode + iNode + 1); + surfaceElementConnectivity[3].push_back((kNode + 1) * mNode * nNode + (mNode - 1) * nNode + iNode); + surfaceElementConnectivity[3].push_back((kNode + 1) * mNode * nNode + (mNode - 1) * nNode + iNode + 1); /*--- Update the number of surface elements for this marker. ---*/ ++numberOfLocalSurfaceElements[3]; @@ -309,14 +292,12 @@ void CBoxMeshReaderFEM::ComputeBoxSurfaceConnectivity() { markerNames[4] = "z_minus"; ind = 0; - for (unsigned long jNode = 0; jNode < mNode-1; ++jNode) { - for (unsigned long iNode = 0; iNode < nNode-1; ++iNode, ++ind) { - - /*--- Determine the corresponding global element ID and check - if it is stored on this rank. ---*/ - const unsigned long globalElemID = jNode*nElemI + iNode; - if(elemPartitioner.GetRankContainingIndex(globalElemID) == static_cast(rank)) { - + for (unsigned long jNode = 0; jNode < mNode - 1; ++jNode) { + for (unsigned long iNode = 0; iNode < nNode - 1; ++iNode, ++ind) { + /*--- Determine the corresponding global element ID and check + if it is stored on this rank. ---*/ + const unsigned long globalElemID = jNode * nElemI + iNode; + if (elemPartitioner.GetRankContainingIndex(globalElemID) == static_cast(rank)) { /*--- The corresponding volume element is stored on this rank, hence store the surface element as well. ---*/ surfaceElementConnectivity[4].push_back(KindBound); // VTK type. @@ -325,10 +306,10 @@ void CBoxMeshReaderFEM::ComputeBoxSurfaceConnectivity() { surfaceElementConnectivity[4].push_back(ind); // Global surface element ID. surfaceElementConnectivity[4].push_back(globalElemID); // Global volume element ID. - surfaceElementConnectivity[4].push_back(jNode*nNode + iNode); - surfaceElementConnectivity[4].push_back(jNode*nNode + iNode+1); - surfaceElementConnectivity[4].push_back((jNode+1)*nNode + iNode); - surfaceElementConnectivity[4].push_back((jNode+1)*nNode + iNode+1); + surfaceElementConnectivity[4].push_back(jNode * nNode + iNode); + surfaceElementConnectivity[4].push_back(jNode * nNode + iNode + 1); + surfaceElementConnectivity[4].push_back((jNode + 1) * nNode + iNode); + surfaceElementConnectivity[4].push_back((jNode + 1) * nNode + iNode + 1); /*--- Update the number of surface elements for this marker. ---*/ ++numberOfLocalSurfaceElements[4]; @@ -340,14 +321,12 @@ void CBoxMeshReaderFEM::ComputeBoxSurfaceConnectivity() { markerNames[5] = "z_plus"; ind = 0; - for (unsigned long jNode = 0; jNode < mNode-1; ++jNode) { - for (unsigned long iNode = 0; iNode < nNode-1; ++iNode, ++ind) { - - /*--- Determine the corresponding global element ID and check - if it is stored on this rank. ---*/ - const unsigned long globalElemID = (pNode-2)*nElemIJ + jNode*nElemI + iNode; - if(elemPartitioner.GetRankContainingIndex(globalElemID) == static_cast(rank)) { - + for (unsigned long jNode = 0; jNode < mNode - 1; ++jNode) { + for (unsigned long iNode = 0; iNode < nNode - 1; ++iNode, ++ind) { + /*--- Determine the corresponding global element ID and check + if it is stored on this rank. ---*/ + const unsigned long globalElemID = (pNode - 2) * nElemIJ + jNode * nElemI + iNode; + if (elemPartitioner.GetRankContainingIndex(globalElemID) == static_cast(rank)) { /*--- The corresponding volume element is stored on this rank, hence store the surface element as well. ---*/ surfaceElementConnectivity[5].push_back(KindBound); // VTK type. @@ -356,10 +335,10 @@ void CBoxMeshReaderFEM::ComputeBoxSurfaceConnectivity() { surfaceElementConnectivity[5].push_back(ind); // Global surface element ID. surfaceElementConnectivity[5].push_back(globalElemID); // Global volume element ID. - surfaceElementConnectivity[5].push_back((pNode-1)*mNode*nNode + jNode*nNode + iNode); - surfaceElementConnectivity[5].push_back((pNode-1)*mNode*nNode + jNode*nNode + iNode+1); - surfaceElementConnectivity[5].push_back((pNode-1)*mNode*nNode + (jNode+1)*nNode + iNode); - surfaceElementConnectivity[5].push_back((pNode-1)*mNode*nNode + (jNode+1)*nNode + iNode+1); + surfaceElementConnectivity[5].push_back((pNode - 1) * mNode * nNode + jNode * nNode + iNode); + surfaceElementConnectivity[5].push_back((pNode - 1) * mNode * nNode + jNode * nNode + iNode + 1); + surfaceElementConnectivity[5].push_back((pNode - 1) * mNode * nNode + (jNode + 1) * nNode + iNode); + surfaceElementConnectivity[5].push_back((pNode - 1) * mNode * nNode + (jNode + 1) * nNode + iNode + 1); /*--- Update the number of surface elements for this marker. ---*/ ++numberOfLocalSurfaceElements[5]; diff --git a/Common/src/geometry/meshreader/CCGNSElementType.cpp b/Common/src/geometry/meshreader/CCGNSElementType.cpp index 8ed50fb91df..53a549c8c78 100644 --- a/Common/src/geometry/meshreader/CCGNSElementType.cpp +++ b/Common/src/geometry/meshreader/CCGNSElementType.cpp @@ -35,58 +35,111 @@ using namespace std; -void CCGNSElementType::CGNSToSU2(const ElementType_t val_elemType, - const unsigned long val_globalID, - const cgsize_t *connCGNS, - std::vector &connSU2) { - +void CCGNSElementType::CGNSToSU2(const ElementType_t val_elemType, const unsigned long val_globalID, + const cgsize_t* connCGNS, std::vector& connSU2) { /*--- Clear the contents of connSU2. ---*/ connSU2.clear(); /*--- Search in the stored elements if the current element type is present. ---*/ unsigned long ind; - for(ind=0; ind SU2ToCGNS; - switch( val_elemType ) { - - case NODE: CreateDataNODE (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case BAR_2: CreateDataBAR_2 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case BAR_3: CreateDataBAR_3 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case BAR_4: CreateDataBAR_4 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case BAR_5: CreateDataBAR_5 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case TRI_3: CreateDataTRI_3 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case TRI_6: CreateDataTRI_6 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case TRI_10: CreateDataTRI_10 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case TRI_15: CreateDataTRI_15 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case QUAD_4: CreateDataQUAD_4 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case QUAD_9: CreateDataQUAD_9 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case QUAD_16: CreateDataQUAD_16 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case QUAD_25: CreateDataQUAD_25 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case TETRA_4: CreateDataTETRA_4 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case TETRA_10: CreateDataTETRA_10(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case TETRA_20: CreateDataTETRA_20(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case TETRA_35: CreateDataTETRA_35(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case PYRA_5: CreateDataPYRA_5 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case PYRA_14: CreateDataPYRA_14 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case PYRA_30: CreateDataPYRA_30 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case PYRA_55: CreateDataPYRA_55 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case PENTA_6: CreateDataPENTA_6 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case PENTA_18: CreateDataPENTA_18(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case PENTA_40: CreateDataPENTA_40(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case PENTA_75: CreateDataPENTA_75(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case HEXA_8: CreateDataHEXA_8 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case HEXA_27: CreateDataHEXA_27 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case HEXA_64: CreateDataHEXA_64 (VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case HEXA_125: CreateDataHEXA_125(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; + switch (val_elemType) { + case NODE: + CreateDataNODE(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case BAR_2: + CreateDataBAR_2(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case BAR_3: + CreateDataBAR_3(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case BAR_4: + CreateDataBAR_4(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case BAR_5: + CreateDataBAR_5(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case TRI_3: + CreateDataTRI_3(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case TRI_6: + CreateDataTRI_6(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case TRI_10: + CreateDataTRI_10(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case TRI_15: + CreateDataTRI_15(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case QUAD_4: + CreateDataQUAD_4(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case QUAD_9: + CreateDataQUAD_9(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case QUAD_16: + CreateDataQUAD_16(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case QUAD_25: + CreateDataQUAD_25(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case TETRA_4: + CreateDataTETRA_4(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case TETRA_10: + CreateDataTETRA_10(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case TETRA_20: + CreateDataTETRA_20(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case TETRA_35: + CreateDataTETRA_35(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case PYRA_5: + CreateDataPYRA_5(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case PYRA_14: + CreateDataPYRA_14(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case PYRA_30: + CreateDataPYRA_30(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case PYRA_55: + CreateDataPYRA_55(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case PENTA_6: + CreateDataPENTA_6(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case PENTA_18: + CreateDataPENTA_18(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case PENTA_40: + CreateDataPENTA_40(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case PENTA_75: + CreateDataPENTA_75(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case HEXA_8: + CreateDataHEXA_8(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case HEXA_27: + CreateDataHEXA_27(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case HEXA_64: + CreateDataHEXA_64(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case HEXA_125: + CreateDataHEXA_125(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; default: ostringstream message; @@ -103,7 +156,7 @@ void CCGNSElementType::CGNSToSU2(const ElementType_t val_elemType, } /*--- Allocate the memory for connSU2 and store the meta data. ---*/ - connSU2.resize(nDOFsStored[ind]+5); + connSU2.resize(nDOFsStored[ind] + 5); connSU2[0] = VTKTypeStored[ind]; connSU2[1] = nPolyStored[ind]; @@ -114,8 +167,7 @@ void CCGNSElementType::CGNSToSU2(const ElementType_t val_elemType, /*--- Loop over the DOFs and convert the connectivity from CGNS to SU2 format. Keep in mind that CGNS start the numbering at 1 while SU2 starts at 0. ---*/ - for(unsigned short i=0; i &SU2ToCGNS) { - +void CCGNSElementType::CreateDataNODE(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* Set the required data for a NODE. */ VTK_Type = VERTEX; - nPoly = 0; - nDOFs = 1; + nPoly = 0; + nDOFs = 1; SU2ToCGNS.push_back(0); } -void CCGNSElementType::CreateDataBAR_2(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataBAR_2(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The BAR_2 element is a linear element. The numbering of the nodes is the same for CGNS and SU2. */ VTK_Type = LINE; - nPoly = 1; - nDOFs = 2; + nPoly = 1; + nDOFs = 2; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 1; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 1; } -void CCGNSElementType::CreateDataBAR_3(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataBAR_3(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The BAR_3 element is a quadratic element. SU2 numbers to nodes with increasing parametric value, while in CGNS the internal node is numbered last. */ VTK_Type = LINE; - nPoly = 2; - nDOFs = 3; + nPoly = 2; + nDOFs = 3; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 2; SU2ToCGNS[2] = 1; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 2; + SU2ToCGNS[2] = 1; } -void CCGNSElementType::CreateDataBAR_4(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataBAR_4(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The BAR_4 element is a cubic element. SU2 numbers to nodes with increasing parametric value, while in CGNS the internal nodes are numbered last. */ VTK_Type = LINE; - nPoly = 3; - nDOFs = 4; + nPoly = 3; + nDOFs = 4; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 2; SU2ToCGNS[2] = 3; SU2ToCGNS[3] = 1; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 2; + SU2ToCGNS[2] = 3; + SU2ToCGNS[3] = 1; } -void CCGNSElementType::CreateDataBAR_5(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataBAR_5(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The BAR_5 element is a quartic element. SU2 numbers to nodes with increasing parametric value, while in CGNS the internal nodes are numbered last. */ VTK_Type = LINE; - nPoly = 4; - nDOFs = 5; + nPoly = 4; + nDOFs = 5; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 2; SU2ToCGNS[2] = 3; - SU2ToCGNS[3] = 4; SU2ToCGNS[4] = 1; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 2; + SU2ToCGNS[2] = 3; + SU2ToCGNS[3] = 4; + SU2ToCGNS[4] = 1; } -void CCGNSElementType::CreateDataTRI_3(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataTRI_3(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The TRI_3 element is a linear triangle. The node numbering is the same in SU2 and CGNS. */ VTK_Type = TRIANGLE; - nPoly = 1; - nDOFs = 3; + nPoly = 1; + nDOFs = 3; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 1; SU2ToCGNS[2] = 2; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 1; + SU2ToCGNS[2] = 2; } -void CCGNSElementType::CreateDataTRI_6(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataTRI_6(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The TRI_6 element is a quadratic triangle. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -227,19 +269,20 @@ void CCGNSElementType::CreateDataTRI_6(unsigned short &VTK_Type, where the i-direction is defined from node 0 to 1 and the j-direction from node 0 along the other edge. */ VTK_Type = TRIANGLE; - nPoly = 2; - nDOFs = 6; + nPoly = 2; + nDOFs = 6; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 3; SU2ToCGNS[2] = 1; - SU2ToCGNS[3] = 5; SU2ToCGNS[4] = 4; SU2ToCGNS[5] = 2; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 3; + SU2ToCGNS[2] = 1; + SU2ToCGNS[3] = 5; + SU2ToCGNS[4] = 4; + SU2ToCGNS[5] = 2; } -void CCGNSElementType::CreateDataTRI_10(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataTRI_10(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The TRI_10 element is a cubic triangle. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -248,20 +291,24 @@ void CCGNSElementType::CreateDataTRI_10(unsigned short &VTK_Type, where the i-direction is defined from node 0 to 1 and the j-direction from node 0 along the other edge. */ VTK_Type = TRIANGLE; - nPoly = 3; - nDOFs = 10; + nPoly = 3; + nDOFs = 10; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 3; SU2ToCGNS[2] = 4; SU2ToCGNS[3] = 1; - SU2ToCGNS[4] = 8; SU2ToCGNS[5] = 9; SU2ToCGNS[6] = 5; SU2ToCGNS[7] = 7; - SU2ToCGNS[8] = 6; SU2ToCGNS[9] = 2; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 3; + SU2ToCGNS[2] = 4; + SU2ToCGNS[3] = 1; + SU2ToCGNS[4] = 8; + SU2ToCGNS[5] = 9; + SU2ToCGNS[6] = 5; + SU2ToCGNS[7] = 7; + SU2ToCGNS[8] = 6; + SU2ToCGNS[9] = 2; } -void CCGNSElementType::CreateDataTRI_15(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataTRI_15(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The TRI_15 element is a quartic triangle. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -273,21 +320,29 @@ void CCGNSElementType::CreateDataTRI_15(unsigned short &VTK_Type, the location for uniform spacing. This effect is currently ignored, i.e. it is assumed that the spacing in parameter space is uniform. */ VTK_Type = TRIANGLE; - nPoly = 4; - nDOFs = 15; + nPoly = 4; + nDOFs = 15; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 3; SU2ToCGNS[2] = 4; SU2ToCGNS[3] = 5; - SU2ToCGNS[4] = 1; SU2ToCGNS[5] = 11; SU2ToCGNS[6] = 12; SU2ToCGNS[7] = 13; - SU2ToCGNS[8] = 6; SU2ToCGNS[9] = 10; SU2ToCGNS[10] = 14; SU2ToCGNS[11] = 7; - SU2ToCGNS[12] = 9; SU2ToCGNS[13] = 8; SU2ToCGNS[14] = 2; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 3; + SU2ToCGNS[2] = 4; + SU2ToCGNS[3] = 5; + SU2ToCGNS[4] = 1; + SU2ToCGNS[5] = 11; + SU2ToCGNS[6] = 12; + SU2ToCGNS[7] = 13; + SU2ToCGNS[8] = 6; + SU2ToCGNS[9] = 10; + SU2ToCGNS[10] = 14; + SU2ToCGNS[11] = 7; + SU2ToCGNS[12] = 9; + SU2ToCGNS[13] = 8; + SU2ToCGNS[14] = 2; } -void CCGNSElementType::CreateDataQUAD_4(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataQUAD_4(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The QUAD_4 element is a linear quadrilateral. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes (not present for QUAD_4). @@ -296,18 +351,18 @@ void CCGNSElementType::CreateDataQUAD_4(unsigned short &VTK_Type, where the i-direction is defined from node 0 to 1 and the j-direction from node 0 along the other edge. */ VTK_Type = QUADRILATERAL; - nPoly = 1; - nDOFs = 4; + nPoly = 1; + nDOFs = 4; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 1; SU2ToCGNS[2] = 3; SU2ToCGNS[3] = 2; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 1; + SU2ToCGNS[2] = 3; + SU2ToCGNS[3] = 2; } -void CCGNSElementType::CreateDataQUAD_9(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataQUAD_9(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The QUAD_9 element is a quadratic quadrilateral. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -316,20 +371,23 @@ void CCGNSElementType::CreateDataQUAD_9(unsigned short &VTK_Type, where the i-direction is defined from node 0 to 1 and the j-direction from node 0 along the other edge. */ VTK_Type = QUADRILATERAL; - nPoly = 2; - nDOFs = 9; + nPoly = 2; + nDOFs = 9; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 4; SU2ToCGNS[2] = 1; SU2ToCGNS[3] = 7; - SU2ToCGNS[4] = 8; SU2ToCGNS[5] = 5; SU2ToCGNS[6] = 3; SU2ToCGNS[7] = 6; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 4; + SU2ToCGNS[2] = 1; + SU2ToCGNS[3] = 7; + SU2ToCGNS[4] = 8; + SU2ToCGNS[5] = 5; + SU2ToCGNS[6] = 3; + SU2ToCGNS[7] = 6; SU2ToCGNS[8] = 2; } -void CCGNSElementType::CreateDataQUAD_16(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataQUAD_16(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The QUAD_16 element is a cubic quadrilateral. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -338,21 +396,30 @@ void CCGNSElementType::CreateDataQUAD_16(unsigned short &VTK_Type, where the i-direction is defined from node 0 to 1 and the j-direction from node 0 along the other edge. */ VTK_Type = QUADRILATERAL; - nPoly = 3; - nDOFs = 16; + nPoly = 3; + nDOFs = 16; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 4; SU2ToCGNS[2] = 5; SU2ToCGNS[3] = 1; - SU2ToCGNS[4] = 11; SU2ToCGNS[5] = 12; SU2ToCGNS[6] = 13; SU2ToCGNS[7] = 6; - SU2ToCGNS[8] = 10; SU2ToCGNS[9] = 15; SU2ToCGNS[10] = 14; SU2ToCGNS[11] = 7; - SU2ToCGNS[12] = 3; SU2ToCGNS[13] = 9; SU2ToCGNS[14] = 8; SU2ToCGNS[15] = 2; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 4; + SU2ToCGNS[2] = 5; + SU2ToCGNS[3] = 1; + SU2ToCGNS[4] = 11; + SU2ToCGNS[5] = 12; + SU2ToCGNS[6] = 13; + SU2ToCGNS[7] = 6; + SU2ToCGNS[8] = 10; + SU2ToCGNS[9] = 15; + SU2ToCGNS[10] = 14; + SU2ToCGNS[11] = 7; + SU2ToCGNS[12] = 3; + SU2ToCGNS[13] = 9; + SU2ToCGNS[14] = 8; + SU2ToCGNS[15] = 2; } -void CCGNSElementType::CreateDataQUAD_25(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataQUAD_25(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The QUAD_25 element is a quartic quadrilateral. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -361,39 +428,54 @@ void CCGNSElementType::CreateDataQUAD_25(unsigned short &VTK_Type, where the i-direction is defined from node 0 to 1 and the j-direction from node 0 along the other edge. */ VTK_Type = QUADRILATERAL; - nPoly = 4; - nDOFs = 25; + nPoly = 4; + nDOFs = 25; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 4; SU2ToCGNS[2] = 5; SU2ToCGNS[3] = 6; - SU2ToCGNS[4] = 1; SU2ToCGNS[5] = 15; SU2ToCGNS[6] = 16; SU2ToCGNS[7] = 17; - SU2ToCGNS[8] = 18; SU2ToCGNS[9] = 7; SU2ToCGNS[10] = 14; SU2ToCGNS[11] = 23; - SU2ToCGNS[12] = 24; SU2ToCGNS[13] = 19; SU2ToCGNS[14] = 8; SU2ToCGNS[15] = 13; - SU2ToCGNS[16] = 22; SU2ToCGNS[17] = 21; SU2ToCGNS[18] = 20; SU2ToCGNS[19] = 9; - SU2ToCGNS[20] = 3; SU2ToCGNS[21] = 12; SU2ToCGNS[22] = 11; SU2ToCGNS[23] = 10; - SU2ToCGNS[24] = 2; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 4; + SU2ToCGNS[2] = 5; + SU2ToCGNS[3] = 6; + SU2ToCGNS[4] = 1; + SU2ToCGNS[5] = 15; + SU2ToCGNS[6] = 16; + SU2ToCGNS[7] = 17; + SU2ToCGNS[8] = 18; + SU2ToCGNS[9] = 7; + SU2ToCGNS[10] = 14; + SU2ToCGNS[11] = 23; + SU2ToCGNS[12] = 24; + SU2ToCGNS[13] = 19; + SU2ToCGNS[14] = 8; + SU2ToCGNS[15] = 13; + SU2ToCGNS[16] = 22; + SU2ToCGNS[17] = 21; + SU2ToCGNS[18] = 20; + SU2ToCGNS[19] = 9; + SU2ToCGNS[20] = 3; + SU2ToCGNS[21] = 12; + SU2ToCGNS[22] = 11; + SU2ToCGNS[23] = 10; + SU2ToCGNS[24] = 2; } -void CCGNSElementType::CreateDataTETRA_4(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataTETRA_4(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The TETRA_4 element is a linear tetrahedron. The node numbering is the same in SU2 and CGNS. */ VTK_Type = TETRAHEDRON; - nPoly = 1; - nDOFs = 4; + nPoly = 1; + nDOFs = 4; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 1; SU2ToCGNS[2] = 2; SU2ToCGNS[3] = 3; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 1; + SU2ToCGNS[2] = 2; + SU2ToCGNS[3] = 3; } -void CCGNSElementType::CreateDataTETRA_10(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataTETRA_10(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The TETRA_10 element is a quadratic tetrahedron. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -404,20 +486,24 @@ void CCGNSElementType::CreateDataTETRA_10(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = TETRAHEDRON; - nPoly = 2; - nDOFs = 10; + nPoly = 2; + nDOFs = 10; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 4; SU2ToCGNS[2] = 1; SU2ToCGNS[3] = 6; - SU2ToCGNS[4] = 5; SU2ToCGNS[5] = 2; SU2ToCGNS[6] = 7; SU2ToCGNS[7] = 8; - SU2ToCGNS[8] = 9; SU2ToCGNS[9] = 3; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 4; + SU2ToCGNS[2] = 1; + SU2ToCGNS[3] = 6; + SU2ToCGNS[4] = 5; + SU2ToCGNS[5] = 2; + SU2ToCGNS[6] = 7; + SU2ToCGNS[7] = 8; + SU2ToCGNS[8] = 9; + SU2ToCGNS[9] = 3; } -void CCGNSElementType::CreateDataTETRA_20(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataTETRA_20(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The TETRA_20 element is a cubic tetrahedron. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -428,22 +514,34 @@ void CCGNSElementType::CreateDataTETRA_20(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = TETRAHEDRON; - nPoly = 3; - nDOFs = 20; + nPoly = 3; + nDOFs = 20; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 4; SU2ToCGNS[2] = 5; SU2ToCGNS[3] = 1; - SU2ToCGNS[4] = 9; SU2ToCGNS[5] = 16; SU2ToCGNS[6] = 6; SU2ToCGNS[7] = 8; - SU2ToCGNS[8] = 7; SU2ToCGNS[9] = 2; SU2ToCGNS[10] = 10; SU2ToCGNS[11] = 17; - SU2ToCGNS[12] = 12; SU2ToCGNS[13] = 19; SU2ToCGNS[14] = 18; SU2ToCGNS[15] = 14; - SU2ToCGNS[16] = 11; SU2ToCGNS[17] = 13; SU2ToCGNS[18] = 15; SU2ToCGNS[19] = 3; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 4; + SU2ToCGNS[2] = 5; + SU2ToCGNS[3] = 1; + SU2ToCGNS[4] = 9; + SU2ToCGNS[5] = 16; + SU2ToCGNS[6] = 6; + SU2ToCGNS[7] = 8; + SU2ToCGNS[8] = 7; + SU2ToCGNS[9] = 2; + SU2ToCGNS[10] = 10; + SU2ToCGNS[11] = 17; + SU2ToCGNS[12] = 12; + SU2ToCGNS[13] = 19; + SU2ToCGNS[14] = 18; + SU2ToCGNS[15] = 14; + SU2ToCGNS[16] = 11; + SU2ToCGNS[17] = 13; + SU2ToCGNS[18] = 15; + SU2ToCGNS[19] = 3; } -void CCGNSElementType::CreateDataTETRA_35(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataTETRA_35(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The TETRA_35 element is a quartic tetrahedron. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -457,26 +555,49 @@ void CCGNSElementType::CreateDataTETRA_35(unsigned short &VTK_Type, currently ignored, i.e. it is assumed that the spacing in parameter space is uniform. */ VTK_Type = TETRAHEDRON; - nPoly = 4; - nDOFs = 35; + nPoly = 4; + nDOFs = 35; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 4; SU2ToCGNS[2] = 5; SU2ToCGNS[3] = 6; - SU2ToCGNS[4] = 1; SU2ToCGNS[5] = 12; SU2ToCGNS[6] = 22; SU2ToCGNS[7] = 23; - SU2ToCGNS[8] = 7; SU2ToCGNS[9] = 11; SU2ToCGNS[10] = 24; SU2ToCGNS[11] = 8; - SU2ToCGNS[12] = 10; SU2ToCGNS[13] = 9; SU2ToCGNS[14] = 2; SU2ToCGNS[15] = 13; - SU2ToCGNS[16] = 25; SU2ToCGNS[17] = 26; SU2ToCGNS[18] = 16; SU2ToCGNS[19] = 32; - SU2ToCGNS[20] = 34; SU2ToCGNS[21] = 28; SU2ToCGNS[22] = 31; SU2ToCGNS[23] = 29; - SU2ToCGNS[24] = 19; SU2ToCGNS[25] = 14; SU2ToCGNS[26] = 27; SU2ToCGNS[27] = 17; - SU2ToCGNS[28] = 33; SU2ToCGNS[29] = 30; SU2ToCGNS[30] = 20; SU2ToCGNS[31] = 15; - SU2ToCGNS[32] = 18; SU2ToCGNS[33] = 21; SU2ToCGNS[34] = 3; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 4; + SU2ToCGNS[2] = 5; + SU2ToCGNS[3] = 6; + SU2ToCGNS[4] = 1; + SU2ToCGNS[5] = 12; + SU2ToCGNS[6] = 22; + SU2ToCGNS[7] = 23; + SU2ToCGNS[8] = 7; + SU2ToCGNS[9] = 11; + SU2ToCGNS[10] = 24; + SU2ToCGNS[11] = 8; + SU2ToCGNS[12] = 10; + SU2ToCGNS[13] = 9; + SU2ToCGNS[14] = 2; + SU2ToCGNS[15] = 13; + SU2ToCGNS[16] = 25; + SU2ToCGNS[17] = 26; + SU2ToCGNS[18] = 16; + SU2ToCGNS[19] = 32; + SU2ToCGNS[20] = 34; + SU2ToCGNS[21] = 28; + SU2ToCGNS[22] = 31; + SU2ToCGNS[23] = 29; + SU2ToCGNS[24] = 19; + SU2ToCGNS[25] = 14; + SU2ToCGNS[26] = 27; + SU2ToCGNS[27] = 17; + SU2ToCGNS[28] = 33; + SU2ToCGNS[29] = 30; + SU2ToCGNS[30] = 20; + SU2ToCGNS[31] = 15; + SU2ToCGNS[32] = 18; + SU2ToCGNS[33] = 21; + SU2ToCGNS[34] = 3; } -void CCGNSElementType::CreateDataPYRA_5(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataPYRA_5(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The PYRA_5 element is a linear pyramid. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes (not present in PYRA_5). @@ -487,19 +608,19 @@ void CCGNSElementType::CreateDataPYRA_5(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = PYRAMID; - nPoly = 1; - nDOFs = 5; + nPoly = 1; + nDOFs = 5; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 1; SU2ToCGNS[2] = 3; SU2ToCGNS[3] = 2; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 1; + SU2ToCGNS[2] = 3; + SU2ToCGNS[3] = 2; SU2ToCGNS[4] = 4; } -void CCGNSElementType::CreateDataPYRA_14(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataPYRA_14(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The PYRA_14 element is a quadratic pyramid. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -510,21 +631,28 @@ void CCGNSElementType::CreateDataPYRA_14(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = PYRAMID; - nPoly = 2; - nDOFs = 14; + nPoly = 2; + nDOFs = 14; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 5; SU2ToCGNS[2] = 1; SU2ToCGNS[3] = 8; - SU2ToCGNS[4] = 13; SU2ToCGNS[5] = 6; SU2ToCGNS[6] = 3; SU2ToCGNS[7] = 7; - SU2ToCGNS[8] = 2; SU2ToCGNS[9] = 9; SU2ToCGNS[10] = 10; SU2ToCGNS[11] = 12; - SU2ToCGNS[12] = 11; SU2ToCGNS[13] = 4; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 5; + SU2ToCGNS[2] = 1; + SU2ToCGNS[3] = 8; + SU2ToCGNS[4] = 13; + SU2ToCGNS[5] = 6; + SU2ToCGNS[6] = 3; + SU2ToCGNS[7] = 7; + SU2ToCGNS[8] = 2; + SU2ToCGNS[9] = 9; + SU2ToCGNS[10] = 10; + SU2ToCGNS[11] = 12; + SU2ToCGNS[12] = 11; + SU2ToCGNS[13] = 4; } -void CCGNSElementType::CreateDataPYRA_30(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataPYRA_30(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The PYRA_30 element is a cubic pyramid. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -535,25 +663,44 @@ void CCGNSElementType::CreateDataPYRA_30(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = PYRAMID; - nPoly = 3; - nDOFs = 30; + nPoly = 3; + nDOFs = 30; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 5; SU2ToCGNS[2] = 6; SU2ToCGNS[3] = 1; - SU2ToCGNS[4] = 12; SU2ToCGNS[5] = 21; SU2ToCGNS[6] = 22; SU2ToCGNS[7] = 7; - SU2ToCGNS[8] = 11; SU2ToCGNS[9] = 24; SU2ToCGNS[10] = 23; SU2ToCGNS[11] = 8; - SU2ToCGNS[12] = 3; SU2ToCGNS[13] = 10; SU2ToCGNS[14] = 9; SU2ToCGNS[15] = 2; - SU2ToCGNS[16] = 13; SU2ToCGNS[17] = 25; SU2ToCGNS[18] = 15; SU2ToCGNS[19] = 28; - SU2ToCGNS[20] = 29; SU2ToCGNS[21] = 26; SU2ToCGNS[22] = 19; SU2ToCGNS[23] = 27; - SU2ToCGNS[24] = 17; SU2ToCGNS[25] = 14; SU2ToCGNS[26] = 16; SU2ToCGNS[27] = 20; - SU2ToCGNS[28] = 18; SU2ToCGNS[29] = 4; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 5; + SU2ToCGNS[2] = 6; + SU2ToCGNS[3] = 1; + SU2ToCGNS[4] = 12; + SU2ToCGNS[5] = 21; + SU2ToCGNS[6] = 22; + SU2ToCGNS[7] = 7; + SU2ToCGNS[8] = 11; + SU2ToCGNS[9] = 24; + SU2ToCGNS[10] = 23; + SU2ToCGNS[11] = 8; + SU2ToCGNS[12] = 3; + SU2ToCGNS[13] = 10; + SU2ToCGNS[14] = 9; + SU2ToCGNS[15] = 2; + SU2ToCGNS[16] = 13; + SU2ToCGNS[17] = 25; + SU2ToCGNS[18] = 15; + SU2ToCGNS[19] = 28; + SU2ToCGNS[20] = 29; + SU2ToCGNS[21] = 26; + SU2ToCGNS[22] = 19; + SU2ToCGNS[23] = 27; + SU2ToCGNS[24] = 17; + SU2ToCGNS[25] = 14; + SU2ToCGNS[26] = 16; + SU2ToCGNS[27] = 20; + SU2ToCGNS[28] = 18; + SU2ToCGNS[29] = 4; } -void CCGNSElementType::CreateDataPYRA_55(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataPYRA_55(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The PYRA_55 element is a quartic pyramid. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -567,47 +714,86 @@ void CCGNSElementType::CreateDataPYRA_55(unsigned short &VTK_Type, effect is currently ignored, i.e. it is assumed that the spacing in parameter space is uniform.*/ VTK_Type = PYRAMID; - nPoly = 4; - nDOFs = 55; + nPoly = 4; + nDOFs = 55; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 5; SU2ToCGNS[2] = 6; SU2ToCGNS[3] = 7; - SU2ToCGNS[4] = 1; SU2ToCGNS[5] = 16; SU2ToCGNS[6] = 29; SU2ToCGNS[7] = 30; - SU2ToCGNS[8] = 31; SU2ToCGNS[9] = 8; SU2ToCGNS[10] = 15; SU2ToCGNS[11] = 36; - SU2ToCGNS[12] = 37; SU2ToCGNS[13] = 32; SU2ToCGNS[14] = 9; SU2ToCGNS[15] = 14; - SU2ToCGNS[16] = 35; SU2ToCGNS[17] = 34; SU2ToCGNS[18] = 33; SU2ToCGNS[19] = 10; - SU2ToCGNS[20] = 3; SU2ToCGNS[21] = 13; SU2ToCGNS[22] = 12; SU2ToCGNS[23] = 11; - SU2ToCGNS[24] = 2; SU2ToCGNS[25] = 17; SU2ToCGNS[26] = 38; SU2ToCGNS[27] = 39; - SU2ToCGNS[28] = 20; SU2ToCGNS[29] = 48; SU2ToCGNS[30] = 50; SU2ToCGNS[31] = 51; - SU2ToCGNS[32] = 41; SU2ToCGNS[33] = 47; SU2ToCGNS[34] = 53; SU2ToCGNS[35] = 52; - SU2ToCGNS[36] = 42; SU2ToCGNS[37] = 26; SU2ToCGNS[38] = 45; SU2ToCGNS[39] = 44; - SU2ToCGNS[40] = 23; SU2ToCGNS[41] = 18; SU2ToCGNS[42] = 40; SU2ToCGNS[43] = 21; - SU2ToCGNS[44] = 49; SU2ToCGNS[45] = 54; SU2ToCGNS[46] = 43; SU2ToCGNS[47] = 27; - SU2ToCGNS[48] = 46; SU2ToCGNS[49] = 24; SU2ToCGNS[50] = 19; SU2ToCGNS[51] = 22; - SU2ToCGNS[52] = 28; SU2ToCGNS[53] = 25; SU2ToCGNS[54] = 4; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 5; + SU2ToCGNS[2] = 6; + SU2ToCGNS[3] = 7; + SU2ToCGNS[4] = 1; + SU2ToCGNS[5] = 16; + SU2ToCGNS[6] = 29; + SU2ToCGNS[7] = 30; + SU2ToCGNS[8] = 31; + SU2ToCGNS[9] = 8; + SU2ToCGNS[10] = 15; + SU2ToCGNS[11] = 36; + SU2ToCGNS[12] = 37; + SU2ToCGNS[13] = 32; + SU2ToCGNS[14] = 9; + SU2ToCGNS[15] = 14; + SU2ToCGNS[16] = 35; + SU2ToCGNS[17] = 34; + SU2ToCGNS[18] = 33; + SU2ToCGNS[19] = 10; + SU2ToCGNS[20] = 3; + SU2ToCGNS[21] = 13; + SU2ToCGNS[22] = 12; + SU2ToCGNS[23] = 11; + SU2ToCGNS[24] = 2; + SU2ToCGNS[25] = 17; + SU2ToCGNS[26] = 38; + SU2ToCGNS[27] = 39; + SU2ToCGNS[28] = 20; + SU2ToCGNS[29] = 48; + SU2ToCGNS[30] = 50; + SU2ToCGNS[31] = 51; + SU2ToCGNS[32] = 41; + SU2ToCGNS[33] = 47; + SU2ToCGNS[34] = 53; + SU2ToCGNS[35] = 52; + SU2ToCGNS[36] = 42; + SU2ToCGNS[37] = 26; + SU2ToCGNS[38] = 45; + SU2ToCGNS[39] = 44; + SU2ToCGNS[40] = 23; + SU2ToCGNS[41] = 18; + SU2ToCGNS[42] = 40; + SU2ToCGNS[43] = 21; + SU2ToCGNS[44] = 49; + SU2ToCGNS[45] = 54; + SU2ToCGNS[46] = 43; + SU2ToCGNS[47] = 27; + SU2ToCGNS[48] = 46; + SU2ToCGNS[49] = 24; + SU2ToCGNS[50] = 19; + SU2ToCGNS[51] = 22; + SU2ToCGNS[52] = 28; + SU2ToCGNS[53] = 25; + SU2ToCGNS[54] = 4; } -void CCGNSElementType::CreateDataPENTA_6(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataPENTA_6(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The PENTA_6 element is a linear prism. The node numbering is the same in SU2 and CGNS. */ VTK_Type = PRISM; - nPoly = 1; - nDOFs = 6; + nPoly = 1; + nDOFs = 6; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 1; SU2ToCGNS[2] = 2; - SU2ToCGNS[3] = 3; SU2ToCGNS[4] = 4; SU2ToCGNS[5] = 5; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 1; + SU2ToCGNS[2] = 2; + SU2ToCGNS[3] = 3; + SU2ToCGNS[4] = 4; + SU2ToCGNS[5] = 5; } -void CCGNSElementType::CreateDataPENTA_18(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataPENTA_18(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The PENTA_18 element is a quadratic prism. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -618,22 +804,32 @@ void CCGNSElementType::CreateDataPENTA_18(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = PRISM; - nPoly = 2; - nDOFs = 18; + nPoly = 2; + nDOFs = 18; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 6; SU2ToCGNS[2] = 1; SU2ToCGNS[3] = 8; - SU2ToCGNS[4] = 7; SU2ToCGNS[5] = 2; SU2ToCGNS[6] = 9; SU2ToCGNS[7] = 15; - SU2ToCGNS[8] = 10; SU2ToCGNS[9] = 17; SU2ToCGNS[10] = 16; SU2ToCGNS[11] = 11; - SU2ToCGNS[12] = 3; SU2ToCGNS[13] = 12; SU2ToCGNS[14] = 4; SU2ToCGNS[15] = 14; - SU2ToCGNS[16] = 13; SU2ToCGNS[17] = 5; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 6; + SU2ToCGNS[2] = 1; + SU2ToCGNS[3] = 8; + SU2ToCGNS[4] = 7; + SU2ToCGNS[5] = 2; + SU2ToCGNS[6] = 9; + SU2ToCGNS[7] = 15; + SU2ToCGNS[8] = 10; + SU2ToCGNS[9] = 17; + SU2ToCGNS[10] = 16; + SU2ToCGNS[11] = 11; + SU2ToCGNS[12] = 3; + SU2ToCGNS[13] = 12; + SU2ToCGNS[14] = 4; + SU2ToCGNS[15] = 14; + SU2ToCGNS[16] = 13; + SU2ToCGNS[17] = 5; } -void CCGNSElementType::CreateDataPENTA_40(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataPENTA_40(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The PENTA_40 element is a cubic prism. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -644,27 +840,54 @@ void CCGNSElementType::CreateDataPENTA_40(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = PRISM; - nPoly = 3; - nDOFs = 40; + nPoly = 3; + nDOFs = 40; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 6; SU2ToCGNS[2] = 7; SU2ToCGNS[3] = 1; - SU2ToCGNS[4] = 11; SU2ToCGNS[5] = 24; SU2ToCGNS[6] = 8; SU2ToCGNS[7] = 10; - SU2ToCGNS[8] = 9; SU2ToCGNS[9] = 2; SU2ToCGNS[10] = 12; SU2ToCGNS[11] = 25; - SU2ToCGNS[12] = 26; SU2ToCGNS[13] = 14; SU2ToCGNS[14] = 34; SU2ToCGNS[15] = 38; - SU2ToCGNS[16] = 29; SU2ToCGNS[17] = 33; SU2ToCGNS[18] = 30; SU2ToCGNS[19] = 16; - SU2ToCGNS[20] = 13; SU2ToCGNS[21] = 28; SU2ToCGNS[22] = 27; SU2ToCGNS[23] = 15; - SU2ToCGNS[24] = 35; SU2ToCGNS[25] = 39; SU2ToCGNS[26] = 32; SU2ToCGNS[27] = 36; - SU2ToCGNS[28] = 31; SU2ToCGNS[29] = 17; SU2ToCGNS[30] = 3; SU2ToCGNS[31] = 18; - SU2ToCGNS[32] = 19; SU2ToCGNS[33] = 4; SU2ToCGNS[34] = 23; SU2ToCGNS[35] = 37; - SU2ToCGNS[36] = 20; SU2ToCGNS[37] = 22; SU2ToCGNS[38] = 21; SU2ToCGNS[39] = 5; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 6; + SU2ToCGNS[2] = 7; + SU2ToCGNS[3] = 1; + SU2ToCGNS[4] = 11; + SU2ToCGNS[5] = 24; + SU2ToCGNS[6] = 8; + SU2ToCGNS[7] = 10; + SU2ToCGNS[8] = 9; + SU2ToCGNS[9] = 2; + SU2ToCGNS[10] = 12; + SU2ToCGNS[11] = 25; + SU2ToCGNS[12] = 26; + SU2ToCGNS[13] = 14; + SU2ToCGNS[14] = 34; + SU2ToCGNS[15] = 38; + SU2ToCGNS[16] = 29; + SU2ToCGNS[17] = 33; + SU2ToCGNS[18] = 30; + SU2ToCGNS[19] = 16; + SU2ToCGNS[20] = 13; + SU2ToCGNS[21] = 28; + SU2ToCGNS[22] = 27; + SU2ToCGNS[23] = 15; + SU2ToCGNS[24] = 35; + SU2ToCGNS[25] = 39; + SU2ToCGNS[26] = 32; + SU2ToCGNS[27] = 36; + SU2ToCGNS[28] = 31; + SU2ToCGNS[29] = 17; + SU2ToCGNS[30] = 3; + SU2ToCGNS[31] = 18; + SU2ToCGNS[32] = 19; + SU2ToCGNS[33] = 4; + SU2ToCGNS[34] = 23; + SU2ToCGNS[35] = 37; + SU2ToCGNS[36] = 20; + SU2ToCGNS[37] = 22; + SU2ToCGNS[38] = 21; + SU2ToCGNS[39] = 5; } -void CCGNSElementType::CreateDataPENTA_75(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataPENTA_75(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The PENTA_75 element is a quartic prism. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -678,36 +901,89 @@ void CCGNSElementType::CreateDataPENTA_75(unsigned short &VTK_Type, effect is currently ignored, i.e. it is assumed that the spacing in parameter space is uniform. */ VTK_Type = PRISM; - nPoly = 4; - nDOFs = 75; + nPoly = 4; + nDOFs = 75; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 6; SU2ToCGNS[2] = 7; SU2ToCGNS[3] = 8; - SU2ToCGNS[4] = 1; SU2ToCGNS[5] = 14; SU2ToCGNS[6] = 33; SU2ToCGNS[7] = 34; - SU2ToCGNS[8] = 9; SU2ToCGNS[9] = 13; SU2ToCGNS[10] = 35; SU2ToCGNS[11] = 10; - SU2ToCGNS[12] = 12; SU2ToCGNS[13] = 11; SU2ToCGNS[14] = 2; SU2ToCGNS[15] = 15; - SU2ToCGNS[16] = 36; SU2ToCGNS[17] = 37; SU2ToCGNS[18] = 38; SU2ToCGNS[19] = 18; - SU2ToCGNS[20] = 56; SU2ToCGNS[21] = 66; SU2ToCGNS[22] = 67; SU2ToCGNS[23] = 45; - SU2ToCGNS[24] = 55; SU2ToCGNS[25] = 68; SU2ToCGNS[26] = 46; SU2ToCGNS[27] = 54; - SU2ToCGNS[28] = 47; SU2ToCGNS[29] = 21; SU2ToCGNS[30] = 16; SU2ToCGNS[31] = 43; - SU2ToCGNS[32] = 44; SU2ToCGNS[33] = 39; SU2ToCGNS[34] = 19; SU2ToCGNS[35] = 57; - SU2ToCGNS[36] = 69; SU2ToCGNS[37] = 70; SU2ToCGNS[38] = 52; SU2ToCGNS[39] = 62; - SU2ToCGNS[40] = 71; SU2ToCGNS[41] = 53; SU2ToCGNS[42] = 61; SU2ToCGNS[43] = 48; - SU2ToCGNS[44] = 22; SU2ToCGNS[45] = 17; SU2ToCGNS[46] = 42; SU2ToCGNS[47] = 41; - SU2ToCGNS[48] = 40; SU2ToCGNS[49] = 20; SU2ToCGNS[50] = 58; SU2ToCGNS[51] = 72; - SU2ToCGNS[52] = 73; SU2ToCGNS[53] = 51; SU2ToCGNS[54] = 59; SU2ToCGNS[55] = 74; - SU2ToCGNS[56] = 50; SU2ToCGNS[57] = 60; SU2ToCGNS[58] = 49; SU2ToCGNS[59] = 23; - SU2ToCGNS[60] = 3; SU2ToCGNS[61] = 24; SU2ToCGNS[62] = 25; SU2ToCGNS[63] = 26; - SU2ToCGNS[64] = 4; SU2ToCGNS[65] = 32; SU2ToCGNS[66] = 63; SU2ToCGNS[67] = 64; - SU2ToCGNS[68] = 27; SU2ToCGNS[69] = 31; SU2ToCGNS[70] = 65; SU2ToCGNS[71] = 28; - SU2ToCGNS[72] = 30; SU2ToCGNS[73] = 29; SU2ToCGNS[74] = 5; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 6; + SU2ToCGNS[2] = 7; + SU2ToCGNS[3] = 8; + SU2ToCGNS[4] = 1; + SU2ToCGNS[5] = 14; + SU2ToCGNS[6] = 33; + SU2ToCGNS[7] = 34; + SU2ToCGNS[8] = 9; + SU2ToCGNS[9] = 13; + SU2ToCGNS[10] = 35; + SU2ToCGNS[11] = 10; + SU2ToCGNS[12] = 12; + SU2ToCGNS[13] = 11; + SU2ToCGNS[14] = 2; + SU2ToCGNS[15] = 15; + SU2ToCGNS[16] = 36; + SU2ToCGNS[17] = 37; + SU2ToCGNS[18] = 38; + SU2ToCGNS[19] = 18; + SU2ToCGNS[20] = 56; + SU2ToCGNS[21] = 66; + SU2ToCGNS[22] = 67; + SU2ToCGNS[23] = 45; + SU2ToCGNS[24] = 55; + SU2ToCGNS[25] = 68; + SU2ToCGNS[26] = 46; + SU2ToCGNS[27] = 54; + SU2ToCGNS[28] = 47; + SU2ToCGNS[29] = 21; + SU2ToCGNS[30] = 16; + SU2ToCGNS[31] = 43; + SU2ToCGNS[32] = 44; + SU2ToCGNS[33] = 39; + SU2ToCGNS[34] = 19; + SU2ToCGNS[35] = 57; + SU2ToCGNS[36] = 69; + SU2ToCGNS[37] = 70; + SU2ToCGNS[38] = 52; + SU2ToCGNS[39] = 62; + SU2ToCGNS[40] = 71; + SU2ToCGNS[41] = 53; + SU2ToCGNS[42] = 61; + SU2ToCGNS[43] = 48; + SU2ToCGNS[44] = 22; + SU2ToCGNS[45] = 17; + SU2ToCGNS[46] = 42; + SU2ToCGNS[47] = 41; + SU2ToCGNS[48] = 40; + SU2ToCGNS[49] = 20; + SU2ToCGNS[50] = 58; + SU2ToCGNS[51] = 72; + SU2ToCGNS[52] = 73; + SU2ToCGNS[53] = 51; + SU2ToCGNS[54] = 59; + SU2ToCGNS[55] = 74; + SU2ToCGNS[56] = 50; + SU2ToCGNS[57] = 60; + SU2ToCGNS[58] = 49; + SU2ToCGNS[59] = 23; + SU2ToCGNS[60] = 3; + SU2ToCGNS[61] = 24; + SU2ToCGNS[62] = 25; + SU2ToCGNS[63] = 26; + SU2ToCGNS[64] = 4; + SU2ToCGNS[65] = 32; + SU2ToCGNS[66] = 63; + SU2ToCGNS[67] = 64; + SU2ToCGNS[68] = 27; + SU2ToCGNS[69] = 31; + SU2ToCGNS[70] = 65; + SU2ToCGNS[71] = 28; + SU2ToCGNS[72] = 30; + SU2ToCGNS[73] = 29; + SU2ToCGNS[74] = 5; } -void CCGNSElementType::CreateDataHEXA_8(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataHEXA_8(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The HEXA_8 element is a linear hexahedron. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes (not present in HEXA_8). @@ -718,19 +994,22 @@ void CCGNSElementType::CreateDataHEXA_8(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = HEXAHEDRON; - nPoly = 1; - nDOFs = 8; + nPoly = 1; + nDOFs = 8; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 1; SU2ToCGNS[2] = 3; SU2ToCGNS[3] = 2; - SU2ToCGNS[4] = 4; SU2ToCGNS[5] = 5; SU2ToCGNS[6] = 7; SU2ToCGNS[7] = 6; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 1; + SU2ToCGNS[2] = 3; + SU2ToCGNS[3] = 2; + SU2ToCGNS[4] = 4; + SU2ToCGNS[5] = 5; + SU2ToCGNS[6] = 7; + SU2ToCGNS[7] = 6; } -void CCGNSElementType::CreateDataHEXA_27(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataHEXA_27(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The HEXA_27 element is a quadratic hexahedron. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -741,24 +1020,41 @@ void CCGNSElementType::CreateDataHEXA_27(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = HEXAHEDRON; - nPoly = 2; - nDOFs = 27; + nPoly = 2; + nDOFs = 27; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 8; SU2ToCGNS[2] = 1; SU2ToCGNS[3] = 11; - SU2ToCGNS[4] = 20; SU2ToCGNS[5] = 9; SU2ToCGNS[6] = 3; SU2ToCGNS[7] = 10; - SU2ToCGNS[8] = 2; SU2ToCGNS[9] = 12; SU2ToCGNS[10] = 21; SU2ToCGNS[11] = 13; - SU2ToCGNS[12] = 24; SU2ToCGNS[13] = 26; SU2ToCGNS[14] = 22; SU2ToCGNS[15] = 15; - SU2ToCGNS[16] = 23; SU2ToCGNS[17] = 14; SU2ToCGNS[18] = 4; SU2ToCGNS[19] = 16; - SU2ToCGNS[20] = 5; SU2ToCGNS[21] = 19; SU2ToCGNS[22] = 25; SU2ToCGNS[23] = 17; - SU2ToCGNS[24] = 7; SU2ToCGNS[25] = 18; SU2ToCGNS[26] = 6; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 8; + SU2ToCGNS[2] = 1; + SU2ToCGNS[3] = 11; + SU2ToCGNS[4] = 20; + SU2ToCGNS[5] = 9; + SU2ToCGNS[6] = 3; + SU2ToCGNS[7] = 10; + SU2ToCGNS[8] = 2; + SU2ToCGNS[9] = 12; + SU2ToCGNS[10] = 21; + SU2ToCGNS[11] = 13; + SU2ToCGNS[12] = 24; + SU2ToCGNS[13] = 26; + SU2ToCGNS[14] = 22; + SU2ToCGNS[15] = 15; + SU2ToCGNS[16] = 23; + SU2ToCGNS[17] = 14; + SU2ToCGNS[18] = 4; + SU2ToCGNS[19] = 16; + SU2ToCGNS[20] = 5; + SU2ToCGNS[21] = 19; + SU2ToCGNS[22] = 25; + SU2ToCGNS[23] = 17; + SU2ToCGNS[24] = 7; + SU2ToCGNS[25] = 18; + SU2ToCGNS[26] = 6; } -void CCGNSElementType::CreateDataHEXA_64(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataHEXA_64(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The HEXA_64 element is a cubic hexahedron. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -769,33 +1065,78 @@ void CCGNSElementType::CreateDataHEXA_64(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = HEXAHEDRON; - nPoly = 3; - nDOFs = 64; + nPoly = 3; + nDOFs = 64; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 8; SU2ToCGNS[2] = 9; SU2ToCGNS[3] = 1; - SU2ToCGNS[4] = 15; SU2ToCGNS[5] = 32; SU2ToCGNS[6] = 33; SU2ToCGNS[7] = 10; - SU2ToCGNS[8] = 14; SU2ToCGNS[9] = 35; SU2ToCGNS[10] = 34; SU2ToCGNS[11] = 11; - SU2ToCGNS[12] = 3; SU2ToCGNS[13] = 13; SU2ToCGNS[14] = 12; SU2ToCGNS[15] = 2; - SU2ToCGNS[16] = 16; SU2ToCGNS[17] = 36; SU2ToCGNS[18] = 37; SU2ToCGNS[19] = 18; - SU2ToCGNS[20] = 49; SU2ToCGNS[21] = 56; SU2ToCGNS[22] = 57; SU2ToCGNS[23] = 40; - SU2ToCGNS[24] = 48; SU2ToCGNS[25] = 59; SU2ToCGNS[26] = 58; SU2ToCGNS[27] = 41; - SU2ToCGNS[28] = 22; SU2ToCGNS[29] = 45; SU2ToCGNS[30] = 44; SU2ToCGNS[31] = 20; - SU2ToCGNS[32] = 17; SU2ToCGNS[33] = 39; SU2ToCGNS[34] = 38; SU2ToCGNS[35] = 19; - SU2ToCGNS[36] = 50; SU2ToCGNS[37] = 60; SU2ToCGNS[38] = 61; SU2ToCGNS[39] = 43; - SU2ToCGNS[40] = 51; SU2ToCGNS[41] = 63; SU2ToCGNS[42] = 62; SU2ToCGNS[43] = 42; - SU2ToCGNS[44] = 23; SU2ToCGNS[45] = 46; SU2ToCGNS[46] = 47; SU2ToCGNS[47] = 21; - SU2ToCGNS[48] = 4; SU2ToCGNS[49] = 24; SU2ToCGNS[50] = 25; SU2ToCGNS[51] = 5; - SU2ToCGNS[52] = 31; SU2ToCGNS[53] = 52; SU2ToCGNS[54] = 53; SU2ToCGNS[55] = 26; - SU2ToCGNS[56] = 30; SU2ToCGNS[57] = 55; SU2ToCGNS[58] = 54; SU2ToCGNS[59] = 27; - SU2ToCGNS[60] = 7; SU2ToCGNS[61] = 29; SU2ToCGNS[62] = 28; SU2ToCGNS[63] = 6; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 8; + SU2ToCGNS[2] = 9; + SU2ToCGNS[3] = 1; + SU2ToCGNS[4] = 15; + SU2ToCGNS[5] = 32; + SU2ToCGNS[6] = 33; + SU2ToCGNS[7] = 10; + SU2ToCGNS[8] = 14; + SU2ToCGNS[9] = 35; + SU2ToCGNS[10] = 34; + SU2ToCGNS[11] = 11; + SU2ToCGNS[12] = 3; + SU2ToCGNS[13] = 13; + SU2ToCGNS[14] = 12; + SU2ToCGNS[15] = 2; + SU2ToCGNS[16] = 16; + SU2ToCGNS[17] = 36; + SU2ToCGNS[18] = 37; + SU2ToCGNS[19] = 18; + SU2ToCGNS[20] = 49; + SU2ToCGNS[21] = 56; + SU2ToCGNS[22] = 57; + SU2ToCGNS[23] = 40; + SU2ToCGNS[24] = 48; + SU2ToCGNS[25] = 59; + SU2ToCGNS[26] = 58; + SU2ToCGNS[27] = 41; + SU2ToCGNS[28] = 22; + SU2ToCGNS[29] = 45; + SU2ToCGNS[30] = 44; + SU2ToCGNS[31] = 20; + SU2ToCGNS[32] = 17; + SU2ToCGNS[33] = 39; + SU2ToCGNS[34] = 38; + SU2ToCGNS[35] = 19; + SU2ToCGNS[36] = 50; + SU2ToCGNS[37] = 60; + SU2ToCGNS[38] = 61; + SU2ToCGNS[39] = 43; + SU2ToCGNS[40] = 51; + SU2ToCGNS[41] = 63; + SU2ToCGNS[42] = 62; + SU2ToCGNS[43] = 42; + SU2ToCGNS[44] = 23; + SU2ToCGNS[45] = 46; + SU2ToCGNS[46] = 47; + SU2ToCGNS[47] = 21; + SU2ToCGNS[48] = 4; + SU2ToCGNS[49] = 24; + SU2ToCGNS[50] = 25; + SU2ToCGNS[51] = 5; + SU2ToCGNS[52] = 31; + SU2ToCGNS[53] = 52; + SU2ToCGNS[54] = 53; + SU2ToCGNS[55] = 26; + SU2ToCGNS[56] = 30; + SU2ToCGNS[57] = 55; + SU2ToCGNS[58] = 54; + SU2ToCGNS[59] = 27; + SU2ToCGNS[60] = 7; + SU2ToCGNS[61] = 29; + SU2ToCGNS[62] = 28; + SU2ToCGNS[63] = 6; } -void CCGNSElementType::CreateDataHEXA_125(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataHEXA_125(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The HEXA_125 element is a quartic hexahedron. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -806,35 +1147,135 @@ void CCGNSElementType::CreateDataHEXA_125(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = HEXAHEDRON; - nPoly = 4; - nDOFs = 125; + nPoly = 4; + nDOFs = 125; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 8; SU2ToCGNS[2] = 9; SU2ToCGNS[3] = 10; SU2ToCGNS[4] = 1; - SU2ToCGNS[5] = 19; SU2ToCGNS[6] = 44; SU2ToCGNS[7] = 45; SU2ToCGNS[8] = 46; SU2ToCGNS[9] = 11; - SU2ToCGNS[10] = 18; SU2ToCGNS[11] = 51; SU2ToCGNS[12] = 52; SU2ToCGNS[13] = 47; SU2ToCGNS[14] = 12; - SU2ToCGNS[15] = 17; SU2ToCGNS[16] = 50; SU2ToCGNS[17] = 49; SU2ToCGNS[18] = 48; SU2ToCGNS[19] = 13; - SU2ToCGNS[20] = 3; SU2ToCGNS[21] = 16; SU2ToCGNS[22] = 15; SU2ToCGNS[23] = 14; SU2ToCGNS[24] = 2; - SU2ToCGNS[25] = 20; SU2ToCGNS[26] = 53; SU2ToCGNS[27] = 54; SU2ToCGNS[28] = 55; SU2ToCGNS[29] = 23; - SU2ToCGNS[30] = 82; SU2ToCGNS[31] = 98; SU2ToCGNS[32] = 99; SU2ToCGNS[33] = 100; SU2ToCGNS[34] = 62; - SU2ToCGNS[35] = 81; SU2ToCGNS[36] = 105; SU2ToCGNS[37] = 106; SU2ToCGNS[38] = 101; SU2ToCGNS[39] = 63; - SU2ToCGNS[40] = 80; SU2ToCGNS[41] = 104; SU2ToCGNS[42] = 103; SU2ToCGNS[43] = 102; SU2ToCGNS[44] = 64; - SU2ToCGNS[45] = 29; SU2ToCGNS[46] = 73; SU2ToCGNS[47] = 72; SU2ToCGNS[48] = 71; SU2ToCGNS[49] = 26; - SU2ToCGNS[50] = 21; SU2ToCGNS[51] = 60; SU2ToCGNS[52] = 61; SU2ToCGNS[53] = 56; SU2ToCGNS[54] = 24; - SU2ToCGNS[55] = 83; SU2ToCGNS[56] = 107; SU2ToCGNS[57] = 108; SU2ToCGNS[58] = 109; SU2ToCGNS[59] = 69; - SU2ToCGNS[60] = 88; SU2ToCGNS[61] = 114; SU2ToCGNS[62] = 115; SU2ToCGNS[63] = 110; SU2ToCGNS[64] = 70; - SU2ToCGNS[65] = 87; SU2ToCGNS[66] = 113; SU2ToCGNS[67] = 112; SU2ToCGNS[68] = 111; SU2ToCGNS[69] = 65; - SU2ToCGNS[70] = 30; SU2ToCGNS[71] = 74; SU2ToCGNS[72] = 79; SU2ToCGNS[73] = 78; SU2ToCGNS[74] = 27; - SU2ToCGNS[75] = 22; SU2ToCGNS[76] = 59; SU2ToCGNS[77] = 58; SU2ToCGNS[78] = 57; SU2ToCGNS[79] = 25; - SU2ToCGNS[80] = 84; SU2ToCGNS[81] = 116; SU2ToCGNS[82] = 117; SU2ToCGNS[83] = 118; SU2ToCGNS[84] = 68; - SU2ToCGNS[85] = 85; SU2ToCGNS[86] = 123; SU2ToCGNS[87] = 124; SU2ToCGNS[88] = 119; SU2ToCGNS[89] = 67; - SU2ToCGNS[90] = 86; SU2ToCGNS[91] = 122; SU2ToCGNS[92] = 121; SU2ToCGNS[93] = 120; SU2ToCGNS[94] = 66; - SU2ToCGNS[95] = 31; SU2ToCGNS[96] = 75; SU2ToCGNS[97] = 76; SU2ToCGNS[98] = 77; SU2ToCGNS[99] = 28; - SU2ToCGNS[100] = 4; SU2ToCGNS[101] = 32; SU2ToCGNS[102] = 33; SU2ToCGNS[103] = 34; SU2ToCGNS[104] = 5; - SU2ToCGNS[105] = 43; SU2ToCGNS[106] = 89; SU2ToCGNS[107] = 90; SU2ToCGNS[108] = 91; SU2ToCGNS[109] = 35; - SU2ToCGNS[110] = 42; SU2ToCGNS[111] = 96; SU2ToCGNS[112] = 97; SU2ToCGNS[113] = 92; SU2ToCGNS[114] = 36; - SU2ToCGNS[115] = 41; SU2ToCGNS[116] = 95; SU2ToCGNS[117] = 94; SU2ToCGNS[118] = 93; SU2ToCGNS[119] = 37; - SU2ToCGNS[120] = 7; SU2ToCGNS[121] = 40; SU2ToCGNS[122] = 39; SU2ToCGNS[123] = 38; SU2ToCGNS[124] = 6; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 8; + SU2ToCGNS[2] = 9; + SU2ToCGNS[3] = 10; + SU2ToCGNS[4] = 1; + SU2ToCGNS[5] = 19; + SU2ToCGNS[6] = 44; + SU2ToCGNS[7] = 45; + SU2ToCGNS[8] = 46; + SU2ToCGNS[9] = 11; + SU2ToCGNS[10] = 18; + SU2ToCGNS[11] = 51; + SU2ToCGNS[12] = 52; + SU2ToCGNS[13] = 47; + SU2ToCGNS[14] = 12; + SU2ToCGNS[15] = 17; + SU2ToCGNS[16] = 50; + SU2ToCGNS[17] = 49; + SU2ToCGNS[18] = 48; + SU2ToCGNS[19] = 13; + SU2ToCGNS[20] = 3; + SU2ToCGNS[21] = 16; + SU2ToCGNS[22] = 15; + SU2ToCGNS[23] = 14; + SU2ToCGNS[24] = 2; + SU2ToCGNS[25] = 20; + SU2ToCGNS[26] = 53; + SU2ToCGNS[27] = 54; + SU2ToCGNS[28] = 55; + SU2ToCGNS[29] = 23; + SU2ToCGNS[30] = 82; + SU2ToCGNS[31] = 98; + SU2ToCGNS[32] = 99; + SU2ToCGNS[33] = 100; + SU2ToCGNS[34] = 62; + SU2ToCGNS[35] = 81; + SU2ToCGNS[36] = 105; + SU2ToCGNS[37] = 106; + SU2ToCGNS[38] = 101; + SU2ToCGNS[39] = 63; + SU2ToCGNS[40] = 80; + SU2ToCGNS[41] = 104; + SU2ToCGNS[42] = 103; + SU2ToCGNS[43] = 102; + SU2ToCGNS[44] = 64; + SU2ToCGNS[45] = 29; + SU2ToCGNS[46] = 73; + SU2ToCGNS[47] = 72; + SU2ToCGNS[48] = 71; + SU2ToCGNS[49] = 26; + SU2ToCGNS[50] = 21; + SU2ToCGNS[51] = 60; + SU2ToCGNS[52] = 61; + SU2ToCGNS[53] = 56; + SU2ToCGNS[54] = 24; + SU2ToCGNS[55] = 83; + SU2ToCGNS[56] = 107; + SU2ToCGNS[57] = 108; + SU2ToCGNS[58] = 109; + SU2ToCGNS[59] = 69; + SU2ToCGNS[60] = 88; + SU2ToCGNS[61] = 114; + SU2ToCGNS[62] = 115; + SU2ToCGNS[63] = 110; + SU2ToCGNS[64] = 70; + SU2ToCGNS[65] = 87; + SU2ToCGNS[66] = 113; + SU2ToCGNS[67] = 112; + SU2ToCGNS[68] = 111; + SU2ToCGNS[69] = 65; + SU2ToCGNS[70] = 30; + SU2ToCGNS[71] = 74; + SU2ToCGNS[72] = 79; + SU2ToCGNS[73] = 78; + SU2ToCGNS[74] = 27; + SU2ToCGNS[75] = 22; + SU2ToCGNS[76] = 59; + SU2ToCGNS[77] = 58; + SU2ToCGNS[78] = 57; + SU2ToCGNS[79] = 25; + SU2ToCGNS[80] = 84; + SU2ToCGNS[81] = 116; + SU2ToCGNS[82] = 117; + SU2ToCGNS[83] = 118; + SU2ToCGNS[84] = 68; + SU2ToCGNS[85] = 85; + SU2ToCGNS[86] = 123; + SU2ToCGNS[87] = 124; + SU2ToCGNS[88] = 119; + SU2ToCGNS[89] = 67; + SU2ToCGNS[90] = 86; + SU2ToCGNS[91] = 122; + SU2ToCGNS[92] = 121; + SU2ToCGNS[93] = 120; + SU2ToCGNS[94] = 66; + SU2ToCGNS[95] = 31; + SU2ToCGNS[96] = 75; + SU2ToCGNS[97] = 76; + SU2ToCGNS[98] = 77; + SU2ToCGNS[99] = 28; + SU2ToCGNS[100] = 4; + SU2ToCGNS[101] = 32; + SU2ToCGNS[102] = 33; + SU2ToCGNS[103] = 34; + SU2ToCGNS[104] = 5; + SU2ToCGNS[105] = 43; + SU2ToCGNS[106] = 89; + SU2ToCGNS[107] = 90; + SU2ToCGNS[108] = 91; + SU2ToCGNS[109] = 35; + SU2ToCGNS[110] = 42; + SU2ToCGNS[111] = 96; + SU2ToCGNS[112] = 97; + SU2ToCGNS[113] = 92; + SU2ToCGNS[114] = 36; + SU2ToCGNS[115] = 41; + SU2ToCGNS[116] = 95; + SU2ToCGNS[117] = 94; + SU2ToCGNS[118] = 93; + SU2ToCGNS[119] = 37; + SU2ToCGNS[120] = 7; + SU2ToCGNS[121] = 40; + SU2ToCGNS[122] = 39; + SU2ToCGNS[123] = 38; + SU2ToCGNS[124] = 6; } #endif diff --git a/Common/src/geometry/meshreader/CCGNSMeshReaderBase.cpp b/Common/src/geometry/meshreader/CCGNSMeshReaderBase.cpp index 379176ad6c9..53697f65958 100644 --- a/Common/src/geometry/meshreader/CCGNSMeshReaderBase.cpp +++ b/Common/src/geometry/meshreader/CCGNSMeshReaderBase.cpp @@ -29,8 +29,7 @@ #include "../../../include/toolboxes/CLinearPartitioner.hpp" #include "../../../include/geometry/meshreader/CCGNSMeshReaderBase.hpp" -CCGNSMeshReaderBase::CCGNSMeshReaderBase(const CConfig* val_config, unsigned short val_iZone, - unsigned short val_nZone) +CCGNSMeshReaderBase::CCGNSMeshReaderBase(const CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone) : CMeshReaderBase(val_config, val_iZone, val_nZone) { #ifdef HAVE_CGNS /*--- Leave the option to do something in the future here. ---*/ @@ -355,42 +354,75 @@ string CCGNSMeshReaderBase::GetCGNSElementType(ElementType_t val_elem_type, int& val_vtk_type = 1; SU2_MPI::Error("Vertex elements detected. Please remove.", CURRENT_FUNCTION); break; - case BAR_2: case BAR_3: case BAR_4: case BAR_5: + case BAR_2: + case BAR_3: + case BAR_4: + case BAR_5: elem_name = "Line"; val_vtk_type = 3; - if (dimension == 3) - SU2_MPI::Error("Line elements detected in a 3D mesh. Please remove.", - CURRENT_FUNCTION); + if (dimension == 3) SU2_MPI::Error("Line elements detected in a 3D mesh. Please remove.", CURRENT_FUNCTION); break; - case TRI_3: case TRI_6: case TRI_9: case TRI_10: - case TRI_12: case TRI_15: + case TRI_3: + case TRI_6: + case TRI_9: + case TRI_10: + case TRI_12: + case TRI_15: elem_name = "Triangle"; val_vtk_type = 5; break; - case QUAD_4: case QUAD_8: case QUAD_9: case QUAD_12: - case QUAD_16: case QUAD_P4_16: case QUAD_25: + case QUAD_4: + case QUAD_8: + case QUAD_9: + case QUAD_12: + case QUAD_16: + case QUAD_P4_16: + case QUAD_25: elem_name = "Quadrilateral"; val_vtk_type = 9; break; - case TETRA_4: case TETRA_10: case TETRA_16: case TETRA_20: - case TETRA_22: case TETRA_34: case TETRA_35: + case TETRA_4: + case TETRA_10: + case TETRA_16: + case TETRA_20: + case TETRA_22: + case TETRA_34: + case TETRA_35: elem_name = "Tetrahedron"; val_vtk_type = 10; break; - case HEXA_8: case HEXA_20: case HEXA_27: case HEXA_32: - case HEXA_56: case HEXA_64: case HEXA_44: case HEXA_98: + case HEXA_8: + case HEXA_20: + case HEXA_27: + case HEXA_32: + case HEXA_56: + case HEXA_64: + case HEXA_44: + case HEXA_98: case HEXA_125: elem_name = "Hexahedron"; val_vtk_type = 12; break; - case PENTA_6: case PENTA_15: case PENTA_18: case PENTA_24: - case PENTA_38: case PENTA_40: case PENTA_33: case PENTA_66: + case PENTA_6: + case PENTA_15: + case PENTA_18: + case PENTA_24: + case PENTA_38: + case PENTA_40: + case PENTA_33: + case PENTA_66: case PENTA_75: elem_name = "Prism"; val_vtk_type = 13; break; - case PYRA_5: case PYRA_14: case PYRA_13: case PYRA_21: - case PYRA_29: case PYRA_30: case PYRA_P4_29: case PYRA_50: + case PYRA_5: + case PYRA_14: + case PYRA_13: + case PYRA_21: + case PYRA_29: + case PYRA_30: + case PYRA_P4_29: + case PYRA_50: case PYRA_55: elem_name = "Pyramid"; val_vtk_type = 14; diff --git a/Common/src/geometry/meshreader/CCGNSMeshReaderFEM.cpp b/Common/src/geometry/meshreader/CCGNSMeshReaderFEM.cpp index 48c0b267cfb..1d2c1f22f01 100644 --- a/Common/src/geometry/meshreader/CCGNSMeshReaderFEM.cpp +++ b/Common/src/geometry/meshreader/CCGNSMeshReaderFEM.cpp @@ -30,8 +30,7 @@ #include "../../../include/geometry/meshreader/CCGNSMeshReaderFEM.hpp" #include "../../../include/geometry/meshreader/CCGNSElementType.hpp" -CCGNSMeshReaderFEM::CCGNSMeshReaderFEM(const CConfig* val_config, unsigned short val_iZone, - unsigned short val_nZone) +CCGNSMeshReaderFEM::CCGNSMeshReaderFEM(const CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone) : CCGNSMeshReaderBase(val_config, val_iZone, val_nZone) { #ifdef HAVE_CGNS OpenCGNSFile(config->GetMesh_FileName()); @@ -65,65 +64,59 @@ CCGNSMeshReaderFEM::CCGNSMeshReaderFEM(const CConfig* val_config, unsigned short CCGNSMeshReaderFEM::~CCGNSMeshReaderFEM() = default; #ifdef HAVE_CGNS -void CCGNSMeshReaderFEM::ReadCGNSConnectivityRangeSection(const int val_section, - const unsigned long val_firstIndex, - const unsigned long val_lastIndex, - unsigned long &elemCount, - unsigned long &localElemCount, - vector &localConn) { - +void CCGNSMeshReaderFEM::ReadCGNSConnectivityRangeSection(const int val_section, const unsigned long val_firstIndex, + const unsigned long val_lastIndex, unsigned long& elemCount, + unsigned long& localElemCount, + vector& localConn) { /*--- Read the connectivity details for this section. ---*/ int nbndry, parent_flag; cgsize_t startE, endE; ElementType_t elemType; char sectionName[CGNS_STRING_SIZE]; - if(cg_section_read(cgnsFileID, cgnsBase, cgnsZone, val_section+1, sectionName, - &elemType, &startE, &endE, &nbndry, &parent_flag)) + if (cg_section_read(cgnsFileID, cgnsBase, cgnsZone, val_section + 1, sectionName, &elemType, &startE, &endE, &nbndry, + &parent_flag)) cg_error_exit(); /*--- Determine the number of elements in this section and update the element counters accordingly. ---*/ - const unsigned long nElemSection = (endE-startE+1); + const unsigned long nElemSection = (endE - startE + 1); const unsigned long elemCountOld = elemCount; elemCount += nElemSection; /*--- Check for overlap with the element range this rank is responsible for. ---*/ const unsigned long indBegOverlap = max(elemCountOld, val_firstIndex); - const unsigned long indEndOverlap = min(elemCount, val_lastIndex); - - if(indEndOverlap > indBegOverlap) { + const unsigned long indEndOverlap = min(elemCount, val_lastIndex); + if (indEndOverlap > indBegOverlap) { /*--- This rank must read element data from this connectivity section. Determine the offset relative to the start of this section and the number of elements to be read by this rank. ---*/ const unsigned long offsetRank = indBegOverlap - elemCountOld; - const unsigned long nElemRank = indEndOverlap - indBegOverlap; + const unsigned long nElemRank = indEndOverlap - indBegOverlap; nElems[val_section] = nElemRank; /*--- Determine the index range to be read for this rank. ---*/ const cgsize_t iBeg = startE + offsetRank; - const cgsize_t iEnd = iBeg + nElemRank -1; + const cgsize_t iEnd = iBeg + nElemRank - 1; /*--- Determine the size of the vector needed to read the connectivity data from the CGNS file. ---*/ cgsize_t sizeNeeded; - if (cg_ElementPartialSize(cgnsFileID, cgnsBase, cgnsZone, val_section+1, - iBeg, iEnd, &sizeNeeded) != CG_OK) + if (cg_ElementPartialSize(cgnsFileID, cgnsBase, cgnsZone, val_section + 1, iBeg, iEnd, &sizeNeeded) != CG_OK) cg_error_exit(); /*--- Allocate the memory for the connectivity and read the data. ---*/ vector connCGNSVec(sizeNeeded); if (elemType == MIXED) { - vector connCGNSOffsetVec(iEnd-iBeg+2); - if(cg_poly_elements_partial_read(cgnsFileID, cgnsBase, cgnsZone, val_section+1, - iBeg, iEnd, connCGNSVec.data(), - connCGNSOffsetVec.data(), NULL) != CG_OK) + vector connCGNSOffsetVec(iEnd - iBeg + 2); + if (cg_poly_elements_partial_read(cgnsFileID, cgnsBase, cgnsZone, val_section + 1, iBeg, iEnd, connCGNSVec.data(), + connCGNSOffsetVec.data(), NULL) != CG_OK) cg_error_exit(); } else { - if(cg_elements_partial_read(cgnsFileID, cgnsBase, cgnsZone, val_section+1, - iBeg, iEnd, connCGNSVec.data(), NULL) != CG_OK) + if (cg_elements_partial_read(cgnsFileID, cgnsBase, cgnsZone, val_section + 1, iBeg, iEnd, connCGNSVec.data(), + NULL) != CG_OK) cg_error_exit(); } @@ -132,15 +125,14 @@ void CCGNSMeshReaderFEM::ReadCGNSConnectivityRangeSection(const int CCGNSElementType CGNSElem; std::vector connSU2; ElementType_t typeElem = elemType; - const cgsize_t *connCGNS = connCGNSVec.data(); + const cgsize_t* connCGNS = connCGNSVec.data(); /*--- Loop over the elements just read. ---*/ - for(unsigned long i=0; i SINGLE_NODE) @@ -168,33 +159,29 @@ void CCGNSMeshReaderFEM::ReadCGNSVolumeElementConnectivity(void) { } /*--- Get a partitioner to help with linear partitioning. ---*/ - CLinearPartitioner elemPartitioner(numberOfGlobalElements,0); + CLinearPartitioner elemPartitioner(numberOfGlobalElements, 0); /*--- Determine the index of the first and last element to be stored on this rank and the number of local elements. ---*/ const unsigned long firstIndex = elemPartitioner.GetFirstIndexOnRank(rank); - const unsigned long lastIndex = elemPartitioner.GetLastIndexOnRank(rank); + const unsigned long lastIndex = elemPartitioner.GetLastIndexOnRank(rank); numberOfLocalElements = elemPartitioner.GetSizeOnRank(rank); /*--- Loop over the section and check for a section with volume elements. ---*/ unsigned long elemCount = 0, localElemCount = 0; - for(int s=0; s localFaces; @@ -213,19 +200,16 @@ void CCGNSMeshReaderFEM::ReadCGNSSurfaceElementConnectivity(void) { /*--- Loop over the number of sections and check for a surface. ---*/ int markerCount = 0; - for(int s=0; s &localFaces, - unsigned long &nSurfElem, - vector &surfConn) { - +void CCGNSMeshReaderFEM::ReadCGNSSurfaceSection(const int val_section, const vector& localFaces, + unsigned long& nSurfElem, vector& surfConn) { /*--- Initialize nSurfElem to zero. ---*/ nSurfElem = 0; @@ -249,46 +230,43 @@ void CCGNSMeshReaderFEM::ReadCGNSSurfaceSection(const int val ElementType_t elemType; char sectionName[CGNS_STRING_SIZE]; - if(cg_section_read(cgnsFileID, cgnsBase, cgnsZone, val_section+1, sectionName, - &elemType, &startE, &endE, &nbndry, &parent_flag)) + if (cg_section_read(cgnsFileID, cgnsBase, cgnsZone, val_section + 1, sectionName, &elemType, &startE, &endE, &nbndry, + &parent_flag)) cg_error_exit(); - const unsigned long nElemSection = (endE-startE+1); + const unsigned long nElemSection = (endE - startE + 1); /*--- Determine the number of chunks used for the reading of the surface elements. This is done to avoid a memory bottleneck for extremely big cases. For reasonably sized grids this connectivity can be read in a single call. ---*/ - unsigned long nChunks = nElemSection/localFaces.size(); - if(nChunks*localFaces.size() != nElemSection) ++nChunks; - const unsigned long nElemChunk = nElemSection/nChunks; + unsigned long nChunks = nElemSection / localFaces.size(); + if (nChunks * localFaces.size() != nElemSection) ++nChunks; + const unsigned long nElemChunk = nElemSection / nChunks; /*--- Loop over the number of chunks. ---*/ - for(unsigned long iChunk=0; iChunk connCGNSVec(sizeNeeded); if (elemType == MIXED) { - vector connCGNSOffsetVec(iEnd-iBeg+2); - if(cg_poly_elements_partial_read(cgnsFileID, cgnsBase, cgnsZone, val_section+1, - iBeg, iEnd, connCGNSVec.data(), - connCGNSOffsetVec.data(), NULL) != CG_OK) + vector connCGNSOffsetVec(iEnd - iBeg + 2); + if (cg_poly_elements_partial_read(cgnsFileID, cgnsBase, cgnsZone, val_section + 1, iBeg, iEnd, connCGNSVec.data(), + connCGNSOffsetVec.data(), NULL) != CG_OK) cg_error_exit(); } else { - if(cg_elements_partial_read(cgnsFileID, cgnsBase, cgnsZone, val_section+1, - iBeg, iEnd, connCGNSVec.data(), NULL) != CG_OK) + if (cg_elements_partial_read(cgnsFileID, cgnsBase, cgnsZone, val_section + 1, iBeg, iEnd, connCGNSVec.data(), + NULL) != CG_OK) cg_error_exit(); } @@ -297,72 +275,70 @@ void CCGNSMeshReaderFEM::ReadCGNSSurfaceSection(const int val CCGNSElementType CGNSElem; std::vector connSU2; ElementType_t typeElem = elemType; - const cgsize_t *connCGNS = connCGNSVec.data(); + const cgsize_t* connCGNS = connCGNSVec.data(); /*--- Loop over the elements just read. ---*/ - for(cgsize_t i=iBeg; i<=iEnd; ++i) { - + for (cgsize_t i = iBeg; i <= iEnd; ++i) { /*--- Determine the element type for this element if this is a mixed connectivity and set the pointer to the actual connectivity data. ---*/ - if(elemType == MIXED) { - typeElem = (ElementType_t) connCGNS[0]; + if (elemType == MIXED) { + typeElem = (ElementType_t)connCGNS[0]; ++connCGNS; } /*--- Convert the CGNS connectivity to SU2 connectivity and update the pointer for the next surface element. ---*/ - const unsigned long globalID = i-1; + const unsigned long globalID = i - 1; CGNSElem.CGNSToSU2(typeElem, globalID, connCGNS, connSU2); connCGNS += connSU2[3]; /*--- Easier storage of the VTK type, polynomial degree and number of DOFs of the surface element. ---*/ - const unsigned short VTK_Type = (unsigned short) connSU2[0]; - const unsigned short nPolyGrid = (unsigned short) connSU2[1]; - const unsigned short nDOFsGrid = (unsigned short) connSU2[3]; + const unsigned short VTK_Type = (unsigned short)connSU2[0]; + const unsigned short nPolyGrid = (unsigned short)connSU2[1]; + const unsigned short nDOFsGrid = (unsigned short)connSU2[3]; /*--- Make a distinction between the possible element surface types and determine the corner points in local numbering of the element. ---*/ const unsigned short nDOFEdgeGrid = nPolyGrid + 1; CFaceOfElement thisFace; - thisFace.cornerPoints[0] = 0; thisFace.cornerPoints[1] = nPolyGrid; + thisFace.cornerPoints[0] = 0; + thisFace.cornerPoints[1] = nPolyGrid; - switch( VTK_Type ) { + switch (VTK_Type) { case LINE: thisFace.nCornerPoints = 2; break; case TRIANGLE: thisFace.nCornerPoints = 3; - thisFace.cornerPoints[2] = nDOFsGrid -1; + thisFace.cornerPoints[2] = nDOFsGrid - 1; break; case QUADRILATERAL: thisFace.nCornerPoints = 4; - thisFace.cornerPoints[2] = nPolyGrid*nDOFEdgeGrid; - thisFace.cornerPoints[3] = nDOFsGrid -1; + thisFace.cornerPoints[2] = nPolyGrid * nDOFEdgeGrid; + thisFace.cornerPoints[3] = nDOFsGrid - 1; break; default: ostringstream message; - message << "Unsupported FEM boundary element value, " << typeElem - << ", in surface section " << sectionName; + message << "Unsupported FEM boundary element value, " << typeElem << ", in surface section " << sectionName; SU2_MPI::Error(message.str(), CURRENT_FUNCTION); } /*--- Convert the local numbering of thisFace to global numbering and create a unique numbering of corner points. ---*/ - for(unsigned short j=0; j::const_iterator low; low = lower_bound(localFaces.begin(), localFaces.end(), thisFace); - if(low != localFaces.end()) { - if( !(thisFace < *low) ) { - + if (low != localFaces.end()) { + if (!(thisFace < *low)) { /*--- Update the number of local surface elements. ---*/ ++nSurfElem; @@ -383,24 +359,22 @@ void CCGNSMeshReaderFEM::ReadCGNSSurfaceSection(const int val #endif void CCGNSMeshReaderFEM::CommPointCoordinates(void) { - /*--- Determine the linear partitioning of the points. ---*/ - CLinearPartitioner pointPartitioner(numberOfGlobalPoints,0); + CLinearPartitioner pointPartitioner(numberOfGlobalPoints, 0); /*--- Loop over the local elements to determine the global point IDs to be stored on this rank. --*/ unsigned long ind = 0; - for(unsigned long i=0; i > pointBuf(size, vector(0)); - for(unsigned long i=0; i sendToRank(size, 0); - vector startingIndRanksInPoint(size+1); + vector startingIndRanksInPoint(size + 1); startingIndRanksInPoint[0] = 0; - for(int i=0; i sizeRecv(size, 1); - SU2_MPI::Reduce_scatter(sendToRank.data(), &nRankRecv, sizeRecv.data(), - MPI_INT, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Reduce_scatter(sendToRank.data(), &nRankRecv, sizeRecv.data(), MPI_INT, MPI_SUM, SU2_MPI::GetComm()); /*--- Send out the messages with the global point numbers. Use nonblocking sends to avoid deadlock. ---*/ vector sendReqs(nRankSend); nRankSend = 0; - for(int i=0; i pointRecvBuf(sizeMess); - coorReturnBuf[i].resize(dimension*sizeMess); + coorReturnBuf[i].resize(dimension * sizeMess); /* Receive the message using a blocking receive. */ - SU2_MPI::Recv(pointRecvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, - source, rank, SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(pointRecvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, source, rank, SU2_MPI::GetComm(), &status); /*--- Loop over the nodes just received and fill the return communication buffer with the coordinates of the requested nodes. ---*/ - for(int j=0; j= static_cast(nPointsRead)) + if (kk < 0 || kk >= static_cast(nPointsRead)) SU2_MPI::Error("Invalid point requested. This should not happen.", CURRENT_FUNCTION); - for(int k=0; k coorRecvBuf(dimension*pointBuf[source].size()); + vector coorRecvBuf(dimension * pointBuf[source].size()); /* Receive the message using a blocking receive. */ - SU2_MPI::Recv(coorRecvBuf.data(), coorRecvBuf.size(), MPI_DOUBLE, - source, rank+1, SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(coorRecvBuf.data(), coorRecvBuf.size(), MPI_DOUBLE, source, rank + 1, SU2_MPI::GetComm(), &status); /*--- Loop over the points just received. ---*/ - for(unsigned long j=0; jGetMesh_FileName()); diff --git a/Common/src/geometry/meshreader/CMeshReaderBase.cpp b/Common/src/geometry/meshreader/CMeshReaderBase.cpp index 478aa9dc2e3..bb20e0d97b9 100644 --- a/Common/src/geometry/meshreader/CMeshReaderBase.cpp +++ b/Common/src/geometry/meshreader/CMeshReaderBase.cpp @@ -31,30 +31,27 @@ CMeshReaderBase::CMeshReaderBase(const CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone) : rank(SU2_MPI::GetRank()), size(SU2_MPI::GetSize()), config(val_config) {} -void CMeshReaderBase::DetermineFacesVolumeElements(vector &localFaces) { - +void CMeshReaderBase::DetermineFacesVolumeElements(vector& localFaces) { /*--- Loop over the locally stored volume elements. ---*/ unsigned long ind = 0; - for(unsigned long k=0; k &local } /*--- Update the index for the next element. ---*/ - const unsigned long nDOFsGrid = localVolumeElementConnectivity[ind+3]; - ind += nDOFsGrid+5; + const unsigned long nDOFsGrid = localVolumeElementConnectivity[ind + 3]; + ind += nDOFsGrid + 5; } /*--- Sort localFaces in increasing order and remove the double entities, @@ -74,29 +71,25 @@ void CMeshReaderBase::DetermineFacesVolumeElements(vector &local localFaces.erase(lastFace, localFaces.end()); } -void CMeshReaderBase::GetCornerPointsAllFaces(const unsigned long *elemInfo, - unsigned short &numFaces, - unsigned short nPointsPerFace[], - unsigned long faceConn[6][4]) { - +void CMeshReaderBase::GetCornerPointsAllFaces(const unsigned long* elemInfo, unsigned short& numFaces, + unsigned short nPointsPerFace[], unsigned long faceConn[6][4]) { /*--- Retrieve the element type, polynomial degree of the grid and number of DOFs for this element and set the pointer for the connectivity information. ---*/ - const unsigned short VTK_Type = (const unsigned short) elemInfo[0]; - const unsigned short nPolyGrid = (const unsigned short) elemInfo[1]; - const unsigned short nDOFsGrid = (const unsigned short) elemInfo[3]; - const unsigned long *conn = elemInfo + 5; + const unsigned short VTK_Type = (const unsigned short)elemInfo[0]; + const unsigned short nPolyGrid = (const unsigned short)elemInfo[1]; + const unsigned short nDOFsGrid = (const unsigned short)elemInfo[3]; + const unsigned long* conn = elemInfo + 5; /*--- Call the static function GetLocalCornerPointsAllFaces of CPrimalGridFEM to determine the local numbering of the corner points of the faces. ---*/ - CPrimalGridFEM::GetLocalCornerPointsAllFaces(VTK_Type, nPolyGrid, nDOFsGrid, - numFaces, nPointsPerFace, faceConn); + CPrimalGridFEM::GetLocalCornerPointsAllFaces(VTK_Type, nPolyGrid, nDOFsGrid, numFaces, nPointsPerFace, faceConn); /*--- Convert the local values of faceConn to global values. ---*/ - for(unsigned short i=0; i(rank)) { - + if (elemPartitioner.GetRankContainingIndex(globalElemID) == static_cast(rank)) { /*--- The corresponding volume element is stored on this rank, hence store the surface element as well. ---*/ surfaceElementConnectivity[0].push_back(KindBound); // VTK type. @@ -184,7 +174,7 @@ void CRectangularMeshReaderFEM::ComputeRectangularSurfaceConnectivity() { surfaceElementConnectivity[0].push_back(globalElemID); // Global volume element ID. surfaceElementConnectivity[0].push_back(iNode); - surfaceElementConnectivity[0].push_back(iNode+1); + surfaceElementConnectivity[0].push_back(iNode + 1); /*--- Update the number of surface elements for this marker. ---*/ ++numberOfLocalSurfaceElements[0]; @@ -194,13 +184,11 @@ void CRectangularMeshReaderFEM::ComputeRectangularSurfaceConnectivity() { /*--- Loop over all faces on the xMax (= iMax) boundary. ---*/ markerNames[1] = "x_plus"; - for(unsigned long jNode = 0; jNode < mNode-1; ++jNode) { - + for (unsigned long jNode = 0; jNode < mNode - 1; ++jNode) { /*--- Determine the corresponding global element ID and check if it is stored on this rank. ---*/ - const unsigned long globalElemID = jNode*nElemI + nElemI-1; - if(elemPartitioner.GetRankContainingIndex(globalElemID) == static_cast(rank)) { - + const unsigned long globalElemID = jNode * nElemI + nElemI - 1; + if (elemPartitioner.GetRankContainingIndex(globalElemID) == static_cast(rank)) { /*--- The corresponding volume element is stored on this rank, hence store the surface element as well. ---*/ surfaceElementConnectivity[1].push_back(KindBound); // VTK type. @@ -209,8 +197,8 @@ void CRectangularMeshReaderFEM::ComputeRectangularSurfaceConnectivity() { surfaceElementConnectivity[1].push_back(jNode); // Global surface element ID. surfaceElementConnectivity[1].push_back(globalElemID); // Global volume element ID. - surfaceElementConnectivity[1].push_back(jNode*nNode + (nNode-1)); - surfaceElementConnectivity[1].push_back((jNode+1)*nNode + (nNode-1)); + surfaceElementConnectivity[1].push_back(jNode * nNode + (nNode - 1)); + surfaceElementConnectivity[1].push_back((jNode + 1) * nNode + (nNode - 1)); /*--- Update the number of surface elements for this marker. ---*/ ++numberOfLocalSurfaceElements[1]; @@ -220,13 +208,11 @@ void CRectangularMeshReaderFEM::ComputeRectangularSurfaceConnectivity() { /*--- Loop over all faces on the yMax (= jMax) boundary. ---*/ markerNames[2] = "y_plus"; - for (unsigned long iNode = 0; iNode < nNode-1; ++iNode) { - - /*--- Determine the corresponding global element ID and check - if it is stored on this rank. ---*/ - const unsigned long globalElemID = (mNode-2)*nElemI + iNode; - if(elemPartitioner.GetRankContainingIndex(globalElemID) == static_cast(rank)) { - + for (unsigned long iNode = 0; iNode < nNode - 1; ++iNode) { + /*--- Determine the corresponding global element ID and check + if it is stored on this rank. ---*/ + const unsigned long globalElemID = (mNode - 2) * nElemI + iNode; + if (elemPartitioner.GetRankContainingIndex(globalElemID) == static_cast(rank)) { /*--- The corresponding volume element is stored on this rank, hence store the surface element as well. ---*/ surfaceElementConnectivity[2].push_back(KindBound); // VTK type. @@ -235,8 +221,8 @@ void CRectangularMeshReaderFEM::ComputeRectangularSurfaceConnectivity() { surfaceElementConnectivity[2].push_back(iNode); // Global surface element ID. surfaceElementConnectivity[2].push_back(globalElemID); // Global volume element ID. - surfaceElementConnectivity[2].push_back((mNode-1)*nNode + iNode+1); - surfaceElementConnectivity[2].push_back((mNode-1)*nNode + iNode); + surfaceElementConnectivity[2].push_back((mNode - 1) * nNode + iNode + 1); + surfaceElementConnectivity[2].push_back((mNode - 1) * nNode + iNode); /*--- Update the number of surface elements for this marker. ---*/ ++numberOfLocalSurfaceElements[2]; @@ -246,13 +232,11 @@ void CRectangularMeshReaderFEM::ComputeRectangularSurfaceConnectivity() { /*--- Loop over all faces on the xMin (= iMin) boundary. ---*/ markerNames[3] = "x_minus"; - for(unsigned long jNode = 0; jNode < mNode-1; ++jNode) { - + for (unsigned long jNode = 0; jNode < mNode - 1; ++jNode) { /*--- Determine the corresponding global element ID and check if it is stored on this rank. ---*/ - const unsigned long globalElemID = jNode*nElemI; - if(elemPartitioner.GetRankContainingIndex(globalElemID) == static_cast(rank)) { - + const unsigned long globalElemID = jNode * nElemI; + if (elemPartitioner.GetRankContainingIndex(globalElemID) == static_cast(rank)) { /*--- The corresponding volume element is stored on this rank, hence store the surface element as well. ---*/ surfaceElementConnectivity[3].push_back(KindBound); // VTK type. @@ -261,8 +245,8 @@ void CRectangularMeshReaderFEM::ComputeRectangularSurfaceConnectivity() { surfaceElementConnectivity[3].push_back(jNode); // Global surface element ID. surfaceElementConnectivity[3].push_back(globalElemID); // Global volume element ID. - surfaceElementConnectivity[3].push_back((jNode+1)*nNode); - surfaceElementConnectivity[3].push_back(jNode*nNode); + surfaceElementConnectivity[3].push_back((jNode + 1) * nNode); + surfaceElementConnectivity[3].push_back(jNode * nNode); /*--- Update the number of surface elements for this marker. ---*/ ++numberOfLocalSurfaceElements[3]; diff --git a/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderBase.cpp b/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderBase.cpp index 1802cc9233e..d5087e6d2de 100644 --- a/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderBase.cpp +++ b/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderBase.cpp @@ -33,8 +33,7 @@ CSU2ASCIIMeshReaderBase::CSU2ASCIIMeshReaderBase(CConfig* val_config, unsigned s : CMeshReaderBase(val_config, val_iZone, val_nZone), myZone(val_iZone), nZones(val_nZone), - meshFilename(config->GetMesh_FileName()) { -} + meshFilename(config->GetMesh_FileName()) {} CSU2ASCIIMeshReaderBase::~CSU2ASCIIMeshReaderBase(void) = default; diff --git a/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFEM.cpp b/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFEM.cpp index ec310aa35f2..f28ef82075b 100644 --- a/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFEM.cpp +++ b/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFEM.cpp @@ -30,10 +30,8 @@ #include "../../../include/geometry/meshreader/CSU2ASCIIMeshReaderFEM.hpp" #include "../../../include/fem/fem_standard_element.hpp" -CSU2ASCIIMeshReaderFEM::CSU2ASCIIMeshReaderFEM(CConfig *val_config, unsigned short val_iZone, - unsigned short val_nZone) +CSU2ASCIIMeshReaderFEM::CSU2ASCIIMeshReaderFEM(CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone) : CSU2ASCIIMeshReaderBase(val_config, val_iZone, val_nZone) { - /* Read the basic metadata and perform some basic error checks. */ ReadMetadata(true, val_config); @@ -53,21 +51,19 @@ CSU2ASCIIMeshReaderFEM::CSU2ASCIIMeshReaderFEM(CConfig *val_config, unsigned sho CSU2ASCIIMeshReaderFEM::~CSU2ASCIIMeshReaderFEM() = default; void CSU2ASCIIMeshReaderFEM::ReadPointCoordinates() { - /*--- Loop over the local elements to determine the global point IDs to be stored on this rank. --*/ unsigned long ind = 0; - for(unsigned long i=0; i> nodeID; localVolumeElementConnectivity.push_back(nodeID); @@ -203,25 +191,20 @@ void CSU2ASCIIMeshReaderFEM::ReadVolumeElementConnectivity() { must be adapted. The reason is that compatability with the original SU2 format is maintained for linear elements, but for the FEM solver the nodes of the elements are stored row-wise. ---*/ - if(nPolyGrid == 1) { - switch( VTK_Type ) { - - case QUADRILATERAL: - swap(localVolumeElementConnectivity[ind+2], - localVolumeElementConnectivity[ind+3]); - break; - - case HEXAHEDRON: - swap(localVolumeElementConnectivity[ind+2], - localVolumeElementConnectivity[ind+3]); - swap(localVolumeElementConnectivity[ind+6], - localVolumeElementConnectivity[ind+7]); - break; - - case PYRAMID: - swap(localVolumeElementConnectivity[ind+2], - localVolumeElementConnectivity[ind+3]); - break; + if (nPolyGrid == 1) { + switch (VTK_Type) { + case QUADRILATERAL: + swap(localVolumeElementConnectivity[ind + 2], localVolumeElementConnectivity[ind + 3]); + break; + + case HEXAHEDRON: + swap(localVolumeElementConnectivity[ind + 2], localVolumeElementConnectivity[ind + 3]); + swap(localVolumeElementConnectivity[ind + 6], localVolumeElementConnectivity[ind + 7]); + break; + + case PYRAMID: + swap(localVolumeElementConnectivity[ind + 2], localVolumeElementConnectivity[ind + 3]); + break; } } } @@ -231,7 +214,6 @@ void CSU2ASCIIMeshReaderFEM::ReadVolumeElementConnectivity() { } void CSU2ASCIIMeshReaderFEM::ReadSurfaceElementConnectivity() { - /*--- Determine the vector to hold the faces of the local elements. ---*/ vector localFaces; DetermineFacesVolumeElements(localFaces); @@ -249,58 +231,57 @@ void CSU2ASCIIMeshReaderFEM::ReadSurfaceElementConnectivity() { /*--- Find the section containing the markers. ---*/ string text_line; - while (getline (mesh_file, text_line)) { - string::size_type position = text_line.find ("NMARK=",0); + while (getline(mesh_file, text_line)) { + string::size_type position = text_line.find("NMARK=", 0); if (position != string::npos) break; } /*--- Loop over the number of boundary markers. ---*/ - for(unsigned long iMarker=0; iMarker connFace(nDOFsGrid); - for(unsigned short j=0; j> connFace[j]; + for (unsigned short j = 0; j < nDOFsGrid; ++j) bound_line >> connFace[j]; /*--- If a linear quadrilateral is used, the node numbering must be adapted. The reason is that compatability with the original SU2 format is maintained for linear elements, but for the FEM solver the nodes of the elements are stored row-wise. ---*/ - if((nPolyGrid == 1) && (VTK_Type == QUADRILATERAL)) - swap(connFace[2], connFace[3]); + if ((nPolyGrid == 1) && (VTK_Type == QUADRILATERAL)) swap(connFace[2], connFace[3]); /*--- Convert the local numbering of thisFace to global numbering and create a unique numbering of corner points. ---*/ - for(unsigned short j=0; j::iterator low; low = lower_bound(localFaces.begin(), localFaces.end(), thisFace); - if(low != localFaces.end()) { - if( !(thisFace < *low) ) { - + if (low != localFaces.end()) { + if (!(thisFace < *low)) { /*--- Update the counter for this boundary marker and store the meta data in surfaceElementConnectivity. ---*/ ++numberOfLocalSurfaceElements[iMarker]; @@ -366,12 +345,12 @@ void CSU2ASCIIMeshReaderFEM::ReadSurfaceElementConnectivity() { surfaceElementConnectivity[iMarker].push_back(VTK_Type); surfaceElementConnectivity[iMarker].push_back(nPolyGrid); surfaceElementConnectivity[iMarker].push_back(nDOFsGrid); - surfaceElementConnectivity[iMarker].push_back(i); // Global surface elem ID. - surfaceElementConnectivity[iMarker].push_back(low->elemID0); // Global volume elem ID. + surfaceElementConnectivity[iMarker].push_back(i); // Global surface elem ID. + surfaceElementConnectivity[iMarker].push_back(low->elemID0); // Global volume elem ID. /*--- Copy the connectivity to surfaceElementConnectivity. ---*/ - surfaceElementConnectivity[iMarker].insert(surfaceElementConnectivity[iMarker].end(), - connFace.begin(), connFace.end()); + surfaceElementConnectivity[iMarker].insert(surfaceElementConnectivity[iMarker].end(), connFace.begin(), + connFace.end()); } } } diff --git a/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp b/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp index 71fb595e0cb..8403c6af425 100644 --- a/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp +++ b/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp @@ -28,8 +28,7 @@ #include "../../../include/geometry/meshreader/CSU2ASCIIMeshReaderFVM.hpp" -CSU2ASCIIMeshReaderFVM::CSU2ASCIIMeshReaderFVM(CConfig* val_config, unsigned short val_iZone, - unsigned short val_nZone) +CSU2ASCIIMeshReaderFVM::CSU2ASCIIMeshReaderFVM(CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone) : CSU2ASCIIMeshReaderBase(val_config, val_iZone, val_nZone) { actuator_disk = (((config->GetnMarker_ActDiskInlet() != 0) || (config->GetnMarker_ActDiskOutlet() != 0)) && ((config->GetKind_SU2() == SU2_COMPONENT::SU2_CFD) || diff --git a/Common/src/geometry/primal_grid/CPrimalGridBoundFEM.cpp b/Common/src/geometry/primal_grid/CPrimalGridBoundFEM.cpp index 562d6471cde..6b374960f46 100644 --- a/Common/src/geometry/primal_grid/CPrimalGridBoundFEM.cpp +++ b/Common/src/geometry/primal_grid/CPrimalGridBoundFEM.cpp @@ -27,24 +27,19 @@ #include "../../../include/geometry/primal_grid/CPrimalGridBoundFEM.hpp" -CPrimalGridBoundFEM::CPrimalGridBoundFEM(const unsigned long *dataElem) - :CPrimalGrid(true, dataElem[2], 1) -{ - +CPrimalGridBoundFEM::CPrimalGridBoundFEM(const unsigned long* dataElem) : CPrimalGrid(true, dataElem[2], 1) { /*--- Store the meta data for this element. ---*/ - VTK_Type = (unsigned short) dataElem[0]; - nPolyGrid = (unsigned short) dataElem[1]; - nDOFsGrid = (unsigned short) dataElem[2]; + VTK_Type = (unsigned short)dataElem[0]; + nPolyGrid = (unsigned short)dataElem[1]; + nDOFsGrid = (unsigned short)dataElem[2]; boundElemIDGlobal = dataElem[3]; - GlobalIndex_DomainElement = dataElem[4]; + GlobalIndex_DomainElement = dataElem[4]; /*--- Allocate the memory for the global nodes of the element to define the geometry and copy them from val_nodes. ---*/ - for(unsigned short i=0; i