From: wolf Date: Mon, 7 Jun 2004 16:49:09 +0000 (+0000) Subject: New test. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=974dc165a4e0f885b8705e6d1d2b2eac064f44e2;p=dealii-svn.git New test. git-svn-id: https://svn.dealii.org/trunk@9398 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/bits/cylinder_shell_02.cc b/tests/bits/cylinder_shell_02.cc new file mode 100644 index 0000000000..6448f7c1e6 --- /dev/null +++ b/tests/bits/cylinder_shell_02.cc @@ -0,0 +1,62 @@ +//---------------------------- cylinder_shell_02.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2003, 2004 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. +// +//---------------------------- cylinder_shell_02.cc --------------------------- + +// turns out that cylinder_shell_01 wasn't enough: measure just takes the +// positive value it computes. we need to ask a FEValues object for the JxW +// values to get the sign of the Jacobian + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +int main () +{ + std::ofstream logfile("cylinder_shell_02.output"); + deallog.attach(logfile); + deallog.depth_console(0); + logfile.precision (2); + + // generate a hyperball in 3d + Triangulation<3> tria; + GridGenerator::cylinder_shell (tria, 1, .8, 1); + + FE_Q<3> fe(1); + DoFHandler<3> dof_handler (tria); + dof_handler.distribute_dofs (fe); + + QMidpoint<3> q; + FEValues<3> fe_values (fe, q, update_JxW_values); + + // make sure that all cells have positive + // volume + for (DoFHandler<3>::active_cell_iterator cell=dof_handler.begin_active(); + cell!=dof_handler.end(); ++cell) + { + fe_values.reinit (cell); + deallog << cell << ' ' << fe_values.JxW(0) << std::endl; + + Assert (fe_values.JxW(0) > 0, ExcInternalError()); + } +}