From: David Wells Date: Sat, 15 Feb 2025 16:37:59 +0000 (-0500) Subject: Avoid calling the deprecated version of project_to_subface(). X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb9c36a778de680da30c28a25c059ffae37a3e83;p=dealii.git Avoid calling the deprecated version of project_to_subface(). --- diff --git a/include/deal.II/fe/fe_tools.templates.h b/include/deal.II/fe/fe_tools.templates.h index 15431416f3..77442f4897 100644 --- a/include/deal.II/fe/fe_tools.templates.h +++ b/include/deal.II/fe/fe_tools.templates.h @@ -1968,7 +1968,12 @@ namespace FETools ++cell_number) { const Quadrature q_coarse = QProjector::project_to_subface( - fe.reference_cell(), q_gauss, face_coarse, cell_number); + fe.reference_cell(), + q_gauss, + face_coarse, + cell_number, + numbers::default_geometric_orientation, + RefinementCase::isotropic_refinement); FEValues coarse(mapping, fe, q_coarse, update_values); typename Triangulation::active_cell_iterator fine_cell = diff --git a/source/fe/fe_abf.cc b/source/fe/fe_abf.cc index c93890a486..be10e3f6fc 100644 --- a/source/fe/fe_abf.cc +++ b/source/fe/fe_abf.cc @@ -382,7 +382,12 @@ FE_ABF::initialize_restriction() // evaluated on the subface // only. Quadrature q_sub = QProjector::project_to_subface( - this->reference_cell(), q_base, face, sub); + this->reference_cell(), + q_base, + face, + sub, + numbers::default_geometric_orientation, + RefinementCase::isotropic_refinement); const unsigned int child = GeometryInfo::child_cell_on_face( RefinementCase::isotropic_refinement, face, sub); diff --git a/source/fe/fe_bernstein.cc b/source/fe/fe_bernstein.cc index 145ffb5983..02764a88d9 100644 --- a/source/fe/fe_bernstein.cc +++ b/source/fe/fe_bernstein.cc @@ -158,10 +158,13 @@ FE_Bernstein::get_subface_interpolation_matrix( quad_face_support, 0, numbers::default_geometric_orientation) : - QProjector::project_to_subface(this->reference_cell(), - quad_face_support, - 0, - subface); + QProjector::project_to_subface( + this->reference_cell(), + quad_face_support, + 0, + subface, + numbers::default_geometric_orientation, + RefinementCase::isotropic_refinement); for (unsigned int i = 0; i < source_fe->n_dofs_per_face(face_no); ++i) { diff --git a/source/fe/fe_p1nc.cc b/source/fe/fe_p1nc.cc index 212ca1ef4a..6162aa925a 100644 --- a/source/fe/fe_p1nc.cc +++ b/source/fe/fe_p1nc.cc @@ -309,8 +309,13 @@ FE_P1NC::fill_fe_subface_values( const ndarray coeffs = get_linear_shape_coefficients(cell); // compute on the subface - const Quadrature<2> quadrature_on_subface = QProjector<2>::project_to_subface( - this->reference_cell(), quadrature, face_no, sub_no); + const Quadrature<2> quadrature_on_subface = + QProjector<2>::project_to_subface(this->reference_cell(), + quadrature, + face_no, + sub_no, + numbers::default_geometric_orientation, + RefinementCase<1>::isotropic_refinement); if (flags & update_values) for (unsigned int i = 0; i < quadrature_on_subface.size(); ++i) diff --git a/source/fe/fe_q_base.cc b/source/fe/fe_q_base.cc index 70cdd53d90..0084fa5e75 100644 --- a/source/fe/fe_q_base.cc +++ b/source/fe/fe_q_base.cc @@ -247,38 +247,38 @@ struct FE_Q_Base::Implementation if (q_deg > 1) { - const unsigned int n = q_deg - 1; - const double step = 1. / q_deg; - std::vector> line_support_points(n); + const unsigned int n = q_deg - 1; + const double step = 1. / q_deg; + std::vector> line_support_points(n); for (unsigned int i = 0; i < n; ++i) line_support_points[i][0] = (i + 1) * step; - const Quadrature qline(line_support_points); - - // auxiliary points in 2d - std::vector> p_line(n); + const Quadrature<1> qline(line_support_points); // Add nodes of lines interior in the "mother-face" + auto get_points = [&](const unsigned int face_no, + const unsigned int subface_no) { + return QProjector<2>::project_to_subface( + ReferenceCells::get_hypercube<2>(), + qline, + face_no, + subface_no, + numbers::default_geometric_orientation, + RefinementCase<1>::isotropic_refinement) + .get_points(); + }; // line 5: use line 9 - QProjector::project_to_subface( - ReferenceCells::get_hypercube(), qline, 0, 0, p_line); - for (unsigned int i = 0; i < n; ++i) - constraint_points.push_back(p_line[i] + Point(0.5, 0)); + for (const Point &p : get_points(0, 0)) + constraint_points.push_back(p + Point(0.5, 0)); // line 6: use line 10 - QProjector::project_to_subface( - ReferenceCells::get_hypercube(), qline, 0, 1, p_line); - for (unsigned int i = 0; i < n; ++i) - constraint_points.push_back(p_line[i] + Point(0.5, 0)); + for (const Point &p : get_points(0, 1)) + constraint_points.push_back(p + Point(0.5, 0)); // line 7: use line 13 - QProjector::project_to_subface( - ReferenceCells::get_hypercube(), qline, 2, 0, p_line); - for (unsigned int i = 0; i < n; ++i) - constraint_points.push_back(p_line[i] + Point(0, 0.5)); + for (const Point &p : get_points(2, 0)) + constraint_points.push_back(p + Point(0, 0.5)); // line 8: use line 14 - QProjector::project_to_subface( - ReferenceCells::get_hypercube(), qline, 2, 1, p_line); - for (unsigned int i = 0; i < n; ++i) - constraint_points.push_back(p_line[i] + Point(0, 0.5)); + for (const Point &p : get_points(2, 1)) + constraint_points.push_back(p + Point(0, 0.5)); // DoFs on bordering lines lines 9-16 for (unsigned int face = 0; @@ -288,12 +288,7 @@ struct FE_Q_Base::Implementation subface < GeometryInfo::max_children_per_face; ++subface) { - QProjector::project_to_subface( - ReferenceCells::get_hypercube(), - qline, - face, - subface, - p_line); + const auto p_line = get_points(face, subface); constraint_points.insert(constraint_points.end(), p_line.begin(), p_line.end()); @@ -672,10 +667,13 @@ FE_Q_Base::get_subface_interpolation_matrix( quad_face_support, 0, numbers::default_geometric_orientation) : - QProjector::project_to_subface(this->reference_cell(), - quad_face_support, - 0, - subface); + QProjector::project_to_subface( + this->reference_cell(), + quad_face_support, + 0, + subface, + numbers::default_geometric_orientation, + RefinementCase::isotropic_refinement); for (unsigned int i = 0; i < source_fe.n_dofs_per_face(face_no); ++i) { const Point &p = subface_quadrature.point(i); diff --git a/source/fe/fe_raviart_thomas.cc b/source/fe/fe_raviart_thomas.cc index ebdec7a3c2..8667afc104 100644 --- a/source/fe/fe_raviart_thomas.cc +++ b/source/fe/fe_raviart_thomas.cc @@ -490,7 +490,12 @@ FE_RaviartThomas::initialize_restriction() // evaluated on the subface // only. const Quadrature q_sub = QProjector::project_to_subface( - this->reference_cell(), q_base, face, sub); + this->reference_cell(), + q_base, + face, + sub, + numbers::default_geometric_orientation, + RefinementCase::isotropic_refinement); const unsigned int child = GeometryInfo::child_cell_on_face( RefinementCase::isotropic_refinement, face, sub); diff --git a/source/fe/fe_raviart_thomas_nodal.cc b/source/fe/fe_raviart_thomas_nodal.cc index d2abaf304e..4e9dbfb28d 100644 --- a/source/fe/fe_raviart_thomas_nodal.cc +++ b/source/fe/fe_raviart_thomas_nodal.cc @@ -623,10 +623,13 @@ FE_RaviartThomasNodal::get_subface_interpolation_matrix( // compute the interpolation matrix by simply taking the value at the // support points. const Quadrature subface_projection = - QProjector::project_to_subface(this->reference_cell(), - quad_face_support, - 0, - subface); + QProjector::project_to_subface( + this->reference_cell(), + quad_face_support, + 0, + subface, + numbers::default_geometric_orientation, + RefinementCase::isotropic_refinement); for (unsigned int i = 0; i < source_fe.n_dofs_per_face(face_no); ++i) { diff --git a/source/fe/fe_simplex_p.cc b/source/fe/fe_simplex_p.cc index 7035f3a23a..8c5daebd42 100644 --- a/source/fe/fe_simplex_p.cc +++ b/source/fe/fe_simplex_p.cc @@ -652,20 +652,21 @@ FE_SimplexPoly::get_subface_interpolation_matrix( const double eps = 2e-13 * this->degree * (dim - 1); - std::vector> subface_quadrature_points( - quad_face_support.size()); - QProjector::project_to_subface(this->reference_cell(), - quad_face_support, - face_no, - subface, - subface_quadrature_points); + const Quadrature subface_quadrature = + QProjector::project_to_subface( + this->reference_cell(), + quad_face_support, + face_no, + subface, + numbers::default_geometric_orientation, + RefinementCase::isotropic_refinement); for (unsigned int i = 0; i < source_fe.n_dofs_per_face(face_no); ++i) for (unsigned int j = 0; j < this->n_dofs_per_face(face_no); ++j) { double matrix_entry = this->shape_value(this->face_to_cell_index(j, 0), - subface_quadrature_points[i]); + subface_quadrature.point(i)); // Correct the interpolated value. I.e. if it is close to 1 or // 0, make it exactly 1 or 0. Unfortunately, this is required to