Skip to content

Commit 020f87a

Browse files
committed
Result of running pre-commit
1 parent 6b617b1 commit 020f87a

23 files changed

+1436
-1169
lines changed

Common/include/geometry/CPhysicalGeometry.hpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,7 @@ class CPhysicalGeometry final : public CGeometry {
285285
* \param[in] val_iZone - Domain to be read from the grid file.
286286
* \param[in] val_nZone - Total number of domains in the grid file.
287287
*/
288-
void Read_Mesh(CConfig* config, const string& val_mesh_filename, unsigned short val_iZone,
289-
unsigned short val_nZone);
288+
void Read_Mesh(CConfig* config, const string& val_mesh_filename, unsigned short val_iZone, unsigned short val_nZone);
290289

291290
/*!
292291
* \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 {
300299
* \param[in] config - definition of the particular problem.
301300
* \param[in] mesh - mesh reader object containing the current zone data.
302301
*/
303-
void LoadLinearlyPartitionedPointsFEM(CConfig *config, CMeshReaderBase *mesh);
302+
void LoadLinearlyPartitionedPointsFEM(CConfig* config, CMeshReaderBase* mesh);
304303

305304
/*!
306305
* \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 {
310309
void LoadLinearlyPartitionedVolumeElements(CConfig* config, CMeshReaderBase* mesh);
311310

312311
/*!
313-
* \brief Loads the interior volume elements from the mesh reader object into the primal element data structures for the FEM solver.
314-
* \param[in] config - definition of the particular problem.
315-
* \param[in] mesh - mesh reader object containing the current zone data.
312+
* \brief Loads the interior volume elements from the mesh reader object into the primal element data structures for
313+
* the FEM solver. \param[in] config - definition of the particular problem. \param[in] mesh - mesh reader object
314+
* containing the current zone data.
316315
*/
317-
void LoadLinearlyPartitionedVolumeElementsFEM(CConfig *config, CMeshReaderBase *mesh);
316+
void LoadLinearlyPartitionedVolumeElementsFEM(CConfig* config, CMeshReaderBase* mesh);
318317

319318
/*!
320319
* \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 {
324323
void LoadUnpartitionedSurfaceElements(CConfig* config, CMeshReaderBase* mesh);
325324

326325
/*!
327-
* \brief Loads the boundary elements (markers) from the mesh reader object into the primal element data structures for the FEM solver.
328-
* \param[in] config - definition of the particular problem.
329-
* \param[in] mesh - mesh reader object containing the current zone data.
326+
* \brief Loads the boundary elements (markers) from the mesh reader object into the primal element data structures
327+
* for the FEM solver. \param[in] config - definition of the particular problem. \param[in] mesh - mesh reader
328+
* object containing the current zone data.
330329
*/
331-
void LoadLinearlyPartitionedSurfaceElementsFEM(CConfig *config, CMeshReaderBase *mesh);
330+
void LoadLinearlyPartitionedSurfaceElementsFEM(CConfig* config, CMeshReaderBase* mesh);
332331

333332
/*!
334333
* \brief Prepares the grid point adjacency based on a linearly partitioned mesh object needed by ParMETIS for graph

Common/include/geometry/meshreader/CBoxMeshReaderFEM.hpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@
3535
* \brief Reads a 3D box grid into linear partitions for the finite element solver (FEM).
3636
* \author: T. Economon, E. van der Weide
3737
*/
38-
class CBoxMeshReaderFEM final: public CMeshReaderBase {
39-
40-
private:
41-
38+
class CBoxMeshReaderFEM final : public CMeshReaderBase {
39+
private:
4240
unsigned long nNode; /*!< \brief Number of grid nodes in the x-direction. */
4341
unsigned long mNode; /*!< \brief Number of grid nodes in the y-direction. */
4442
unsigned long pNode; /*!< \brief Number of grid nodes in the z-direction. */
@@ -71,12 +69,11 @@ class CBoxMeshReaderFEM final: public CMeshReaderBase {
7169
*/
7270
void ComputeBoxSurfaceConnectivity();
7371

74-
public:
75-
72+
public:
7673
/*!
7774
* \brief Constructor of the CBoxMeshReaderFEM class.
7875
*/
79-
CBoxMeshReaderFEM(const CConfig *val_config, unsigned short val_iZone, unsigned short val_nZone);
76+
CBoxMeshReaderFEM(const CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone);
8077

8178
/*!
8279
* \brief Destructor of the CBoxMeshReaderFEM class.

Common/include/geometry/meshreader/CCGNSElementType.hpp

Lines changed: 70 additions & 133 deletions
Large diffs are not rendered by default.

Common/include/geometry/meshreader/CCGNSMeshReaderFEM.hpp

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
*/
3838
class CCGNSMeshReaderFEM final : public CCGNSMeshReaderBase {
3939
private:
40-
4140
/*!
4241
* \brief Communicates the grid points to the MPI rank where they are needed.
4342
*/
@@ -54,20 +53,18 @@ class CCGNSMeshReaderFEM final : public CCGNSMeshReaderBase {
5453
* \param[inout] localElemCount - Counter, which keeps track how many local elements are stored.
5554
* \param[inout] localConn - Vector where the connectivity must be stored.
5655
*/
57-
void ReadCGNSConnectivityRangeSection(const int val_section,
58-
const unsigned long val_firstIndex,
59-
const unsigned long val_lastIndex,
60-
unsigned long &elemCount,
61-
unsigned long &localElemCount,
62-
vector<unsigned long> &localConn);
56+
void ReadCGNSConnectivityRangeSection(const int val_section, const unsigned long val_firstIndex,
57+
const unsigned long val_lastIndex, unsigned long& elemCount,
58+
unsigned long& localElemCount, vector<unsigned long>& localConn);
6359

64-
/*!
60+
/*!
6561
* \brief Reads the interior volume elements from one section of a CGNS zone into linear partitions across all ranks.
6662
*/
6763
void ReadCGNSVolumeElementConnectivity();
6864

6965
/*!
70-
* \brief Reads the surface (boundary) elements from one section of a CGNS zone into linear partitions across all ranks.
66+
* \brief Reads the surface (boundary) elements from one section of a CGNS zone into linear partitions across all
67+
* ranks.
7168
*/
7269
void ReadCGNSSurfaceElementConnectivity();
7370

@@ -78,18 +75,15 @@ class CCGNSMeshReaderFEM final : public CCGNSMeshReaderBase {
7875
* \param[out] nSurfElem - Number of local surface elements stored for this surface section.
7976
* \param[out] surfConn - Vector to store the connectivity of the surface elements to be stored.
8077
*/
81-
void ReadCGNSSurfaceSection(const int val_section,
82-
const vector<CFaceOfElement> &localFaces,
83-
unsigned long &nSurfElem,
84-
vector<unsigned long> &surfConn);
78+
void ReadCGNSSurfaceSection(const int val_section, const vector<CFaceOfElement>& localFaces, unsigned long& nSurfElem,
79+
vector<unsigned long>& surfConn);
8580
#endif
8681

8782
public:
88-
8983
/*!
9084
* \brief Constructor of the CCGNSMeshReaderFEM class.
9185
*/
92-
CCGNSMeshReaderFEM(const CConfig *val_config, unsigned short val_iZone, unsigned short val_nZone);
86+
CCGNSMeshReaderFEM(const CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone);
9387

9488
/*!
9589
* \brief Destructor of the CCGNSMeshReaderFEM class.

Common/include/geometry/meshreader/CMeshReaderBase.hpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,18 @@ class CMeshReaderBase {
6666

6767
unsigned long numberOfMarkers = 0; /*!< \brief Total number of markers contained within the mesh file. */
6868
vector<string> markerNames; /*!< \brief String names for all markers in the mesh file. */
69-
vector<unsigned long> numberOfLocalSurfaceElements; /*!< \brief Vector containing the number of local surface elements. */
69+
vector<unsigned long>
70+
numberOfLocalSurfaceElements; /*!< \brief Vector containing the number of local surface elements. */
7071
vector<vector<unsigned long> >
7172
surfaceElementConnectivity; /*!< \brief Vector containing the surface element connectivity from the mesh file on a
72-
per-marker basis. For FVM, only the master node reads and stores this connectivity. */
73+
per-marker basis. For FVM, only the master node reads and stores this connectivity.
74+
*/
7375

7476
/*!
7577
* \brief Function, which determines the faces of the local volume elements.
7678
* \param[out] localFaces - The faces of the locally stored volume elements.
7779
*/
78-
void DetermineFacesVolumeElements(vector<CFaceOfElement> &localFaces);
80+
void DetermineFacesVolumeElements(vector<CFaceOfElement>& localFaces);
7981

8082
/*!
8183
* \brief Get all the corner points of all the faces of the given element. It must
@@ -84,10 +86,8 @@ class CMeshReaderBase {
8486
* \param[out] nPointsPerFace - Number of corner points for each of the faces.
8587
* \param[out] faceConn - Global IDs of the corner points of the faces.
8688
*/
87-
void GetCornerPointsAllFaces(const unsigned long *elemInfo,
88-
unsigned short &numFaces,
89-
unsigned short nPointsPerFace[],
90-
unsigned long faceConn[6][4]);
89+
void GetCornerPointsAllFaces(const unsigned long* elemInfo, unsigned short& numFaces, unsigned short nPointsPerFace[],
90+
unsigned long faceConn[6][4]);
9191

9292
public:
9393
/*!
@@ -110,9 +110,7 @@ class CMeshReaderBase {
110110
* \brief Get the global IDs of the local points.
111111
* \returns Reference to the vector containing the global points IDs.
112112
*/
113-
inline const vector<unsigned long> &GetGlobalPointIDs() const {
114-
return globalPointIDs;
115-
}
113+
inline const vector<unsigned long>& GetGlobalPointIDs() const { return globalPointIDs; }
116114

117115
/*!
118116
* \brief Get the local point coordinates (linearly partitioned).
@@ -133,7 +131,7 @@ class CMeshReaderBase {
133131
* \brief Get the number surface elements for all markers.
134132
* \returns Reference to the vector containing the number of surface elements for all markers.
135133
*/
136-
inline const vector<unsigned long> &GetNumberOfSurfaceElementsAllMarkers() const {
134+
inline const vector<unsigned long>& GetNumberOfSurfaceElementsAllMarkers() const {
137135
return numberOfLocalSurfaceElements;
138136
}
139137

Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFEM.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,16 @@ class CSU2ASCIIMeshReaderFEM : public CSU2ASCIIMeshReaderBase {
5050
void ReadVolumeElementConnectivity();
5151

5252
/*!
53-
* \brief Reads the surface (boundary) elements from one section of an SU2 zone into linear partitions across all ranks.
53+
* \brief Reads the surface (boundary) elements from one section of an SU2 zone into linear partitions across all
54+
* ranks.
5455
*/
5556
void ReadSurfaceElementConnectivity();
5657

5758
public:
5859
/*!
5960
* \brief Constructor of the CSU2ASCIIMeshReaderFEM class.
6061
*/
61-
CSU2ASCIIMeshReaderFEM(CConfig *val_config, unsigned short val_iZone, unsigned short val_nZone);
62+
CSU2ASCIIMeshReaderFEM(CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone);
6263

6364
/*!
6465
* \brief Destructor of the CSU2ASCIIMeshReaderFEM class.

Common/include/geometry/primal_grid/CPrimalGridBoundFEM.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class CPrimalGridBoundFEM final : public CPrimalGrid {
5353
* \brief Constructor using data to initialize the boundary element.
5454
* \param[in] dataElem - Meta and connectivity data for this element.
5555
*/
56-
CPrimalGridBoundFEM(const unsigned long *dataElem);
56+
CPrimalGridBoundFEM(const unsigned long* dataElem);
5757

5858
/*!
5959
* \brief Get the number of nodes that composes a face of an element.

Common/include/geometry/primal_grid/CPrimalGridFEM.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,12 @@ class CPrimalGridFEM final : public CPrimalGrid {
5353
is (almost) constant. */
5454

5555
public:
56-
5756
/*!
5857
* \brief Constructor using data to initialize the element.
5958
* \param[in] dataElem - Meta and connectivity data for this element.
6059
* \param[in,out] offsetDOFs - The offset of the solution DOFs for this element.
6160
*/
62-
CPrimalGridFEM(const unsigned long *dataElem, unsigned long &offsetSolDOFs);
61+
CPrimalGridFEM(const unsigned long* dataElem, unsigned long& offsetSolDOFs);
6362

6463
/*!
6564
* \brief Get the number of nodes that composes a face of an element.

Common/src/fem/fem_geometry_structure.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,8 @@ CMeshFEM::CMeshFEM(CGeometry* geometry, CConfig* config) {
379379
/* Loop over the local boundary elements in geometry for this marker. */
380380
for (unsigned long i = 0; i < geometry->GetnElem_Bound(iMarker); ++i) {
381381
/* Determine the local ID of the corresponding domain element. */
382-
unsigned long elemID = geometry->bound[iMarker][i]->GetDomainElement()
383-
- elemPartitioner.GetFirstIndexOnRank(rank);
382+
unsigned long elemID =
383+
geometry->bound[iMarker][i]->GetDomainElement() - elemPartitioner.GetFirstIndexOnRank(rank);
384384

385385
/* Determine to which rank this boundary element must be sent.
386386
That is the same as its corresponding domain element.
@@ -672,8 +672,7 @@ CMeshFEM::CMeshFEM(CGeometry* geometry, CConfig* config) {
672672
/* Determine the number of elements per rank of the originally partitioned grid
673673
stored in cumulative storage format. */
674674
vector<unsigned long> nElemPerRankOr(size + 1);
675-
for (int i = 0; i <= size; ++i)
676-
nElemPerRankOr[i] = elemPartitioner.GetCumulativeSizeBeforeRank(i);
675+
for (int i = 0; i <= size; ++i) nElemPerRankOr[i] = elemPartitioner.GetCumulativeSizeBeforeRank(i);
677676

678677
/* Determine to which ranks I have to send messages to find out the information
679678
of the halos stored on this rank. */
@@ -809,7 +808,7 @@ CMeshFEM::CMeshFEM(CGeometry* geometry, CConfig* config) {
809808
/* Determine the local index of the element in the original partitioning.
810809
Check if the index is valid. */
811810
const long localID = globalID - elemPartitioner.GetFirstIndexOnRank(rank);
812-
if(elemPartitioner.GetRankContainingIndex(globalID) != static_cast<unsigned long>(rank)) {
811+
if (elemPartitioner.GetRankContainingIndex(globalID) != static_cast<unsigned long>(rank)) {
813812
ostringstream message;
814813
message << "Invalid local element ID: " << localID;
815814
SU2_MPI::Error(message.str(), CURRENT_FUNCTION);

0 commit comments

Comments
 (0)