From: Peter Munch Date: Thu, 10 Mar 2022 13:39:47 +0000 (+0100) Subject: Implement MGLevelObject::n_levels() X-Git-Tag: v9.4.0-rc1~377^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13529%2Fhead;p=dealii.git Implement MGLevelObject::n_levels() --- 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