]> https://gitweb.dealii.org/ - dealii.git/commitdiff
FEInterfaceValues: pass to the constructor hp::QCollection 11371/head
authorPeter Munch <peterrmuench@gmail.com>
Mon, 14 Dec 2020 12:01:50 +0000 (13:01 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Sat, 19 Dec 2020 17:01:29 +0000 (18:01 +0100)
include/deal.II/fe/fe_interface_values.h

index 3d1a2b8c98c27e8a46ec1ca9035f4fe91d32346f..0b581f237d1afe57aac9af85bbe972d9e5f5d69b 100644 (file)
@@ -21,6 +21,8 @@
 #include <deal.II/fe/fe_values.h>
 #include <deal.II/fe/mapping_q1.h>
 
+#include <deal.II/hp/q_collection.h>
+
 DEAL_II_NAMESPACE_OPEN
 
 /**
@@ -67,6 +69,16 @@ public:
                     const Quadrature<dim - 1> &         quadrature,
                     const UpdateFlags                   update_flags);
 
+  /**
+   * The same as above but taking a collection of quadrature rules
+   * so that different quadrature rules can be assigned to different
+   * faces.
+   */
+  FEInterfaceValues(const Mapping<dim, spacedim> &      mapping,
+                    const FiniteElement<dim, spacedim> &fe,
+                    const hp::QCollection<dim - 1> &    quadrature,
+                    const UpdateFlags                   update_flags);
+
   /**
    * Construct the FEInterfaceValues with a single FiniteElement and
    * a Q1 Mapping.
@@ -487,6 +499,24 @@ FEInterfaceValues<dim, spacedim>::FEInterfaceValues(
   , fe_face_values_neighbor(nullptr)
 {}
 
+template <int dim, int spacedim>
+FEInterfaceValues<dim, spacedim>::FEInterfaceValues(
+  const Mapping<dim, spacedim> &      mapping,
+  const FiniteElement<dim, spacedim> &fe,
+  const hp::QCollection<dim - 1> &    quadrature,
+  const UpdateFlags                   update_flags)
+  : n_quadrature_points(quadrature.max_n_quadrature_points())
+  , internal_fe_face_values(mapping, fe, quadrature, update_flags)
+  , internal_fe_subface_values(mapping, fe, quadrature, update_flags)
+  , internal_fe_face_values_neighbor(mapping, fe, quadrature[0], update_flags)
+  , internal_fe_subface_values_neighbor(mapping,
+                                        fe,
+                                        quadrature[0],
+                                        update_flags)
+  , fe_face_values(nullptr)
+  , fe_face_values_neighbor(nullptr)
+{}
+
 
 
 template <int dim, int spacedim>
@@ -551,6 +581,12 @@ FEInterfaceValues<dim, spacedim>::reinit(
       fe_face_values_neighbor = &internal_fe_subface_values_neighbor;
     }
 
+  AssertDimension(fe_face_values->n_quadrature_points,
+                  fe_face_values_neighbor->n_quadrature_points);
+
+  const_cast<unsigned int &>(this->n_quadrature_points) =
+    fe_face_values->n_quadrature_points;
+
   // Set up dof mapping and remove duplicates (for continuous elements).
   {
     // Get dof indices first:

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.