]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add internal::TriangulationImplementation::ImplementationMixedMesh 11141/head
authorPeter Munch <peterrmuench@gmail.com>
Wed, 4 Nov 2020 09:20:34 +0000 (10:20 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Thu, 5 Nov 2020 08:11:49 +0000 (09:11 +0100)
include/deal.II/grid/tria.h
source/grid/tria.cc

index 5a8efeeb31a31a6e4d77bac3b9976057ed9a79bb..2a57871fe6e734b814e414c10ab9e5d48de519b0 100644 (file)
@@ -99,6 +99,7 @@ namespace internal
      * information.
      */
     struct Implementation;
+    struct ImplementationMixedMesh;
   } // namespace TriangulationImplementation
 
   namespace TriaAccessorImplementation
@@ -4025,6 +4026,8 @@ private:
   friend class hp::DoFHandler<dim, spacedim>;
 
   friend struct dealii::internal::TriangulationImplementation::Implementation;
+  friend struct dealii::internal::TriangulationImplementation::
+    ImplementationMixedMesh;
 
   friend class dealii::internal::TriangulationImplementation::TriaObjects;
 
index 5912648524a50c87e9db0d211535df722a5073f4..68778d1a82d196d634b755cf26417fabf72cf599 100644 (file)
@@ -9354,6 +9354,68 @@ namespace internal
     };
 
 
+    /**
+     * Same as above but for mixed meshes (and simplex meshes).
+     */
+    struct ImplementationMixedMesh
+    {
+      template <int dim, int spacedim>
+      static void
+      delete_children(
+        Triangulation<dim, spacedim> &                        triangulation,
+        typename Triangulation<dim, spacedim>::cell_iterator &cell,
+        std::vector<unsigned int> &                           line_cell_count,
+        std::vector<unsigned int> &                           quad_cell_count)
+      {
+        AssertThrow(false, ExcNotImplemented());
+        (void)triangulation;
+        (void)cell;
+        (void)line_cell_count;
+        (void)quad_cell_count;
+      }
+
+      template <int dim, int spacedim>
+      static typename Triangulation<dim, spacedim>::DistortedCellList
+      execute_refinement(Triangulation<dim, spacedim> &triangulation,
+                         const bool check_for_distorted_cells)
+      {
+        AssertThrow(false, ExcNotImplemented());
+        (void)triangulation;
+        (void)check_for_distorted_cells;
+
+        return {};
+      }
+
+      template <int dim, int spacedim>
+      static void
+      prevent_distorted_boundary_cells(
+        Triangulation<dim, spacedim> &triangulation)
+      {
+        AssertThrow(false, ExcNotImplemented());
+        (void)triangulation;
+      }
+
+      template <int dim, int spacedim>
+      static void
+      prepare_refinement_dim_dependent(
+        Triangulation<dim, spacedim> &triangulation)
+      {
+        AssertThrow(false, ExcNotImplemented());
+        (void)triangulation;
+      }
+
+      template <int dim, int spacedim>
+      static bool
+      coarsening_allowed(
+        const typename Triangulation<dim, spacedim>::cell_iterator &cell)
+      {
+        AssertThrow(false, ExcNotImplemented());
+        (void)cell;
+
+        return false;
+      }
+    };
+
 
     template <int dim, int spacedim>
     const Manifold<dim, spacedim> &
@@ -9795,12 +9857,6 @@ Triangulation<dim, spacedim>::create_triangulation(
   // are used
   Assert(subcelldata.check_consistency(dim), ExcInternalError());
 
-  this->policy =
-    std::make_unique<internal::TriangulationImplementation::PolicyWrapper<
-      dim,
-      spacedim,
-      internal::TriangulationImplementation::Implementation>>();
-
   // try to create a triangulation; if this fails, we still want to
   // throw an exception but if we just do so we'll get into trouble
   // because sometimes other objects are already attached to it:
@@ -9810,12 +9866,6 @@ Triangulation<dim, spacedim>::create_triangulation(
         create_triangulation(v, cells, subcelldata, *this);
 
       this->update_reference_cell_types();
-
-#ifndef DEAL_II_WITH_SIMPLEX_SUPPORT
-      Assert(this->all_reference_cell_types_are_hyper_cube(),
-             ExcMessage(
-               "A cell with invalid number of vertices has been provided."));
-#endif
     }
   catch (...)
     {
@@ -9823,6 +9873,27 @@ Triangulation<dim, spacedim>::create_triangulation(
       throw;
     }
 
+  if (this->all_reference_cell_types_are_hyper_cube())
+    {
+      this->policy =
+        std::make_unique<internal::TriangulationImplementation::PolicyWrapper<
+          dim,
+          spacedim,
+          internal::TriangulationImplementation::Implementation>>();
+    }
+  else
+    {
+#ifndef DEAL_II_WITH_SIMPLEX_SUPPORT
+      Assert(false, ExcNeedsSimplexSupport());
+#endif
+
+      this->policy =
+        std::make_unique<internal::TriangulationImplementation::PolicyWrapper<
+          dim,
+          spacedim,
+          internal::TriangulationImplementation::ImplementationMixedMesh>>();
+    }
+
   // update our counts of the various elements of a triangulation, and set
   // active_cell_indices of all cells
   internal::TriangulationImplementation::Implementation::compute_number_cache(

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.