From: wolf Date: Sun, 19 Oct 2003 22:30:05 +0000 (+0000) Subject: New test. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a88cf35804853ab658899e293471dafe77fea28;p=dealii-svn.git New test. git-svn-id: https://svn.dealii.org/trunk@8113 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/bits/mesh_3d_16.cc b/tests/bits/mesh_3d_16.cc new file mode 100644 index 0000000000..488d8f2255 --- /dev/null +++ b/tests/bits/mesh_3d_16.cc @@ -0,0 +1,117 @@ +//---------------------------- mesh_3d_16.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2003 by the deal.II authors +// +// This file is subject to QPL 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. +// +//---------------------------- mesh_3d_16.cc --------------------------- + + +// like normals_1, but with the type of cells we have in the mesh_3d_* +// tests: integrating the normals over the surface of any cell +// (distorted or not) should yield a zero vector. (To prove this, use +// the divergence theorem.) + +#include "mesh_3d.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + + + +void check (Triangulation<3> &tria) +{ + FE_Q<3> fe(1); + DoFHandler<3> dof_handler (tria); + dof_handler.distribute_dofs (fe); + + QGauss3<2> q_face; + + FEFaceValues<3> fe_face_values (fe, q_face, + update_normal_vectors | update_JxW_values); + FESubfaceValues<3> fe_subface_values (fe, q_face, + update_normal_vectors | update_JxW_values); + + for (DoFHandler<3>::active_cell_iterator cell = dof_handler.begin_active(); + cell!=dof_handler.end(); ++cell) + { + Tensor<1,3> n1, n2; + + // first integrate over faces + // and make sure that the + // result of the integration is + // close to zero + for (unsigned int f=0; f::faces_per_cell; ++f) + { + fe_face_values.reinit (cell, f); + for (unsigned int q=0; q::faces_per_cell; ++f) + for (unsigned int sf=0; sf::subfaces_per_face; ++sf) + { + fe_subface_values.reinit (cell, f, sf); + for (unsigned int q=0; q coarse_grid; + create_two_cubes (coarse_grid); + check (coarse_grid); + } + + { + Triangulation<3> coarse_grid; + create_L_shape (coarse_grid); + check (coarse_grid); + } + + { + Triangulation<3> coarse_grid; + GridGenerator::hyper_ball (coarse_grid); + check (coarse_grid); + } + +} + + +