From: Jonathan Robey Date: Fri, 5 Aug 2016 22:59:34 +0000 (-0700) Subject: Rename and deprecate MGLevelObject::clear() X-Git-Tag: v8.5.0-rc1~791^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68c3cd53034cba53bf761abe933c7a910bea536b;p=dealii.git Rename and deprecate MGLevelObject::clear() --- diff --git a/include/deal.II/base/mg_level_object.h b/include/deal.II/base/mg_level_object.h index 71058f9a47..7fcbb840c9 100644 --- a/include/deal.II/base/mg_level_object.h +++ b/include/deal.II/base/mg_level_object.h @@ -105,6 +105,18 @@ public: */ MGLevelObject &operator = (const double d); + /** + * Call @p clear on all objects stored by this object. This function + * is only implemented for some @p Object classes, e.g., matrix + * types or the PreconditionBlockSOR and similar classes. Using this + * function will fail with a compiler error if the @p Object + * template type to this class does not provide a + * clear() member function. + * + * @deprecated Use clear_elements () instead + */ + void clear() DEAL_II_DEPRECATED; + /** * Call @p clear on all objects stored by this object. This function * is only implemented for some @p Object classes, e.g., matrix @@ -113,7 +125,7 @@ public: * template type to this class does not provide a * clear() member function. */ - void clear(); + void clear_elements(); /** * The coarsest level for which this class stores a level object. @@ -207,7 +219,16 @@ MGLevelObject::operator = (const double d) template void -MGLevelObject::clear () +MGLevelObject::clear () // DEPRECATED +{ + // Avoid code duplication in deprecated call by calling replacing function + clear_elements(); +} + + +template +void +MGLevelObject::clear_elements () { typename std::vector >::iterator v; for (v = objects.begin(); v != objects.end(); ++v)