]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Instantiate MappingC1 for dim <= spacedim 16798/head
authorSimon Sticko <simon@sticko.se>
Thu, 28 Mar 2024 07:06:10 +0000 (08:06 +0100)
committerSimon Sticko <simon@sticko.se>
Thu, 28 Mar 2024 07:49:37 +0000 (08:49 +0100)
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
source/fe/mapping_c1.cc
source/fe/mapping_c1.inst.in

index adaee0547f00de25d7b5e43bfd381bf752e43735..352d9d93eae4a9c20f9e8a18d06f5e36846dfbf6 100644 (file)
@@ -63,8 +63,8 @@ public:
    */
   virtual void
   add_line_support_points(
-    const typename Triangulation<dim>::cell_iterator &cell,
-    std::vector<Point<dim>>                          &a) const override;
+    const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+    std::vector<Point<spacedim>> &a) const override;
 
   /**
    * For <tt>dim=3</tt>. Append the support points of all shape functions
@@ -77,8 +77,8 @@ public:
    */
   virtual void
   add_quad_support_points(
-    const typename Triangulation<dim>::cell_iterator &cell,
-    std::vector<Point<dim>>                          &a) const override;
+    const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+    std::vector<Point<spacedim>> &a) const override;
 };
 
 /** @} */
index 4989e128749d2088f2c8ce2cfe9039c5b368dc7a..f27c76787d33fa13f59e2558725e01a2a28f7fd9 100644 (file)
@@ -31,6 +31,7 @@ MappingC1<dim, spacedim>::MappingC1()
   : MappingQ<dim, spacedim>(3)
 {
   Assert(dim > 1, ExcImpossibleInDim(dim));
+  Assert(dim == spacedim, ExcNotImplemented());
 }
 
 
@@ -156,8 +157,8 @@ MappingC1<2>::add_line_support_points(
 template <int dim, int spacedim>
 void
 MappingC1<dim, spacedim>::add_line_support_points(
-  const typename Triangulation<dim>::cell_iterator &,
-  std::vector<Point<dim>> &) const
+  const typename Triangulation<dim, spacedim>::cell_iterator &,
+  std::vector<Point<spacedim>> &) const
 {
   DEAL_II_NOT_IMPLEMENTED();
 }
@@ -191,8 +192,8 @@ MappingC1<2>::add_quad_support_points(const Triangulation<2>::cell_iterator &,
 template <int dim, int spacedim>
 void
 MappingC1<dim, spacedim>::add_quad_support_points(
-  const typename Triangulation<dim>::cell_iterator &,
-  std::vector<Point<dim>> &) const
+  const typename Triangulation<dim, spacedim>::cell_iterator &,
+  std::vector<Point<spacedim>> &) const
 {
   DEAL_II_NOT_IMPLEMENTED();
 }
index 9c8149b4cf3a628608883a57885f42c1f75af5f1..fa36f5e909e8a3ba3ab72e5e7674bf393c248601 100644 (file)
@@ -14,7 +14,9 @@
 
 
 
-for (deal_II_dimension : DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
   {
-    template class MappingC1<deal_II_dimension>;
+#if deal_II_dimension <= deal_II_space_dimension
+    template class MappingC1<deal_II_dimension, deal_II_space_dimension>;
+#endif
   }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.