From: Peter Munch Date: Mon, 25 Apr 2022 07:22:45 +0000 (+0200) Subject: Implement MGLevelObject::back() X-Git-Tag: v9.4.0-rc1~304^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13641%2Fhead;p=dealii.git Implement MGLevelObject::back() --- diff --git a/include/deal.II/base/mg_level_object.h b/include/deal.II/base/mg_level_object.h index 88a9e3ae47..fd10610f5d 100644 --- a/include/deal.II/base/mg_level_object.h +++ b/include/deal.II/base/mg_level_object.h @@ -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::operator[](const unsigned int i) const } +template +const Object & +MGLevelObject::back() const +{ + return this->operator[](this->max_level()); +} + + template template void