summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-01-31 15:14:03 +0100
committerAdrian Kummerlaender2019-06-24 15:17:09 +0200
commit3bc4210c9a3c10ffe61f0237bba101f9700b7668 (patch)
tree2a214bf7fc7db75ad12d936297d485ede4436e56 /src
parent39e22863be1e50bd8e6b36f3d3ecbd1bec09e6a0 (diff)
downloadgrid_refinement_openlb-3bc4210c9a3c10ffe61f0237bba101f9700b7668.tar
grid_refinement_openlb-3bc4210c9a3c10ffe61f0237bba101f9700b7668.tar.gz
grid_refinement_openlb-3bc4210c9a3c10ffe61f0237bba101f9700b7668.tar.bz2
grid_refinement_openlb-3bc4210c9a3c10ffe61f0237bba101f9700b7668.tar.lz
grid_refinement_openlb-3bc4210c9a3c10ffe61f0237bba101f9700b7668.tar.xz
grid_refinement_openlb-3bc4210c9a3c10ffe61f0237bba101f9700b7668.tar.zst
grid_refinement_openlb-3bc4210c9a3c10ffe61f0237bba101f9700b7668.zip
Report total number of active cells in refinement hierarchy
Diffstat (limited to 'src')
-rw-r--r--src/refinement/grid2D.h2
-rw-r--r--src/refinement/grid2D.hh10
2 files changed, 12 insertions, 0 deletions
diff --git a/src/refinement/grid2D.h b/src/refinement/grid2D.h
index 37e764a..95324f7 100644
--- a/src/refinement/grid2D.h
+++ b/src/refinement/grid2D.h
@@ -110,6 +110,8 @@ public:
RefiningGrid2D<T,DESCRIPTOR>& refine(Vector<T,2> origin, Vector<T,2> extend, bool addCouplers=true);
+ std::size_t getActiveVoxelN() const;
+
};
template <typename T, template<typename> class DESCRIPTOR>
diff --git a/src/refinement/grid2D.hh b/src/refinement/grid2D.hh
index 941bff7..504808a 100644
--- a/src/refinement/grid2D.hh
+++ b/src/refinement/grid2D.hh
@@ -218,6 +218,16 @@ Vector<T,2> Grid2D<T,DESCRIPTOR>::alignExtendToGrid(Vector<T,2> extend) const
}
template <typename T, template<typename> class DESCRIPTOR>
+std::size_t Grid2D<T,DESCRIPTOR>::getActiveVoxelN() const
+{
+ std::size_t n = _geometry->getStatistics().getNvoxel();
+ for (const auto& grid : _fineGrids) {
+ n += grid->getActiveVoxelN();
+ }
+ return n;
+}
+
+template <typename T, template<typename> class DESCRIPTOR>
RefiningGrid2D<T,DESCRIPTOR>& Grid2D<T,DESCRIPTOR>::refine(
Vector<T,2> wantedOrigin, Vector<T,2> wantedExtend, bool addCouplers)
{