]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fixed test to check also normal_vector.
authorLuca Heltai <luca.heltai@sissa.it>
Sun, 20 Mar 2016 23:12:08 +0000 (00:12 +0100)
committerLuca Heltai <luca.heltai@sissa.it>
Sun, 20 Mar 2016 23:12:08 +0000 (00:12 +0100)
source/grid/manifold.cc
tests/manifold/spherical_manifold_07.cc

index 129b7d1555fe3e48d6379199e104e4d1c6f12a47..a27460aacbdfc9c2cf7601d1b52488f0033536ef 100644 (file)
@@ -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();
 }
index a058cb6fa3bea60aaf7c24436cc99abf6ab49b50..7aff76f3a3e51e917d9bc7dc48eaca64d419f56f 100644 (file)
@@ -62,6 +62,12 @@ void test ()
 
             for (unsigned int v=0; v<GeometryInfo<dim>::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;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.