|
1 | 1 | #include "INodeGeometry1D.hpp" |
2 | 2 |
|
| 3 | +#include "simplnx/Utilities/DataObjectUtilities.hpp" |
| 4 | + |
3 | 5 | namespace nx::core |
4 | 6 | { |
5 | 7 | INodeGeometry1D::INodeGeometry1D(DataStructure& dataStructure, std::string name) |
@@ -224,37 +226,16 @@ void INodeGeometry1D::checkUpdatedIdsImpl(const std::vector<std::pair<IdType, Id |
224 | 226 | { |
225 | 227 | INodeGeometry0D::checkUpdatedIdsImpl(updatedIds); |
226 | 228 |
|
| 229 | + std::vector<bool> visited(7, false); |
| 230 | + |
227 | 231 | for(const auto& updatedId : updatedIds) |
228 | 232 | { |
229 | | - if(m_EdgeAttributeMatrixId == updatedId.first) |
230 | | - { |
231 | | - m_EdgeAttributeMatrixId = updatedId.second; |
232 | | - } |
233 | | - |
234 | | - if(m_EdgeDataArrayId == updatedId.first) |
235 | | - { |
236 | | - m_EdgeDataArrayId = updatedId.second; |
237 | | - } |
238 | | - |
239 | | - if(m_CellContainingVertDataArrayId == updatedId.first) |
240 | | - { |
241 | | - m_CellContainingVertDataArrayId = updatedId.second; |
242 | | - } |
243 | | - |
244 | | - if(m_CellNeighborsDataArrayId == updatedId.first) |
245 | | - { |
246 | | - m_CellNeighborsDataArrayId = updatedId.second; |
247 | | - } |
248 | | - |
249 | | - if(m_CellCentroidsDataArrayId == updatedId.first) |
250 | | - { |
251 | | - m_CellCentroidsDataArrayId = updatedId.second; |
252 | | - } |
253 | | - |
254 | | - if(m_ElementSizesId == updatedId.first) |
255 | | - { |
256 | | - m_ElementSizesId = updatedId.second; |
257 | | - } |
| 233 | + m_EdgeAttributeMatrixId = nx::core::VisitDataStructureId(m_EdgeAttributeMatrixId, updatedId, visited, 0); |
| 234 | + m_EdgeDataArrayId = nx::core::VisitDataStructureId(m_EdgeDataArrayId, updatedId, visited, 1); |
| 235 | + m_CellContainingVertDataArrayId = nx::core::VisitDataStructureId(m_CellContainingVertDataArrayId, updatedId, visited, 2); |
| 236 | + m_CellNeighborsDataArrayId = nx::core::VisitDataStructureId(m_CellNeighborsDataArrayId, updatedId, visited, 3); |
| 237 | + m_CellCentroidsDataArrayId = nx::core::VisitDataStructureId(m_CellCentroidsDataArrayId, updatedId, visited, 4); |
| 238 | + m_ElementSizesId = nx::core::VisitDataStructureId(m_ElementSizesId, updatedId, visited, 5); |
258 | 239 | } |
259 | 240 | } |
260 | 241 | } // namespace nx::core |
0 commit comments