From c80951646b581f686c8a9a007474263240d41022 Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Mon, 21 Mar 2016 00:12:08 +0100 Subject: [PATCH] Fixed test to check also normal_vector. --- source/grid/manifold.cc | 4 ++-- tests/manifold/spherical_manifold_07.cc | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/source/grid/manifold.cc b/source/grid/manifold.cc index 129b7d1555..a27460aacb 100644 --- a/source/grid/manifold.cc +++ b/source/grid/manifold.cc @@ -72,8 +72,8 @@ normal_vector (const typename Triangulation<2, 2>::face_iterator &face, const int spacedim=2, dim=2; Tensor<1,spacedim> tangent = ((p-face->vertex(0)).norm_square() > (p-face->vertex(1)).norm_square() ? - get_tangent_vector(p, face->vertex(0)) : - -get_tangent_vector(p, face->vertex(1))); + -get_tangent_vector(p, face->vertex(0)) : + get_tangent_vector(p, face->vertex(1))); Tensor<1,spacedim> normal = cross_product_2d(tangent); return normal/normal.norm(); } diff --git a/tests/manifold/spherical_manifold_07.cc b/tests/manifold/spherical_manifold_07.cc index a058cb6fa3..7aff76f3a3 100644 --- a/tests/manifold/spherical_manifold_07.cc +++ b/tests/manifold/spherical_manifold_07.cc @@ -62,6 +62,12 @@ void test () for (unsigned int v=0; v::vertices_per_face; ++v) { + Tensor<1,spacedim> dn = n[v]-manifold.normal_vector + (cell->face(f), cell->face(f)->vertex(v)); + + if ( dn.norm() > 1e-10) + deallog << "Error on vertex " << f << ", face " + << cell->face(f) << ": " << dn << std::endl; deallog.get_file_stream() << cell->face(f)->vertex(v) << " " << n[v]*.1 << std::endl; -- 2.39.5