diff --git a/src/gpu/GridGenerator/grid/GridImp.cpp b/src/gpu/GridGenerator/grid/GridImp.cpp index 9b64d8260a69226a5481405b0f33f91de4dbf09d..0d1a6c3472309ff030e764e4690fc8631ddcee61 100644 --- a/src/gpu/GridGenerator/grid/GridImp.cpp +++ b/src/gpu/GridGenerator/grid/GridImp.cpp @@ -868,6 +868,7 @@ void GridImp::findSparseIndices(SPtr<Grid> finerGrid) if (fineGrid) { fineGrid->updateSparseIndices(); + this->findForGridInterfaceNewIndices(fineGrid); } const uint newGridSize = this->getSparseSize(); @@ -875,6 +876,16 @@ void GridImp::findSparseIndices(SPtr<Grid> finerGrid) << ", delete nodes:" << this->getSize() - newGridSize << "\n"; } +void GridImp::findForGridInterfaceNewIndices(SPtr<GridImp> fineGrid) +{ +#pragma omp parallel for + for (int index = 0; index < (int)this->getNumberOfNodesCF(); index++) + this->gridInterface->findForGridInterfaceSparseIndexCF(this, fineGrid.get(), index); + +#pragma omp parallel for + for (int index = 0; index < (int)this->getNumberOfNodesFC(); index++) + this->gridInterface->findForGridInterfaceSparseIndexFC(this, fineGrid.get(), index); +} void GridImp::updateSparseIndices() { diff --git a/src/gpu/GridGenerator/grid/GridImp.h b/src/gpu/GridGenerator/grid/GridImp.h index 7d44b0bb58168a6bf4da87ad94cf5a8f533002ed..6d6000b67d08da40349548afeb12028a0b265521 100644 --- a/src/gpu/GridGenerator/grid/GridImp.h +++ b/src/gpu/GridGenerator/grid/GridImp.h @@ -28,7 +28,7 @@ // //! \file GridImp.h //! \ingroup grid -//! \author Soeren Peters, Stephan Lenz, Martin Schönherr +//! \author Soeren Peters, Stephan Lenz, Martin Schoenherr //======================================================================================= #ifndef GRID_IMP_H #define GRID_IMP_H @@ -53,19 +53,19 @@ class BoundingBox; class TriangularMeshDiscretizationStrategy; #ifdef __GNUC__ -#ifndef __clang__ -#pragma push -#pragma diag_suppress = 3156 -#endif + #ifndef __clang__ + #pragma push + #pragma diag_suppress = 3156 + #endif #endif // GCC: warning #3156-D: extern declaration of the entity DIRECTIONS is treated as a static definition extern int DIRECTIONS[DIR_END_MAX][DIMENSION]; #ifdef __GNUC__ -#ifndef __clang__ -#pragma pop -#endif + #ifndef __clang__ + #pragma pop + #endif #endif class GRIDGENERATOR_EXPORT GridImp : public enableSharedFromThis<GridImp>, public Grid @@ -266,6 +266,7 @@ public: public: virtual void findSparseIndices(SPtr<Grid> fineGrid) override; + void findForGridInterfaceNewIndices(SPtr<GridImp> fineGrid); void updateSparseIndices(); void setNeighborIndices(uint index); real getFirstFluidNode(real coords[3], int direction, real startCoord) const override;