]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Rename FIV::normal() to normal_vector() and introduce FIV::quadrature_point() 17884/head
authorPeter Munch <peterrmuench@gmail.com>
Sat, 23 Nov 2024 14:52:38 +0000 (15:52 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Wed, 27 Nov 2024 06:31:41 +0000 (07:31 +0100)
doc/news/changes/incompatibilities/20241123Munch [new file with mode: 0644]
doc/news/changes/minor/20241123Munch [new file with mode: 0644]
examples/step-50/step-50.cc
examples/step-85/step-85.cc
include/deal.II/fe/fe_interface_values.h
tests/feinterface/fe_interface_values_12.cc
tests/feinterface/step-12.cc

diff --git a/doc/news/changes/incompatibilities/20241123Munch b/doc/news/changes/incompatibilities/20241123Munch
new file mode 100644 (file)
index 0000000..c400ae6
--- /dev/null
@@ -0,0 +1,3 @@
+Changed: FEInterfaceValues::normal() has been renamed FEInterfaceValues::normal_vector().
+<br>
+(Peter Munch, 2024/11/23)
diff --git a/doc/news/changes/minor/20241123Munch b/doc/news/changes/minor/20241123Munch
new file mode 100644 (file)
index 0000000..5a26642
--- /dev/null
@@ -0,0 +1,4 @@
+Improved: The function FEInterfaceValues::quadrature_point() has
+been added.
+<br>
+(Peter Munch, 2024/11/23)
index 11f3835fc575fd05ff44b1e60b49ceb21f4ecb68..185f35f32690e601fe8f13b5646dd8b6545b4aec 100644 (file)
@@ -1355,9 +1355,10 @@ namespace Step50
            qpoint < fe_interface_values.n_quadrature_points;
            ++qpoint)
         {
-          const double jump =
-            coeff1 * grad_u[0][qpoint] * fe_interface_values.normal(qpoint) -
-            coeff2 * grad_u[1][qpoint] * fe_interface_values.normal(qpoint);
+          const double jump = coeff1 * grad_u[0][qpoint] *
+                                fe_interface_values.normal_vector(qpoint) -
+                              coeff2 * grad_u[1][qpoint] *
+                                fe_interface_values.normal_vector(qpoint);
 
           jump_norm_square += jump * jump * fe_interface_values.JxW(qpoint);
         }
