From e75f23a55f1b9d2acc0ae8f8e310228fdb080f42 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 6 Jul 2024 10:10:58 -0400 Subject: [PATCH] PolarManifold: deprecate the public center member. --- include/deal.II/grid/manifold_lib.h | 13 ++++++++++++- source/grid/manifold_lib.cc | 5 +++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/include/deal.II/grid/manifold_lib.h b/include/deal.II/grid/manifold_lib.h index 156f65a840..11c5d6ba5d 100644 --- a/include/deal.II/grid/manifold_lib.h +++ b/include/deal.II/grid/manifold_lib.h @@ -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 center; private: + /** + * The center of the spherical coordinate system. + * + * @note This exists to avoid warnings when using center internally. + */ + const Point p_center; + /** * Helper function which returns the periodicity associated with this * coordinate system, according to dim, chartdim, and spacedim. @@ -1234,7 +1245,7 @@ template inline const Point & PolarManifold::get_center() const { - return center; + return p_center; } diff --git a/source/grid/manifold_lib.cc b/source/grid/manifold_lib.cc index 07d5e1dbff..889b0175ed 100644 --- a/source/grid/manifold_lib.cc +++ b/source/grid/manifold_lib.cc @@ -128,6 +128,7 @@ PolarManifold::PolarManifold(const Point center) : ChartManifold( PolarManifold::get_periodicity()) , center(center) + , p_center(center) {} @@ -187,7 +188,7 @@ PolarManifold::push_forward( default: DEAL_II_NOT_IMPLEMENTED(); } - return p + center; + return p + p_center; } @@ -197,7 +198,7 @@ Point PolarManifold::pull_back( const Point &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 p; -- 2.39.5