From ece622e278c182559180003090bb529c23e83c06 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Thu, 10 Mar 2022 14:39:47 +0100 Subject: [PATCH] Implement MGLevelObject::n_levels() --- include/deal.II/base/mg_level_object.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/deal.II/base/mg_level_object.h b/include/deal.II/base/mg_level_object.h index 6303e04d2f..88a9e3ae47 100644 --- a/include/deal.II/base/mg_level_object.h +++ b/include/deal.II/base/mg_level_object.h @@ -148,6 +148,12 @@ public: unsigned int max_level() const; + /** + * Number of levels, i.e., `max_level()-min_level()+1`. + */ + unsigned int + n_levels() const; + /** * Apply the action @p action to every object stored in here. The * parameter @p action is expected to be a function object that accepts @@ -280,6 +286,14 @@ MGLevelObject::max_level() const return minlevel + objects.size() - 1; } + +template +unsigned int +MGLevelObject::n_levels() const +{ + return objects.size(); +} + template template void -- 2.39.5