]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
A testcase that should illustrate the problem with crash_10 and hp_hanging_nodes_02...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 21 Sep 2006 23:39:33 +0000 (23:39 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 21 Sep 2006 23:39:33 +0000 (23:39 +0000)
git-svn-id: https://svn.dealii.org/trunk@13945 0785d39b-7218-0410-832d-ea1e28bc413d

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

diff --git a/tests/hp/crash_11.cc b/tests/hp/crash_11.cc
new file mode 100644 (file)
index 0000000..5d0020f
--- /dev/null
@@ -0,0 +1,125 @@
+//----------------------------  crash_11.cc  ---------------------------
+//    $Id: crash_11.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_11.cc  ---------------------------
+
+
+// a test where a degree of freedom was constrained multiple times,
+// but with different weights. see the hp paper for more on this
+
+char logname[] = "crash_11/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 (viewed
+                                  // from top):
+                                  //
+                                  // *---*---*
+                                  // | 2 | 3 |
+                                  // *---*---*
+                                  // | 0 | 1 |
+                                  // *---*---*
+  Triangulation<3>     triangulation;
+  std::vector<unsigned int> subdivisions (3, 2);
+  subdivisions[2] = 1;
+  GridGenerator::subdivided_hyper_rectangle (triangulation, subdivisions,
+                                             Point<3>(), Point<3>(2,2,1));
+
+  hp::FECollection<3> fe;
+  fe.push_back (FE_Q<3>(1));
+  fe.push_back (FE_Q<3>(2));
+  fe.push_back (FE_Q<3>(3));
+  fe.push_back (FE_Q<3>(4));
+
+  hp::DoFHandler<3>        dof_handler(triangulation);
+
+                                  // assign polynomial degrees like this:
+                                   //
+                                  // *---*---*
+                                  // | 1 | 2 |
+                                  // *---*---*
+                                  // | 4 | 3 |
+                                  // *---*---*
+                                   //
+  hp::DoFHandler<3>::active_cell_iterator
+    cell = dof_handler.begin_active();
+  cell->set_active_fe_index (0);
+  ++cell;
+  cell->set_active_fe_index (1);
+  ++cell;
+  cell->set_active_fe_index (2);
+  ++cell;
+  cell->set_active_fe_index (3);
+
+  dof_handler.distribute_dofs (fe);
+  
+                                   // for illustrative purposes, print
+                                   // out the numbers of the dofs that
+                                   // belong to the shared edge
+                                   // (that's the one that has four
+                                   // different fe indices associated
+                                   // with it)
+  for (hp::DoFHandler<3>::active_line_iterator line = dof_handler.begin_active_line();
+       line != dof_handler.end_line(); ++line)
+    if (line->n_active_fe_indices() == 4)
+      {
+       deallog << "Shared line: " << line << std::endl;
+       for (unsigned int i=0; i<4; ++i)
+         {
+           deallog << "DoF indices for fe_index=" << i << ": ";
+           std::vector<unsigned int> line_dofs (fe[i].dofs_per_line + 2*fe[i].dofs_per_vertex);
+           line->get_dof_indices (line_dofs, i);
+           for (unsigned int j=0; j<fe[i].dofs_per_line + 2*fe[i].dofs_per_vertex; ++j)
+             deallog << line_dofs[j] << ' ';
+           deallog << std::endl;
+         }
+      }
+  ConstraintMatrix constraints;
+  DoFTools::make_hanging_node_constraints (dof_handler,
+                                          constraints);
+  constraints.close ();
+
+  constraints.print (deallog.get_file_stream());
+}
+
diff --git a/tests/hp/crash_11/cmp/generic b/tests/hp/crash_11/cmp/generic
new file mode 100644 (file)
index 0000000..e1b0852
--- /dev/null
@@ -0,0 +1,99 @@
+
+DEAL::Shared line: 13
+DEAL::DoF indices for fe_index=0: 3 7 
+DEAL::DoF indices for fe_index=1: 3 7 22 
+DEAL::DoF indices for fe_index=2: 3 7 53 54 
+    12 1:  0.500
+    12 3:  0.500
+    16 5:  0.500
+    16 7:  0.500
+    20 1:  0.500
+    20 5:  0.500
+    22 3:  0.500
+    22 7:  0.500
+    24 1:  0.250
+    24 3:  0.250
+    24 5:  0.250
+    24 7:  0.250
+    37 3:  0.667
+    37 32:  0.333
+    38 3:  0.333
+    38 32:  0.667
+    41 3:  0.222
+    41 9:  -0.111
+    41 15:  0.889
+    42 3:  -0.111
+    42 9:  0.222
+    42 15:  0.889
+    45 7:  0.667
+    45 34:  0.333
+    46 7:  0.333
+    46 34:  0.667
+    49 7:  0.222
+    49 11:  -0.111
+    49 19:  0.889
+    50 7:  -0.111
+    50 11:  0.222
+    50 19:  0.889
+    53 3:  0.667
+    53 7:  0.333
+    54 3:  0.333
+    54 7:  0.667
+    55 9:  0.222
+    55 11:  -0.111
+    55 23:  0.889
+    56 9:  -0.111
+    56 11:  0.222
+    56 23:  0.889
+    57 32:  0.667
+    57 34:  0.333
+    58 32:  0.333
+    58 34:  0.667
+    61 3:  0.444
+    61 7:  0.222
+    61 32:  0.222
+    61 34:  0.111
+    62 3:  0.222
+    62 7:  0.111
+    62 32:  0.444
+    62 34:  0.222
+    63 3:  0.222
+    63 7:  0.444
+    63 32:  0.111
+    63 34:  0.222
+    64 3:  0.111
+    64 7:  0.222
+    64 32:  0.222
+    64 34:  0.444
+    69 3:  0.148
+    69 7:  0.0741
+    69 9:  -0.0247
+    69 11:  0.0123
+    69 15:  0.198
+    69 19:  -0.0988
+    69 23:  -0.0988
+    69 27:  0.790
+    70 3:  0.0741
+    70 7:  0.148
+    70 9:  0.0123
+    70 11:  -0.0247
+    70 15:  -0.0988
+    70 19:  0.198
+    70 23:  -0.0988
+    70 27:  0.790
+    71 3:  -0.0741
+    71 7:  -0.0370
+    71 9:  0.0494
+    71 11:  -0.0247
+    71 15:  0.198
+    71 19:  -0.0988
+    71 23:  0.198
+    71 27:  0.790
+    72 3:  -0.0370
+    72 7:  -0.0741
+    72 9:  -0.0247
+    72 11:  0.0494
+    72 15:  -0.0988
+    72 19:  0.198
+    72 23:  0.198
+    72 27:  0.790

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.