From: Luca Heltai Date: Fri, 11 Mar 2016 09:57:52 +0000 (+0100) Subject: Added a failing test. X-Git-Tag: v8.5.0-rc1~1165^2~4 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58d421006f9e365a4442c91c446b635935b2e4c0;p=dealii.git Added a failing test. --- diff --git a/tests/manifold/spherical_manifold_09.cc b/tests/manifold/spherical_manifold_09.cc new file mode 100644 index 0000000000..a8d5668ec5 --- /dev/null +++ b/tests/manifold/spherical_manifold_09.cc @@ -0,0 +1,141 @@ +// --------------------------------------------------------------------- +// +// 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 on faces. + +#include "../tests.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +// Check that the spherical manifold finds the right intermediate +// points both using face quadratures, as well as using face +// quadratures projected to cells. + +#include + +template +void test() +{ + deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl; + + Triangulation triangulation; + + GridGenerator::hyper_cube (triangulation, 2.0, 4.0); + + typename Triangulation::active_cell_iterator + cell = triangulation.begin_active(); + + // Center and radius of the Ball + Point center = cell->center(); + double radius = center.distance(cell->vertex(0)); + + static const SphericalManifold manifold(cell->center()); + + triangulation.set_all_manifold_ids(0); + triangulation.set_manifold (0, manifold); + + const QGauss face_quad(3); + + const FE_Q face_fe_q(1); + + // Compute the points with the faces + deallog << "Face quadratures (" + << face_quad.size() * GeometryInfo::faces_per_cell + << ")" << std::endl; + + for(unsigned int f=0; f::faces_per_cell; ++f) { + std::vector > vertices; + std::vector weights(GeometryInfo::vertices_per_face); + + for(unsigned int i=0; i::vertices_per_face; ++i) + vertices.push_back(cell->face(f)->vertex(i)); + + for (unsigned int i=0; i(vertices, weights)) + << std::endl; + } + } + + // Project the face quads + Quadrature quad = QProjector::project_to_all_faces(face_quad); + + deallog << "Face quadratures projected on cell " + << "(" << quad.size() << ")" << std::endl; + + std::vector > vertices; + for(unsigned int i=0; i::vertices_per_cell; ++i) + vertices.push_back(cell->vertex(i)); + + // Used to compute weights. + FE_Q fe_q(1); + + std::vector weights(GeometryInfo::vertices_per_cell); + + for (unsigned int i=0; i(vertices, weights)) + << std::endl; + } + + // for(unsigned int f=0; f::faces_per_cell; ++f) { + // std::vector > vertices; + // std::vector weights(GeometryInfo::vertices_per_face); + + // for(unsigned int i=0; i::vertices_per_face; ++i) + // vertices.push_back(cell->face(f)->vertex(i)); + + // for (unsigned int i=0; i(vertices, weights)) + // << std::endl; + // } + // } +} + + +int +main() +{ + std::ofstream logfile ("output"); + deallog.attach(logfile); + deallog.threshold_double(1.e-10); + + test<2,2>(); + test<2,3>(); + + // stest<3,3>(); + + return 0; +} + + + diff --git a/tests/manifold/spherical_manifold_09.output b/tests/manifold/spherical_manifold_09.output new file mode 100644 index 0000000000..c378bc7f0d --- /dev/null +++ b/tests/manifold/spherical_manifold_09.output @@ -0,0 +1,55 @@ + +DEAL::dim=2, spacedim=2 +DEAL::Face quadratures (12) +DEAL::1.83952 2.19174 +DEAL::1.58579 3.00000 +DEAL::1.83952 3.80826 +DEAL::4.16048 2.19174 +DEAL::4.41421 3.00000 +DEAL::4.16048 3.80826 +DEAL::2.19174 1.83952 +DEAL::3.00000 1.58579 +DEAL::3.80826 1.83952 +DEAL::2.19174 4.16048 +DEAL::3.00000 4.41421 +DEAL::3.80826 4.16048 +DEAL::Face quadratures projected on cell (12) +DEAL::1.83952 2.19174 +DEAL::1.58579 3.00000 +DEAL::1.83952 3.80826 +DEAL::4.16048 2.19174 +DEAL::4.41421 3.00000 +DEAL::4.16048 3.80826 +DEAL::2.19174 1.83952 +DEAL::3.00000 1.58579 +DEAL::3.80826 1.83952 +DEAL::2.19174 4.16048 +DEAL::3.00000 4.41421 +DEAL::3.80826 4.16048 +DEAL::dim=2, spacedim=3 +DEAL::Face quadratures (12) +DEAL::1.88197 2.13397 0.00000 +DEAL::1.58579 3.00000 0.00000 +DEAL::1.88197 3.86603 0.00000 +DEAL::4.11803 2.13397 0.00000 +DEAL::4.41421 3.00000 0.00000 +DEAL::4.11803 3.86603 0.00000 +DEAL::2.13397 1.88197 0.00000 +DEAL::3.00000 1.58579 0.00000 +DEAL::3.86603 1.88197 0.00000 +DEAL::2.13397 4.11803 0.00000 +DEAL::3.00000 4.41421 0.00000 +DEAL::3.86603 4.11803 0.00000 +DEAL::Face quadratures projected on cell (12) +DEAL::1.88197 2.13397 0.00000 +DEAL::1.58579 3.00000 0.00000 +DEAL::1.88197 3.86603 0.00000 +DEAL::4.11803 2.13397 0.00000 +DEAL::4.41421 3.00000 0.00000 +DEAL::4.11803 3.86603 0.00000 +DEAL::2.13397 1.88197 0.00000 +DEAL::3.00000 1.58579 0.00000 +DEAL::3.86603 1.88197 0.00000 +DEAL::2.13397 4.11803 0.00000 +DEAL::3.00000 4.41421 0.00000 +DEAL::3.86603 4.11803 0.00000