]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
New presently crashing test. Add comments.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 21 Sep 2006 20:49:06 +0000 (20:49 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 21 Sep 2006 20:49:06 +0000 (20:49 +0000)
git-svn-id: https://svn.dealii.org/trunk@13941 0785d39b-7218-0410-832d-ea1e28bc413d

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

diff --git a/tests/hp/crash_10.cc b/tests/hp/crash_10.cc
new file mode 100644 (file)
index 0000000..3b03d19
--- /dev/null
@@ -0,0 +1,114 @@
+//----------------------------  crash_10.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_10.cc  ---------------------------
+
+
+// a version of hp_hanging_node_02 that crashed at the time
+// of writing the time
+
+#include <base/logstream.h>
+#include <grid/tria.h>
+#include <dofs/dof_handler.h>
+#include <dofs/dof_constraints.h>
+#include <grid/grid_generator.h>
+
+#include <grid/tria_accessor.h>
+#include <grid/tria_iterator.h>
+#include <dofs/dof_accessor.h>
+
+#include <fe/fe_q.h>
+
+#include <dofs/dof_tools.h>
+
+#include <fe/hp_fe_values.h>
+#include <base/quadrature_lib.h>
+
+#include <base/function.h>
+#include <numerics/vectors.h>
+#include <numerics/matrices.h>
+
+#include <lac/vector.h>
+#include <lac/full_matrix.h>
+#include <lac/sparse_matrix.h>
+#include <lac/solver_cg.h>
+#include <lac/precondition.h>
+
+#include <numerics/data_out.h>
+#include <fstream>
+#include <iostream>
+
+std::ofstream logfile("crash_10/output");
+
+
+template <int dim>
+void test ()
+{
+  Triangulation<dim>     triangulation;
+  hp::FECollection<dim>              fe;
+  hp::DoFHandler<dim>        dof_handler(triangulation);
+  ConstraintMatrix     hanging_node_constraints;
+
+  FE_Q<dim> fe_1 (1), fe_2 (2), fe_3 (3), fe_4 (4);
+
+  fe.push_back (fe_1);
+  fe.push_back (fe_2);
+  fe.push_back (fe_3);
+  fe.push_back (fe_4);
+  
+  
+  
+  GridGenerator::hyper_cube (triangulation, -1, 1);
+  triangulation.refine_global (5-dim);
+  deallog << "Number of active cells: "
+           << triangulation.n_active_cells()
+           << std::endl;
+  deallog << "Total number of cells: "
+           << triangulation.n_cells()
+           << std::endl;
+
+                                  // Now to the p-Method. Assign
+                                  // random active_fe_indices to the
+                                  // different cells.
+  typename hp::DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active (),
+                                                    endc = dof_handler.end ();
+  for (; cell != endc; ++cell)
+    cell->set_active_fe_index (random() % 4);
+  
+  dof_handler.distribute_dofs (fe);
+  DoFTools::make_hanging_node_constraints (dof_handler,
+                                          hanging_node_constraints);
+
+  hanging_node_constraints.print (deallog.get_file_stream ());
+
+  hanging_node_constraints.close ();
+}
+
+
+int main () 
+{
+  logfile.precision(2);
+  
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);  
+
+                                  // this test depends on the right
+                                  // starting value of the random
+                                  // number generator. set it to the
+                                  // same value it has in
+                                  // hp_hanging_nodes_02
+  for (unsigned int i=0; i<64; ++i)
+    random ();
+  test<3> ();
+      
+  return 0;
+}
index e2bd9bb334c18026cb95f46d5b44e81aecba5a78..a8b71d5db78b6f203db04528034efaa9f904e763 100644 (file)
@@ -1,4 +1,4 @@
-//----------------------------  step-3.cc  ---------------------------
+//----------------------------  hp_hanging_node_constraints_02.cc  ---------------------------
 //    $Id$
 //    Version: $Name$ 
 //
@@ -9,7 +9,7 @@
 //    to the file deal.II/doc/license.html for the  text  and
 //    further information on this license.
 //
-//----------------------------  step-3.cc  ---------------------------
+//----------------------------  hp_hanging_node_constraints_02.cc  ---------------------------
 
 
 // modified step-3 to be a L_2 projection. This function

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.