From 97afdb8faf5edc74f3b4a031ad1e62d3b87c1862 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Mon, 25 Apr 2022 09:22:45 +0200 Subject: [PATCH] Implement MGLevelObject::back() --- 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 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 -- 2.39.5