From a5ff6cc6a75aff4781dfdb487ae20a64c5c46b49 Mon Sep 17 00:00:00 2001 From: Rene Gassmoeller Date: Tue, 31 Oct 2017 15:13:05 -0600 Subject: [PATCH] Add changelog and test --- .../changes/minor/20171031ReneGassmoeller | 6 ++ tests/manifold/spherical_manifold_06.cc | 59 +++++++++++++++++++ tests/manifold/spherical_manifold_06.output | 3 + 3 files changed, 68 insertions(+) create mode 100644 doc/news/changes/minor/20171031ReneGassmoeller create mode 100644 tests/manifold/spherical_manifold_06.cc create mode 100644 tests/manifold/spherical_manifold_06.output diff --git a/doc/news/changes/minor/20171031ReneGassmoeller b/doc/news/changes/minor/20171031ReneGassmoeller new file mode 100644 index 0000000000..55e9b333ed --- /dev/null +++ b/doc/news/changes/minor/20171031ReneGassmoeller @@ -0,0 +1,6 @@ +Fixed: The spherical manifold used to do a division +by zero inside of SphericalManifold::get_new_point() +if the new point was exactly at the center of the +manifold. This is fixed now. +
+(Rene Gassmoeller, 2017/10/31) diff --git a/tests/manifold/spherical_manifold_06.cc b/tests/manifold/spherical_manifold_06.cc new file mode 100644 index 0000000000..beb7867024 --- /dev/null +++ b/tests/manifold/spherical_manifold_06.cc @@ -0,0 +1,59 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2016 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 for get_new_point issues at the origin. + +#include "../tests.h" + +#include +#include + +int +main() +{ + initlog(); + + { + Point<2> center(1.0, 0.0); + const SphericalManifold<2,2> manifold(center); + Point<2> P1(1.0, 1.0); + Point<2> P2(1.0, -1.0); + std::vector > points; + std::vector weights; + points.push_back(P1); + points.push_back(P2); + weights.push_back(0.5); + weights.push_back(0.5); + Point<2> mid_point = manifold.get_new_point(points,weights); + deallog << mid_point << std::endl; + } + + { + Point<3> center(1.0, 0.0, 0.0); + const SphericalManifold<3,3> manifold(center); + Point<3> P1(1.0, 1.0, 0.0); + Point<3> P2(1.0, -1.0, 0.0); + std::vector > points; + std::vector weights; + points.push_back(P1); + points.push_back(P2); + weights.push_back(0.5); + weights.push_back(0.5); + Point<3> mid_point = manifold.get_new_point(points,weights); + deallog << mid_point << std::endl; + } + + return 0; +} diff --git a/tests/manifold/spherical_manifold_06.output b/tests/manifold/spherical_manifold_06.output new file mode 100644 index 0000000000..901ef0a4d6 --- /dev/null +++ b/tests/manifold/spherical_manifold_06.output @@ -0,0 +1,3 @@ + +DEAL::1.00000 0.00000 +DEAL::1.00000 0.00000 0.00000 -- 2.39.5