]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Deprecate (bool, bool, bool) QProjector functions.
authorDavid Wells <drwells@email.unc.edu>
Sat, 30 Mar 2024 11:57:44 +0000 (07:57 -0400)
committerDavid Wells <drwells@email.unc.edu>
Mon, 1 Apr 2024 13:09:58 +0000 (09:09 -0400)
include/deal.II/base/qprojector.h
source/base/qprojector.cc

index 9a0a36237fba1515d1a7f252d9038b82506a5d43..9b2585b024808d1396b88cdd5be9526968fff837 100644 (file)
@@ -301,7 +301,13 @@ public:
      * The last argument denotes the number of quadrature points the
      * lower-dimensional face quadrature formula (the one that has been
      * projected onto the faces) has.
+     *
+     * @deprecated Use the version of this function which takes a
+     * combined_orientation argument instead.
      */
+    DEAL_II_DEPRECATED_EARLY_WITH_COMMENT(
+      "Use the version of this function which takes a combined_orientation "
+      "argument instead.")
     static DataSetDescriptor
     face(const ReferenceCell &reference_cell,
          const unsigned int   face_no,
@@ -310,10 +316,32 @@ public:
          const bool           face_rotation,
          const unsigned int   n_quadrature_points);
 
+    /**
+     * Static function to generate an offset object for a given face of a cell
+     * with the given combined face orientation. This function of course is only
+     * allowed if <tt>dim>=2</tt>, and @p combined_orientation is ignored if the
+     * space dimension equals 2.
+     *
+     * @p n_quadrature_points is the number of quadrature points the
+     * lower-dimensional face quadrature formula (the one that has been
+     * projected onto the faces) has.
+     */
+    static DataSetDescriptor
+    face(const ReferenceCell &reference_cell,
+         const unsigned int   face_no,
+         const unsigned char  combined_orientation,
+         const unsigned int   n_quadrature_points);
+
     /**
      * Like the above function but taking a quadrature collection, enabling
      * that each face might have different number of quadrature points.
+     *
+     * @deprecated Use the version of this function which takes a
+     * combined_orientation argument instead.
      */
+    DEAL_II_DEPRECATED_EARLY_WITH_COMMENT(
+      "Use the version of this function which takes a combined_orientation "
+      "argument instead.")
     static DataSetDescriptor
     face(const ReferenceCell            &reference_cell,
          const unsigned int              face_no,
@@ -322,6 +350,16 @@ public:
          const bool                      face_rotation,
          const hp::QCollection<dim - 1> &quadrature);
 
+    /**
+     * Like the above function but taking a quadrature collection, enabling
+     * that each face might have different number of quadrature points.
+     */
+    static DataSetDescriptor
+    face(const ReferenceCell            &reference_cell,
+         const unsigned int              face_no,
+         const unsigned char             combined_orientation,
+         const hp::QCollection<dim - 1> &quadrature);
+
     /**
      * Static function to generate an offset object for a given subface of a
      * cell with the given face orientation, flip and rotation. This function
@@ -333,7 +371,13 @@ public:
      * projected onto the faces) has.
      *
      * Through the last argument anisotropic refinement can be respected.
+     *
+     * @deprecated Use the version of this function which takes a
+     * combined_orientation argument instead.
      */
+    DEAL_II_DEPRECATED_EARLY_WITH_COMMENT(
+      "Use the version of this function which takes a combined_orientation "
+      "argument instead.")
     static DataSetDescriptor
     subface(const ReferenceCell             &reference_cell,
             const unsigned int               face_no,
@@ -345,6 +389,27 @@ public:
             const internal::SubfaceCase<dim> ref_case =
               internal::SubfaceCase<dim>::case_isotropic);
 
