Skip to content

Commit ea8ad97

Browse files
authored
Merge pull request #1038 from su2code/cleanup_orientation_checks
Improving and cleaning element orientation checks
2 parents abb5243 + 23ab119 commit ea8ad97

14 files changed

Lines changed: 243 additions & 414 deletions

Common/include/geometry/CGeometry.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,13 +751,13 @@ class CGeometry {
751751
* \brief A virtual member.
752752
* \param[in] config - Definition of the particular problem.
753753
*/
754-
inline virtual void Check_IntElem_Orientation(CConfig *config) {}
754+
inline virtual void Check_IntElem_Orientation(const CConfig *config) {}
755755

756756
/*!
757757
* \brief A virtual member.
758758
* \param[in] config - Definition of the particular problem.
759759
*/
760-
inline virtual void Check_BoundElem_Orientation(CConfig *config) {}
760+
inline virtual void Check_BoundElem_Orientation(const CConfig *config) {}
761761

762762
/*!
763763
* \brief A virtual member.

Common/include/geometry/CPhysicalGeometry.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,13 +517,13 @@ class CPhysicalGeometry final : public CGeometry {
517517
* \brief Check the volume element orientation.
518518
* \param[in] config - Definition of the particular problem.
519519
*/
520-
void Check_IntElem_Orientation(CConfig *config) override;
520+
void Check_IntElem_Orientation(const CConfig *config) override;
521521

522522
/*!
523523
* \brief Check the volume element orientation.
524524
* \param[in] config - Definition of the particular problem.
525525
*/
526-
void Check_BoundElem_Orientation(CConfig *config) override;
526+
void Check_BoundElem_Orientation(const CConfig *config) override;
527527

528528
/*!
529529
* \brief Set the domains for grid grid partitioning using ParMETIS.

Common/include/geometry/primal_grid/CLine.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,6 @@ class CLine final : public CPrimalGrid {
142142
* \brief Change the orientation of an element.
143143
*/
144144
inline void Change_Orientation(void) override {
145-
unsigned long Point_0, Point_1;
146-
Point_0 = Nodes[0];
147-
Point_1 = Nodes[1];
148-
Nodes[0] = Point_1;
149-
Nodes[1] = Point_0;
145+
swap(Nodes[0], Nodes[1]);
150146
}
151147
};

Common/include/geometry/primal_grid/CTriangle.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,6 @@ class CTriangle final: public CPrimalGrid {
143143
* \brief Change the orientation of an element.
144144
*/
145145
inline void Change_Orientation(void) override {
146-
unsigned long Point_0, Point_2;
147-
Point_0 = Nodes[0];
148-
Point_2 = Nodes[2];
149-
Nodes[0] = Point_2;
150-
Nodes[2] = Point_0;
146+
swap(Nodes[0], Nodes[2]);
151147
}
152148
};

0 commit comments

Comments
 (0)