From b80d5d0dd48b04ea1aa6a7a7010fa32222f2cb0f Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Wed, 6 Apr 2016 19:58:45 +0200 Subject: [PATCH] Added normal to test. --- source/fe/mapping_manifold.cc | 12 +- source/grid/manifold.cc | 2 - tests/fe/mapping_manifold_06.cc | 30 ++++- tests/fe/mapping_manifold_06.output | 190 ++++++++++++++++++++++++++++ 4 files changed, 228 insertions(+), 6 deletions(-) diff --git a/source/fe/mapping_manifold.cc b/source/fe/mapping_manifold.cc index 0137b9e2b9..fa516e13d9 100644 --- a/source/fe/mapping_manifold.cc +++ b/source/fe/mapping_manifold.cc @@ -173,6 +173,7 @@ initialize_face (const UpdateFlags update_flags, } + template MappingManifold::MappingManifold () {} @@ -223,6 +224,7 @@ transform_unit_to_real_cell (const typename Triangulation::cell_it } + // In the code below, GCC tries to instantiate MappingManifold<3,4> when // seeing which of the overloaded versions of // do_transform_real_to_unit_cell_internal() to call. This leads to bad @@ -235,6 +237,7 @@ class MappingManifold<3,4> {}; + template UpdateFlags MappingManifold::requires_update_flags (const UpdateFlags in) const @@ -363,6 +366,8 @@ namespace internal return cell->get_manifold(); } + + /** * Some specialization for face Manifolds. The mapping argument is * only used to help the compiler infer dim and spacedim. @@ -376,6 +381,8 @@ namespace internal return cell->face(face_no)->get_manifold(); } + + /** * Compute the locations of quadrature points on the object described by * the first argument (and the cell for which the mapping support points @@ -404,6 +411,7 @@ namespace internal } + /** * Update the co- and contravariant matrices as well as their determinant, for the cell * described stored in the data object, but only if the update_flags of the @p data @@ -763,8 +771,8 @@ namespace internal if (subface_no!=numbers::invalid_unsigned_int) { - const double area_ratio=GeometryInfo::subface_ratio( - cell->subface_case(face_no), subface_no); + const double area_ratio=GeometryInfo::subface_ratio(cell->subface_case(face_no), + subface_no); output_data.JxW_values[i] *= area_ratio; } } diff --git a/source/grid/manifold.cc b/source/grid/manifold.cc index 361057fbf9..64ab4cddb5 100644 --- a/source/grid/manifold.cc +++ b/source/grid/manifold.cc @@ -423,8 +423,6 @@ get_new_point (const Quadrature &quad) const if (periodicity[d] > 0) for (unsigned int i=0; i tolerance) - minP[d] = std::min(minP[d], surrounding_points[i][d]); Assert( (surrounding_points[i][d] < periodicity[d]+tolerance*periodicity.norm()) || (surrounding_points[i][d] >= -tolerance*periodicity.norm()), ExcPeriodicBox(d, surrounding_points[i], periodicity, tolerance*periodicity.norm())); diff --git a/tests/fe/mapping_manifold_06.cc b/tests/fe/mapping_manifold_06.cc index c8bd6af93d..99c20549b3 100644 --- a/tests/fe/mapping_manifold_06.cc +++ b/tests/fe/mapping_manifold_06.cc @@ -52,8 +52,8 @@ void test() FE_Q fe(1); const QGauss quad(5); - FEFaceValues fe_v(map_manifold, fe, quad, - update_quadrature_points); + FEFaceValues fe_v(map_manifold, fe, quad, + update_quadrature_points | update_normal_vectors); out << "set size ratio -1" << std::endl << "set terminal aqua " << dim+spacedim << std::endl @@ -66,6 +66,7 @@ void test() { fe_v.reinit(cell, f); const std::vector > &qps = fe_v.get_quadrature_points(); + const std::vector > &nps = fe_v.get_normal_vectors(); for (unsigned int i=0; i::active_cell_iterator cell = + triangulation.begin_active(); cell != triangulation.end(); ++cell) + for (unsigned int f=0; f::faces_per_cell; ++f) + if (cell->face(f)->at_boundary()) + { + fe_v.reinit(cell, f); + const std::vector > &qps = fe_v.get_quadrature_points(); + const std::vector > &nps = fe_v.get_normal_vectors(); + for (unsigned int i=0; i 1e-10) + out << "# Error! The normal vector should be radial! " << std::endl + << "# Got " << center + nps[i]<< " instead of " + << qps[i] << std::endl; + } + out << std::endl; + } out << "e" << std::endl << std::endl; + } diff --git a/tests/fe/mapping_manifold_06.output b/tests/fe/mapping_manifold_06.output index 97d058a327..da67f6645a 100644 --- a/tests/fe/mapping_manifold_06.output +++ b/tests/fe/mapping_manifold_06.output @@ -29,6 +29,35 @@ plot '-' w l e + +set terminal aqua 9 +plot '-' with vectors +0.846869 1.74276 -0.653131 -0.757245 +1.08958 1.58810 -0.410418 -0.911897 +1.50000 1.50000 -2.22045e-16 -1.00000 +1.91042 1.58810 0.410418 -0.911897 +2.15313 1.74276 0.653131 -0.757245 + +0.742755 1.84687 -0.757245 -0.653131 +0.588103 2.08958 -0.911897 -0.410418 +0.500000 2.50000 -1.00000 0.00000 +0.588103 2.91042 -0.911897 0.410418 +0.742755 3.15313 -0.757245 0.653131 + +2.25724 1.84687 0.757245 -0.653131 +2.41190 2.08958 0.911897 -0.410418 +2.50000 2.50000 1.00000 0.00000 +2.41190 2.91042 0.911897 0.410418 +2.25724 3.15313 0.757245 0.653131 + +0.846869 3.25724 -0.653131 0.757245 +1.08958 3.41190 -0.410418 0.911897 +1.50000 3.50000 0.00000 1.00000 +1.91042 3.41190 0.410418 0.911897 +2.15313 3.25724 0.653131 0.757245 + +e + # dim=3, spacedim=3 set size ratio -1 set terminal aqua 6 @@ -191,3 +220,164 @@ splot '-' w l e + +set terminal aqua 13 +splot '-' with vectors +0.942530 1.94253 -0.615187 -0.557470 -0.557470 -0.615187 +1.12940 1.87632 -0.688247 -0.370600 -0.623676 -0.688247 +1.50000 1.82851 -0.741013 0.00000 -0.671491 -0.741013 +1.87060 1.87632 -0.688247 0.370600 -0.623676 -0.688247 +2.05747 1.94253 -0.615187 0.557470 -0.557470 -0.615187 +0.876324 2.12940 -0.688247 -0.623676 -0.370600 -0.688247 +1.07160 2.07160 -0.795583 -0.428397 -0.428397 -0.795583 +1.50000 2.02589 -0.880468 -4.44089e-16 -0.474105 -0.880468 +1.92840 2.07160 -0.795583 0.428397 -0.428397 -0.795583 +2.12368 2.12940 -0.688247 0.623676 -0.370600 -0.688247 +0.828509 2.50000 -0.741013 -0.671491 -4.44089e-16 -0.741013 +1.02589 2.50000 -0.880468 -0.474105 0.00000 -0.880468 +1.50000 2.50000 -1.00000 0.00000 0.00000 -1.00000 +1.97411 2.50000 -0.880468 0.474105 0.00000 -0.880468 +2.17149 2.50000 -0.741013 0.671491 0.00000 -0.741013 +0.876324 2.87060 -0.688247 -0.623676 0.370600 -0.688247 +1.07160 2.92840 -0.795583 -0.428397 0.428397 -0.795583 +1.50000 2.97411 -0.880468 0.00000 0.474105 -0.880468 +1.92840 2.92840 -0.795583 0.428397 0.428397 -0.795583 +2.12368 2.87060 -0.688247 0.623676 0.370600 -0.688247 +0.942530 3.05747 -0.615187 -0.557470 0.557470 -0.615187 +1.12940 3.12368 -0.688247 -0.370600 0.623676 -0.688247 +1.50000 3.17149 -0.741013 0.00000 0.671491 -0.741013 +1.87060 3.12368 -0.688247 0.370600 0.623676 -0.688247 +2.05747 3.05747 -0.615187 0.557470 0.557470 -0.615187 + +2.11519 1.94253 -0.557470 0.615187 -0.557470 -0.557470 +2.18825 1.87632 -0.370600 0.688247 -0.623676 -0.370600 +2.24101 1.82851 -8.90587e-18 0.741013 -0.671491 -8.90587e-18 +2.18825 1.87632 0.370600 0.688247 -0.623676 0.370600 +2.11519 1.94253 0.557470 0.615187 -0.557470 0.557470 +2.18825 2.12940 -0.623676 0.688247 -0.370600 -0.623676 +2.29558 2.07160 -0.428397 0.795583 -0.428397 -0.428397 +2.38047 2.02589 -2.11638e-17 0.880468 -0.474105 -2.11638e-17 +2.29558 2.07160 0.428397 0.795583 -0.428397 0.428397 +2.18825 2.12940 0.623676 0.688247 -0.370600 0.623676 +2.24101 2.50000 -0.671491 0.741013 -4.44089e-16 -0.671491 +2.38047 2.50000 -0.474105 0.880468 -8.88178e-16 -0.474105 +2.50000 2.50000 0.00000 1.00000 0.00000 0.00000 +2.38047 2.50000 0.474105 0.880468 0.00000 0.474105 +2.24101 2.50000 0.671491 0.741013 0.00000 0.671491 +2.18825 2.87060 -0.623676 0.688247 0.370600 -0.623676 +2.29558 2.92840 -0.428397 0.795583 0.428397 -0.428397 +2.38047 2.97411 0.00000 0.880468 0.474105 0.00000 +2.29558 2.92840 0.428397 0.795583 0.428397 0.428397 +2.18825 2.87060 0.623676 0.688247 0.370600 0.623676 +2.11519 3.05747 -0.557470 0.615187 0.557470 -0.557470 +2.18825 3.12368 -0.370600 0.688247 0.623676 -0.370600 +2.24101 3.17149 0.00000 0.741013 0.671491 0.00000 +2.18825 3.12368 0.370600 0.688247 0.623676 0.370600 +2.11519 3.05747 0.557470 0.615187 0.557470 0.557470 + +0.942530 1.94253 0.615187 -0.557470 -0.557470 0.615187 +0.876324 2.12940 0.688247 -0.623676 -0.370600 0.688247 +0.828509 2.50000 0.741013 -0.671491 -4.44089e-16 0.741013 +0.876324 2.87060 0.688247 -0.623676 0.370600 0.688247 +0.942530 3.05747 0.615187 -0.557470 0.557470 0.615187 +1.12940 1.87632 0.688247 -0.370600 -0.623676 0.688247 +1.07160 2.07160 0.795583 -0.428397 -0.428397 0.795583 +1.02589 2.50000 0.880468 -0.474105 0.00000 0.880468 +1.07160 2.92840 0.795583 -0.428397 0.428397 0.795583 +1.12940 3.12368 0.688247 -0.370600 0.623676 0.688247 +1.50000 1.82851 0.741013 0.00000 -0.671491 0.741013 +1.50000 2.02589 0.880468 -4.44089e-16 -0.474105 0.880468 +1.50000 2.50000 1.00000 0.00000 0.00000 1.00000 +1.50000 2.97411 0.880468 0.00000 0.474105 0.880468 +1.50000 3.17149 0.741013 0.00000 0.671491 0.741013 +1.87060 1.87632 0.688247 0.370600 -0.623676 0.688247 +1.92840 2.07160 0.795583 0.428397 -0.428397 0.795583 +1.97411 2.50000 0.880468 0.474105 0.00000 0.880468 +1.92840 2.92840 0.795583 0.428397 0.428397 0.795583 +1.87060 3.12368 0.688247 0.370600 0.623676 0.688247 +2.05747 1.94253 0.615187 0.557470 -0.557470 0.615187 +2.12368 2.12940 0.688247 0.623676 -0.370600 0.688247 +2.17149 2.50000 0.741013 0.671491 0.00000 0.741013 +2.12368 2.87060 0.688247 0.623676 0.370600 0.688247 +2.05747 3.05747 0.615187 0.557470 0.557470 0.615187 + +0.884813 1.94253 -0.557470 -0.615187 -0.557470 -0.557470 +0.811753 2.12940 -0.623676 -0.688247 -0.370600 -0.623676 +0.758987 2.50000 -0.671491 -0.741013 -4.44089e-16 -0.671491 +0.811753 2.87060 -0.623676 -0.688247 0.370600 -0.623676 +0.884813 3.05747 -0.557470 -0.615187 0.557470 -0.557470 +0.811753 1.87632 -0.370600 -0.688247 -0.623676 -0.370600 +0.704417 2.07160 -0.428397 -0.795583 -0.428397 -0.428397 +0.619532 2.50000 -0.474105 -0.880468 -8.88178e-16 -0.474105 +0.704417 2.92840 -0.428397 -0.795583 0.428397 -0.428397 +0.811753 3.12368 -0.370600 -0.688247 0.623676 -0.370600 +0.758987 1.82851 -8.90587e-18 -0.741013 -0.671491 -8.90587e-18 +0.619532 2.02589 -2.11638e-17 -0.880468 -0.474105 -2.11638e-17 +0.500000 2.50000 0.00000 -1.00000 0.00000 0.00000 +0.619532 2.97411 0.00000 -0.880468 0.474105 0.00000 +0.758987 3.17149 0.00000 -0.741013 0.671491 0.00000 +0.811753 1.87632 0.370600 -0.688247 -0.623676 0.370600 +0.704417 2.07160 0.428397 -0.795583 -0.428397 0.428397 +0.619532 2.50000 0.474105 -0.880468 0.00000 0.474105 +0.704417 2.92840 0.428397 -0.795583 0.428397 0.428397 +0.811753 3.12368 0.370600 -0.688247 0.623676 0.370600 +0.884813 1.94253 0.557470 -0.615187 -0.557470 0.557470 +0.811753 2.12940 0.623676 -0.688247 -0.370600 0.623676 +0.758987 2.50000 0.671491 -0.741013 0.00000 0.671491 +0.811753 2.87060 0.623676 -0.688247 0.370600 0.623676 +0.884813 3.05747 0.557470 -0.615187 0.557470 0.557470 + +0.942530 1.88481 -0.557470 -0.557470 -0.615187 -0.557470 +0.876324 1.81175 -0.370600 -0.623676 -0.688247 -0.370600 +0.828509 1.75899 -8.90587e-18 -0.671491 -0.741013 -8.90587e-18 +0.876324 1.81175 0.370600 -0.623676 -0.688247 0.370600 +0.942530 1.88481 0.557470 -0.557470 -0.615187 0.557470 +1.12940 1.81175 -0.623676 -0.370600 -0.688247 -0.623676 +1.07160 1.70442 -0.428397 -0.428397 -0.795583 -0.428397 +1.02589 1.61953 -2.11638e-17 -0.474105 -0.880468 -2.11638e-17 +1.07160 1.70442 0.428397 -0.428397 -0.795583 0.428397 +1.12940 1.81175 0.623676 -0.370600 -0.688247 0.623676 +1.50000 1.75899 -0.671491 0.00000 -0.741013 -0.671491 +1.50000 1.61953 -0.474105 -4.44089e-16 -0.880468 -0.474105 +1.50000 1.50000 0.00000 0.00000 -1.00000 0.00000 +1.50000 1.61953 0.474105 0.00000 -0.880468 0.474105 +1.50000 1.75899 0.671491 0.00000 -0.741013 0.671491 +1.87060 1.81175 -0.623676 0.370600 -0.688247 -0.623676 +1.92840 1.70442 -0.428397 0.428397 -0.795583 -0.428397 +1.97411 1.61953 0.00000 0.474105 -0.880468 0.00000 +1.92840 1.70442 0.428397 0.428397 -0.795583 0.428397 +1.87060 1.81175 0.623676 0.370600 -0.688247 0.623676 +2.05747 1.88481 -0.557470 0.557470 -0.615187 -0.557470 +2.12368 1.81175 -0.370600 0.623676 -0.688247 -0.370600 +2.17149 1.75899 0.00000 0.671491 -0.741013 0.00000 +2.12368 1.81175 0.370600 0.623676 -0.688247 0.370600 +2.05747 1.88481 0.557470 0.557470 -0.615187 0.557470 + +0.942530 3.11519 -0.557470 -0.557470 0.615187 -0.557470 +1.12940 3.18825 -0.623676 -0.370600 0.688247 -0.623676 +1.50000 3.24101 -0.671491 0.00000 0.741013 -0.671491 +1.87060 3.18825 -0.623676 0.370600 0.688247 -0.623676 +2.05747 3.11519 -0.557470 0.557470 0.615187 -0.557470 +0.876324 3.18825 -0.370600 -0.623676 0.688247 -0.370600 +1.07160 3.29558 -0.428397 -0.428397 0.795583 -0.428397 +1.50000 3.38047 -0.474105 -4.44089e-16 0.880468 -0.474105 +1.92840 3.29558 -0.428397 0.428397 0.795583 -0.428397 +2.12368 3.18825 -0.370600 0.623676 0.688247 -0.370600 +0.828509 3.24101 -8.90587e-18 -0.671491 0.741013 -8.90587e-18 +1.02589 3.38047 -2.11638e-17 -0.474105 0.880468 -2.11638e-17 +1.50000 3.50000 0.00000 0.00000 1.00000 0.00000 +1.97411 3.38047 0.00000 0.474105 0.880468 0.00000 +2.17149 3.24101 0.00000 0.671491 0.741013 0.00000 +0.876324 3.18825 0.370600 -0.623676 0.688247 0.370600 +1.07160 3.29558 0.428397 -0.428397 0.795583 0.428397 +1.50000 3.38047 0.474105 0.00000 0.880468 0.474105 +1.92840 3.29558 0.428397 0.428397 0.795583 0.428397 +2.12368 3.18825 0.370600 0.623676 0.688247 0.370600 +0.942530 3.11519 0.557470 -0.557470 0.615187 0.557470 +1.12940 3.18825 0.623676 -0.370600 0.688247 0.623676 +1.50000 3.24101 0.671491 0.00000 0.741013 0.671491 +1.87060 3.18825 0.623676 0.370600 0.688247 0.623676 +2.05747 3.11519 0.557470 0.557470 0.615187 0.557470 + +e + -- 2.39.5