]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add test case for hang with fe_system with 0 components
authorTimo Heister <timo.heister@gmail.com>
Wed, 26 Sep 2012 20:41:14 +0000 (20:41 +0000)
committerTimo Heister <timo.heister@gmail.com>
Wed, 26 Sep 2012 20:41:14 +0000 (20:41 +0000)
git-svn-id: https://svn.dealii.org/trunk@26759 0785d39b-7218-0410-832d-ea1e28bc413d

tests/fail/fe_system.cc [new file with mode: 0644]

diff --git a/tests/fail/fe_system.cc b/tests/fail/fe_system.cc
new file mode 100644 (file)
index 0000000..773adcf
--- /dev/null
@@ -0,0 +1,94 @@
+//----------------------------  system_1.cc  ---------------------------
+//    system_1.cc,v 1.3 2003/06/09 21:55:00 wolf Exp
+//    Version: 
+//
+//    Copyright (C) 2003, 2005 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
+//    fuqher information on this license.
+//
+//----------------------------  system_1.cc  ---------------------------
+
+// document a hang in make_hanging_node_constraints with an
+// FE_System with 0 components.
+
+#include "../tests.h"
+#include <sstream>
+#include <deal.II/base/logstream.h>
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/fe_dgq.h>
+#include <deal.II/fe/fe_dgp.h>
+#include <deal.II/fe/fe_system.h>
+#include <deal.II/fe/fe_tools.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/dofs/dof_handler.h>
+#include <deal.II/dofs/dof_tools.h>
+
+
+
+#include <fstream>
+#include <string>
+
+#define PRECISION 5
+
+
+
+
+template<int dim>
+void test()
+{
+  #if DEAL_II_USE_MT == 1
+
+  DeadlockKiller killer;
+  #endif
+  
+                                  // 0 components is not okay
+  FESystem<dim> fe(FE_Q<dim>(1), 1, FE_Q<dim>(2), 0);
+  Triangulation<dim> tria;
+  GridGenerator::hyper_cube(tria, 0., 1.);
+  tria.refine_global(2);
+tria.begin_active()->set_refine_flag();
+tria.execute_coarsening_and_refinement();
+
+  DoFHandler<dim> dofh(tria);
+
+dofh.distribute_dofs(fe);
+
+ConstraintMatrix cm;
+
+  DoFTools::make_hanging_node_constraints (dofh, cm);
+  cm.close ();
+
+std::ostringstream ss;
+cm.print(ss);
+
+deallog << ss.str() << std::endl;
+
+
+
+
+  
+  deallog << "ok" << std::endl;
+}
+
+
+int
+main()
+{
+  std::ofstream logfile ("fe_system/output");
+  deallog << std::setprecision(PRECISION);
+  deallog << std::fixed;  
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  test<2>();
+  
+  return 0;
+}
+
+
+

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.