From 121ecf772dccea4527ee6ef4247b10ca7d079dfd Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 4 Nov 2016 10:49:55 -0600 Subject: [PATCH] Rename function arguments. The Nedelec class used 'degree' in a few places, but it was really the 'order' of the element. The polynomial degree as used in the base class is 'order+1'. --- include/deal.II/fe/fe_nedelec.h | 9 +++-- source/fe/fe_nedelec.cc | 59 +++++++++++++++++---------------- 2 files changed, 36 insertions(+), 32 deletions(-) diff --git a/include/deal.II/fe/fe_nedelec.h b/include/deal.II/fe/fe_nedelec.h index e01bd960f7..6e085d44ab 100644 --- a/include/deal.II/fe/fe_nedelec.h +++ b/include/deal.II/fe/fe_nedelec.h @@ -112,9 +112,12 @@ class FE_Nedelec : public FE_PolyTensor, dim> { public: /** - * Constructor for the Nédélec element of degree @p p. + * Constructor for the Nédélec element of given @p order. + * The maximal polynomial degree of the shape functions is + * order+1 (in each variable; the total polynomial degree + * may be higher). */ - FE_Nedelec (const unsigned int p); + FE_Nedelec (const unsigned int order); /** * Return a string that uniquely identifies a finite element. This class @@ -290,7 +293,7 @@ private: * class and fill the tables with interpolation weights (#boundary_weights * and interior_weights). Called from the constructor. */ - void initialize_support_points (const unsigned int degree); + void initialize_support_points (const unsigned int order); /** * Initialize the interpolation from functions on refined mesh cells onto diff --git a/source/fe/fe_nedelec.cc b/source/fe/fe_nedelec.cc index 1ef22756d3..85cbc3a981 100644 --- a/source/fe/fe_nedelec.cc +++ b/source/fe/fe_nedelec.cc @@ -59,14 +59,15 @@ namespace internal template -FE_Nedelec::FE_Nedelec (const unsigned int p) : +FE_Nedelec::FE_Nedelec (const unsigned int order) + : FE_PolyTensor, dim> - (p, - FiniteElementData (get_dpo_vector (p), dim, p + 1, + (order, + FiniteElementData (get_dpo_vector (order), dim, order + 1, FiniteElementData::Hcurl), - std::vector (PolynomialsNedelec::compute_n_pols (p), true), + std::vector (PolynomialsNedelec::compute_n_pols (order), true), std::vector - (PolynomialsNedelec::compute_n_pols (p), + (PolynomialsNedelec::compute_n_pols (order), std::vector (dim, true))) { #ifdef DEBUG_NEDELEC @@ -82,7 +83,7 @@ FE_Nedelec::FE_Nedelec (const unsigned int p) : // generalized support points and // quadrature weights, since they // are required for interpolation. - initialize_support_points (p); + initialize_support_points (order); this->inverse_node_matrix.reinit (n_dofs, n_dofs); this->inverse_node_matrix.fill (FullMatrix (IdentityMatrix (n_dofs))); @@ -104,7 +105,7 @@ FE_Nedelec::FE_Nedelec (const unsigned int p) : FETools::compute_face_embedding_matrices (*this, face_embeddings, 0, 0, - internal::get_embedding_computation_tolerance(p)); + internal::get_embedding_computation_tolerance(order)); switch (dim) { @@ -235,22 +236,22 @@ FE_Nedelec<1>::initialize_support_points (const unsigned int) template <> void -FE_Nedelec<2>::initialize_support_points (const unsigned int degree) +FE_Nedelec<2>::initialize_support_points (const unsigned int order) { const int dim = 2; // Create polynomial basis. const std::vector > &lobatto_polynomials - = Polynomials::Lobatto::generate_complete_basis (degree + 1); + = Polynomials::Lobatto::generate_complete_basis (order + 1); std::vector > - lobatto_polynomials_grad (degree + 1); + lobatto_polynomials_grad (order + 1); for (unsigned int i = 0; i < lobatto_polynomials_grad.size (); ++i) lobatto_polynomials_grad[i] = lobatto_polynomials[i + 1].derivative (); // Initialize quadratures to obtain // quadrature points later on. - const QGauss reference_edge_quadrature (degree + 1); + const QGauss reference_edge_quadrature (order + 1); const unsigned int n_edge_points = reference_edge_quadrature.size (); const unsigned int n_boundary_points = GeometryInfo::lines_per_cell * n_edge_points; @@ -264,17 +265,17 @@ FE_Nedelec<2>::initialize_support_points (const unsigned int degree) this->generalized_face_support_points[q_point] = reference_edge_quadrature.point (q_point); - if (degree > 0) + if (order > 0) { // If the polynomial degree is positive // we have support points on the faces // and in the interior of a cell. - const QGauss quadrature (degree + 1); + const QGauss quadrature (order + 1); const unsigned int &n_interior_points = quadrature.size (); this->generalized_support_points.resize (n_boundary_points + n_interior_points); - boundary_weights.reinit (n_edge_points, degree); + boundary_weights.reinit (n_edge_points, order); for (unsigned int q_point = 0; q_point < n_edge_points; ++q_point) @@ -287,7 +288,7 @@ FE_Nedelec<2>::initialize_support_points (const unsigned int degree) (QProjector::DataSetDescriptor::face (line, true, false, false, n_edge_points) + q_point); - for (unsigned int i = 0; i < degree; ++i) + for (unsigned int i = 0; i < order; ++i) boundary_weights (q_point, i) = reference_edge_quadrature.weight (q_point) * lobatto_polynomials_grad[i + 1].value @@ -322,43 +323,43 @@ FE_Nedelec<2>::initialize_support_points (const unsigned int degree) template <> void -FE_Nedelec<3>::initialize_support_points (const unsigned int degree) +FE_Nedelec<3>::initialize_support_points (const unsigned int order) { const int dim = 3; // Create polynomial basis. const std::vector > &lobatto_polynomials - = Polynomials::Lobatto::generate_complete_basis (degree + 1); + = Polynomials::Lobatto::generate_complete_basis (order + 1); std::vector > - lobatto_polynomials_grad (degree + 1); + lobatto_polynomials_grad (order + 1); for (unsigned int i = 0; i < lobatto_polynomials_grad.size (); ++i) lobatto_polynomials_grad[i] = lobatto_polynomials[i + 1].derivative (); // Initialize quadratures to obtain // quadrature points later on. - const QGauss<1> reference_edge_quadrature (degree + 1); + const QGauss<1> reference_edge_quadrature (order + 1); const unsigned int &n_edge_points = reference_edge_quadrature.size (); const Quadrature& edge_quadrature = QProjector::project_to_all_faces (reference_edge_quadrature); - if (degree > 0) + if (order > 0) { - // If the polynomial degree is positive + // If the polynomial order is positive // we have support points on the edges, // faces and in the interior of a cell. - const QGauss reference_face_quadrature (degree + 1); + const QGauss reference_face_quadrature (order + 1); const unsigned int &n_face_points = reference_face_quadrature.size (); const unsigned int n_boundary_points = GeometryInfo::lines_per_cell * n_edge_points + GeometryInfo::faces_per_cell * n_face_points; - const QGauss quadrature (degree + 1); + const QGauss quadrature (order + 1); const unsigned int &n_interior_points = quadrature.size (); boundary_weights.reinit (n_edge_points + n_face_points, - 2 * (degree + 1) * degree); + 2 * (order + 1) * order); this->generalized_face_support_points.resize (4 * n_edge_points + n_face_points); this->generalized_support_points.resize @@ -395,7 +396,7 @@ FE_Nedelec<3>::initialize_support_points (const unsigned int degree) reference_edge_quadrature.point (q_point) (0)); } - for (unsigned int i = 0; i < degree; ++i) + for (unsigned int i = 0; i < order; ++i) boundary_weights (q_point, i) = reference_edge_quadrature.weight (q_point) * lobatto_polynomials_grad[i + 1].value @@ -410,11 +411,11 @@ FE_Nedelec<3>::initialize_support_points (const unsigned int degree) + 4 * n_edge_points] = reference_face_quadrature.point (q_point); - for (unsigned int i = 0; i <= degree; ++i) - for (unsigned int j = 0; j < degree; ++j) + for (unsigned int i = 0; i <= order; ++i) + for (unsigned int j = 0; j < order; ++j) { boundary_weights (q_point + n_edge_points, - 2 * (i * degree + j)) + 2 * (i * order + j)) = reference_face_quadrature.weight (q_point) * lobatto_polynomials_grad[i].value (this->generalized_face_support_points @@ -423,7 +424,7 @@ FE_Nedelec<3>::initialize_support_points (const unsigned int degree) (this->generalized_face_support_points [q_point + 4 * n_edge_points] (1)); boundary_weights (q_point + n_edge_points, - 2 * (i * degree + j) + 1) + 2 * (i * order + j) + 1) = reference_face_quadrature.weight (q_point) * lobatto_polynomials_grad[i].value (this->generalized_face_support_points -- 2.39.5