]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Implement MGLevelObject::n_levels() 13529/head
authorPeter Munch <peterrmuench@gmail.com>
Thu, 10 Mar 2022 13:39:47 +0000 (14:39 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Thu, 10 Mar 2022 13:39:47 +0000 (14:39 +0100)
include/deal.II/base/mg_level_object.h

index 6303e04d2fd40372a78e0baefbd0840bdff8c962..88a9e3ae47f5021286015df5b473e35bc5c16393 100644 (file)
@@ -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<Object>::max_level() const
   return minlevel + objects.size() - 1;
 }
 
+
+template <class Object>
+unsigned int
+MGLevelObject<Object>::n_levels() const
+{
+  return objects.size();
+}
+
 template <class Object>
 template <typename ActionFunctionObjectType>
 void

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.