From 00754e194b04d28b1c5d975254307858e6c686a4 Mon Sep 17 00:00:00 2001 From: Simon Sticko Date: Thu, 28 Mar 2024 08:06:10 +0100 Subject: [PATCH] Instantiate MappingC1 for dim <= spacedim The mapping is not implemened for dim!=spacedim, but it is better to get ExcNotImplemented than missing symbols. --- include/deal.II/fe/mapping_c1.h | 8 ++++---- source/fe/mapping_c1.cc | 9 +++++---- source/fe/mapping_c1.inst.in | 6 ++++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/include/deal.II/fe/mapping_c1.h b/include/deal.II/fe/mapping_c1.h index adaee0547f..352d9d93ea 100644 --- a/include/deal.II/fe/mapping_c1.h +++ b/include/deal.II/fe/mapping_c1.h @@ -63,8 +63,8 @@ public: */ virtual void add_line_support_points( - const typename Triangulation::cell_iterator &cell, - std::vector> &a) const override; + const typename Triangulation::cell_iterator &cell, + std::vector> &a) const override; /** * For dim=3. Append the support points of all shape functions @@ -77,8 +77,8 @@ public: */ virtual void add_quad_support_points( - const typename Triangulation::cell_iterator &cell, - std::vector> &a) const override; + const typename Triangulation::cell_iterator &cell, + std::vector> &a) const override; }; /** @} */ diff --git a/source/fe/mapping_c1.cc b/source/fe/mapping_c1.cc index 4989e12874..f27c76787d 100644 --- a/source/fe/mapping_c1.cc +++ b/source/fe/mapping_c1.cc @@ -31,6 +31,7 @@ MappingC1::MappingC1() : MappingQ(3) { Assert(dim > 1, ExcImpossibleInDim(dim)); + Assert(dim == spacedim, ExcNotImplemented()); } @@ -156,8 +157,8 @@ MappingC1<2>::add_line_support_points( template void MappingC1::add_line_support_points( - const typename Triangulation::cell_iterator &, - std::vector> &) const + const typename Triangulation::cell_iterator &, + std::vector> &) const { DEAL_II_NOT_IMPLEMENTED(); } @@ -191,8 +192,8 @@ MappingC1<2>::add_quad_support_points(const Triangulation<2>::cell_iterator &, template void MappingC1::add_quad_support_points( - const typename Triangulation::cell_iterator &, - std::vector> &) const + const typename Triangulation::cell_iterator &, + std::vector> &) const { DEAL_II_NOT_IMPLEMENTED(); } diff --git a/source/fe/mapping_c1.inst.in b/source/fe/mapping_c1.inst.in index 9c8149b4cf..fa36f5e909 100644 --- a/source/fe/mapping_c1.inst.in +++ b/source/fe/mapping_c1.inst.in @@ -14,7 +14,9 @@ -for (deal_II_dimension : DIMENSIONS) +for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS) { - template class MappingC1; +#if deal_II_dimension <= deal_II_space_dimension + template class MappingC1; +#endif } -- 2.39.5