From: Luca Heltai Date: Sun, 27 Mar 2016 18:05:13 +0000 (+0200) Subject: Test periodicity. X-Git-Tag: v8.5.0-rc1~1116^2~6 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=970fb8bb6c24fb6168c62deb13dd447f2de0c598;p=dealii.git Test periodicity. --- diff --git a/tests/manifold/composition_manifold_04.cc b/tests/manifold/composition_manifold_04.cc new file mode 100644 index 0000000000..c04f9a7ea3 --- /dev/null +++ b/tests/manifold/composition_manifold_04.cc @@ -0,0 +1,113 @@ +//---------------------------- function_manifold_chart --------------------------- +// Copyright (C) 2011 - 2015 by the mathLab team. +// +// This file is subject to LGPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//---------------------------- composition_manifold --------------------------- + + +// Stress periodicity in CompositionManifold + +#include "../tests.h" +#include +#include + + +// all include files you need here +#include +#include + + +int main () +{ + initlog(); + std::ostream &out = deallog.get_file_stream(); + + const int dim=2, spacedim=2; + + Point center; + + SphericalManifold S(center); + FunctionManifold F("x;y", "x;y"); + + CompositionManifold manifold(S,F); + + // Chart points. + Point cp[2]; + + // Radius + cp[0][0] = 1.0; + cp[1][0] = 1.0; + + // Last point + cp[0][1] = -numbers::PI/4; + cp[1][1] = numbers::PI/4; + + // Spacedim points + std::vector > sp(2); + + // Weights + std::vector w(2); + + sp[0] = manifold.push_forward(cp[0]); + sp[1] = manifold.push_forward(cp[1]); + + unsigned int n_intermediates = 32; + + for (unsigned int n=0; n<2; ++n) + { + if (n == 1) + { + sp.push_back(manifold.push_forward(Point<2>(1.0, numbers::PI/4))); + sp.push_back(manifold.push_forward(Point<2>(1.0, numbers::PI*3/4))); + w.push_back(0); + w.push_back(0); + } + out << "set terminal aqua " << n << std::endl + << "set size ratio -1" << std::endl + << "plot '-' with vectors " << std::endl; + + for (unsigned int v=0; v ip = manifold.get_new_point(Quadrature(sp, w)); + Tensor<1,spacedim> t1 = manifold.get_tangent_vector(ip, sp[0]); + Tensor<1,spacedim> t2 = manifold.get_tangent_vector(ip, sp[1]); + + out << ip << " " + << t2 << std::endl; + } + + out << "e" << std::endl; + + out << "set terminal aqua " << 2+n << std::endl + << "set size ratio -1" << std::endl + << "plot '-' w lp " << std::endl; + + for (unsigned int i=0; i ip = manifold. + pull_back(manifold.get_new_point(Quadrature(sp, w))); + + ip[0] = w[1]; + + out << ip << std::endl; + } + out << "e" << std::endl; + } + + return 0; +} diff --git a/tests/manifold/composition_manifold_04.with_muparser=true.output b/tests/manifold/composition_manifold_04.with_muparser=true.output new file mode 100644 index 0000000000..e69de29bb2