From ebc1d1aa15ecd64a363d1a84788c6f41fc719139 Mon Sep 17 00:00:00 2001 From: bangerth Date: Thu, 21 Sep 2006 23:39:33 +0000 Subject: [PATCH] A testcase that should illustrate the problem with crash_10 and hp_hanging_nodes_02 (but doesn't right now, because we have a problem with eliminating DoFs). git-svn-id: https://svn.dealii.org/trunk@13945 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/hp/crash_11.cc | 125 ++++++++++++++++++++++++++++++++++ tests/hp/crash_11/cmp/generic | 99 +++++++++++++++++++++++++++ 2 files changed, 224 insertions(+) create mode 100644 tests/hp/crash_11.cc create mode 100644 tests/hp/crash_11/cmp/generic diff --git a/tests/hp/crash_11.cc b/tests/hp/crash_11.cc new file mode 100644 index 0000000000..5d0020f290 --- /dev/null +++ b/tests/hp/crash_11.cc @@ -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 +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + + +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 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 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