]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Implement MGLevelObject::back() 13641/head
authorPeter Munch <peterrmuench@gmail.com>
Mon, 25 Apr 2022 07:22:45 +0000 (09:22 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Mon, 25 Apr 2022 07:22:45 +0000 (09:22 +0200)
include/deal.II/base/mg_level_object.h

index 88a9e3ae47f5021286015df5b473e35bc5c16393..fd10610f5dcdcf7af6fdd854de250505730e0872 100644 (file)
@@ -97,6 +97,12 @@ public:
   const Object &
   operator[](const unsigned int level) const;
 
+  /**
+   * Return object on level max.
+   */
+  const Object &
+  back() const;
+
   /**
    * Delete all previous contents of this object and reset its size according
    * to the values of @p new_minlevel and @p new_maxlevel.
@@ -230,6 +236,14 @@ MGLevelObject<Object>::operator[](const unsigned int i) const
 }
 
 
+template <class Object>
+const Object &
+MGLevelObject<Object>::back() const
+{
+  return this->operator[](this->max_level());
+}
+
+
 template <class Object>
 template <class... Args>
 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.