]> https://gitweb.dealii.org/ - dealii.git/commitdiff
PolarManifold: deprecate the public center member.
authorDavid Wells <drwells@email.unc.edu>
Sat, 6 Jul 2024 14:10:58 +0000 (10:10 -0400)
committerDavid Wells <drwells@email.unc.edu>
Sat, 6 Jul 2024 14:46:15 +0000 (10:46 -0400)
include/deal.II/grid/manifold_lib.h
source/grid/manifold_lib.cc

index 156f65a84020d687abdf752918b583781905202b..11c5d6ba5d9cb8388b3f8fd1fde3a4b8e14c6ba0 100644 (file)
@@ -142,10 +142,21 @@ public:
 
   /**
    * The center of the spherical coordinate system.
+   *
+   * @deprecated Use get_center() instead.
    */
+  DEAL_II_DEPRECATED_EARLY_WITH_COMMENT(
+    "Access the center with get_center() instead.")
   const Point<spacedim> center;
 
 private:
+  /**
+   * The center of the spherical coordinate system.
+   *
+   * @note This exists to avoid warnings when using center internally.
+   */
+  const Point<spacedim> p_center;
+
   /**
    * Helper function which returns the periodicity associated with this
    * coordinate system, according to dim, chartdim, and spacedim.
@@ -1234,7 +1245,7 @@ template <int dim, int spacedim>
 inline const Point<spacedim> &
 PolarManifold<dim, spacedim>::get_center() const
 {
-  return center;
+  return p_center;
 }
 
 
index 07d5e1dbff67079b27360eacca456bd589fd883c..889b0175ed445b73fd652481bcbee0b7437864eb 100644 (file)
@@ -128,6 +128,7 @@ PolarManifold<dim, spacedim>::PolarManifold(const Point<spacedim> center)
   : ChartManifold<dim, spacedim, spacedim>(
       PolarManifold<dim, spacedim>::get_periodicity())
   , center(center)
+  , p_center(center)
 {}
 
 
@@ -187,7 +188,7 @@ PolarManifold<dim, spacedim>::push_forward(
         default:
           DEAL_II_NOT_IMPLEMENTED();
       }
-  return p + center;
+  return p + p_center;
 }
 
 
@@ -197,7 +198,7 @@ Point<spacedim>
 PolarManifold<dim, spacedim>::pull_back(
   const Point<spacedim> &space_point) const
 {
-  const Tensor<1, spacedim> R   = space_point - center;
+  const Tensor<1, spacedim> R   = space_point - p_center;
   const double              rho = R.norm();
 
   Point<spacedim> p;

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.