From 18708a94cf8482495301b4c6646f5afa65266f42 Mon Sep 17 00:00:00 2001 From: David Wells Date: Tue, 20 Jun 2017 22:15:25 -0400 Subject: [PATCH] Compile TransfiniteInterpolationManifold<1> in the library. In addition, disable usage of the class by throwing an exception. This class is not as useful in 1D as it is in higher spatial dimensions, but compiling it in the library improves generic programming (i.e., one can write a solver that runs in 1D and 2D and on a 2D execution path can use TransfiniteInterpolationManifold). --- include/deal.II/grid/tria_accessor.h | 5 +++++ include/deal.II/grid/tria_accessor.templates.h | 9 +++++++++ source/grid/manifold_lib.cc | 6 ++++-- source/grid/manifold_lib.inst.in | 2 -- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/include/deal.II/grid/tria_accessor.h b/include/deal.II/grid/tria_accessor.h index 6bf44eacbc..f4ae231bed 100644 --- a/include/deal.II/grid/tria_accessor.h +++ b/include/deal.II/grid/tria_accessor.h @@ -558,6 +558,11 @@ public: * has children. */ bool has_children () const; + + /** + * Dummy function that always returns numbers::invalid_manifold_id. + */ + types::manifold_id manifold_id () const; }; diff --git a/include/deal.II/grid/tria_accessor.templates.h b/include/deal.II/grid/tria_accessor.templates.h index 0e2721dd5a..9d6252cad1 100644 --- a/include/deal.II/grid/tria_accessor.templates.h +++ b/include/deal.II/grid/tria_accessor.templates.h @@ -511,6 +511,15 @@ InvalidAccessor::operator -- () const +template +types::manifold_id +InvalidAccessor::manifold_id () const +{ + return numbers::invalid_manifold_id; +} + + + /*------------------------ Functions: TriaAccessor ---------------------------*/ diff --git a/source/grid/manifold_lib.cc b/source/grid/manifold_lib.cc index 5566da7ea8..6a806d0cda 100644 --- a/source/grid/manifold_lib.cc +++ b/source/grid/manifold_lib.cc @@ -630,7 +630,9 @@ TransfiniteInterpolationManifold::TransfiniteInterpolationManifold : triangulation(nullptr), level_coarse (-1) -{} +{ + AssertThrow(dim > 1, ExcNotImplemented()); +} @@ -675,7 +677,7 @@ namespace Point compute_transfinite_interpolation(const AccessorType &cell, const Point<1> &chart_point, - const bool cell_is_flat) + const bool /*cell_is_flat*/) { return cell.vertex(0) * (1.-chart_point[0]) + cell.vertex(1) * chart_point[0]; } diff --git a/source/grid/manifold_lib.inst.in b/source/grid/manifold_lib.inst.in index b3387bf720..d9d00a7c7b 100644 --- a/source/grid/manifold_lib.inst.in +++ b/source/grid/manifold_lib.inst.in @@ -23,10 +23,8 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS #if deal_II_dimension <= deal_II_space_dimension template class PolarManifold; template class SphericalManifold; -#if deal_II_dimension > 1 template class TransfiniteInterpolationManifold; #endif -#endif #if deal_II_dimension == deal_II_space_dimension template class TorusManifold; #endif -- 2.39.5