]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add new testcase that produces cyclic constraints.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 15 Sep 2006 15:44:07 +0000 (15:44 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 15 Sep 2006 15:44:07 +0000 (15:44 +0000)
git-svn-id: https://svn.dealii.org/trunk@13907 0785d39b-7218-0410-832d-ea1e28bc413d

tests/hp/crash_08.cc [new file with mode: 0644]
tests/hp/crash_08/cmp/generic [new file with mode: 0644]

diff --git a/tests/hp/crash_08.cc b/tests/hp/crash_08.cc
new file mode 100644 (file)
index 0000000..a7df912
--- /dev/null
@@ -0,0 +1,150 @@
+//----------------------------  crash_08.cc  ---------------------------
+//    $Id: crash_08.cc 12732 2006-03-28 23:15:45Z wolf $
+//    Version: $Name$ 
+//
+//    Copyright (C) 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_08.cc  ---------------------------
+
+
+// the crash_08 testcase discussed in the hp paper. this produces a cyclic
+// constraint between degrees of freedom 3->14->17->6->3 with the algorithm
+// that is presently in make_hanging_node_constraints
+
+char logname[] = "crash_08/output";
+
+
+#include "../tests.h"
+#include <base/function.h>
+#include <base/logstream.h>
+#include <base/quadrature_lib.h>
+#include <lac/vector.h>
+
+#include <grid/tria.h>
+#include <dofs/hp_dof_handler.h>
+#include <dofs/dof_constraints.h>
+#include <grid/grid_generator.h>
+#include <grid/grid_refinement.h>
+#include <grid/tria_accessor.h>
+#include <grid/tria_iterator.h>
+#include <grid/tria_boundary_lib.h>
+#include <dofs/dof_accessor.h>
+#include <dofs/dof_tools.h>
+#include <numerics/vectors.h>
+#include <fe/fe_q.h>
+
+#include <fstream>
+#include <vector>
+
+
+
+int main ()
+{
+  std::ofstream logfile(logname);
+  logfile.precision (3);
+  
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+
+                                  // create a mesh like this:
+                                  //
+                                  // *---*---*---*
+                                  // | 6 | 7 | 8 |
+                                  // *---*---*---*
+                                  // | 3 | 4 | 5 |
+                                  // *---*---*---*
+                                  // | 0 | 1 | 2 |
+                                  // *---*---*---*
+  Triangulation<2>     triangulation;
+  GridGenerator::subdivided_hyper_cube (triangulation, 3);
+
+  hp::FECollection<2> fe;
+  fe.push_back (FE_Q<2>(1));
+  fe.push_back (FE_Q<2>(2));
+  fe.push_back (FE_Q<2>(3));
+
+  hp::DoFHandler<2>        dof_handler(triangulation);
+
+                                  // subdivide cells 1, 3, 5, 7
+  hp::DoFHandler<2>::active_cell_iterator
+    cell = dof_handler.begin_active();
+  ++cell;
+  cell->set_refine_flag ();
+  ++cell; ++cell;
+  cell->set_refine_flag ();
+  ++cell; ++cell;
+  cell->set_refine_flag ();
+  ++cell; ++cell;
+  cell->set_refine_flag ();
+  triangulation.execute_coarsening_and_refinement ();
+
+                                  // now set fe_index as described in the
+                                  // paper
+  cell = dof_handler.begin_active();
+  cell->set_active_fe_index (0);
+  ++cell;
+  cell->set_active_fe_index (0);
+  ++cell;
+  cell->set_active_fe_index (1);
+  ++cell;
+  cell->set_active_fe_index (0);
+  ++cell;
+  cell->set_active_fe_index (0);
+
+                                  // one set of small cells
+  ++cell;
+  cell->set_active_fe_index (0);
+  ++cell;
+  cell->set_active_fe_index (0);
+  ++cell;
+  cell->set_active_fe_index (0);
+  ++cell;
+  cell->set_active_fe_index (2);
+
+                                  // one set of small cells
+  ++cell;
+  cell->set_active_fe_index (0);
+  ++cell;
+  cell->set_active_fe_index (2);
+  ++cell;
+  cell->set_active_fe_index (0);
+  ++cell;
+  cell->set_active_fe_index (0);
+
+                                  // one set of small cells
+  ++cell;
+  cell->set_active_fe_index (0);
+  ++cell;
+  cell->set_active_fe_index (0);
+  ++cell;
+  cell->set_active_fe_index (2);
+  ++cell;
+  cell->set_active_fe_index (0);
+
+                                  // one set of small cells
+  ++cell;
+  cell->set_active_fe_index (2);
+  ++cell;
+  cell->set_active_fe_index (0);
+  ++cell;
+  cell->set_active_fe_index (0);
+  ++cell;
+  cell->set_active_fe_index (0);
+
+  dof_handler.distribute_dofs (fe);
+  
+  ConstraintMatrix constraints;
+  DoFTools::make_hanging_node_constraints (dof_handler,
+                                          constraints);
+  constraints.close ();
+
+  constraints.print (deallog.get_file_stream());
+}
+
diff --git a/tests/hp/crash_08/cmp/generic b/tests/hp/crash_08/cmp/generic
new file mode 100644 (file)
index 0000000..efc6a30
--- /dev/null
@@ -0,0 +1,145 @@
+
+DEAL::n_dofs=12
+DEAL:cg::Starting value 1.09
+DEAL:cg::Convergence step 10 value 0
+DEAL::FE_Q<2>(1), P_0, rel. error=0
+DEAL:cg::Starting value 2.19
+DEAL:cg::Convergence step 10 value 0
+DEAL::FE_Q<2>(1), P_1, rel. error=0
+DEAL:cg::Starting value 3.31
+DEAL:cg::Convergence step 10 value 0
+DEAL::FE_Q<2>(1), P_2, rel. error=0.00715
+DEAL:cg::Starting value 4.45
+DEAL:cg::Convergence step 10 value 0
+DEAL::FE_Q<2>(1), P_3, rel. error=0.0158
+DEAL::n_dofs=12
+DEAL:cg::Starting value 1.15
+DEAL:cg::Convergence step 10 value 0
+DEAL::FE_Q<2>(1), P_0, rel. error=0
+DEAL:cg::Starting value 2.20
+DEAL:cg::Convergence step 10 value 0
+DEAL::FE_Q<2>(1), P_1, rel. error=0
+DEAL:cg::Starting value 3.21
+DEAL:cg::Convergence step 10 value 0
+DEAL::FE_Q<2>(1), P_2, rel. error=0.00605
+DEAL:cg::Starting value 4.20
+DEAL:cg::Convergence step 10 value 0
+DEAL::FE_Q<2>(1), P_3, rel. error=0.0124
+DEAL::n_dofs=12
+DEAL:cg::Starting value 1.06
+DEAL:cg::Convergence step 10 value 0
+DEAL::FE_Q<2>(1), P_0, rel. error=0
+DEAL:cg::Starting value 2.10
+DEAL:cg::Convergence step 9 value 0
+DEAL::FE_Q<2>(1), P_1, rel. error=0
+DEAL:cg::Starting value 3.13
+DEAL:cg::Convergence step 9 value 0
+DEAL::FE_Q<2>(1), P_2, rel. error=0.00407
+DEAL:cg::Starting value 4.16
+DEAL:cg::Convergence step 9 value 0
+DEAL::FE_Q<2>(1), P_3, rel. error=0.00858
+DEAL::n_dofs=37
+DEAL:cg::Starting value 0.807
+DEAL:cg::Convergence step 13 value 0
+DEAL::FE_Q<2>(2), P_0, rel. error=0
+DEAL:cg::Starting value 1.65
+DEAL:cg::Convergence step 12 value 0
+DEAL::FE_Q<2>(2), P_1, rel. error=0
+DEAL:cg::Starting value 2.52
+DEAL:cg::Convergence step 12 value 0
+DEAL::FE_Q<2>(2), P_2, rel. error=0
+DEAL:cg::Starting value 3.40
+DEAL:cg::Convergence step 12 value 0
+DEAL::FE_Q<2>(2), P_3, rel. error=0.000778
+DEAL:cg::Starting value 4.29
+DEAL:cg::Convergence step 13 value 0
+DEAL::FE_Q<2>(2), P_4, rel. error=0.00214
+DEAL::n_dofs=37
+DEAL:cg::Starting value 0.884
+DEAL:cg::Convergence step 12 value 0
+DEAL::FE_Q<2>(2), P_0, rel. error=0
+DEAL:cg::Starting value 1.67
+DEAL:cg::Convergence step 12 value 0
+DEAL::FE_Q<2>(2), P_1, rel. error=0
+DEAL:cg::Starting value 2.41
+DEAL:cg::Convergence step 13 value 0
+DEAL::FE_Q<2>(2), P_2, rel. error=0
+DEAL:cg::Starting value 3.13
+DEAL:cg::Convergence step 13 value 0
+DEAL::FE_Q<2>(2), P_3, rel. error=0.000621
+DEAL:cg::Starting value 3.84
+DEAL:cg::Convergence step 13 value 0
+DEAL::FE_Q<2>(2), P_4, rel. error=0.00167
+DEAL::n_dofs=37
+DEAL:cg::Starting value 0.746
+DEAL:cg::Convergence step 13 value 0
+DEAL::FE_Q<2>(2), P_0, rel. error=0
+DEAL:cg::Starting value 1.47
+DEAL:cg::Convergence step 13 value 0
+DEAL::FE_Q<2>(2), P_1, rel. error=0
+DEAL:cg::Starting value 2.22
+DEAL:cg::Convergence step 13 value 0
+DEAL::FE_Q<2>(2), P_2, rel. error=0
+DEAL:cg::Starting value 3.00
+DEAL:cg::Convergence step 13 value 0
+DEAL::FE_Q<2>(2), P_3, rel. error=0.000395
+DEAL:cg::Starting value 3.79
+DEAL:cg::Convergence step 13 value 0
+DEAL::FE_Q<2>(2), P_4, rel. error=0.00106
+DEAL::n_dofs=74
+DEAL:cg::Starting value 0.508
+DEAL:cg::Convergence step 15 value 0
+DEAL::FE_Q<2>(3), P_0, rel. error=0
+DEAL:cg::Starting value 1.04
+DEAL:cg::Convergence step 15 value 0
+DEAL::FE_Q<2>(3), P_1, rel. error=0
+DEAL:cg::Starting value 1.61
+DEAL:cg::Convergence step 15 value 0
+DEAL::FE_Q<2>(3), P_2, rel. error=0
+DEAL:cg::Starting value 2.21
+DEAL:cg::Convergence step 15 value 0
+DEAL::FE_Q<2>(3), P_3, rel. error=0
+DEAL:cg::Starting value 2.85
+DEAL:cg::Convergence step 15 value 0
+DEAL::FE_Q<2>(3), P_4, rel. error=0.000115
+DEAL:cg::Starting value 3.51
+DEAL:cg::Convergence step 15 value 0
+DEAL::FE_Q<2>(3), P_5, rel. error=0.000379
+DEAL::n_dofs=74
+DEAL:cg::Starting value 0.560
+DEAL:cg::Convergence step 15 value 0
+DEAL::FE_Q<2>(3), P_0, rel. error=0
+DEAL:cg::Starting value 1.05
+DEAL:cg::Convergence step 15 value 0
+DEAL::FE_Q<2>(3), P_1, rel. error=0
+DEAL:cg::Starting value 1.53
+DEAL:cg::Convergence step 15 value 0
+DEAL::FE_Q<2>(3), P_2, rel. error=0
+DEAL:cg::Starting value 2.03
+DEAL:cg::Convergence step 15 value 0
+DEAL::FE_Q<2>(3), P_3, rel. error=0
+DEAL:cg::Starting value 2.55
+DEAL:cg::Convergence step 15 value 0
+DEAL::FE_Q<2>(3), P_4, rel. error=8.88e-05
+DEAL:cg::Starting value 3.09
+DEAL:cg::Convergence step 15 value 0
+DEAL::FE_Q<2>(3), P_5, rel. error=0.000291
+DEAL::n_dofs=74
+DEAL:cg::Starting value 0.471
+DEAL:cg::Convergence step 15 value 0
+DEAL::FE_Q<2>(3), P_0, rel. error=0
+DEAL:cg::Starting value 0.922
+DEAL:cg::Convergence step 15 value 0
+DEAL::FE_Q<2>(3), P_1, rel. error=0
+DEAL:cg::Starting value 1.41
+DEAL:cg::Convergence step 15 value 0
+DEAL::FE_Q<2>(3), P_2, rel. error=0
+DEAL:cg::Starting value 1.93
+DEAL:cg::Convergence step 15 value 0
+DEAL::FE_Q<2>(3), P_3, rel. error=0
+DEAL:cg::Starting value 2.48
+DEAL:cg::Convergence step 15 value 0
+DEAL::FE_Q<2>(3), P_4, rel. error=4.73e-05
+DEAL:cg::Starting value 3.05
+DEAL:cg::Convergence step 15 value 0
+DEAL::FE_Q<2>(3), P_5, rel. error=0.000155

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.