From 0c5ff00e04229483e3c70b73076d4da93a125eff Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 27 Nov 2023 11:31:05 -0700 Subject: [PATCH] Make sure stuff in compat.h/cc is guarded by a deal.II version. --- include/aspect/compat.h | 22 ++++++++++++++++++++++ source/compat.cc | 7 +++++++ 2 files changed, 29 insertions(+) diff --git a/include/aspect/compat.h b/include/aspect/compat.h index 9ed4ae94049..e4bb332af2b 100644 --- a/include/aspect/compat.h +++ b/include/aspect/compat.h @@ -1070,6 +1070,11 @@ namespace dealii #endif +// deal.II versions up to 9.5 had a poorly designed interface of the +// SphericalManifold class that made it impossible for us to use. +// This file thus contains a copy of it. +#if !DEAL_II_VERSION_GTE(9,6,0) + #include #include @@ -1213,4 +1218,21 @@ namespace aspect }; } +#else + +// For sufficiently new deal.II versions, we can use the deal.II class, but to +// avoid name clashes, we have to import the class into namespace aspect. Once +// we rely on these sufficiently new versions of deal.II, we can not only remove +// the code above, but also the following lines, and in all places where we +// reference 'aspect::SphericalManifold' simply use 'SphericalManifold' instead +// (which then refers to the deal.II class). + +#include +namespace aspect +{ + using dealii::SphericalManifold; +} + +#endif + #endif diff --git a/source/compat.cc b/source/compat.cc index c5d78de7cc1..6648ca76f94 100644 --- a/source/compat.cc +++ b/source/compat.cc @@ -21,6 +21,11 @@ #include +// deal.II versions up to 9.5 had a poorly designed interface of the +// SphericalManifold class that made it impossible for us to use. +// This file thus contains a copy of it. +#if !DEAL_II_VERSION_GTE(9,6,0) + namespace aspect { namespace @@ -797,3 +802,5 @@ namespace aspect template class SphericalManifold<2>; template class SphericalManifold<3>; } + +#endif