Skip to content

Commit d16221f

Browse files
author
Max Aehle
committed
remove globalindex test
The bool CPrimalGrid::gi indicated whether CPrimalGrid::GlobalIndex_DomainElement held a GlobalIndex or a DomainElement. We used it to check whether there each instance uses only one of them, the regression tests succeeded.
1 parent 91dbc79 commit d16221f

3 files changed

Lines changed: 4 additions & 7 deletions

File tree

Common/include/geometry/primal_grid/CPrimalGrid.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class CPrimalGrid {
5151
/*! If this is a domain element, store the global index.
5252
* If this is a boundary element, store the index of the incident domain element. */
5353
unsigned long GlobalIndex_DomainElement;
54-
bool gi;
5554
unique_ptr<long[]> Neighbor_Elements; /*!< \brief Vector to store the elements surronding an element. */
5655
su2double Coord_CG[3] = {0.0}; /*!< \brief Coordinates of the center-of-gravity of the element. */
5756

@@ -250,24 +249,24 @@ class CPrimalGrid {
250249
* \brief Get the element global index in a parallel computation.
251250
* \return Global index of the element in a parallel computation.
252251
*/
253-
inline unsigned long GetGlobalIndex() const { if(!gi) SU2_MPI::Error("gi",CURRENT_FUNCTION); return GlobalIndex_DomainElement; }
252+
inline unsigned long GetGlobalIndex() const { return GlobalIndex_DomainElement; }
254253

255254
/*!
256255
* \brief Set the global index for an element in a parallel computation.
257256
* \return Global index of an element in a parallel computation.
258257
*/
259-
inline void SetGlobalIndex(unsigned long val_globalindex) { gi=true; GlobalIndex_DomainElement = val_globalindex; }
258+
inline void SetGlobalIndex(unsigned long val_globalindex) { GlobalIndex_DomainElement = val_globalindex; }
260259

261260
/*!
262261
* \brief Set the index of the domain element of which this boundary element is a face.
263262
* \param[in] val_domainelement - Value to set.
264263
*/
265-
inline void SetDomainElement(unsigned long val_domainelement) { gi=false; GlobalIndex_DomainElement = val_domainelement; }
264+
inline void SetDomainElement(unsigned long val_domainelement) { GlobalIndex_DomainElement = val_domainelement; }
266265

267266
/*!
268267
* \brief Get the index of the domain element of which this boundary element is a face.
269268
*/
270-
inline unsigned long GetDomainElement() const{ if(gi) SU2_MPI::Error("gi",CURRENT_FUNCTION); return GlobalIndex_DomainElement; }
269+
inline unsigned long GetDomainElement() const{ return GlobalIndex_DomainElement; }
271270

272271
/*!
273272
* \brief A pure virtual member.

Common/src/geometry/primal_grid/CPrimalGrid.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ CPrimalGrid::CPrimalGrid(bool FEM, unsigned short nNodes, unsigned short nNeighb
3636
GlobalIndex_DomainElement = 0;
3737
for(unsigned short i=0; i<nNeighbor_Elements; i++)
3838
Neighbor_Elements[i] = -1;
39-
gi =true;
4039

4140
}
4241

Common/src/geometry/primal_grid/CPrimalGridBoundFEM.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ CPrimalGridBoundFEM::CPrimalGridBoundFEM(unsigned long val_elemGlobalID,
4242

4343
boundElemIDGlobal = val_elemGlobalID;
4444
GlobalIndex_DomainElement = val_domainElementID;
45-
gi = false;
4645

4746
/*--- Copy face structure of the element from val_nodes. ---*/
4847

0 commit comments

Comments
 (0)