]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Rename unit_tangential/normal_vectors() to face_tangent/normal_vector().
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 23 Jan 2025 16:47:05 +0000 (09:47 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 23 Jan 2025 16:57:39 +0000 (09:57 -0700)
include/deal.II/grid/reference_cell.h
source/fe/mapping_fe.cc
source/fe/mapping_fe_field.cc
tests/simplex/orientation_03.cc
tests/simplex/orientation_04.cc
tests/simplex/unit_tangential_vectors_01.cc

index ed9bd6c832ed305a214ac83058f62a1940228b3c..032bc46af39507c7acf433bc9f3c4a94da670e76 100644 (file)
@@ -729,9 +729,9 @@ public:
   closest_point(const Point<dim> &p) const;
 
   /**
-   * Return $i$-th unit tangential vector of a face of the reference cell.
-   * The vectors are arranged such that the
-   * cross product between the two vectors returns the unit normal vector.
+   * Return $i$-th unit tangent vector to a face of the reference cell.
+   * The vectors are arranged in such an order that the
+   * cross product between the two vectors returns the face normal vector.
    *
    * @pre $i$ must be between zero and `dim-1`.
    *
@@ -741,8 +741,25 @@ public:
    */
   template <int dim>
   Tensor<1, dim>
-  unit_tangential_vectors(const unsigned int face_no,
-                          const unsigned int i) const;
+  face_tangent_vector(const unsigned int face_no, const unsigned int i) const;
+
+  /**
+   * Return $i$-th unit tangent vector to a face of the reference cell.
+   * The vectors are arranged in such an order that the
+   * cross product between the two vectors returns the face normal vector.
+   *
+   * @pre $i$ must be between zero and `dim-1`.
+   *
+   * @pre The template argument `dim` must equal the dimension
+   *   of the space in which the reference cell you are querying
+   *   lives (i.e., it must equal the result of get_dimension()).
+   *
+   * @deprecated Use face_tangent_vector() instead.
+   */
+  template <int dim>
+  DEAL_II_DEPRECATED_EARLY_WITH_COMMENT("Use face_tangent_vector() instead.")
+  Tensor<1, dim> unit_tangential_vectors(const unsigned int face_no,
+                                         const unsigned int i) const;
 
   /**
    * Return the unit normal vector of a face of the reference cell.
@@ -753,7 +770,20 @@ public:
    */
   template <int dim>
   Tensor<1, dim>
-  unit_normal_vectors(const unsigned int face_no) const;
+  face_normal_vector(const unsigned int face_no) const;
+
+  /**
+   * Return the unit normal vector of a face of the reference cell.
+   *
+   * @pre The template argument `dim` must equal the dimension
+   *   of the space in which the reference cell you are querying
+   *   lives (i.e., it must equal the result of get_dimension()).
+   *
+   * @deprecated Use face_normal_vector() instead.
+   */
+  template <int dim>
+  DEAL_II_DEPRECATED_EARLY_WITH_COMMENT("Use face_normal_vector() instead.")
+  Tensor<1, dim> unit_normal_vectors(const unsigned int face_no) const;
 
   /**
    * Return the number of orientations for a face in the ReferenceCell. For
@@ -3119,6 +3149,16 @@ template <int dim>
 inline Tensor<1, dim>
 ReferenceCell::unit_tangential_vectors(const unsigned int face_no,
                                        const unsigned int i) const
+{
+  return face_tangent_vector<dim>(face_no, i);
+}
+
+
+
+template <int dim>
+inline Tensor<1, dim>
+ReferenceCell::face_tangent_vector(const unsigned int face_no,
+                                   const unsigned int i) const
 {
   Assert(dim == get_dimension(),
          ExcMessage("You can only call this function with arguments for "
@@ -3204,6 +3244,15 @@ ReferenceCell::unit_tangential_vectors(const unsigned int face_no,
 template <int dim>
 inline Tensor<1, dim>
 ReferenceCell::unit_normal_vectors(const unsigned int face_no) const
+{
+  return face_normal_vector<dim>(face_no);
+}
+
+
+
+template <int dim>
+inline Tensor<1, dim>
+ReferenceCell::face_normal_vector(const unsigned int face_no) const
 {
   Assert(dim == get_dimension(),
          ExcMessage("You can only call this function with arguments for "
@@ -3222,12 +3271,12 @@ ReferenceCell::unit_normal_vectors(const unsigned int face_no) const
       Assert(*this == ReferenceCells::Triangle, ExcInternalError());
 
       // Return the rotated vector
-      return cross_product_2d(unit_tangential_vectors<dim>(face_no, 0));
+      return cross_product_2d(face_tangent_vector<dim>(face_no, 0));
     }
   else if (dim == 3)
     {
-      return cross_product_3d(unit_tangential_vectors<dim>(face_no, 0),
-                              unit_tangential_vectors<dim>(face_no, 1));
+      return cross_product_3d(face_tangent_vector<dim>(face_no, 0),
+                              face_tangent_vector<dim>(face_no, 1));
     }
 
   DEAL_II_NOT_IMPLEMENTED();
index f06ffb89973fdd33804a8425457e1995e16752e3..563045675c808becb8e68ee8808eda1b5898f7ef 100644 (file)
@@ -157,14 +157,13 @@ MappingFE<dim, spacedim>::InternalData::initialize_face(
           unit_tangentials[i].resize(n_original_q_points);
           std::fill(unit_tangentials[i].begin(),
                     unit_tangentials[i].end(),
-                    reference_cell.template unit_tangential_vectors<dim>(i, 0));
+                    reference_cell.template face_tangent_vector<dim>(i, 0));
           if (dim > 2)
             {
               unit_tangentials[n_faces + i].resize(n_original_q_points);
-              std::fill(
-                unit_tangentials[n_faces + i].begin(),
-                unit_tangentials[n_faces + i].end(),
-                reference_cell.template unit_tangential_vectors<dim>(i, 1));
+              std::fill(unit_tangentials[n_faces + i].begin(),
+                        unit_tangentials[n_faces + i].end(),
+                        reference_cell.template face_tangent_vector<dim>(i, 1));
             }
         }
     }
index b13539d37e1a3a0c4c49ce1f72fa01f30d4f4d26..b8e4f2a0585da0df8273c2634deeaa219800cdb4 100644 (file)
@@ -604,10 +604,9 @@ MappingFEField<dim, spacedim, VectorType>::compute_face_data(
           for (unsigned int i = 0; i < n_faces; ++i)
             {
               data.unit_tangentials[i].resize(n_original_q_points);
-              std::fill(
-                data.unit_tangentials[i].begin(),
-                data.unit_tangentials[i].end(),
-                reference_cell.template unit_tangential_vectors<dim>(i, 0));
+              std::fill(data.unit_tangentials[i].begin(),
+                        data.unit_tangentials[i].end(),
+                        reference_cell.template face_tangent_vector<dim>(i, 0));
               if (dim > 2)
                 {
                   data.unit_tangentials[n_faces + i].resize(
@@ -615,7 +614,7 @@ MappingFEField<dim, spacedim, VectorType>::compute_face_data(
                   std::fill(
                     data.unit_tangentials[n_faces + i].begin(),
                     data.unit_tangentials[n_faces + i].end(),
-                    reference_cell.template unit_tangential_vectors<dim>(i, 1));
+                    reference_cell.template face_tangent_vector<dim>(i, 1));
                 }
             }
         }
index a80a54fac1f71c89fc7e031932b574a3d7413990..3a6a8d65db4658731974687a0a1d17ee0c885eff 100644 (file)
@@ -42,7 +42,7 @@ test_face(const std::vector<Point<3>>    &vertices_,
       face_n, i, numbers::default_geometric_orientation));
 
   extra_vertex /= 3.0;
-  extra_vertex += ref_cell.template unit_normal_vectors<3>(face_n);
+  extra_vertex += ref_cell.template face_normal_vector<3>(face_n);
 
   vertices.push_back(extra_vertex);
 
index fae603c31db0076c560b57aaf5e210251e714096..3704c6e5ef91a63f73a538a9b02637cd2e16c4f6 100644 (file)
@@ -60,7 +60,7 @@ create_triangulation(const std::vector<Point<3>>    &vertices_,
       face_n, i, numbers::default_geometric_orientation));
 
   extra_vertex /= 3.0;
-  extra_vertex += ref_cell.template unit_normal_vectors<3>(face_n);
+  extra_vertex += ref_cell.template face_normal_vector<3>(face_n);
 
   vertices.push_back(extra_vertex);
 
index fd88d06541e9adceaba2b0a47615546a4fe91921..a115116ff155d32e7bfac1e3ceb32952d8c573f5 100644 (file)
@@ -13,7 +13,7 @@
 // ------------------------------------------------------------------------
 
 
-// Test ReferenceCell::unit_tangential_vectors() and ::unit_normal_vectors()
+// Test ReferenceCell::face_tangent_vector() and ::face_normal_vector()
 // for all reference-cell types.
 
 
@@ -30,12 +30,11 @@ test(const ReferenceCell &reference_cell)
 {
   for (const auto face_no : reference_cell.face_indices())
     {
-      deallog << reference_cell.template unit_normal_vectors<dim>(face_no)
+      deallog << reference_cell.template face_normal_vector<dim>(face_no)
               << std::endl;
 
       for (unsigned int i = 0; i < dim - 1; ++i)
-        deallog << reference_cell.template unit_tangential_vectors<dim>(face_no,
-                                                                        i)
+        deallog << reference_cell.template face_tangent_vector<dim>(face_no, i)
                 << std::endl;
     }
   deallog << std::endl;

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.