]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
New test.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 7 Jun 2004 16:49:09 +0000 (16:49 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 7 Jun 2004 16:49:09 +0000 (16:49 +0000)
git-svn-id: https://svn.dealii.org/trunk@9398 0785d39b-7218-0410-832d-ea1e28bc413d

tests/bits/cylinder_shell_02.cc [new file with mode: 0644]

diff --git a/tests/bits/cylinder_shell_02.cc b/tests/bits/cylinder_shell_02.cc
new file mode 100644 (file)
index 0000000..6448f7c
--- /dev/null
@@ -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 <base/logstream.h>
+#include <base/quadrature_lib.h>
+#include <grid/tria.h>
+#include <grid/tria_iterator.h>
+#include <grid/tria_accessor.h>
+#include <grid/grid_generator.h>
+#include <dofs/dof_accessor.h>
+#include <dofs/dof_handler.h>
+#include <fe/fe_q.h>
+#include <fe/fe_values.h>
+#include <fstream>
+
+    
+
+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());
+    }
+}

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.