+    /**
+     * Static function to generate an offset object for a given subface of a
+     * cell with the given combined face orientation. This function of course is
+     * only allowed if <tt>dim>=2</tt>, and the orientation is ignored if the
+     * space dimension equals 2.
+     *
+     * @p n_quadrature_points denotes the number of quadrature points the
+     * lower-dimensional face quadrature formula (the one that has been
+     * projected onto the faces) has.
+     *
+     * Through the last argument anisotropic refinement can be respected.
+     */
+    static DataSetDescriptor
+    subface(const ReferenceCell             &reference_cell,
+            const unsigned int               face_no,
+            const unsigned int               subface_no,
+            const unsigned char              combined_orientation,
+            const unsigned int               n_quadrature_points,
+            const internal::SubfaceCase<dim> ref_case =
+              internal::SubfaceCase<dim>::case_isotropic);
+
     /**
      * Conversion operator to an integer denoting the offset of the first
      * element of this dataset in the set of quadrature formulas all projected
index ed827b0b391919dead2f29d2e67c0313dc996846..0f6c8817e534cd0d15f799e98e45b05ca6e6d912 100644 (file)
@@ -1322,10 +1322,26 @@ QProjector<dim>::DataSetDescriptor::face(const ReferenceCell &reference_cell,
                                          const bool           face_rotation,
                                          const unsigned int n_quadrature_points)
 {
-  const unsigned char combined_orientation =
-    internal::combined_face_orientation(face_orientation,
-                                        face_rotation,
-                                        face_flip);
+  return face(reference_cell,
+              face_no,
+              internal::combined_face_orientation(face_orientation,
+                                                  face_rotation,
+                                                  face_flip),
+              n_quadrature_points);
+}
+
+
+
+template <int dim>
+typename QProjector<dim>::DataSetDescriptor
+QProjector<dim>::DataSetDescriptor::face(
+  const ReferenceCell &reference_cell,
+  const unsigned int   face_no,
+  const unsigned char  combined_orientation,
+  const unsigned int   n_quadrature_points)
+{
+  const auto [face_orientation, face_rotation, face_flip] =
+    internal::split_face_orientation(combined_orientation);
   // TODO: once we move to representing the default orientation as 0 (instead of
   // 1) we can get rid of the dim = 1 check
   Assert(dim == 1 ||
@@ -1424,17 +1440,33 @@ QProjector<dim>::DataSetDescriptor::face(
   const bool                      face_rotation,
   const hp::QCollection<dim - 1> &quadrature)
 {
+  return face(reference_cell,
+              face_no,
+              internal::combined_face_orientation(face_orientation,
+                                                  face_rotation,
+                                                  face_flip),
+              quadrature);
+}
+
+
+
+template <int dim>
+typename QProjector<dim>::DataSetDescriptor
+QProjector<dim>::DataSetDescriptor::face(
+  const ReferenceCell            &reference_cell,
+  const unsigned int              face_no,
+  const unsigned char             combined_orientation,
+  const hp::QCollection<dim - 1> &quadrature)
+{
+  const auto [face_orientation, face_rotation, face_flip] =
+    internal::split_face_orientation(combined_orientation);
+
   if (reference_cell == ReferenceCells::Triangle ||
       reference_cell == ReferenceCells::Tetrahedron ||
       reference_cell == ReferenceCells::Wedge ||
       reference_cell == ReferenceCells::Pyramid)
     {
       unsigned int offset = 0;
-
-      const unsigned char combined_orientation =
-        internal::combined_face_orientation(face_orientation,
-                                            face_rotation,
-                                            face_flip);
       Assert(combined_orientation < reference_cell.n_face_orientations(face_no),
              ExcInternalError());
 
@@ -1555,6 +1587,31 @@ QProjector<dim>::DataSetDescriptor::face(
 
 
 
+template <int dim>
+typename QProjector<dim>::DataSetDescriptor
+QProjector<dim>::DataSetDescriptor::subface(
+  const ReferenceCell             &reference_cell,
+  const unsigned int               face_no,
+  const unsigned int               subface_no,
+  const bool                       face_orientation,
+  const bool                       face_flip,
+  const bool                       face_rotation,
+  const unsigned int               n_quadrature_points,
+  const internal::SubfaceCase<dim> ref_case)
+{
+  return QProjector<dim>::DataSetDescriptor::subface(
+    reference_cell,
+    face_no,
+    subface_no,
+    internal::combined_face_orientation(face_orientation,
+                                        face_rotation,
+                                        face_flip),
+    n_quadrature_points,
+    ref_case);
+}
+
+
+
 template <>
 QProjector<1>::DataSetDescriptor
 QProjector<1>::DataSetDescriptor::subface(

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.