]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Actually use ShapeInfo for Simplex::FE_P and Simplex::QGauss 11196/head
authorPeter Munch <peterrmuench@gmail.com>
Tue, 17 Nov 2020 18:50:16 +0000 (19:50 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Wed, 18 Nov 2020 15:29:01 +0000 (16:29 +0100)
include/deal.II/matrix_free/mapping_info.h
include/deal.II/matrix_free/mapping_info.templates.h

index e4852ea9eb8661b99cbec03b516cfe2ed24ede0f..d717e3fc1790dfbdf3f2582d92e5c892c39f913e 100644 (file)
@@ -125,6 +125,14 @@ namespace internal
          */
         QuadratureDescriptor();
 
+        /**
+         * Set up the lengths in the various members of this struct.
+         */
+        template <int dim_q>
+        void
+        initialize(const Quadrature<dim_q> &quadrature,
+                   const UpdateFlags update_flags_inner_faces = update_default);
+
         /**
          * Set up the lengths in the various members of this struct.
          */
index 1d89993cc5ab7d29c1f725bc0f3ae2f9c90134d8..e81fcb0fe8595bcc10449747f3ccecaccba49106 100644 (file)
@@ -51,6 +51,34 @@ namespace internal
 
 
 
+    template <int structdim,
+              int spacedim,
+              typename Number,
+              typename VectorizedArrayType>
+    template <int dim_q>
+    void
+    MappingInfoStorage<structdim, spacedim, Number, VectorizedArrayType>::
+      QuadratureDescriptor::initialize(
+        const Quadrature<dim_q> &quadrature,
+        const UpdateFlags        update_flags_inner_faces)
+    {
+      Assert(structdim + 1 <= spacedim ||
+               update_flags_inner_faces == update_default,
+             ExcMessage("Volume cells do not allow for setting inner faces"));
+      this->quadrature = quadrature;
+      n_q_points       = quadrature.size();
+      quadrature_weights.resize(n_q_points);
+      for (unsigned int i = 0; i < n_q_points; ++i)
+        quadrature_weights[i] = quadrature.weight(i);
+
+      // note: quadrature_1 and tensor_quadrature_weights are not set up
+
+      // TODO: set up face_orientations
+      (void)update_flags_inner_faces;
+    }
+
+
+
     template <int structdim,
               int spacedim,
               typename Number,
@@ -338,27 +366,41 @@ namespace internal
           cell_data[my_q].descriptor.resize(n_hp_quads);
           for (unsigned int q = 0; q < n_hp_quads; ++q)
             {
-              Assert(quad[my_q][q].is_tensor_product(), ExcNotImplemented());
-              for (unsigned int i = 1; i < dim; ++i)
-                {
-                  Assert(quad[my_q][q].get_tensor_basis()[0] ==
-                           quad[my_q][q].get_tensor_basis()[i],
-                         ExcNotImplemented());
-                }
+              bool flag = quad[my_q][q].is_tensor_product();
 
-              cell_data[my_q].descriptor[q].initialize(
-                quad[my_q][q].get_tensor_basis()[0], update_default);
+              if (flag)
+                for (unsigned int i = 1; i < dim; ++i)
+                  {
+                    flag &= quad[my_q][q].get_tensor_basis()[0] ==
+                            quad[my_q][q].get_tensor_basis()[i];
+                  }
+#ifdef DEAL_II_WITH_SIMPLEX_SUPPORT
+              if (flag == false)
+                cell_data[my_q].descriptor[q].initialize(quad[my_q][q],
+                                                         update_default);
+              else
+#endif
+                cell_data[my_q].descriptor[q].initialize(
+                  quad[my_q][q].get_tensor_basis()[0], update_default);
             }
 
           face_data[my_q].descriptor.resize(n_hp_quads);
           for (unsigned int hpq = 0; hpq < n_hp_quads; ++hpq)
             {
-              Assert(quad[my_q][hpq].is_tensor_product(), ExcNotImplemented());
-              for (unsigned int i = 1; i < dim; ++i)
+              bool flag = quad[my_q][hpq].is_tensor_product();
+
+              if (flag)
+                for (unsigned int i = 1; i < dim; ++i)
+                  flag &= quad[my_q][hpq].get_tensor_basis()[0] ==
+                          quad[my_q][hpq].get_tensor_basis()[i];
+
+              if (flag == false)
                 {
-                  Assert(quad[my_q][hpq].get_tensor_basis()[0] ==
-                           quad[my_q][hpq].get_tensor_basis()[i],
-                         ExcNotImplemented());
+#ifdef DEAL_II_WITH_SIMPLEX_SUPPORT
+                  continue; // TODO: face data is not set up
+#else
+                  Assert(false, ExcNotImplemented());
+#endif
                 }
 
               face_data[my_q].descriptor[hpq].initialize(
@@ -369,12 +411,20 @@ namespace internal
           face_data_by_cells[my_q].descriptor.resize(n_hp_quads);
           for (unsigned int hpq = 0; hpq < n_hp_quads; ++hpq)
             {
-              Assert(quad[my_q][hpq].is_tensor_product(), ExcNotImplemented());
-              for (unsigned int i = 1; i < dim; ++i)
+              bool flag = quad[my_q][hpq].is_tensor_product();
+
+              if (flag)
+                for (unsigned int i = 1; i < dim; ++i)
+                  flag &= quad[my_q][hpq].get_tensor_basis()[0] ==
+                          quad[my_q][hpq].get_tensor_basis()[i];
+
+              if (flag == false)
                 {
-                  Assert(quad[my_q][hpq].get_tensor_basis()[0] ==
-                           quad[my_q][hpq].get_tensor_basis()[i],
-                         ExcNotImplemented());
+#ifdef DEAL_II_WITH_SIMPLEX_SUPPORT
+                  continue; // TODO: face data is not set up
+#else
+                  Assert(false, ExcNotImplemented());
+#endif
                 }
 
               face_data_by_cells[my_q].descriptor[hpq].initialize(

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.