From: bangerth Date: Thu, 21 Sep 2006 20:49:06 +0000 (+0000) Subject: New presently crashing test. Add comments. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=081985e15637d3318debcbf51fea7200a9a95521;p=dealii-svn.git New presently crashing test. Add comments. git-svn-id: https://svn.dealii.org/trunk@13941 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/hp/crash_10.cc b/tests/hp/crash_10.cc new file mode 100644 index 0000000000..3b03d195b2 --- /dev/null +++ b/tests/hp/crash_10.cc @@ -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 +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +std::ofstream logfile("crash_10/output"); + + +template +void test () +{ + Triangulation triangulation; + hp::FECollection fe; + hp::DoFHandler dof_handler(triangulation); + ConstraintMatrix hanging_node_constraints; + + FE_Q 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::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; +} diff --git a/tests/hp/hp_hanging_nodes_02.cc b/tests/hp/hp_hanging_nodes_02.cc index e2bd9bb334..a8b71d5db7 100644 --- a/tests/hp/hp_hanging_nodes_02.cc +++ b/tests/hp/hp_hanging_nodes_02.cc @@ -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