Skip to content

Commit

Permalink
Result of running pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vdweide committed Feb 5, 2025
1 parent 6b617b1 commit 020f87a
Show file tree
Hide file tree
Showing 23 changed files with 1,436 additions and 1,169 deletions.
21 changes: 10 additions & 11 deletions Common/include/geometry/CPhysicalGeometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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
Expand Down
11 changes: 4 additions & 7 deletions Common/include/geometry/meshreader/CBoxMeshReaderFEM.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down Expand Up @@ -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.
Expand Down
203 changes: 70 additions & 133 deletions Common/include/geometry/meshreader/CCGNSElementType.hpp

Large diffs are not rendered by default.

24 changes: 9 additions & 15 deletions Common/include/geometry/meshreader/CCGNSMeshReaderFEM.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
*/
class CCGNSMeshReaderFEM final : public CCGNSMeshReaderBase {
private:

/*!
* \brief Communicates the grid points to the MPI rank where they are needed.
*/
Expand All @@ -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<unsigned long> &localConn);
void ReadCGNSConnectivityRangeSection(const int val_section, const unsigned long val_firstIndex,
const unsigned long val_lastIndex, unsigned long& elemCount,
unsigned long& localElemCount, vector<unsigned long>& 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();

Expand All @@ -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<CFaceOfElement> &localFaces,
unsigned long &nSurfElem,
vector<unsigned long> &surfConn);
void ReadCGNSSurfaceSection(const int val_section, const vector<CFaceOfElement>& localFaces, unsigned long& nSurfElem,
vector<unsigned long>& 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.
Expand Down
20 changes: 9 additions & 11 deletions Common/include/geometry/meshreader/CMeshReaderBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,18 @@ class CMeshReaderBase {

unsigned long numberOfMarkers = 0; /*!< \brief Total number of markers contained within the mesh file. */
vector<string> markerNames; /*!< \brief String names for all markers in the mesh file. */
vector<unsigned long> numberOfLocalSurfaceElements; /*!< \brief Vector containing the number of local surface elements. */
vector<unsigned long>
numberOfLocalSurfaceElements; /*!< \brief Vector containing the number of local surface elements. */
vector<vector<unsigned long> >
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<CFaceOfElement> &localFaces);
void DetermineFacesVolumeElements(vector<CFaceOfElement>& localFaces);

/*!
* \brief Get all the corner points of all the faces of the given element. It must
Expand All @@ -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:
/*!
Expand All @@ -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<unsigned long> &GetGlobalPointIDs() const {
return globalPointIDs;
}
inline const vector<unsigned long>& GetGlobalPointIDs() const { return globalPointIDs; }

/*!
* \brief Get the local point coordinates (linearly partitioned).
Expand All @@ -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<unsigned long> &GetNumberOfSurfaceElementsAllMarkers() const {
inline const vector<unsigned long>& GetNumberOfSurfaceElementsAllMarkers() const {
return numberOfLocalSurfaceElements;
}

Expand Down
5 changes: 3 additions & 2 deletions Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFEM.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,16 @@ 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();

public:
/*!
* \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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions Common/include/geometry/primal_grid/CPrimalGridFEM.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 4 additions & 5 deletions Common/src/fem/fem_geometry_structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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<unsigned long> 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. */
Expand Down Expand Up @@ -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<unsigned long>(rank)) {
if (elemPartitioner.GetRankContainingIndex(globalID) != static_cast<unsigned long>(rank)) {
ostringstream message;
message << "Invalid local element ID: " << localID;
SU2_MPI::Error(message.str(), CURRENT_FUNCTION);
Expand Down
Loading

0 comments on commit 020f87a

Please sign in to comment.