]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Deprecate new_* in favour of set_*
authorLuca Heltai <luca.heltai@sissa.it>
Thu, 18 Apr 2019 13:48:51 +0000 (15:48 +0200)
committerLuca Heltai <luca.heltai@sissa.it>
Tue, 23 Apr 2019 12:59:00 +0000 (14:59 +0200)
include/deal.II/base/function_lib.h
source/base/function_lib_cutoff.cc
tests/base/function_cutoff_01.cc [moved from tests/function_cutoff_01.cc with 98% similarity]
tests/base/function_cutoff_01.output [moved from tests/function_cutoff_01.output with 100% similarity]

index 3769444c3e746a3f986fed9c558129e5cc7dd153..0b36b2d4e32dca9b771023b4803bc4023051598f 100644 (file)
@@ -948,16 +948,34 @@ namespace Functions
 
     /**
      * Move the center of the ball to new point <tt>p</tt>.
+     *
+     * @deprecated Use set_center() instead.
      */
-    void
+    DEAL_II_DEPRECATED void
     new_center(const Point<dim> &p);
 
     /**
      * Set the radius of the ball to <tt>r</tt>.
+     *
+     * @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<dim> &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.
      */
index 71ba7b7834fc1f7e703c3232ae66939063270718..e1fa60fc532ba80c1e5e1eb29aaec61acdcb0763 100644 (file)
@@ -51,6 +51,15 @@ namespace Functions
   template <int dim>
   void
   CutOffFunctionBase<dim>::new_center(const Point<dim> &p)
+  {
+    set_center(p);
+  }
+
+
+
+  template <int dim>
+  void
+  CutOffFunctionBase<dim>::set_center(const Point<dim> &p)
   {
     center = p;
   }
@@ -69,6 +78,15 @@ namespace Functions
   template <int dim>
   void
   CutOffFunctionBase<dim>::new_radius(const double r)
+  {
+    set_radius(r);
+  }
+
+
+
+  template <int dim>
+  void
+  CutOffFunctionBase<dim>::set_radius(const double r)
   {
     radius = r;
     Assert(r > 0, ExcMessage("You must specify a radius > 0."));
similarity index 98%
rename from tests/function_cutoff_01.cc
rename to tests/base/function_cutoff_01.cc
index 428660863091f9f184626bbb11ba9f4090b1bfee..c51ac0f797477fd50be107c1c168d38e66733a53 100644 (file)
@@ -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;

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.