From d2ef16ba1ba681f120e9ce4070c97105e6842539 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Fri, 25 Dec 2020 13:10:54 +0100 Subject: [PATCH] Pyramid/wedge: diverse fixes --- include/deal.II/grid/reference_cell.h | 10 +++++-- source/base/qprojector.cc | 24 ++++++++-------- source/fe/mapping_fe.cc | 28 +++++++++---------- source/simplex/fe_lib.cc | 4 +-- ...ilinos=true.with_simplex_support=on.output | 6 ++-- ...ilinos=true.with_simplex_support=on.output | 6 ++-- 6 files changed, 42 insertions(+), 36 deletions(-) diff --git a/include/deal.II/grid/reference_cell.h b/include/deal.II/grid/reference_cell.h index 28a314d2b4..b9c2816f7c 100644 --- a/include/deal.II/grid/reference_cell.h +++ b/include/deal.II/grid/reference_cell.h @@ -887,8 +887,14 @@ namespace ReferenceCell standard_line_to_face_and_line_index( const unsigned int line) const override { - static const std::array table[6] = { - {{0, 0}}, {{0, 1}}, {{0, 2}}, {{1, 1}}, {{1, 2}}, {{2, 1}}}; + static const std::array table[8] = {{{0, 0}}, + {{0, 1}}, + {{0, 2}}, + {{0, 3}}, + {{1, 2}}, + {{2, 1}}, + {{1, 1}}, + {{2, 2}}}; return table[line]; } diff --git a/source/base/qprojector.cc b/source/base/qprojector.cc index b0cd657d78..3a33573303 100644 --- a/source/base/qprojector.cc +++ b/source/base/qprojector.cc @@ -693,7 +693,7 @@ QProjector<3>::project_to_all_faces( } }; - const auto process = [&](const auto faces) { + const auto process = [&](const auto &faces) { // new (projected) quadrature points and weights std::vector> points; std::vector weights; @@ -825,14 +825,19 @@ QProjector<3>::project_to_all_faces( else if (reference_cell_type == ReferenceCell::Type::Wedge) { const std::vector>, double>> faces = { - {{{{Point<3>(0.0, 1.0, 0.0), - Point<3>(1.0, 0.0, 0.0), - Point<3>(0.0, 0.0, 0.0)}}, + {{{{Point<3>(1.0, 0.0, 0.0), + Point<3>(0.0, 0.0, 0.0), + Point<3>(0.0, 1.0, 0.0)}}, 0.5}, - {{{Point<3>(1.0, 0.0, 1.0), - Point<3>(0.0, 1.0, 1.0), - Point<3>(0.0, 0.0, 1.0)}}, + {{{Point<3>(0.0, 0.0, 1.0), + Point<3>(1.0, 0.0, 1.0), + Point<3>(0.0, 1.0, 1.0)}}, 0.5}, + {{{Point<3>(0.0, 0.0, 0.0), + Point<3>(1.0, 0.0, 0.0), + Point<3>(0.0, 0.0, 1.0), + Point<3>(1.0, 0.0, 1.0)}}, + 1.0}, {{{Point<3>(1.0, 0.0, 0.0), Point<3>(0.0, 1.0, 0.0), Point<3>(1.0, 0.0, 1.0), @@ -842,11 +847,6 @@ QProjector<3>::project_to_all_faces( Point<3>(0.0, 0.0, 0.0), Point<3>(0.0, 1.0, 1.0), Point<3>(0.0, 0.0, 1.0)}}, - 1.0}, - {{{Point<3>(0.0, 0.0, 0.0), - Point<3>(1.0, 0.0, 0.0), - Point<3>(0.0, 0.0, 1.0), - Point<3>(1.0, 0.0, 1.0)}}, 1.0}}}; return process(faces); diff --git a/source/fe/mapping_fe.cc b/source/fe/mapping_fe.cc index 169f944bf5..7921ebfd07 100644 --- a/source/fe/mapping_fe.cc +++ b/source/fe/mapping_fe.cc @@ -282,8 +282,8 @@ MappingFE::InternalData::initialize_face( unit_tangentials[6].emplace_back(t1); // face 2 - t1[d0] = -1 / std::sqrt(2.0); - t1[d1] = +1 / std::sqrt(2.0); + t1[d0] = 1; + t1[d1] = 0; t1[d2] = 0; for (unsigned int i = 0; i < n_original_q_points; i++) unit_tangentials[2].emplace_back(t1); @@ -296,30 +296,30 @@ MappingFE::InternalData::initialize_face( unit_tangentials[7].emplace_back(t1); // face 3 - t1[d0] = +0; - t1[d1] = +0; - t1[d2] = +1; + t1[d0] = -1 / std::sqrt(2.0); + t1[d1] = +1 / std::sqrt(2.0); + t1[d2] = 0; for (unsigned int i = 0; i < n_original_q_points; i++) unit_tangentials[3].emplace_back(t1); // face 3 - t1[d0] = +0; - t1[d1] = +1; - t1[d2] = +0; + t1[d0] = 0; + t1[d1] = 0; + t1[d2] = 1; for (unsigned int i = 0; i < n_original_q_points; i++) unit_tangentials[8].emplace_back(t1); // face 4 - t1[d0] = 1; - t1[d1] = 0; - t1[d2] = 0; + t1[d0] = +0; + t1[d1] = +0; + t1[d2] = +1; for (unsigned int i = 0; i < n_original_q_points; i++) unit_tangentials[4].emplace_back(t1); // face 4 - t1[d0] = 0; - t1[d1] = 0; - t1[d2] = 1; + t1[d0] = +0; + t1[d1] = +1; + t1[d2] = +0; for (unsigned int i = 0; i < n_original_q_points; i++) unit_tangentials[9].emplace_back(t1); } diff --git a/source/simplex/fe_lib.cc b/source/simplex/fe_lib.cc index 91dbf2e260..587b91e83c 100644 --- a/source/simplex/fe_lib.cc +++ b/source/simplex/fe_lib.cc @@ -511,12 +511,12 @@ namespace Simplex if (degree == 1) { + this->unit_support_points.emplace_back(0.0, 0.0, 0.0); this->unit_support_points.emplace_back(1.0, 0.0, 0.0); this->unit_support_points.emplace_back(0.0, 1.0, 0.0); - this->unit_support_points.emplace_back(0.0, 0.0, 0.0); + this->unit_support_points.emplace_back(0.0, 0.0, 1.0); this->unit_support_points.emplace_back(1.0, 0.0, 1.0); this->unit_support_points.emplace_back(0.0, 1.0, 1.0); - this->unit_support_points.emplace_back(0.0, 0.0, 1.0); } } diff --git a/tests/simplex/poisson_01.mpirun=1.with_trilinos=true.with_simplex_support=on.output b/tests/simplex/poisson_01.mpirun=1.with_trilinos=true.with_simplex_support=on.output index 1df99dcc92..afde6fa7c6 100644 --- a/tests/simplex/poisson_01.mpirun=1.with_trilinos=true.with_simplex_support=on.output +++ b/tests/simplex/poisson_01.mpirun=1.with_trilinos=true.with_simplex_support=on.output @@ -25,9 +25,9 @@ DEAL:: with 134 CG iterations needed to obtain convergence DEAL:: DEAL::Solve problem on WEDGE mesh: DEAL:: on parallel::fullydistributed::Triangulation -DEAL:cg::Starting value 0.0561953 -DEAL:cg::Convergence step 197 value 8.61398e-13 -DEAL:: with 197 CG iterations needed to obtain convergence +DEAL:cg::Starting value 0.0576447 +DEAL:cg::Convergence step 196 value 8.95502e-13 +DEAL:: with 196 CG iterations needed to obtain convergence DEAL:: DEAL::Solve problem on PYRAMID mesh: DEAL:: on parallel::fullydistributed::Triangulation diff --git a/tests/simplex/poisson_01.mpirun=4.with_trilinos=true.with_simplex_support=on.output b/tests/simplex/poisson_01.mpirun=4.with_trilinos=true.with_simplex_support=on.output index 6c0ab9a4a1..18ba5d0158 100644 --- a/tests/simplex/poisson_01.mpirun=4.with_trilinos=true.with_simplex_support=on.output +++ b/tests/simplex/poisson_01.mpirun=4.with_trilinos=true.with_simplex_support=on.output @@ -25,9 +25,9 @@ DEAL:: with 134 CG iterations needed to obtain convergence DEAL:: DEAL::Solve problem on WEDGE mesh: DEAL:: on parallel::fullydistributed::Triangulation -DEAL:cg::Starting value 0.0561953 -DEAL:cg::Convergence step 197 value 8.60684e-13 -DEAL:: with 197 CG iterations needed to obtain convergence +DEAL:cg::Starting value 0.0576447 +DEAL:cg::Convergence step 196 value 8.89749e-13 +DEAL:: with 196 CG iterations needed to obtain convergence DEAL:: DEAL::Solve problem on PYRAMID mesh: DEAL:: on parallel::fullydistributed::Triangulation -- 2.39.5