]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add new test that shows failure in DerivativeApproximation
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 22 Feb 2006 15:46:22 +0000 (15:46 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 22 Feb 2006 15:46:22 +0000 (15:46 +0000)
git-svn-id: https://svn.dealii.org/trunk@12458 0785d39b-7218-0410-832d-ea1e28bc413d

tests/hp/crash_04.cc [new file with mode: 0644]

diff --git a/tests/hp/crash_04.cc b/tests/hp/crash_04.cc
new file mode 100644 (file)
index 0000000..e31ac0f
--- /dev/null
@@ -0,0 +1,64 @@
+//----------------------------  crash_04.cc  ---------------------------
+//    $Id$
+//    Version: $Name$ 
+//
+//    Copyright (C) 2005, 2006 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.
+//
+//----------------------------  crash_04.cc  ---------------------------
+
+
+// trigger a problem in DerivativeApproximation with memory handling
+
+
+#include <base/logstream.h>
+#include <lac/vector.h>
+#include <grid/tria.h>
+#include <grid/grid_generator.h>
+#include <grid/tria_accessor.h>
+#include <dofs/hp_dof_handler.h>
+#include <fe/fe_dgq.h>
+#include <numerics/derivative_approximation.h>
+
+#include <fstream>
+
+
+template <int dim>
+void test ()
+{
+  Triangulation<dim> tria;
+  GridGenerator::hyper_cube(tria);
+  tria.refine_global (1);
+
+  hp::FECollection<dim> fe_collection;
+  fe_collection.push_back (FE_DGQ<dim> (1));
+
+  hp::DoFHandler<dim> dof_handler(tria);
+  dof_handler.distribute_dofs (fe_collection);
+
+  Vector<double> v(dof_handler.n_dofs());
+  Vector<float> e(tria.n_active_cells());
+  DerivativeApproximation::approximate_gradient (dof_handler, v, e);
+}
+
+
+
+int main ()
+{
+  std::ofstream logfile("crash_04/output");
+  logfile.precision(2);
+  
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+  
+  test<1> ();
+  test<2> ();
+  test<3> ();
+  
+  deallog << "OK" << std::endl;
+}

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.