]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Test for tangent on spherical manifold to convince myself that the new formula is... 5564/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Mon, 4 Dec 2017 20:32:52 +0000 (21:32 +0100)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 5 Dec 2017 10:00:04 +0000 (11:00 +0100)
tests/manifold/spherical_manifold_11.cc [new file with mode: 0644]
tests/manifold/spherical_manifold_11.output [new file with mode: 0644]

diff --git a/tests/manifold/spherical_manifold_11.cc b/tests/manifold/spherical_manifold_11.cc
new file mode 100644 (file)
index 0000000..71ce4e7
--- /dev/null
@@ -0,0 +1,59 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2017 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+// test tangent vectors for nearly linear dependent positions
+
+#include "../tests.h"
+
+#include <deal.II/base/utilities.h>
+#include <deal.II/grid/manifold_lib.h>
+
+
+int
+main()
+{
+  initlog();
+  deallog << std::setprecision(10);
+
+  const SphericalManifold<2> manifold_2;
+  const SphericalManifold<3> manifold_3;
+
+  // get tangent vectors for positions that are on a line and almost on a line
+  // as seen from the center
+  deallog << manifold_2.get_tangent_vector (Point<2>(0.5, 0),
+                                            Point<2>(1.0, 0)) << std::endl
+          << manifold_2.get_tangent_vector (Point<2>(0.5, 0),
+                                            Point<2>(1.0, 0.01)) << std::endl
+          << manifold_2.get_tangent_vector (Point<2>(0.5, 0),
+                                            Point<2>(1.0, 1e-6)) << std::endl
+          << manifold_2.get_tangent_vector (Point<2>(0.5, 0),
+                                            Point<2>(1.0, -1e-6)) << std::endl
+          << manifold_3.get_tangent_vector (Point<3>(0, 0, -0.5),
+                                            Point<3>(0, 0, -1.0)) << std::endl
+          << manifold_3.get_tangent_vector (Point<3>(0, 0, -0.5),
+                                            Point<3>(0, 1e-6, -1.0)) << std::endl
+          << manifold_3.get_tangent_vector (Point<3>(0, 0, 1.0),
+                                            Point<3>(0, -1e-6, 0.5)) << std::endl
+          << manifold_3.get_tangent_vector (Point<3>(0.2, 0.3, 0.4),
+                                            Point<3>(0.4, 0.55, 0.8)) << std::endl
+          << manifold_3.get_tangent_vector (Point<3>(std::sqrt(0.5), std::sqrt(0.5), 0.),
+                                            Point<3>(-std::sqrt(0.5), std::sqrt(0.5), 0.)) << std::endl
+          << manifold_3.get_tangent_vector (Point<3>(std::sqrt(1./3.), std::sqrt(1./3.), std::sqrt(1./3.)),
+                                            Point<3>(-std::sqrt(1./3.), std::sqrt(1./3.), std::sqrt(1./3.))) << std::endl
+          << manifold_3.get_tangent_vector (Point<3>(std::sqrt(1./3.), std::sqrt(1./3.), std::sqrt(1./3.)),
+                                            Point<3>(-std::sqrt(1./3.), -std::sqrt(1./3.), std::sqrt(1./3.))) << std::endl
+          << manifold_3.get_tangent_vector (Point<3>(std::sqrt(1./3.), std::sqrt(1./3.), std::sqrt(1./3.)),
+                                            Point<3>(std::sqrt(1./3.), -std::sqrt(1./3.), std::sqrt(1./3.))) << std::endl;
+}
diff --git a/tests/manifold/spherical_manifold_11.output b/tests/manifold/spherical_manifold_11.output
new file mode 100644 (file)
index 0000000..e4e6645
--- /dev/null
@@ -0,0 +1,13 @@
+
+DEAL::0.5000000000 0.000000000
+DEAL::0.5000499988 0.004999833343
+DEAL::0.5000000000 5.000222247e-07
+DEAL::0.5000000000 -5.000222247e-07
+DEAL::0.000000000 0.000000000 -0.5000000000
+DEAL::0.000000000 5.000222247e-07 -0.5000000000
+DEAL::0.000000000 -1.999977878e-06 -0.5000000000
+DEAL::0.1952671751 0.2672504322 0.3905343502
+DEAL::-1.110720735 1.110720735 0.000000000
+DEAL::-1.005074156 0.5025370778 0.5025370778
+DEAL::-0.7800127524 -0.7800127524 1.560025505
+DEAL::0.5025370778 -1.005074156 0.5025370778

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.