From 576b6c4257ce76cc76a9d7f578f2950e6a083b85 Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Sun, 13 Mar 2016 16:05:40 +0100 Subject: [PATCH] Added test for periodicity on FlatManifold. --- tests/manifold/flat_manifold_07.cc | 71 ++++++++++++++++++++++++++ tests/manifold/flat_manifold_07.output | 23 +++++++++ 2 files changed, 94 insertions(+) create mode 100644 tests/manifold/flat_manifold_07.cc create mode 100644 tests/manifold/flat_manifold_07.output diff --git a/tests/manifold/flat_manifold_07.cc b/tests/manifold/flat_manifold_07.cc new file mode 100644 index 0000000000..2b7e0ad662 --- /dev/null +++ b/tests/manifold/flat_manifold_07.cc @@ -0,0 +1,71 @@ +// --------------------------------------------------------------------- +// +// 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 FlatManifold for periodicity issues. Check that the it finds +// the right intermediate points independent on the number of +// surrounding points + +#include "../tests.h" + +#include +#include + + +int +main() +{ + initlog(); + + const FlatManifold<2> manifold(Point<2>(1.0, 0.0)); + + // Some points that would cross the periodicity boundary + std::vector > points; + + points.push_back(Point<2>(0.1, 0.0)); + points.push_back(Point<2>(0.9, 0.0)); + + // And the weights + std::vector weights(2); + + unsigned int n_intermediates=10; + + // First, use only two surrounding points. The second time around, + // instead, use four, with additional zero weights + for (unsigned int test_no=0; test_no<2; ++test_no) + { + if (test_no == 1) + { + // Test that we get the same result with four surrounding points + points.push_back(Point<2>(0.3, 1.0)); + points.push_back(Point<2>(0.7, 1.0)); + weights.push_back(0.0); + weights.push_back(0.0); + } + + deallog << "Test " << test_no << std::endl; + for (unsigned int i=0; i(points, weights)) << std::endl; + } + } + + return 0; +} + + + diff --git a/tests/manifold/flat_manifold_07.output b/tests/manifold/flat_manifold_07.output new file mode 100644 index 0000000000..2705afce02 --- /dev/null +++ b/tests/manifold/flat_manifold_07.output @@ -0,0 +1,23 @@ + +DEAL::Test 0 +DEAL::0.900000 0.00000 +DEAL::0.922222 0.00000 +DEAL::0.944444 0.00000 +DEAL::0.966667 0.00000 +DEAL::0.988889 0.00000 +DEAL::0.0111111 0.00000 +DEAL::0.0333333 0.00000 +DEAL::0.0555556 0.00000 +DEAL::0.0777778 0.00000 +DEAL::0.100000 0.00000 +DEAL::Test 1 +DEAL::0.900000 0.00000 +DEAL::0.922222 0.00000 +DEAL::0.944444 0.00000 +DEAL::0.966667 0.00000 +DEAL::0.988889 0.00000 +DEAL::0.0111111 0.00000 +DEAL::0.0333333 0.00000 +DEAL::0.0555556 0.00000 +DEAL::0.0777778 0.00000 +DEAL::0.100000 0.00000 -- 2.39.5