]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid several more uses of GeometryInfo. 18055/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 29 Jan 2025 17:25:43 +0000 (10:25 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 29 Jan 2025 17:25:43 +0000 (10:25 -0700)
source/fe/fe_dgp_nonparametric.cc
source/fe/fe_dgq.cc
source/fe/fe_nedelec.cc
source/fe/fe_nedelec_sz.cc
source/fe/fe_q_base.cc
source/fe/fe_q_bubbles.cc
source/fe/fe_q_hierarchical.cc
source/fe/fe_raviart_thomas.cc
source/fe/fe_raviart_thomas_nodal.cc
source/fe/fe_rt_bubbles.cc
source/fe/mapping_cartesian.cc

index 34aa5df4f113f4c62361b3b796cbc6e28d7f18f5..69e78b7ab9d4b2ea6f5b50b46302fdc4e1adcb48 100644 (file)
@@ -61,8 +61,8 @@ FE_DGPNonparametric<dim, spacedim>::FE_DGPNonparametric(
           // implemented so far
           continue;
 
-        const unsigned int nc =
-          GeometryInfo<dim>::n_children(RefinementCase<dim>(ref_case));
+        const unsigned int nc = this->reference_cell().template n_children<dim>(
+          RefinementCase<dim>(ref_case));
         for (unsigned int i = 0; i < nc; ++i)
           {
             this->prolongation[ref_case - 1][i].reinit(n_dofs, n_dofs);
index ffd2dc6a02a8985385a466c19d4e39b2fe177fc1..c068a1989a6425b1b2966eba61a0a6daccd7878b 100644 (file)
@@ -430,7 +430,8 @@ FE_DGQ<dim, spacedim>::get_prolongation_matrix(
   Assert(refinement_case != RefinementCase<dim>::no_refinement,
          ExcMessage(
            "Prolongation matrices are only available for refined cells!"));
-  AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
+  AssertIndexRange(
+    child, this->reference_cell().template n_children<dim>(refinement_case));
 
   // initialization upon first request
   if (this->prolongation[refinement_case - 1][child].n() == 0)
@@ -451,7 +452,8 @@ FE_DGQ<dim, spacedim>::get_prolongation_matrix(
           std::vector<std::vector<FullMatrix<double>>> isotropic_matrices(
             RefinementCase<dim>::isotropic_refinement);
           isotropic_matrices.back().resize(
-            GeometryInfo<dim>::n_children(RefinementCase<dim>(refinement_case)),
+            this->reference_cell().template n_children<dim>(
+              RefinementCase<dim>(refinement_case)),
             FullMatrix<double>(this->n_dofs_per_cell(),
                                this->n_dofs_per_cell()));
           if (dim == spacedim)
@@ -506,7 +508,8 @@ FE_DGQ<dim, spacedim>::get_restriction_matrix(
   Assert(refinement_case != RefinementCase<dim>::no_refinement,
          ExcMessage(
            "Restriction matrices are only available for refined cells!"));
-  AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
+  AssertIndexRange(
+    child, this->reference_cell().template n_children<dim>(refinement_case));
 
   // initialization upon first request
   if (this->restriction[refinement_case - 1][child].n() == 0)
@@ -527,7 +530,8 @@ FE_DGQ<dim, spacedim>::get_restriction_matrix(
           std::vector<std::vector<FullMatrix<double>>> isotropic_matrices(
             RefinementCase<dim>::isotropic_refinement);
           isotropic_matrices.back().resize(
-            GeometryInfo<dim>::n_children(RefinementCase<dim>(refinement_case)),
+            this->reference_cell().template n_children<dim>(
+              RefinementCase<dim>(refinement_case)),
             FullMatrix<double>(this->n_dofs_per_cell(),
                                this->n_dofs_per_cell()));
           if (dim == spacedim)
index ef7f533b19c1b63e6cc03bfc3685eaeea04e2db7..03e731201a000117ff7aaa5ebdc4dce3fb786196 100644 (file)
@@ -3375,7 +3375,8 @@ FE_Nedelec<dim>::get_prolongation_matrix(
   Assert(refinement_case != RefinementCase<dim>::no_refinement,
          ExcMessage(
            "Prolongation matrices are only available for refined cells!"));
-  AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
+  AssertIndexRange(
+    child, this->reference_cell().template n_children<dim>(refinement_case));
 
   // initialization upon first request
   if (this->prolongation[refinement_case - 1][child].n() == 0)
@@ -3430,8 +3431,9 @@ FE_Nedelec<dim>::get_restriction_matrix(
   Assert(refinement_case != RefinementCase<dim>::no_refinement,
          ExcMessage(
            "Restriction matrices are only available for refined cells!"));
-  AssertIndexRange(
-    child, GeometryInfo<dim>::n_children(RefinementCase<dim>(refinement_case)));
+  AssertIndexRange(child,
+                   this->reference_cell().template n_children<dim>(
+                     RefinementCase<dim>(refinement_case)));
 
   // initialization upon first request
   if (this->restriction[refinement_case - 1][child].n() == 0)
index df5b3644a146311c8c2638e0552363f6b522138e..a60a787c9b75d5ca593935bd4ffad32a7ad0676e 100644 (file)
@@ -3334,7 +3334,8 @@ FE_NedelecSZ<dim, spacedim>::get_prolongation_matrix(
   Assert(refinement_case != RefinementCase<dim>::no_refinement,
          ExcMessage(
            "Prolongation matrices are only available for refined cells!"));
-  AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
+  AssertIndexRange(
+    child, this->reference_cell().template n_children<dim>(refinement_case));
 
   // initialization upon first request
   if (this->prolongation[refinement_case - 1][child].n() == 0)
index 240bf5f811f05941ed8d39f3718b011bb294b96a..4bd1ab1c536474737c2fbd0e43d2cb61f264fb52 100644 (file)
@@ -1244,7 +1244,8 @@ FE_Q_Base<dim, spacedim>::get_prolongation_matrix(
   Assert(refinement_case != RefinementCase<dim>::no_refinement,
          ExcMessage(
            "Prolongation matrices are only available for refined cells!"));
-  AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
+  AssertIndexRange(
+    child, this->reference_cell().template n_children<dim>(refinement_case));
 
   // initialization upon first request
   if (this->prolongation[refinement_case - 1][child].n() == 0)
@@ -1443,7 +1444,8 @@ FE_Q_Base<dim, spacedim>::get_restriction_matrix(
   Assert(refinement_case != RefinementCase<dim>::no_refinement,
          ExcMessage(
            "Restriction matrices are only available for refined cells!"));
-  AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
+  AssertIndexRange(
+    child, this->reference_cell().template n_children<dim>(refinement_case));
 
   // initialization upon first request
   if (this->restriction[refinement_case - 1][child].n() == 0)
@@ -1557,7 +1559,7 @@ FE_Q_Base<dim, spacedim>::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<dim>::n_children(
+              1. / this->reference_cell().template n_children<dim>(
                      RefinementCase<dim>(refinement_case));
         }
 
index 7ed79ffb47c944d043ab57732bf77ecc2fd94b7e..441ec198313039b5ae4a7187019998b8d3872a9f 100644 (file)
@@ -98,7 +98,8 @@ namespace internal
              ++ref_case)
           {
             const unsigned int nc =
-              GeometryInfo<dim>::n_children(RefinementCase<dim>(ref_case));
+              fe.reference_cell().template n_children<dim>(
+                RefinementCase<dim>(ref_case));
 
             for (unsigned int i = 0; i < nc; ++i)
               {
@@ -471,7 +472,8 @@ FE_Q_Bubbles<dim, spacedim>::get_prolongation_matrix(
   Assert(refinement_case != RefinementCase<dim>::no_refinement,
          ExcMessage(
            "Prolongation matrices are only available for refined cells!"));
-  AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
+  AssertIndexRange(
+    child, this->reference_cell().template n_children<dim>(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<dim, spacedim>::get_restriction_matrix(
   Assert(refinement_case != RefinementCase<dim>::no_refinement,
          ExcMessage(
            "Restriction matrices are only available for refined cells!"));
-  AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
+  AssertIndexRange(
+    child, this->reference_cell().template n_children<dim>(refinement_case));
 
   Assert(this->restriction[refinement_case - 1][child].n() != 0,
          ExcMessage("This restriction matrix has not been computed yet!"));
index b9c637a2067661dc4266a2d446010d767be177c7..074a5c3f4e3ed1c12a819c88d1d64c87010c5e85 100644 (file)
@@ -209,7 +209,8 @@ FE_Q_Hierarchical<dim>::get_prolongation_matrix(
     ExcMessage(
       "Prolongation matrices are only available for isotropic refinement!"));
 
-  AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
+  AssertIndexRange(
+    child, this->reference_cell().template n_children<dim>(refinement_case));
 
   return this->prolongation[refinement_case - 1][child];
 }
index 3585e105a2f74ba7c9f5260387c1821e489ccb9b..4449d51a8d3df6633c286b514913e4583e82fec1 100644 (file)
@@ -208,7 +208,7 @@ FE_RaviartThomas<dim>::initialize_support_points(const unsigned int deg)
         QProjector<dim>::project_to_all_faces(this->reference_cell(),
                                               face_points);
 
-      for (; current < GeometryInfo<dim>::faces_per_cell * n_face_points;
+      for (; current < this->reference_cell().n_faces() * n_face_points;
            ++current)
         {
           // Enter the support point into the vector
index 75a245f67c98068ea2f2a54344112ed1c587de6c..33c0c5c7eee2f136ca93539fd302f617f51eabf8 100644 (file)
@@ -677,7 +677,8 @@ FE_RaviartThomasNodal<dim>::get_prolongation_matrix(
   Assert(refinement_case != RefinementCase<dim>::no_refinement,
          ExcMessage(
            "Prolongation matrices are only available for refined cells!"));
-  AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
+  AssertIndexRange(
+    child, this->reference_cell().template n_children<dim>(refinement_case));
 
   // initialization upon first request
   if (this->prolongation[refinement_case - 1][child].n() == 0)
@@ -698,7 +699,8 @@ FE_RaviartThomasNodal<dim>::get_prolongation_matrix(
           std::vector<std::vector<FullMatrix<double>>> isotropic_matrices(
             RefinementCase<dim>::isotropic_refinement);
           isotropic_matrices.back().resize(
-            GeometryInfo<dim>::n_children(RefinementCase<dim>(refinement_case)),
+            this->reference_cell().template n_children<dim>(
+              RefinementCase<dim>(refinement_case)),
             FullMatrix<double>(this->n_dofs_per_cell(),
                                this->n_dofs_per_cell()));
           FETools::compute_embedding_matrices(*this, isotropic_matrices, true);
@@ -735,7 +737,8 @@ FE_RaviartThomasNodal<dim>::get_restriction_matrix(
   Assert(refinement_case != RefinementCase<dim>::no_refinement,
          ExcMessage(
            "Restriction matrices are only available for refined cells!"));
-  AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
+  AssertIndexRange(
+    child, this->reference_cell().template n_children<dim>(refinement_case));
 
   // initialization upon first request
   if (this->restriction[refinement_case - 1][child].n() == 0)
@@ -756,7 +759,8 @@ FE_RaviartThomasNodal<dim>::get_restriction_matrix(
           std::vector<std::vector<FullMatrix<double>>> isotropic_matrices(
             RefinementCase<dim>::isotropic_refinement);
           isotropic_matrices.back().resize(
-            GeometryInfo<dim>::n_children(RefinementCase<dim>(refinement_case)),
+            this->reference_cell().template n_children<dim>(
+              RefinementCase<dim>(refinement_case)),
             FullMatrix<double>(this->n_dofs_per_cell(),
                                this->n_dofs_per_cell()));
           FETools::compute_projection_matrices(*this, isotropic_matrices, true);
index bf72375dcb95c2478bb852e8e84ff824b7628210..598564db24248551585328e0ac26bf5ecf591c04 100644 (file)
@@ -71,8 +71,8 @@ FE_RT_Bubbles<dim>::FE_RT_Bubbles(const unsigned int deg)
        RefinementCase<dim>::all_refinement_cases())
     if (ref_case != RefinementCase<dim>::no_refinement)
       {
-        const unsigned int nc =
-          GeometryInfo<dim>::n_children(RefinementCase<dim>(ref_case));
+        const unsigned int nc = this->reference_cell().template n_children<dim>(
+          RefinementCase<dim>(ref_case));
 
         for (unsigned int i = 0; i < nc; ++i)
           this->prolongation[ref_case - 1][i].reinit(n_dofs, n_dofs);
index 2bb5977b7e79bd0af3fde042fcb41809e2386a29..04e752a27d03477a89badc9cc7e2fc2b2d145221 100644 (file)
@@ -383,7 +383,8 @@ MappingCartesian<dim, spacedim>::maybe_update_normal_vectors(
       Assert(face_no < GeometryInfo<dim>::faces_per_cell, ExcInternalError());
       std::fill(normal_vectors.begin(),
                 normal_vectors.end(),
-                GeometryInfo<dim>::unit_normal_vector[face_no]);
+                ReferenceCells::get_hypercube<dim>()
+                  .template face_normal_vector<dim>(face_no));
     }
 }
 

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.