From ec1d8db9b4b857f00055912f0ef292f8c88da2e1 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Mon, 4 Dec 2017 21:32:52 +0100 Subject: [PATCH] Test for tangent on spherical manifold to convince myself that the new formula is correct. --- tests/manifold/spherical_manifold_11.cc | 59 +++++++++++++++++++++ tests/manifold/spherical_manifold_11.output | 13 +++++ 2 files changed, 72 insertions(+) create mode 100644 tests/manifold/spherical_manifold_11.cc create mode 100644 tests/manifold/spherical_manifold_11.output diff --git a/tests/manifold/spherical_manifold_11.cc b/tests/manifold/spherical_manifold_11.cc new file mode 100644 index 0000000000..71ce4e75ba --- /dev/null +++ b/tests/manifold/spherical_manifold_11.cc @@ -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 +#include + + +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 index 0000000000..e4e664598d --- /dev/null +++ b/tests/manifold/spherical_manifold_11.output @@ -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 -- 2.39.5