]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use new functions in FE_Q and MappingQEulerian
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Sun, 5 Apr 2020 14:09:11 +0000 (16:09 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Wed, 8 Apr 2020 10:22:16 +0000 (12:22 +0200)
source/fe/fe_q_base.cc
source/fe/mapping_q_eulerian.cc

index 14e5a3edcb7217b1fc14183a4907a0f40e754d25..4ab6de7034b6b490a439b38893a6d0709700413d 100644 (file)
@@ -42,31 +42,6 @@ namespace internal
   {
     namespace
     {
-      // get the renumbering for faces
-      template <int dim>
-      inline std::vector<unsigned int>
-      face_lexicographic_to_hierarchic_numbering(const unsigned int degree)
-      {
-        std::vector<unsigned int> dpo(dim, 1U);
-        for (unsigned int i = 1; i < dpo.size(); ++i)
-          dpo[i] = dpo[i - 1] * (degree - 1);
-        const dealii::FiniteElementData<dim - 1> face_data(dpo, 1, degree);
-        std::vector<unsigned int> face_renumber(face_data.dofs_per_cell);
-        FETools::lexicographic_to_hierarchic_numbering(face_data,
-                                                       face_renumber);
-        return face_renumber;
-      }
-
-      // dummy specialization for dim == 1 to avoid linker errors
-      template <>
-      inline std::vector<unsigned int>
-      face_lexicographic_to_hierarchic_numbering<1>(const unsigned int)
-      {
-        return std::vector<unsigned int>();
-      }
-
-
-
       // in get_restriction_matrix() and get_prolongation_matrix(), want to undo
       // tensorization on inner loops for performance reasons. this clears a
       // dim-array
@@ -208,8 +183,7 @@ struct FE_Q_Base<PolynomialType, xdim, xspacedim>::Implementation
     const std::vector<unsigned int> &index_map_inverse =
       fe.poly_space.get_numbering_inverse();
     const std::vector<unsigned int> face_index_map =
-      internal::FE_Q_Base::face_lexicographic_to_hierarchic_numbering<dim>(
-        q_deg);
+      FETools::lexicographic_to_hierarchic_numbering<dim - 1>(q_deg);
     Assert(std::abs(
              fe.poly_space.compute_value(index_map_inverse[0], Point<dim>()) -
              1.) < 1e-14,
@@ -344,8 +318,7 @@ struct FE_Q_Base<PolynomialType, xdim, xspacedim>::Implementation
     const std::vector<unsigned int> &index_map_inverse =
       fe.poly_space.get_numbering_inverse();
     const std::vector<unsigned int> face_index_map =
-      internal::FE_Q_Base::face_lexicographic_to_hierarchic_numbering<dim>(
-        q_deg);
+      FETools::lexicographic_to_hierarchic_numbering<dim - 1>(q_deg);
     Assert(std::abs(
              fe.poly_space.compute_value(index_map_inverse[0], Point<dim>()) -
              1.) < 1e-14,
@@ -468,9 +441,8 @@ FE_Q_Base<PolynomialType, dim, spacedim>::initialize(
          ExcInternalError());
 
   {
-    std::vector<unsigned int>    renumber(q_dofs_per_cell);
-    const FiniteElementData<dim> fe(get_dpo_vector(q_degree), 1, q_degree);
-    FETools::hierarchic_to_lexicographic_numbering(fe, renumber);
+    std::vector<unsigned int> renumber =
+      FETools::hierarchic_to_lexicographic_numbering<dim>(q_degree);
     for (unsigned int i = q_dofs_per_cell; i < this->dofs_per_cell; ++i)
       renumber.push_back(i);
     this->poly_space.set_numbering(renumber);
@@ -932,8 +904,7 @@ FE_Q_Base<PolynomialType, dim, spacedim>::initialize_unit_face_support_points(
 
   // find renumbering of faces and assign from values of quadrature
   const std::vector<unsigned int> face_index_map =
-    internal::FE_Q_Base::face_lexicographic_to_hierarchic_numbering<dim>(
-      q_degree);
+    FETools::lexicographic_to_hierarchic_numbering<dim - 1>(q_degree);
 
   // We can compute the support points by computing the tensor
   // product of the 1d set of points. We could do this by hand, but it's
index c22770c625fc271c5af6eebe87a88be63da17954..bfa18d4865fb284ff9d649d3874899999f9887c4 100644 (file)
@@ -106,15 +106,9 @@ MappingQEulerian<dim, VectorType, spacedim>::MappingQEulerianGeneric::
   const unsigned int       n_q_points = q_iterated.size();
 
   // we then need to define a renumbering vector that allows us to go from a
-  // lexicographic numbering scheme to a hierarchic one.  this fragment is
-  // taking almost verbatim from the MappingQ class.
-  std::vector<unsigned int> renumber(n_q_points);
-  std::vector<unsigned int> dpo(dim + 1, 1U);
-  for (unsigned int i = 1; i < dpo.size(); ++i)
-    dpo[i] = dpo[i - 1] * (map_degree - 1);
-
-  FETools::lexicographic_to_hierarchic_numbering(
-    FiniteElementData<dim>(dpo, 1, map_degree), renumber);
+  // lexicographic numbering scheme to a hierarchic one.
+  const std::vector<unsigned int> renumber =
+    FETools::lexicographic_to_hierarchic_numbering<dim>(map_degree);
 
   // finally we assign the quadrature points in the required order.
   for (unsigned int q = 0; q < n_q_points; ++q)

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.