Skip to content

Commit

Permalink
Merge pull request #5503 from bangerth/compat
Browse files Browse the repository at this point in the history
Make sure stuff in compat.h/cc is guarded by a deal.II version.
  • Loading branch information
gassmoeller authored Nov 28, 2023
2 parents 7458546 + 0c5ff00 commit e062250
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
22 changes: 22 additions & 0 deletions include/aspect/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <deal.II/grid/manifold.h>
#include <deal.II/grid/manifold_lib.h>

Expand Down Expand Up @@ -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 <deal.II/grid/manifold_lib.h>
namespace aspect
{
using dealii::SphericalManifold;
}

#endif

#endif
7 changes: 7 additions & 0 deletions source/compat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@

#include <aspect/compat.h>

// 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
Expand Down Expand Up @@ -797,3 +802,5 @@ namespace aspect
template class SphericalManifold<2>;
template class SphericalManifold<3>;
}

#endif

0 comments on commit e062250

Please sign in to comment.