Skip to content

Commit 23c3d09

Browse files
committed
Addressing comments
1 parent 31f6ed8 commit 23c3d09

File tree

9 files changed

+33
-120
lines changed

9 files changed

+33
-120
lines changed

Common/include/toolboxes/fem/CFaceOfElement.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
#include <algorithm>
3535
#include <climits>
3636

37-
using namespace std;
38-
3937
/*!
4038
* \class CFaceOfElement
4139
* \brief Class used in the partitioning of the FEM grid as well as the building of
@@ -68,9 +66,8 @@ class CFaceOfElement {
6866
bool elem0IsOwner; /*!< \brief Whether or not the neighboring element 0 is the owner
6967
of the face. If false, element 1 is the owner. */
7068

71-
/* Standard constructor and destructor. */
69+
/* Constructor. Initialize the member variables. */
7270
CFaceOfElement();
73-
~CFaceOfElement() {}
7471

7572
/* Alternative constructor to set the corner points. */
7673
CFaceOfElement(const unsigned short VTK_Type, const unsigned short nPoly, const unsigned long* Nodes);
@@ -91,11 +88,11 @@ class CFaceOfElement {
9188

9289
/*--- Member function, which creates a unique numbering for the corner points.
9390
A sort in increasing order is OK for this purpose. ---*/
94-
inline void CreateUniqueNumbering(void) { std::sort(cornerPoints, cornerPoints + nCornerPoints); }
91+
inline void CreateUniqueNumbering() { std::sort(cornerPoints, cornerPoints + nCornerPoints); }
9592

9693
/*--- Member function, which creates a unique numbering for the corner points
9794
while the orientation is taken into account. ---*/
98-
void CreateUniqueNumberingWithOrientation(void);
95+
void CreateUniqueNumberingWithOrientation();
9996

10097
private:
10198
/*--- Copy function, which copies the data of the given object into the current object. ---*/

Common/include/toolboxes/fem/CMatchingFace.hpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,9 @@ class CMatchingFace {
5050
su2double cornerCoor[4][3]; /*!< \brief Coordinates of the corner points of the face. */
5151
su2double tolForMatching; /*!< \brief Tolerance for this face for matching points. */
5252

53-
/* Standard constructor. */
53+
/* Constructor. Initialize the member variables to zero. */
5454
CMatchingFace();
5555

56-
/* Destructor, nothing to be done. */
57-
~CMatchingFace() {}
58-
5956
/* Copy constructor and assignment operator. */
6057
inline CMatchingFace(const CMatchingFace& other) { Copy(other); }
6158

@@ -68,7 +65,7 @@ class CMatchingFace {
6865
bool operator<(const CMatchingFace& other) const;
6966

7067
/*--- Member function, which sorts the coordinates of the face. ---*/
71-
void SortFaceCoordinates(void);
68+
void SortFaceCoordinates();
7269

7370
private:
7471
/*--- Copy function, which copies the data of the given object into the current object. ---*/

Common/include/toolboxes/fem/CReorderElements.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class CReorderElements {
6060
/*!
6161
* \brief Default constructor of the class. Disabled.
6262
*/
63-
CReorderElements(void) = delete;
63+
CReorderElements() = delete;
6464

6565
/*!
6666
* \brief Less than operator of the class. Needed for the sorting.
@@ -71,26 +71,26 @@ class CReorderElements {
7171
* \brief Function to make available the variable commSolution.
7272
* \return Whether or not the solution of the element must be communicated.
7373
*/
74-
inline bool GetCommSolution(void) const { return commSolution; }
74+
inline bool GetCommSolution() const { return commSolution; }
7575

7676
/*!
7777
* \brief Function to make available the element type of the element.
7878
* \return The value of elemType, which stores the VTK type, polynomial degree
7979
and whether or not the Jacobian is constant.
8080
*/
81-
inline unsigned short GetElemType(void) const { return elemType; }
81+
inline unsigned short GetElemType() const { return elemType; }
8282

8383
/*!
8484
* \brief Function to make available the global element ID.
8585
* \return The global element ID of the element.
8686
*/
87-
inline unsigned long GetGlobalElemID(void) const { return globalElemID; }
87+
inline unsigned long GetGlobalElemID() const { return globalElemID; }
8888

8989
/*!
9090
* \brief Function to make available the time level.
9191
* \return The time level of the element.
9292
*/
93-
inline unsigned short GetTimeLevel(void) const { return timeLevel; }
93+
inline unsigned short GetTimeLevel() const { return timeLevel; }
9494

9595
/*!
9696
* \brief Function, which sets the value of commSolution.

Common/include/toolboxes/fem/CSortBoundaryFaces.hpp

Lines changed: 0 additions & 48 deletions
This file was deleted.

Common/include/toolboxes/fem/CSortFaces.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class CSortFaces {
6060
/*!
6161
* \brief Default constructor of the class. Disabled.
6262
*/
63-
CSortFaces(void) = delete;
63+
CSortFaces() = delete;
6464

6565
/*!
6666
* \brief Operator used for the comparison.

Common/src/fem/fem_geometry_structure.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include "../../include/toolboxes/classes_multiple_integers.hpp"
3030
#include "../../include/toolboxes/fem/CReorderElements.hpp"
3131
#include "../../include/toolboxes/fem/CSortFaces.hpp"
32-
#include "../../include/toolboxes/fem/CSortBoundaryFaces.hpp"
3332
#include "../../include/fem/fem_geometry_structure.hpp"
3433
#include "../../include/geometry/primal_grid/CPrimalGridFEM.hpp"
3534
#include "../../include/geometry/primal_grid/CPrimalGridBoundFEM.hpp"
@@ -2974,7 +2973,18 @@ void CMeshFEM_DG::CreateFaces(CConfig* config) {
29742973
each time level. */
29752974
for (unsigned short i = 0; i < nTimeLevels; ++i)
29762975
sort(surfElem.begin() + boundaries[iMarker].nSurfElem[i],
2977-
surfElem.begin() + boundaries[iMarker].nSurfElem[i + 1], CSortBoundaryFaces());
2976+
surfElem.begin() + boundaries[iMarker].nSurfElem[i + 1],
2977+
[](const CSurfaceElementFEM& f0, const CSurfaceElementFEM& f1) {
2978+
/* First sorting criterion is the index of the standard element. The
2979+
boundary faces should be sorted per standard element. Note that the
2980+
time level is not taken into account here, because it is assumed that
2981+
the surface elements to be sorted belong to one time level. */
2982+
if (f0.indStandardElement != f1.indStandardElement) return f0.indStandardElement < f1.indStandardElement;
2983+
2984+
/* The standard elements are the same. The second criterion is the
2985+
corresponding volume IDs of the surface elements. */
2986+
return f0.volElemID < f1.volElemID;
2987+
});
29782988
}
29792989
}
29802990
}

