From 65c89f163c140daa9dfdee524984d3cfe71c9ed0 Mon Sep 17 00:00:00 2001 From: Simon Sticko Date: Wed, 2 Jun 2021 15:24:37 +0200 Subject: [PATCH] Add a 0-dimensional face support point on FE_Q<1>. In several places QProjector is used to map the dim-1 dimensional face support points to dim dimensional points, but this is not possible in 1D because unit_face_support_points currently contains no points for FE_Q<1>. Add a single 0-dimensional point to unit_face_support_points to fix this. --- source/fe/fe_q_base.cc | 9 +++++---- tests/fe/fe_data_test.output | 6 +++--- tests/fe/fe_support_points_q.cc | 2 ++ tests/fe/fe_support_points_q.output | 10 ++++++++++ 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/source/fe/fe_q_base.cc b/source/fe/fe_q_base.cc index 10ceee4f0a..f0eb0cd8e0 100644 --- a/source/fe/fe_q_base.cc +++ b/source/fe/fe_q_base.cc @@ -978,10 +978,6 @@ void FE_Q_Base::initialize_unit_face_support_points( const std::vector> &points) { - // no faces in 1d, so nothing to do - if (dim == 1) - return; - // TODO: the implementation makes the assumption that all faces have the // same number of dofs AssertDimension(this->n_unique_faces(), 1); @@ -990,6 +986,11 @@ FE_Q_Base::initialize_unit_face_support_points( this->unit_face_support_points[face_no].resize( Utilities::fixed_power(q_degree + 1)); + // In 1D, there is only one 0-dimensional support point, so there is nothing + // more to be done. + if (dim == 1) + return; + // find renumbering of faces and assign from values of quadrature const std::vector face_index_map = FETools::lexicographic_to_hierarchic_numbering(q_degree); diff --git a/tests/fe/fe_data_test.output b/tests/fe/fe_data_test.output index 95b0ee1f0b..e1f992eb8b 100644 --- a/tests/fe/fe_data_test.output +++ b/tests/fe/fe_data_test.output @@ -50,7 +50,7 @@ DEAL::blocks=1:[2]->2 DEAL::degree=1 DEAL::conformity= Hcurl Hdiv H1 DEAL::unit_support_points=2 -DEAL::unit_face_support_points=0 +DEAL::unit_face_support_points=1 DEAL::generalized_support_points=2 DEAL::face_to_equivalent_cell_index: 0 DEAL::face_to_cell_index: 0 @@ -76,7 +76,7 @@ DEAL::blocks=1:[3]->3 DEAL::degree=2 DEAL::conformity= Hcurl Hdiv H1 DEAL::unit_support_points=3 -DEAL::unit_face_support_points=0 +DEAL::unit_face_support_points=1 DEAL::generalized_support_points=3 DEAL::face_to_equivalent_cell_index: 0 DEAL::face_to_cell_index: 0 @@ -102,7 +102,7 @@ DEAL::blocks=1:[5]->5 DEAL::degree=4 DEAL::conformity= Hcurl Hdiv H1 DEAL::unit_support_points=5 -DEAL::unit_face_support_points=0 +DEAL::unit_face_support_points=1 DEAL::generalized_support_points=5 DEAL::face_to_equivalent_cell_index: 0 DEAL::face_to_cell_index: 0 diff --git a/tests/fe/fe_support_points_q.cc b/tests/fe/fe_support_points_q.cc index 5c2a4250a9..b97018df0f 100644 --- a/tests/fe/fe_support_points_q.cc +++ b/tests/fe/fe_support_points_q.cc @@ -25,6 +25,8 @@ main() { initlog(); + CHECK_ALL(Q, 1, 1); + CHECK_ALL(Q, 1, 2); CHECK_ALL(Q, 2, 2); CHECK_ALL(Q, 3, 2); diff --git a/tests/fe/fe_support_points_q.output b/tests/fe/fe_support_points_q.output index 11cc9484c5..c3532a4277 100644 --- a/tests/fe/fe_support_points_q.output +++ b/tests/fe/fe_support_points_q.output @@ -1,4 +1,14 @@ +DEAL::Q1<1> cell support points +DEAL::0.00 +DEAL::1.00 +DEAL::Q1<1> face 0 support points +DEAL::0.00 +DEAL::Q1<1> face 1 support points +DEAL::1.00 +DEAL::Q1<1> cell generalized support points +DEAL::0.00 +DEAL::1.00 DEAL::Q1<2> cell support points DEAL::0.00 0.00 DEAL::1.00 0.00 -- 2.39.5