From 9d547d2dc7d2e96c16ee5cbf9ebf2f73a7a5233e Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 4 Feb 2019 22:56:00 +0100 Subject: Automatically apply prepareLattice for all grids --- src/refinement/grid2D.h | 1 + src/refinement/grid2D.hh | 9 +++++++++ 2 files changed, 10 insertions(+) (limited to 'src/refinement') diff --git a/src/refinement/grid2D.h b/src/refinement/grid2D.h index adfcd55..6cbbf6f 100644 --- a/src/refinement/grid2D.h +++ b/src/refinement/grid2D.h @@ -144,6 +144,7 @@ public: RefiningGrid2D& refine(Vector origin, Vector extend, bool addCouplers=true); + void forEachGrid(std::function&)>&& f); void forEachGrid(const std::string& id, std::function&,const std::string&)>&& f); std::size_t getActiveVoxelN() const; diff --git a/src/refinement/grid2D.hh b/src/refinement/grid2D.hh index 6d16648..fdf6461 100644 --- a/src/refinement/grid2D.hh +++ b/src/refinement/grid2D.hh @@ -258,6 +258,15 @@ Vector Grid2D::alignExtendToGrid(Vector extend) const }; } +template class DESCRIPTOR> +void Grid2D::forEachGrid(std::function&)>&& f) +{ + f(*this); + for (auto& grid : _fineGrids) { + grid->forEachGrid(std::forward(f)); + } +} + template class DESCRIPTOR> void Grid2D::forEachGrid( const std::string& id, -- cgit v1.2.3