Common/src/toolboxes/fem/CFaceOfElement.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ CFaceOfElement::CFaceOfElement(const unsigned short VTK_Type, const unsigned sho
9090
}
9191

9292
default: {
93-
ostringstream message;
93+
std::ostringstream message;
9494
message << "Unknown VTK surface element type, " << VTK_Type;
9595
SU2_MPI::Error(message.str(), CURRENT_FUNCTION);
9696
}
@@ -151,7 +151,7 @@ void CFaceOfElement::CreateUniqueNumberingWithOrientation() {
151151
also the element information must be swapped, because element 0 is to
152152
the left of the face and element 1 to the right. */
153153
if (cornerPoints[1] < cornerPoints[0]) {
154-
swap(cornerPoints[0], cornerPoints[1]);
154+
std::swap(cornerPoints[0], cornerPoints[1]);
155155
swapElements = true;
156156
}
157157
break;
@@ -225,19 +225,19 @@ void CFaceOfElement::CreateUniqueNumberingWithOrientation() {
225225
}
226226

227227
default: {
228-
ostringstream message;
229-
message << "Unknown surface element type with " << nCornerPoints << " corners." << endl;
228+
std::ostringstream message;
229+
message << "Unknown surface element type with " << nCornerPoints << " corners." << std::endl;
230230
SU2_MPI::Error(message.str(), CURRENT_FUNCTION);
231231
}
232232
}
233233

234234
/* Swap the element information, if needed. */
235235
if (swapElements) {
236-
swap(elemID0, elemID1);
237-
swap(nPolyGrid0, nPolyGrid1);
238-
swap(nPolySol0, nPolySol1);
239-
swap(nDOFsElem0, nDOFsElem1);
240-
swap(elemType0, elemType1);
241-
swap(faceID0, faceID1);
236+
std::swap(elemID0, elemID1);
237+
std::swap(nPolyGrid0, nPolyGrid1);
238+
std::swap(nPolySol0, nPolySol1);
239+
std::swap(nDOFsElem0, nDOFsElem1);
240+
std::swap(elemType0, elemType1);
241+
std::swap(faceID0, faceID1);
242242
}
243243
}

Common/src/toolboxes/fem/CSortBoundaryFaces.cpp

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
common_src += files(['CFaceOfElement.cpp',
22
'CMatchingFace.cpp',
33
'CReorderElements.cpp',
4-
'CSortBoundaryFaces.cpp',
54
'CSortFaces.cpp'])

0 commit comments

Comments
 (0)