From f7aac42b451345b2d6b2c1b45f24496fdfd3de47 Mon Sep 17 00:00:00 2001 From: alberto sartori Date: Wed, 2 Mar 2016 15:01:27 +0100 Subject: [PATCH] Mapping Manifold Test 01 --- tests/fe/mapping_manifold_01.cc | 105 ++++++++++++++++++++++++++++ tests/fe/mapping_manifold_01.output | 0 2 files changed, 105 insertions(+) create mode 100644 tests/fe/mapping_manifold_01.cc create mode 100644 tests/fe/mapping_manifold_01.output diff --git a/tests/fe/mapping_manifold_01.cc b/tests/fe/mapping_manifold_01.cc new file mode 100644 index 0000000000..f20fb07b60 --- /dev/null +++ b/tests/fe/mapping_manifold_01.cc @@ -0,0 +1,105 @@ +// --------------------------------------------------------------------- +// +// 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. +// +// --------------------------------------------------------------------- + + + +#include "../tests.h" + +#include +#include +#include +#include +#include +#include + +#include + +template +void test() +{ + deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl; + + Triangulation triangulation; + + const Point<2> center (7,9); + const Point<2> origin (0,0); + const double inner_radius = 0.5, + outer_radius = 1.0; + GridGenerator::hyper_shell (triangulation, + center, inner_radius, outer_radius, + 10); + + + static const SphericalManifold manifold(center); + + triangulation.set_all_manifold_ids_on_boundary(0); + triangulation.set_manifold (0, manifold); + typename Triangulation::active_cell_iterator + cell = triangulation.begin_active(), + endc = triangulation.end(); + for (; cell!=endc; ++cell) + cell->set_all_manifold_ids (0); + triangulation.refine_global (0); + + const QGauss quadrature(7); + + std::vector > q_points = quadrature.get_points(); + + + MappingManifold map_manifold(); + MappingQGeneric map_q1(1); + + + cell = triangulation.begin_active(); + + std::ofstream two_be_plotted ("points.txt"); + for (; cell!=endc; ++cell) + { + for (unsigned int i=0; i p = map.transform_unit_to_real_cell(cell,q_points[i]); + // deallog << "mapping manifold ---> " << p.distance() << std::endl; + + const Point pq = map_manifold.transform_unit_to_real_cell(cell,q_points[i]); + deallog << "mapping q1 ---> " << pq.distance(origin) << std::endl; + for (unsigned int d=0; d(); + test<2,2>(); + // test<3,3>(); + + // test<1,2>(); + // test<1,3>(); + // test<2,3>(); + + return 0; +} + + + diff --git a/tests/fe/mapping_manifold_01.output b/tests/fe/mapping_manifold_01.output new file mode 100644 index 0000000000..e69de29bb2 -- 2.39.5