index 5afa0d2ed3eed343c278411b0343899b472c721c..827552b6963b5637972a271c9f0ed5fa6da3c09e 100644 (file)
@@ -503,7 +503,8 @@ namespace Step85
                    q < fe_interface_values.n_quadrature_points;
                    ++q)
                 {
-                  const Tensor<1, dim> normal = fe_interface_values.normal(q);
+                  const Tensor<1, dim> normal =
+                    fe_interface_values.normal_vector(q);
                   for (unsigned int i = 0; i < n_interface_dofs; ++i)
                     for (unsigned int j = 0; j < n_interface_dofs; ++j)
                       {
index 98e2b364bbb688ce9ccd01980d30dd7430550a04..4f1631697723c8334015c8606f4479b7f824b167 100644 (file)
@@ -1605,6 +1605,29 @@ public:
   const std::vector<double> &
   get_JxW_values() const;
 
+  /**
+   * Return the normal in a given quadrature point.
+   *
+   * The normal points in outwards direction as seen from the first cell of
+   * this interface.
+   *
+   * @dealiiRequiresUpdateFlags{update_normal_vectors}
+   */
+  DEAL_II_DEPRECATED_EARLY_WITH_COMMENT("Use the function normal_vector().")
+  Tensor<1, spacedim>
+  normal(const unsigned int q_point_index) const;
+
+  /**
+   * Return the normal in a given quadrature point.
+   *
+   * The normal points in outwards direction as seen from the first cell of
+   * this interface.
+   *
+   * @dealiiRequiresUpdateFlags{update_normal_vectors}
+   */
+  Tensor<1, spacedim>
+  normal_vector(const unsigned int q_point_index) const;
+
   /**
    * Return the normal vector of the interface in each quadrature point.
    *
@@ -1627,6 +1650,15 @@ public:
   std_cxx20::ranges::iota_view<unsigned int, unsigned int>
   quadrature_point_indices() const;
 
+  /**
+   * Return the location of the <tt>q_point</tt>th quadrature point in
+   * real space.
+   *
+   * @dealiiRequiresUpdateFlags{update_quadrature_points}
+   */
+  const Point<spacedim> &
+  quadrature_point(const unsigned int q_point) const;
+
   /**
    * Return a reference to the quadrature points in real space.
    *
@@ -1706,17 +1738,6 @@ public:
   std::array<unsigned int, 2>
   interface_dof_to_dof_indices(const unsigned int interface_dof_index) const;
 
-  /**
-   * Return the normal in a given quadrature point.
-   *
-   * The normal points in outwards direction as seen from the first cell of
-   * this interface.
-   *
-   * @dealiiRequiresUpdateFlags{update_normal_vectors}
-   */
-  Tensor<1, spacedim>
-  normal(const unsigned int q_point_index) const;
-
   /**
    * @}
    */
@@ -2773,6 +2794,18 @@ FEInterfaceValues<dim, spacedim>::quadrature_point_indices() const
 
 
 
+template <int dim, int spacedim>
+const Point<spacedim> &
+FEInterfaceValues<dim, spacedim>::quadrature_point(
+  const unsigned int q_point) const
+{
+  Assert(fe_face_values != nullptr,
+         ExcMessage("This call requires a call to reinit() first."));
+  return fe_face_values->quadrature_point(q_point);
+}
+
+
+
 template <int dim, int spacedim>
 const std::vector<Point<spacedim>> &
 FEInterfaceValues<dim, spacedim>::get_quadrature_points() const
@@ -2885,6 +2918,16 @@ FEInterfaceValues<dim, spacedim>::get_fe_face_values(
 template <int dim, int spacedim>
 Tensor<1, spacedim>
 FEInterfaceValues<dim, spacedim>::normal(const unsigned int q_point_index) const
+{
+  return normal_vector(q_point_index);
+}
+
+
+
+template <int dim, int spacedim>
+Tensor<1, spacedim>
+FEInterfaceValues<dim, spacedim>::normal_vector(
+  const unsigned int q_point_index) const
 {
   return fe_face_values->normal_vector(q_point_index);
 }
index 39f8e684961dfe2cbc94419e5cbfd7fa6bea6eb9..994118b8f68998e643a03888523de43ce4c4981e 100644 (file)
@@ -90,8 +90,13 @@ test(const unsigned int fe_degree0, const unsigned int fe_degree1 = 0)
 
         const auto &q_points = fiv.get_quadrature_points();
         for (unsigned int qpoint = 0; qpoint < q_points.size(); ++qpoint)
-          deallog << "qpoint " << qpoint << ": " << q_points[qpoint]
-                  << std::endl;
+          {
+            Assert(q_points[qpoint] == fiv.quadrature_point(qpoint),
+                   ExcInternalError());
+
+            deallog << "qpoint " << qpoint << ": " << q_points[qpoint]
+                    << std::endl;
+          }
 
         for (unsigned int idx = 0; idx < n_dofs; ++idx)
           {
index 02ebfe1980f047a719fbc506ca09e7c00b67d567..e75b8d81ccba54d7e35760d9607912715c8b3985 100644 (file)
@@ -313,6 +313,10 @@ namespace Step12
 
       for (unsigned int point = 0; point < q_points.size(); ++point)
         {
+          Assert(normals[point] ==
+                   scratch_data.fe_interface_values.normal_vector(point),
+                 ExcInternalError());
+
           const double beta_n = beta(q_points[point]) * normals[point];
 
           if (beta_n > 0)

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.