From 96c4a2a8b98e10a20be9336e7df7e45e32792ae4 Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Thu, 18 Apr 2019 15:48:51 +0200 Subject: [PATCH] Deprecate new_* in favour of set_* --- include/deal.II/base/function_lib.h | 22 ++++++++++++++++++++-- source/base/function_lib_cutoff.cc | 18 ++++++++++++++++++ tests/{ => base}/function_cutoff_01.cc | 4 ++-- tests/{ => base}/function_cutoff_01.output | 0 4 files changed, 40 insertions(+), 4 deletions(-) rename tests/{ => base}/function_cutoff_01.cc (98%) rename tests/{ => base}/function_cutoff_01.output (100%) diff --git a/include/deal.II/base/function_lib.h b/include/deal.II/base/function_lib.h index 3769444c3e..0b36b2d4e3 100644 --- a/include/deal.II/base/function_lib.h +++ b/include/deal.II/base/function_lib.h @@ -948,16 +948,34 @@ namespace Functions /** * Move the center of the ball to new point p. + * + * @deprecated Use set_center() instead. */ - void + DEAL_II_DEPRECATED void new_center(const Point &p); /** * Set the radius of the ball to r. + * + * @deprecated Use set_radius() instead. */ - void + DEAL_II_DEPRECATED void new_radius(const double r); + /** + * Set the center of the ball to the point @p p. + */ + void + set_center(const Point &p); + + /** + * Set the radius of the ball to @p r + * + * @deprecated Use set_radius() instead. + */ + void + set_radius(const double r); + /** * Return the center stored in this object. */ diff --git a/source/base/function_lib_cutoff.cc b/source/base/function_lib_cutoff.cc index 71ba7b7834..e1fa60fc53 100644 --- a/source/base/function_lib_cutoff.cc +++ b/source/base/function_lib_cutoff.cc @@ -51,6 +51,15 @@ namespace Functions template void CutOffFunctionBase::new_center(const Point &p) + { + set_center(p); + } + + + + template + void + CutOffFunctionBase::set_center(const Point &p) { center = p; } @@ -69,6 +78,15 @@ namespace Functions template void CutOffFunctionBase::new_radius(const double r) + { + set_radius(r); + } + + + + template + void + CutOffFunctionBase::set_radius(const double r) { radius = r; Assert(r > 0, ExcMessage("You must specify a radius > 0.")); diff --git a/tests/function_cutoff_01.cc b/tests/base/function_cutoff_01.cc similarity index 98% rename from tests/function_cutoff_01.cc rename to tests/base/function_cutoff_01.cc index 4286608630..c51ac0f797 100644 --- a/tests/function_cutoff_01.cc +++ b/tests/base/function_cutoff_01.cc @@ -92,8 +92,8 @@ test() for (unsigned int i = 0; i < dim; ++i) new_center[i] = .5; - fun.new_center(new_center); - fun.new_radius(.5); + fun.set_center(new_center); + fun.set_radius(.5); deallog << "Center: " << fun.get_center() << std::endl << "Radius: " << fun.get_radius() << std::endl; diff --git a/tests/function_cutoff_01.output b/tests/base/function_cutoff_01.output similarity index 100% rename from tests/function_cutoff_01.output rename to tests/base/function_cutoff_01.output -- 2.39.5