]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
New test.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 3 Jun 2011 13:13:20 +0000 (13:13 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 3 Jun 2011 13:13:20 +0000 (13:13 +0000)
git-svn-id: https://svn.dealii.org/trunk@23786 0785d39b-7218-0410-832d-ea1e28bc413d

tests/deal.II/cell_similarity_crash_02.cc [new file with mode: 0644]
tests/deal.II/cell_similarity_crash_02/cmp/generic [new file with mode: 0644]

diff --git a/tests/deal.II/cell_similarity_crash_02.cc b/tests/deal.II/cell_similarity_crash_02.cc
new file mode 100644 (file)
index 0000000..d56924a
--- /dev/null
@@ -0,0 +1,69 @@
+//----------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2009, 2011 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.
+//
+//----------------------------------------------------------------------
+
+
+// The first attempt to fix the _01 test had a bug in it in that we
+// managed to invalidate the cell stored in FEValues but forgot to
+// disconnect from the triangulation's signal. We were therefore still
+// getting reminders from the triangulation even though we weren't
+// doing anything with it any more
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/quadrature_lib.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/dofs/dof_handler.h>
+#include <deal.II/fe/fe_values.h>
+#include <deal.II/fe/fe_q.h>
+
+#include <fstream>
+
+
+
+template <int dim>
+void test()
+{
+  Triangulation<dim> tr;
+  GridGenerator::hyper_cube(tr);
+  tr.refine_global (2);
+
+  FE_Q<dim> fe(1);
+  const QGauss<dim> quadrature(2);
+  FEValues<dim> fe_values (fe, quadrature, update_values);
+
+                                  // initialize FEValues with the first cell
+  fe_values.reinit (tr.begin_active());
+
+                                  // then invalidate the cell iterator
+  tr.refine_global (1);
+                                  // and invalidate it again. this
+                                  // shouldn't do any further harm
+  tr.refine_global (1);
+
+  deallog << "OK" << std::endl;
+}
+
+
+int main()
+{
+  std::ofstream logfile ("cell_similarity_crash_02/output");
+  deallog << std::setprecision (4);
+
+  deallog.attach(logfile);
+  deallog.depth_console (0);
+  deallog.threshold_double(1.e-7);
+
+  test<1>();
+  test<2>();
+  test<3>();
+}
diff --git a/tests/deal.II/cell_similarity_crash_02/cmp/generic b/tests/deal.II/cell_similarity_crash_02/cmp/generic
new file mode 100644 (file)
index 0000000..fb71de2
--- /dev/null
@@ -0,0 +1,4 @@
+
+DEAL::OK
+DEAL::OK
+DEAL::OK

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.