From: Wolfgang Bangerth Date: Wed, 29 Jan 2025 17:25:43 +0000 (-0700) Subject: Avoid several more uses of GeometryInfo. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc8b4b702a6e5f6318d58d59a5889c2065082040;p=dealii.git Avoid several more uses of GeometryInfo. --- diff --git a/source/fe/fe_dgp_nonparametric.cc b/source/fe/fe_dgp_nonparametric.cc index 34aa5df4f1..69e78b7ab9 100644 --- a/source/fe/fe_dgp_nonparametric.cc +++ b/source/fe/fe_dgp_nonparametric.cc @@ -61,8 +61,8 @@ FE_DGPNonparametric::FE_DGPNonparametric( // implemented so far continue; - const unsigned int nc = - GeometryInfo::n_children(RefinementCase(ref_case)); + const unsigned int nc = this->reference_cell().template n_children( + RefinementCase(ref_case)); for (unsigned int i = 0; i < nc; ++i) { this->prolongation[ref_case - 1][i].reinit(n_dofs, n_dofs); diff --git a/source/fe/fe_dgq.cc b/source/fe/fe_dgq.cc index ffd2dc6a02..c068a1989a 100644 --- a/source/fe/fe_dgq.cc +++ b/source/fe/fe_dgq.cc @@ -430,7 +430,8 @@ FE_DGQ::get_prolongation_matrix( Assert(refinement_case != RefinementCase::no_refinement, ExcMessage( "Prolongation matrices are only available for refined cells!")); - AssertIndexRange(child, GeometryInfo::n_children(refinement_case)); + AssertIndexRange( + child, this->reference_cell().template n_children(refinement_case)); // initialization upon first request if (this->prolongation[refinement_case - 1][child].n() == 0) @@ -451,7 +452,8 @@ FE_DGQ::get_prolongation_matrix( std::vector>> isotropic_matrices( RefinementCase::isotropic_refinement); isotropic_matrices.back().resize( - GeometryInfo::n_children(RefinementCase(refinement_case)), + this->reference_cell().template n_children( + RefinementCase(refinement_case)), FullMatrix(this->n_dofs_per_cell(), this->n_dofs_per_cell())); if (dim == spacedim) @@ -506,7 +508,8 @@ FE_DGQ::get_restriction_matrix( Assert(refinement_case != RefinementCase::no_refinement, ExcMessage( "Restriction matrices are only available for refined cells!")); - AssertIndexRange(child, GeometryInfo::n_children(refinement_case)); + AssertIndexRange( + child, this->reference_cell().template n_children(refinement_case)); // initialization upon first request if (this->restriction[refinement_case - 1][child].n() == 0) @@ -527,7 +530,8 @@ FE_DGQ::get_restriction_matrix( std::vector>> isotropic_matrices( RefinementCase::isotropic_refinement); isotropic_matrices.back().resize( - GeometryInfo::n_children(RefinementCase(refinement_case)), + this->reference_cell().template n_children( + RefinementCase(refinement_case)), FullMatrix(this->n_dofs_per_cell(), this->n_dofs_per_cell())); if (dim == spacedim) diff --git a/source/fe/fe_nedelec.cc b/source/fe/fe_nedelec.cc index ef7f533b19..03e731201a 100644 --- a/source/fe/fe_nedelec.cc +++ b/source/fe/fe_nedelec.cc @@ -3375,7 +3375,8 @@ FE_Nedelec::get_prolongation_matrix( Assert(refinement_case != RefinementCase::no_refinement, ExcMessage( "Prolongation matrices are only available for refined cells!")); - AssertIndexRange(child, GeometryInfo::n_children(refinement_case)); + AssertIndexRange( + child, this->reference_cell().template n_children(refinement_case)); // initialization upon first request if (this->prolongation[refinement_case - 1][child].n() == 0) @@ -3430,8 +3431,9 @@ FE_Nedelec::get_restriction_matrix( Assert(refinement_case != RefinementCase::no_refinement, ExcMessage( "Restriction matrices are only available for refined cells!")); - AssertIndexRange( - child, GeometryInfo::n_children(RefinementCase(refinement_case))); + AssertIndexRange(child, + this->reference_cell().template n_children( + RefinementCase(refinement_case))); // initialization upon first request if (this->restriction[refinement_case - 1][child].n() == 0) diff --git a/source/fe/fe_nedelec_sz.cc b/source/fe/fe_nedelec_sz.cc index df5b3644a1..a60a787c9b 100644 --- a/source/fe/fe_nedelec_sz.cc +++ b/source/fe/fe_nedelec_sz.cc @@ -3334,7 +3334,8 @@ FE_NedelecSZ::get_prolongation_matrix( Assert(refinement_case != RefinementCase::no_refinement, ExcMessage( "Prolongation matrices are only available for refined cells!")); - AssertIndexRange(child, GeometryInfo::n_children(refinement_case)); + AssertIndexRange( + child, this->reference_cell().template n_children(refinement_case)); // initialization upon first request if (this->prolongation[refinement_case - 1][child].n() == 0) diff --git a/source/fe/fe_q_base.cc b/source/fe/fe_q_base.cc index 240bf5f811..4bd1ab1c53 100644 --- a/source/fe/fe_q_base.cc +++ b/source/fe/fe_q_base.cc @@ -1244,7 +1244,8 @@ FE_Q_Base::get_prolongation_matrix( Assert(refinement_case != RefinementCase::no_refinement, ExcMessage( "Prolongation matrices are only available for refined cells!")); - AssertIndexRange(child, GeometryInfo::n_children(refinement_case)); + AssertIndexRange( + child, this->reference_cell().template n_children(refinement_case)); // initialization upon first request if (this->prolongation[refinement_case - 1][child].n() == 0) @@ -1443,7 +1444,8 @@ FE_Q_Base::get_restriction_matrix( Assert(refinement_case != RefinementCase::no_refinement, ExcMessage( "Restriction matrices are only available for refined cells!")); - AssertIndexRange(child, GeometryInfo::n_children(refinement_case)); + AssertIndexRange( + child, this->reference_cell().template n_children(refinement_case)); // initialization upon first request if (this->restriction[refinement_case - 1][child].n() == 0) @@ -1557,7 +1559,7 @@ FE_Q_Base::get_restriction_matrix( if (q_dofs_per_cell < this->n_dofs_per_cell()) my_restriction(this->n_dofs_per_cell() - 1, this->n_dofs_per_cell() - 1) = - 1. / GeometryInfo::n_children( + 1. / this->reference_cell().template n_children( RefinementCase(refinement_case)); } diff --git a/source/fe/fe_q_bubbles.cc b/source/fe/fe_q_bubbles.cc index 7ed79ffb47..441ec19831 100644 --- a/source/fe/fe_q_bubbles.cc +++ b/source/fe/fe_q_bubbles.cc @@ -98,7 +98,8 @@ namespace internal ++ref_case) { const unsigned int nc = - GeometryInfo::n_children(RefinementCase(ref_case)); + fe.reference_cell().template n_children( + RefinementCase(ref_case)); for (unsigned int i = 0; i < nc; ++i) { @@ -471,7 +472,8 @@ FE_Q_Bubbles::get_prolongation_matrix( Assert(refinement_case != RefinementCase::no_refinement, ExcMessage( "Prolongation matrices are only available for refined cells!")); - AssertIndexRange(child, GeometryInfo::n_children(refinement_case)); + AssertIndexRange( + child, this->reference_cell().template n_children(refinement_case)); Assert(this->prolongation[refinement_case - 1][child].n() != 0, ExcMessage("This prolongation matrix has not been computed yet!")); @@ -492,7 +494,8 @@ FE_Q_Bubbles::get_restriction_matrix( Assert(refinement_case != RefinementCase::no_refinement, ExcMessage( "Restriction matrices are only available for refined cells!")); - AssertIndexRange(child, GeometryInfo::n_children(refinement_case)); + AssertIndexRange( + child, this->reference_cell().template n_children(refinement_case)); Assert(this->restriction[refinement_case - 1][child].n() != 0, ExcMessage("This restriction matrix has not been computed yet!")); diff --git a/source/fe/fe_q_hierarchical.cc b/source/fe/fe_q_hierarchical.cc index b9c637a206..074a5c3f4e 100644 --- a/source/fe/fe_q_hierarchical.cc +++ b/source/fe/fe_q_hierarchical.cc @@ -209,7 +209,8 @@ FE_Q_Hierarchical::get_prolongation_matrix( ExcMessage( "Prolongation matrices are only available for isotropic refinement!")); - AssertIndexRange(child, GeometryInfo::n_children(refinement_case)); + AssertIndexRange( + child, this->reference_cell().template n_children(refinement_case)); return this->prolongation[refinement_case - 1][child]; } diff --git a/source/fe/fe_raviart_thomas.cc b/source/fe/fe_raviart_thomas.cc index 3585e105a2..4449d51a8d 100644 --- a/source/fe/fe_raviart_thomas.cc +++ b/source/fe/fe_raviart_thomas.cc @@ -208,7 +208,7 @@ FE_RaviartThomas::initialize_support_points(const unsigned int deg) QProjector::project_to_all_faces(this->reference_cell(), face_points); - for (; current < GeometryInfo::faces_per_cell * n_face_points; + for (; current < this->reference_cell().n_faces() * n_face_points; ++current) { // Enter the support point into the vector diff --git a/source/fe/fe_raviart_thomas_nodal.cc b/source/fe/fe_raviart_thomas_nodal.cc index 75a245f67c..33c0c5c7ee 100644 --- a/source/fe/fe_raviart_thomas_nodal.cc +++ b/source/fe/fe_raviart_thomas_nodal.cc @@ -677,7 +677,8 @@ FE_RaviartThomasNodal::get_prolongation_matrix( Assert(refinement_case != RefinementCase::no_refinement, ExcMessage( "Prolongation matrices are only available for refined cells!")); - AssertIndexRange(child, GeometryInfo::n_children(refinement_case)); + AssertIndexRange( + child, this->reference_cell().template n_children(refinement_case)); // initialization upon first request if (this->prolongation[refinement_case - 1][child].n() == 0) @@ -698,7 +699,8 @@ FE_RaviartThomasNodal::get_prolongation_matrix( std::vector>> isotropic_matrices( RefinementCase::isotropic_refinement); isotropic_matrices.back().resize( - GeometryInfo::n_children(RefinementCase(refinement_case)), + this->reference_cell().template n_children( + RefinementCase(refinement_case)), FullMatrix(this->n_dofs_per_cell(), this->n_dofs_per_cell())); FETools::compute_embedding_matrices(*this, isotropic_matrices, true); @@ -735,7 +737,8 @@ FE_RaviartThomasNodal::get_restriction_matrix( Assert(refinement_case != RefinementCase::no_refinement, ExcMessage( "Restriction matrices are only available for refined cells!")); - AssertIndexRange(child, GeometryInfo::n_children(refinement_case)); + AssertIndexRange( + child, this->reference_cell().template n_children(refinement_case)); // initialization upon first request if (this->restriction[refinement_case - 1][child].n() == 0) @@ -756,7 +759,8 @@ FE_RaviartThomasNodal::get_restriction_matrix( std::vector>> isotropic_matrices( RefinementCase::isotropic_refinement); isotropic_matrices.back().resize( - GeometryInfo::n_children(RefinementCase(refinement_case)), + this->reference_cell().template n_children( + RefinementCase(refinement_case)), FullMatrix(this->n_dofs_per_cell(), this->n_dofs_per_cell())); FETools::compute_projection_matrices(*this, isotropic_matrices, true); diff --git a/source/fe/fe_rt_bubbles.cc b/source/fe/fe_rt_bubbles.cc index bf72375dcb..598564db24 100644 --- a/source/fe/fe_rt_bubbles.cc +++ b/source/fe/fe_rt_bubbles.cc @@ -71,8 +71,8 @@ FE_RT_Bubbles::FE_RT_Bubbles(const unsigned int deg) RefinementCase::all_refinement_cases()) if (ref_case != RefinementCase::no_refinement) { - const unsigned int nc = - GeometryInfo::n_children(RefinementCase(ref_case)); + const unsigned int nc = this->reference_cell().template n_children( + RefinementCase(ref_case)); for (unsigned int i = 0; i < nc; ++i) this->prolongation[ref_case - 1][i].reinit(n_dofs, n_dofs); diff --git a/source/fe/mapping_cartesian.cc b/source/fe/mapping_cartesian.cc index 2bb5977b7e..04e752a27d 100644 --- a/source/fe/mapping_cartesian.cc +++ b/source/fe/mapping_cartesian.cc @@ -383,7 +383,8 @@ MappingCartesian::maybe_update_normal_vectors( Assert(face_no < GeometryInfo::faces_per_cell, ExcInternalError()); std::fill(normal_vectors.begin(), normal_vectors.end(), - GeometryInfo::unit_normal_vector[face_no]); + ReferenceCells::get_hypercube() + .template face_normal_vector(face_no)); } }