diff options
-rw-r--r-- | apps/adrian/cylinder2d/optimized_grid/cylinder2d.cpp | 11 | ||||
-rw-r--r-- | src/refinement/grid2D.hh | 7 |
2 files changed, 6 insertions, 12 deletions
diff --git a/apps/adrian/cylinder2d/optimized_grid/cylinder2d.cpp b/apps/adrian/cylinder2d/optimized_grid/cylinder2d.cpp index d516394..b4c3689 100644 --- a/apps/adrian/cylinder2d/optimized_grid/cylinder2d.cpp +++ b/apps/adrian/cylinder2d/optimized_grid/cylinder2d.cpp @@ -113,14 +113,6 @@ void prepareGeometry(Grid2D<T,DESCRIPTOR>& grid, Vector<T,2> origin, Vector<T,2> clout << "Prepare Geometry ... OK" << std::endl; } -void disableRefinedArea(Grid2D<T,DESCRIPTOR>& coarseGrid, - RefiningGrid2D<T,DESCRIPTOR>& fineGrid) -{ - auto& sGeometry = coarseGrid.getSuperGeometry(); - auto refinedOverlap = fineGrid.getRefinedOverlap(); - sGeometry.reset(*refinedOverlap); -} - void prepareLattice(Grid2D<T,DESCRIPTOR>& grid) { OstreamManager clout(std::cout,"prepareLattice"); @@ -297,21 +289,18 @@ void setupRefinement(Grid2D<T,DESCRIPTOR>& coarseGrid, Vector<T,2> domainOrigin, auto& fineGrid = coarseGrid.refine(fineOrigin, fineExtend); prepareGeometry(fineGrid, domainOrigin, domainExtend); - disableRefinedArea(coarseGrid, fineGrid); const Vector<T,2> fineExtend2 {5*cylinderD, fineGrid.getExtend()[1]-2*coarseDeltaX}; const Vector<T,2> fineOrigin2 {1*cylinderD, (domainExtend[1]-fineExtend2[1])/2}; auto& fineGrid2 = fineGrid.refine(fineOrigin2, fineExtend2); prepareGeometry(fineGrid2, domainOrigin, domainExtend); - disableRefinedArea(fineGrid, fineGrid2); const Vector<T,2> fineExtend3 {1.25*cylinderD, 1.25*cylinderD}; const Vector<T,2> fineOrigin3 {cylinderX-fineExtend3[0]/2, cylinderY-fineExtend3[1]/2}; auto& fineGrid3 = fineGrid2.refine(fineOrigin3, fineExtend3); prepareGeometry(fineGrid3, domainOrigin, domainExtend); - disableRefinedArea(fineGrid2, fineGrid3); } int main(int argc, char* argv[]) diff --git a/src/refinement/grid2D.hh b/src/refinement/grid2D.hh index 9ca8aaf..4f76896 100644 --- a/src/refinement/grid2D.hh +++ b/src/refinement/grid2D.hh @@ -338,7 +338,12 @@ RefiningGrid2D<T,DESCRIPTOR>& Grid2D<T,DESCRIPTOR>::refine( _fineGrids.emplace_back( new RefiningGrid2D<T,DESCRIPTOR>(*this, origin, extend)); - return *_fineGrids.back(); + RefiningGrid2D<T,DESCRIPTOR>& fineGrid = *_fineGrids.back(); + + auto refinedOverlap = fineGrid.getRefinedOverlap(); + _geometry->reset(*refinedOverlap); + + return fineGrid; } } |