From 0d78af105eb7bbbb01d9dc9b10fdc3771e362cc3 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 30 Mar 2024 07:57:44 -0400 Subject: [PATCH] Deprecate (bool, bool, bool) QProjector functions. --- include/deal.II/base/qprojector.h | 65 +++++++++++++++++++++++++++ source/base/qprojector.cc | 75 +++++++++++++++++++++++++++---- 2 files changed, 131 insertions(+), 9 deletions(-) diff --git a/include/deal.II/base/qprojector.h b/include/deal.II/base/qprojector.h index 9a0a36237f..9b2585b024 100644 --- a/include/deal.II/base/qprojector.h +++ b/include/deal.II/base/qprojector.h @@ -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 dim>=2, 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 &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 &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 ref_case = internal::SubfaceCase::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 dim>=2, 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 ref_case = + internal::SubfaceCase::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 diff --git a/source/base/qprojector.cc b/source/base/qprojector.cc index ed827b0b39..0f6c8817e5 100644 --- a/source/base/qprojector.cc +++ b/source/base/qprojector.cc @@ -1322,10 +1322,26 @@ QProjector::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 +typename QProjector::DataSetDescriptor +QProjector::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::DataSetDescriptor::face( const bool face_rotation, const hp::QCollection &quadrature) { + return face(reference_cell, + face_no, + internal::combined_face_orientation(face_orientation, + face_rotation, + face_flip), + quadrature); +} + + + +template +typename QProjector::DataSetDescriptor +QProjector::DataSetDescriptor::face( + const ReferenceCell &reference_cell, + const unsigned int face_no, + const unsigned char combined_orientation, + const hp::QCollection &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::DataSetDescriptor::face( +template +typename QProjector::DataSetDescriptor +QProjector::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 ref_case) +{ + return QProjector::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( -- 2.39.5