]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add test. 5507/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Mon, 20 Nov 2017 12:08:58 +0000 (13:08 +0100)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Mon, 20 Nov 2017 12:22:03 +0000 (13:22 +0100)
tests/manifold/spherical_manifold_08.cc [new file with mode: 0644]
tests/manifold/spherical_manifold_08.output [new file with mode: 0644]

diff --git a/tests/manifold/spherical_manifold_08.cc b/tests/manifold/spherical_manifold_08.cc
new file mode 100644 (file)
index 0000000..2de8ee3
--- /dev/null
@@ -0,0 +1,45 @@
+// ---------------------------------------------------------------------
+//
+// 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.
+//
+// ---------------------------------------------------------------------
+
+// Check SphericalManifold::get_intermediate_point for two particular points
+// that are almost along a line to the center (this used to trigger when
+// refining a 3d shell starting from 12 initial elements 6 times globally).
+
+#include "../tests.h"
+#include <deal.II/base/point.h>
+#include <deal.II/grid/manifold_lib.h>
+
+using namespace dealii;
+
+int
+main()
+{
+  initlog();
+  deallog << std::setprecision(10);
+
+  SphericalManifold<3> spherical;
+
+  Point<3> p1(-0.036923837121444085, -0.87096345314118251, -0.075394254055706517);
+  Point<3> p2(-0.037583190343442631, -0.8865163726762405, -0.076740572095662762);
+
+  // when projected to radius one, both points are almost the same:
+  // p1/p1.norm() : [-0.042198670995936091, -0.99538680358992271, -0.086164861777950297]
+  // p2/p2.norm() : [-0.042198669859304011, -0.99538680440841054, -0.086164852879340656]
+
+  deallog << "intermediate point: " << spherical.get_intermediate_point(p1, p2, 0.5)
+          << std::endl;
+
+  return 0;
+}
diff --git a/tests/manifold/spherical_manifold_08.output b/tests/manifold/spherical_manifold_08.output
new file mode 100644 (file)
index 0000000..4c43f0b
--- /dev/null
@@ -0,0 +1,2 @@
+
+DEAL::intermediate point: -0.03725351424 -0.8787399125 -0.07606741704

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.