From: Natalia Nebulishvili Date: Sun, 22 Jun 2025 15:20:10 +0000 (+0200) Subject: All previous issues were addressed X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F18576%2Fhead;p=dealii.git All previous issues were addressed --- diff --git a/include/deal.II/fe/fe_raviart_thomas.h b/include/deal.II/fe/fe_raviart_thomas.h index 46541cdd61..153f89d29c 100644 --- a/include/deal.II/fe/fe_raviart_thomas.h +++ b/include/deal.II/fe/fe_raviart_thomas.h @@ -148,9 +148,8 @@ public: * Compute the lexicographic to hierarchic numbering underlying this class, * necessary for the creation of the respective vector polynomial space. */ - std::vector - get_lexicographic_numbering(const unsigned int normal_degree, - const unsigned int tangential_degree) const; + static std::vector + get_lexicographic_numbering(const unsigned int degree); /** * This function returns @p true, if the shape function @p shape_index has @@ -360,14 +359,6 @@ public: virtual std::unique_ptr> clone() const override; - /** - * Compute the lexicographic to hierarchic numbering underlying this class, - * necessary for the creation of the respective vector polynomial space. - */ - std::vector - get_lexicographic_numbering(const unsigned int normal_degree, - const unsigned int tangential_degree) const; - virtual void get_face_interpolation_matrix(const FiniteElement &source, FullMatrix &matrix, diff --git a/include/deal.II/matrix_free/shape_info.templates.h b/include/deal.II/matrix_free/shape_info.templates.h index 8c852e76ff..8619ee71d7 100644 --- a/include/deal.II/matrix_free/shape_info.templates.h +++ b/include/deal.II/matrix_free/shape_info.templates.h @@ -268,8 +268,8 @@ namespace internal const unsigned int dofs_per_face_normal = fe_in.n_dofs_per_face(); lexicographic_numbering = - PolynomialsRaviartThomas::get_lexicographic_numbering( - fe_in.degree - 1); + FE_RaviartThomas::get_lexicographic_numbering(fe_in.degree - + 1); // To get the right shape_values of the RT element std::vector lex_normal, lex_tangent; diff --git a/source/fe/fe_raviart_thomas.cc b/source/fe/fe_raviart_thomas.cc index cadd78a4ac..6911821c4b 100644 --- a/source/fe/fe_raviart_thomas.cc +++ b/source/fe/fe_raviart_thomas.cc @@ -45,8 +45,7 @@ FE_RaviartThomas::FE_RaviartThomas(const unsigned int deg) : FE_PolyTensor( PolynomialsVectorAnisotropic(deg + 1, deg, - get_lexicographic_numbering(deg + 1, - deg)), + get_lexicographic_numbering(deg)), FiniteElementData(get_dpo_vector(deg), dim, deg + 1, @@ -700,45 +699,37 @@ FE_RaviartThomas::has_support_on_face(const unsigned int shape_index, template std::vector -FE_RaviartThomas::get_lexicographic_numbering( - const unsigned int normal_degree, - const unsigned int tangential_degree) const +FE_RaviartThomas::get_lexicographic_numbering(const unsigned int degree) { - const unsigned int n_dofs_face = - Utilities::pow(tangential_degree + 1, dim - 1); + const unsigned int n_dofs_face = Utilities::pow(degree + 1, dim - 1); std::vector lexicographic_numbering; // component 1 for (unsigned int j = 0; j < n_dofs_face; ++j) { lexicographic_numbering.push_back(j); - if (normal_degree > 1) - for (unsigned int i = n_dofs_face * 2 * dim; - i < n_dofs_face * 2 * dim + normal_degree - 1; - ++i) - lexicographic_numbering.push_back(i + j * (normal_degree - 1)); + for (unsigned int i = n_dofs_face * 2 * dim; + i < n_dofs_face * 2 * dim + degree; + ++i) + lexicographic_numbering.push_back(i + j * degree); lexicographic_numbering.push_back(n_dofs_face + j); } // component 2 - unsigned int layers = (dim == 3) ? tangential_degree + 1 : 1; + unsigned int layers = (dim == 3) ? degree + 1 : 1; for (unsigned int k = 0; k < layers; ++k) { - unsigned int k_add = k * (tangential_degree + 1); - for (unsigned int j = n_dofs_face * 2; - j < n_dofs_face * 2 + tangential_degree + 1; + unsigned int k_add = k * (degree + 1); + for (unsigned int j = n_dofs_face * 2; j < n_dofs_face * 2 + degree + 1; ++j) lexicographic_numbering.push_back(j + k_add); - if (normal_degree > 1) - for (unsigned int i = n_dofs_face * (2 * dim + (normal_degree - 1)); - i < n_dofs_face * (2 * dim + (normal_degree - 1)) + - (normal_degree - 1) * (tangential_degree + 1); - ++i) - { - lexicographic_numbering.push_back(i + k_add * tangential_degree); - } - for (unsigned int j = n_dofs_face * 3; - j < n_dofs_face * 3 + tangential_degree + 1; + for (unsigned int i = n_dofs_face * (2 * dim + degree); + i < n_dofs_face * (2 * dim + degree) + degree * (degree + 1); + ++i) + { + lexicographic_numbering.push_back(i + k_add * degree); + } + for (unsigned int j = n_dofs_face * 3; j < n_dofs_face * 3 + degree + 1; ++j) lexicographic_numbering.push_back(j + k_add); } @@ -748,12 +739,10 @@ FE_RaviartThomas::get_lexicographic_numbering( { for (unsigned int i = 4 * n_dofs_face; i < 5 * n_dofs_face; ++i) lexicographic_numbering.push_back(i); - if (normal_degree > 1) - for (unsigned int i = - 6 * n_dofs_face + n_dofs_face * 2 * (normal_degree - 1); - i < 6 * n_dofs_face + n_dofs_face * 3 * (normal_degree - 1); - ++i) - lexicographic_numbering.push_back(i); + for (unsigned int i = 6 * n_dofs_face + n_dofs_face * 2 * degree; + i < 6 * n_dofs_face + n_dofs_face * 3 * degree; + ++i) + lexicographic_numbering.push_back(i); for (unsigned int i = 5 * n_dofs_face; i < 6 * n_dofs_face; ++i) lexicographic_numbering.push_back(i); } diff --git a/source/fe/fe_raviart_thomas_nodal.cc b/source/fe/fe_raviart_thomas_nodal.cc index d259869236..28f3f41342 100644 --- a/source/fe/fe_raviart_thomas_nodal.cc +++ b/source/fe/fe_raviart_thomas_nodal.cc @@ -67,10 +67,10 @@ namespace template FE_RaviartThomasNodal::FE_RaviartThomasNodal(const unsigned int degree) : FE_PolyTensor( - PolynomialsVectorAnisotropic(degree + 1, - degree, - get_lexicographic_numbering(degree + 1, - degree)), + PolynomialsVectorAnisotropic( + degree + 1, + degree, + FE_RaviartThomas::get_lexicographic_numbering(degree)), FiniteElementData(get_rt_dpo_vector(dim, degree), dim, degree + 1, @@ -85,7 +85,7 @@ FE_RaviartThomasNodal::FE_RaviartThomasNodal(const unsigned int degree) this->mapping_kind = {mapping_raviart_thomas}; const std::vector numbering = - get_lexicographic_numbering(degree + 1, degree); + FE_RaviartThomas::get_lexicographic_numbering(degree); // First, initialize the generalized support points and quadrature weights, // since they are required for interpolation. @@ -242,71 +242,6 @@ FE_RaviartThomasNodal::has_support_on_face( -template -std::vector -FE_RaviartThomasNodal::get_lexicographic_numbering( - const unsigned int normal_degree, - const unsigned int tangential_degree) const -{ - const unsigned int n_dofs_face = - Utilities::pow(tangential_degree + 1, dim - 1); - std::vector lexicographic_numbering; - // component 1 - for (unsigned int j = 0; j < n_dofs_face; ++j) - { - lexicographic_numbering.push_back(j); - if (normal_degree > 1) - for (unsigned int i = n_dofs_face * 2 * dim; - i < n_dofs_face * 2 * dim + normal_degree - 1; - ++i) - lexicographic_numbering.push_back(i + j * (normal_degree - 1)); - lexicographic_numbering.push_back(n_dofs_face + j); - } - - // component 2 - unsigned int layers = (dim == 3) ? tangential_degree + 1 : 1; - for (unsigned int k = 0; k < layers; ++k) - { - unsigned int k_add = k * (tangential_degree + 1); - for (unsigned int j = n_dofs_face * 2; - j < n_dofs_face * 2 + tangential_degree + 1; - ++j) - lexicographic_numbering.push_back(j + k_add); - - if (normal_degree > 1) - for (unsigned int i = n_dofs_face * (2 * dim + (normal_degree - 1)); - i < n_dofs_face * (2 * dim + (normal_degree - 1)) + - (normal_degree - 1) * (tangential_degree + 1); - ++i) - { - lexicographic_numbering.push_back(i + k_add * tangential_degree); - } - for (unsigned int j = n_dofs_face * 3; - j < n_dofs_face * 3 + tangential_degree + 1; - ++j) - lexicographic_numbering.push_back(j + k_add); - } - - // component 3 - if (dim == 3) - { - for (unsigned int i = 4 * n_dofs_face; i < 5 * n_dofs_face; ++i) - lexicographic_numbering.push_back(i); - if (normal_degree > 1) - for (unsigned int i = - 6 * n_dofs_face + n_dofs_face * 2 * (normal_degree - 1); - i < 6 * n_dofs_face + n_dofs_face * 3 * (normal_degree - 1); - ++i) - lexicographic_numbering.push_back(i); - for (unsigned int i = 5 * n_dofs_face; i < 6 * n_dofs_face; ++i) - lexicographic_numbering.push_back(i); - } - - return lexicographic_numbering; -} - - - template void FE_RaviartThomasNodal::