From: David Wells Date: Sat, 23 Jan 2021 15:01:58 +0000 (-0500) Subject: Fix a variety of small simplex things. X-Git-Tag: v9.3.0-rc1~575^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11613%2Fhead;p=dealii.git Fix a variety of small simplex things. 1. Our convention is to still mark overridden methods as virtual. 2. convert_generalized_support_point_values_to_dof_values should be public. 3. Fix simplex reference tria generation in codimension 1. 4. Remove some hard-coded numbers. 5. Fix a quadrature weight. --- diff --git a/include/deal.II/simplex/fe_lib.h b/include/deal.II/simplex/fe_lib.h index a70a5cda07..f8b8688a89 100644 --- a/include/deal.II/simplex/fe_lib.h +++ b/include/deal.II/simplex/fe_lib.h @@ -48,7 +48,7 @@ namespace Simplex * Return a list of constant modes of the element. For this element, the * list consists of true arguments for all components. */ - std::pair, std::vector> + virtual std::pair, std::vector> get_constant_modes() const override; /** @@ -56,17 +56,16 @@ namespace Simplex * * @note Only implemented for RefinementCase::isotropic_refinement. */ - const FullMatrix & + virtual const FullMatrix & get_prolongation_matrix( const unsigned int child, const RefinementCase &refinement_case = RefinementCase::isotropic_refinement) const override; - private: /** * @copydoc dealii::FiniteElement::convert_generalized_support_point_values_to_dof_values() */ - void + virtual void convert_generalized_support_point_values_to_dof_values( const std::vector> &support_point_values, std::vector & nodal_values) const override; diff --git a/source/grid/reference_cell.cc b/source/grid/reference_cell.cc index 81a1820a09..2ce04c7d8e 100644 --- a/source/grid/reference_cell.cc +++ b/source/grid/reference_cell.cc @@ -75,8 +75,19 @@ namespace ReferenceCell } else if (reference_cell == Type::Tri) { - static const std::vector> vertices = { - {{0.0, 0.0}, {1.0, 0.0}, {0.0, 1.0}}}; + std::vector> vertices; + if (spacedim == 2) + { + vertices.emplace_back(0.0, 0.0); + vertices.emplace_back(1.0, 0.0); + vertices.emplace_back(0.0, 1.0); + } + else if (spacedim == 3) + { + vertices.emplace_back(0.0, 0.0, 0.0); + vertices.emplace_back(1.0, 0.0, 0.0); + vertices.emplace_back(0.0, 1.0, 0.0); + } std::vector> cells(1); cells[0].vertices = {0, 1, 2}; diff --git a/source/grid/tria_accessor.cc b/source/grid/tria_accessor.cc index 9574a90451..bf6f98c58f 100644 --- a/source/grid/tria_accessor.cc +++ b/source/grid/tria_accessor.cc @@ -1670,11 +1670,9 @@ TriaAccessor<3, 3, 3>::set_all_manifold_ids( // for hexes also set manifold_id // of bounding quads and lines - // Six bonding quads - for (unsigned int i = 0; i < 6; ++i) + for (unsigned int i : this->face_indices()) this->quad(i)->set_manifold_id(manifold_ind); - // Twelve bounding lines - for (unsigned int i = 0; i < 12; ++i) + for (unsigned int i : this->line_indices()) this->line(i)->set_manifold_id(manifold_ind); } diff --git a/source/simplex/quadrature_lib.cc b/source/simplex/quadrature_lib.cc index 2bb93a055f..6e8b9832ea 100644 --- a/source/simplex/quadrature_lib.cc +++ b/source/simplex/quadrature_lib.cc @@ -46,7 +46,7 @@ namespace Simplex { const double p = 1.0 / 3.0; this->quadrature_points.emplace_back(p, p); - this->weights.emplace_back(1.0); + this->weights.emplace_back(0.5); } else if (n_points_1D == 2) { diff --git a/tests/simplex/q_projection_01.output b/tests/simplex/q_projection_01.output index c2e3fc6765..ed748deec4 100644 --- a/tests/simplex/q_projection_01.output +++ b/tests/simplex/q_projection_01.output @@ -72,76 +72,76 @@ DEAL:2d-3::0.00000 0.500000 0.444444 DEAL:2d-3::0.00000 0.887298 0.277778 DEAL:2d-3:: DEAL:3d-1::face_no=0 face_orientation=true face_flip=false face_rotation=false: -DEAL:3d-1::0.333333 0.333333 0.00000 1.00000 +DEAL:3d-1::0.333333 0.333333 0.00000 0.500000 DEAL:3d-1:: DEAL:3d-1::face_no=0 face_orientation=true face_flip=true face_rotation=false: -DEAL:3d-1::0.333333 0.333333 0.00000 1.00000 +DEAL:3d-1::0.333333 0.333333 0.00000 0.500000 DEAL:3d-1:: DEAL:3d-1::face_no=0 face_orientation=true face_flip=false face_rotation=true: -DEAL:3d-1::0.333333 0.333333 0.00000 1.00000 +DEAL:3d-1::0.333333 0.333333 0.00000 0.500000 DEAL:3d-1:: DEAL:3d-1::face_no=0 face_orientation=false face_flip=false face_rotation=false: -DEAL:3d-1::0.333333 0.333333 0.00000 1.00000 +DEAL:3d-1::0.333333 0.333333 0.00000 0.500000 DEAL:3d-1:: DEAL:3d-1::face_no=0 face_orientation=false face_flip=true face_rotation=false: -DEAL:3d-1::0.333333 0.333333 0.00000 1.00000 +DEAL:3d-1::0.333333 0.333333 0.00000 0.500000 DEAL:3d-1:: DEAL:3d-1::face_no=0 face_orientation=false face_flip=false face_rotation=true: -DEAL:3d-1::0.333333 0.333333 0.00000 1.00000 +DEAL:3d-1::0.333333 0.333333 0.00000 0.500000 DEAL:3d-1:: DEAL:3d-1::face_no=1 face_orientation=true face_flip=false face_rotation=false: -DEAL:3d-1::0.333333 0.00000 0.333333 1.00000 +DEAL:3d-1::0.333333 0.00000 0.333333 0.500000 DEAL:3d-1:: DEAL:3d-1::face_no=1 face_orientation=true face_flip=true face_rotation=false: -DEAL:3d-1::0.333333 0.00000 0.333333 1.00000 +DEAL:3d-1::0.333333 0.00000 0.333333 0.500000 DEAL:3d-1:: DEAL:3d-1::face_no=1 face_orientation=true face_flip=false face_rotation=true: -DEAL:3d-1::0.333333 0.00000 0.333333 1.00000 +DEAL:3d-1::0.333333 0.00000 0.333333 0.500000 DEAL:3d-1:: DEAL:3d-1::face_no=1 face_orientation=false face_flip=false face_rotation=false: -DEAL:3d-1::0.333333 0.00000 0.333333 1.00000 +DEAL:3d-1::0.333333 0.00000 0.333333 0.500000 DEAL:3d-1:: DEAL:3d-1::face_no=1 face_orientation=false face_flip=true face_rotation=false: -DEAL:3d-1::0.333333 0.00000 0.333333 1.00000 +DEAL:3d-1::0.333333 0.00000 0.333333 0.500000 DEAL:3d-1:: DEAL:3d-1::face_no=1 face_orientation=false face_flip=false face_rotation=true: -DEAL:3d-1::0.333333 0.00000 0.333333 1.00000 +DEAL:3d-1::0.333333 0.00000 0.333333 0.500000 DEAL:3d-1:: DEAL:3d-1::face_no=2 face_orientation=true face_flip=false face_rotation=false: -DEAL:3d-1::0.00000 0.333333 0.333333 1.00000 +DEAL:3d-1::0.00000 0.333333 0.333333 0.500000 DEAL:3d-1:: DEAL:3d-1::face_no=2 face_orientation=true face_flip=true face_rotation=false: -DEAL:3d-1::0.00000 0.333333 0.333333 1.00000 +DEAL:3d-1::0.00000 0.333333 0.333333 0.500000 DEAL:3d-1:: DEAL:3d-1::face_no=2 face_orientation=true face_flip=false face_rotation=true: -DEAL:3d-1::0.00000 0.333333 0.333333 1.00000 +DEAL:3d-1::0.00000 0.333333 0.333333 0.500000 DEAL:3d-1:: DEAL:3d-1::face_no=2 face_orientation=false face_flip=false face_rotation=false: -DEAL:3d-1::0.00000 0.333333 0.333333 1.00000 +DEAL:3d-1::0.00000 0.333333 0.333333 0.500000 DEAL:3d-1:: DEAL:3d-1::face_no=2 face_orientation=false face_flip=true face_rotation=false: -DEAL:3d-1::0.00000 0.333333 0.333333 1.00000 +DEAL:3d-1::0.00000 0.333333 0.333333 0.500000 DEAL:3d-1:: DEAL:3d-1::face_no=2 face_orientation=false face_flip=false face_rotation=true: -DEAL:3d-1::0.00000 0.333333 0.333333 1.00000 +DEAL:3d-1::0.00000 0.333333 0.333333 0.500000 DEAL:3d-1:: DEAL:3d-1::face_no=3 face_orientation=true face_flip=false face_rotation=false: -DEAL:3d-1::0.333333 0.333333 0.333333 1.73205 +DEAL:3d-1::0.333333 0.333333 0.333333 0.866025 DEAL:3d-1:: DEAL:3d-1::face_no=3 face_orientation=true face_flip=true face_rotation=false: -DEAL:3d-1::0.333333 0.333333 0.333333 1.73205 +DEAL:3d-1::0.333333 0.333333 0.333333 0.866025 DEAL:3d-1:: DEAL:3d-1::face_no=3 face_orientation=true face_flip=false face_rotation=true: -DEAL:3d-1::0.333333 0.333333 0.333333 1.73205 +DEAL:3d-1::0.333333 0.333333 0.333333 0.866025 DEAL:3d-1:: DEAL:3d-1::face_no=3 face_orientation=false face_flip=false face_rotation=false: -DEAL:3d-1::0.333333 0.333333 0.333333 1.73205 +DEAL:3d-1::0.333333 0.333333 0.333333 0.866025 DEAL:3d-1:: DEAL:3d-1::face_no=3 face_orientation=false face_flip=true face_rotation=false: -DEAL:3d-1::0.333333 0.333333 0.333333 1.73205 +DEAL:3d-1::0.333333 0.333333 0.333333 0.866025 DEAL:3d-1:: DEAL:3d-1::face_no=3 face_orientation=false face_flip=false face_rotation=true: -DEAL:3d-1::0.333333 0.333333 0.333333 1.73205 +DEAL:3d-1::0.333333 0.333333 0.333333 0.866025 DEAL:3d-1:: DEAL:3d-4::face_no=0 face_orientation=true face_flip=false face_rotation=false: DEAL:3d-4::0.666667 0.166667 0.00000 0.166667 diff --git a/tests/simplex/quadrature_lib_01.output b/tests/simplex/quadrature_lib_01.output index 94888c477f..d2a4bff8c8 100644 --- a/tests/simplex/quadrature_lib_01.output +++ b/tests/simplex/quadrature_lib_01.output @@ -5,7 +5,7 @@ DEAL:1d-2::0.788675 0.500000 DEAL:1d-3::0.112702 0.277778 DEAL:1d-3::0.500000 0.444444 DEAL:1d-3::0.887298 0.277778 -DEAL:2d-1::0.333333 0.333333 1.00000 +DEAL:2d-1::0.333333 0.333333 0.50000 DEAL:2d-3::0.666667 0.166667 0.166667 DEAL:2d-3::0.166667 0.666667 0.166667 DEAL:2d-3::0.166667 0.166667 0.166667