|
47 | 47 | class CPrimalGrid { |
48 | 48 | protected: |
49 | 49 | vector<unsigned long> Nodes; /*!< \brief Global node indices of the element. */ |
50 | | - unsigned long GlobalIndex; /*!< \brief The global index of an element. */ |
| 50 | + /*! If this is a domain element, store the global index. |
| 51 | + * If this is a boundary element, store the index of the incident domain element. */ |
| 52 | + unsigned long GlobalIndex_DomainElement; |
| 53 | + bool gi; |
51 | 54 | vector<long> Neighbor_Elements; /*!< \brief Vector to store the elements surronding an element. */ |
52 | 55 | vector<short> PeriodIndexNeighbors; /*!< \brief Vector to store the periodic index of a neighbor. |
53 | 56 | A -1 indicates no periodic transformation to the neighbor. */ |
54 | 57 | su2double Coord_CG[3] = {0.0}; /*!< \brief Coordinates of the center-of-gravity of the element. */ |
55 | | - unsigned long DomainElement; /*!< \brief Only for boundaries, in this variable the 3D elements which |
56 | | - correspond with a boundary element is stored. */ |
| 58 | + |
57 | 59 | su2double Volume; /*!< \brief Volume of the element. */ |
58 | 60 | su2double LenScale; /*!< \brief Length scale of the element. */ |
59 | 61 | unsigned short TimeLevel; /*!< \brief Time level of the element for time accurate local time stepping. */ |
@@ -245,25 +247,24 @@ class CPrimalGrid { |
245 | 247 | * \brief Get the element global index in a parallel computation. |
246 | 248 | * \return Global index of the element in a parallel computation. |
247 | 249 | */ |
248 | | - inline unsigned long GetGlobalIndex(void) const { return GlobalIndex; } |
| 250 | + inline unsigned long GetGlobalIndex() const { if(gi) SU2_MPI::Error("gi",CURRENT_FUNCTION); return GlobalIndex_DomainElement; } |
249 | 251 |
|
250 | 252 | /*! |
251 | 253 | * \brief Set the global index for an element in a parallel computation. |
252 | 254 | * \return Global index of an element in a parallel computation. |
253 | 255 | */ |
254 | | - inline void SetGlobalIndex(unsigned long val_globalindex) { GlobalIndex = val_globalindex; } |
| 256 | + inline void SetGlobalIndex(unsigned long val_globalindex) { gi=true; GlobalIndex_DomainElement = val_globalindex; } |
255 | 257 |
|
256 | 258 | /*! |
257 | | - * \brief A virtual member. |
258 | | - * \param[in] val_domainelement Index of the domain element which has a face shared by this boundary element. |
| 259 | + * \brief Set the index of the domain element of which this boundary element is a face. |
| 260 | + * \param[in] val_domainelement - Value to set. |
259 | 261 | */ |
260 | | - inline virtual void SetDomainElement(unsigned long val_domainelement) { DomainElement = val_domainelement; } |
| 262 | + inline void SetDomainElement(unsigned long val_domainelement) { gi=false; GlobalIndex_DomainElement = val_domainelement; } |
261 | 263 |
|
262 | 264 | /*! |
263 | | - * \brief A virtual member. |
264 | | - * \return Relate the boundary element which a face of a domain element. |
| 265 | + * \brief Get the index of the domain element of which this boundary element is a face. |
265 | 266 | */ |
266 | | - inline virtual unsigned long GetDomainElement(void) const{ return DomainElement; } |
| 267 | + inline unsigned long GetDomainElement() const{ if(!gi) SU2_MPI::Error("gi",CURRENT_FUNCTION); return GlobalIndex_DomainElement; } |
267 | 268 |
|
268 | 269 | /*! |
269 | 270 | * \brief A pure virtual member. |
|
0 commit comments