From a3db658408f06cbb05860058f4411d61e8b37605 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 10 May 2005 16:29:37 +0000 Subject: [PATCH] These tests tested something that proved to be a dead end. git-svn-id: https://svn.dealii.org/trunk@10664 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/bits/dof_constraints_01x.cc | 239 ----------------------------- tests/bits/dof_constraints_01y.cc | 245 ------------------------------ 2 files changed, 484 deletions(-) delete mode 100644 tests/bits/dof_constraints_01x.cc delete mode 100644 tests/bits/dof_constraints_01y.cc diff --git a/tests/bits/dof_constraints_01x.cc b/tests/bits/dof_constraints_01x.cc deleted file mode 100644 index fab31aa36b..0000000000 --- a/tests/bits/dof_constraints_01x.cc +++ /dev/null @@ -1,239 +0,0 @@ -//---------------------------- dof_constraints_01x.cc --------------------------- -// $Id$ -// Version: $Name$ -// -// Copyright (C) 2004 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. -// -//---------------------------- dof_constraints_01x.cc --------------------------- - - -// check DoFConstraints::distribute_local_to_global for matrices and -// vectors in the presence of both constraints and boundary -// values. this proved to be a really tricky can of worms. this test -// checks things on a rather small domain, the sister test -// dof_constraints_01y does it on complicated meshes - -#include "../tests.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -template -void test () -{ - deallog << dim << "D" << std::endl; - - Triangulation triangulation; - GridGenerator::hyper_cube (triangulation); - - // set boundary conditions on part of the boundary - for (unsigned int i=0; iface(i)->set_boundary_indicator (1); - - // refine the mesh exactly once - // adaptively, so that there are - // hanging nodes and boundary - // values: - triangulation.refine_global (1); - triangulation.begin_active()->set_refine_flag (); - triangulation.execute_coarsening_and_refinement (); - - deallog << "Number of cells: " << triangulation.n_active_cells() << std::endl; - - // set up a DoFHandler and compute hanging - // node constraints - FE_Q fe(1); - DoFHandler dof_handler (triangulation); - dof_handler.distribute_dofs (fe); - deallog << "Number of dofs: " << dof_handler.n_dofs() << std::endl; - - ConstraintMatrix constraints; - DoFTools::make_hanging_node_constraints (dof_handler, constraints); - constraints.close (); - deallog << "Number of constraints: " << constraints.n_constraints() << std::endl; - - // compute some boundary values - std::map boundary_values; - VectorTools::interpolate_boundary_values (dof_handler, 0, - ConstantFunction (1.), - boundary_values); - - // then set up a sparsity pattern and two - // matrices on top of it - SparsityPattern sparsity (dof_handler.n_dofs(), - dof_handler.n_dofs(), - dof_handler.max_couplings_between_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, sparsity); - constraints.condense (sparsity); - SparseMatrix A(sparsity), B(sparsity); - Vector a(dof_handler.n_dofs()), b(dof_handler.n_dofs()); - - // then fill the two matrices by setting up - // bogus matrix entries and (1) writing - // them into the matrix and condensing away - // hanging node constraints later on, or - // (2) distributing them right away - std::vector local_dofs (fe.dofs_per_cell); - FullMatrix local_matrix (fe.dofs_per_cell, fe.dofs_per_cell); - Vector local_vector (fe.dofs_per_cell); - - for (typename DoFHandler::active_cell_iterator - cell = dof_handler.begin_active(); - cell != dof_handler.end(); ++cell) - { - cell->get_dof_indices (local_dofs); - local_matrix = 0; - local_vector = 0; - for (unsigned int i=0; i x (dof_handler.n_dofs()); - MatrixTools::apply_boundary_values (boundary_values, A, x, a); - - // we haven't yet set the diagonal entries - // for constrained nodes. we can do so at - // will, since these values don't matter - // anyway - for (unsigned int i=0; i (); - test<3> (); - } - catch (std::exception &exc) - { - std::cerr << std::endl << std::endl - << "----------------------------------------------------" - << std::endl; - std::cerr << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - - return 1; - } - catch (...) - { - std::cerr << std::endl << std::endl - << "----------------------------------------------------" - << std::endl; - std::cerr << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - return 1; - }; -} diff --git a/tests/bits/dof_constraints_01y.cc b/tests/bits/dof_constraints_01y.cc deleted file mode 100644 index de13a429bd..0000000000 --- a/tests/bits/dof_constraints_01y.cc +++ /dev/null @@ -1,245 +0,0 @@ -//---------------------------- dof_constraints_01y.cc --------------------------- -// $Id$ -// Version: $Name$ -// -// Copyright (C) 2004 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. -// -//---------------------------- dof_constraints_01y.cc --------------------------- - - -// check DoFConstraints::distribute_local_to_global for matrices and -// vectors in the presence of both constraints and boundary -// values. this proved to be a really tricky can of worms. this test -// checks things on a rather small domain, the sister test -// dof_constraints_01y does it on complicated meshes - -#include "../tests.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -template -void test () -{ - deallog << dim << "D" << std::endl; - - Triangulation triangulation; - GridGenerator::hyper_cube (triangulation); - - // set boundary conditions on part of the boundary - for (unsigned int i=0; iface(i)->set_boundary_indicator (1); - - // refine the mesh in a random way so as to - // generate as many hanging node - // constraints as possible - triangulation.refine_global (4-dim); - for (unsigned int i=0; i<11-2*dim; ++i) - { - typename Triangulation::active_cell_iterator - cell = triangulation.begin_active(); - for (unsigned int index=0; cell != triangulation.end(); ++cell, ++index) - if (index % (3*dim) == 0) - cell->set_refine_flag(); - triangulation.execute_coarsening_and_refinement (); - } - - deallog << "Number of cells: " << triangulation.n_active_cells() << std::endl; - - // set up a DoFHandler and compute hanging - // node constraints - FE_Q fe(1); - DoFHandler dof_handler (triangulation); - dof_handler.distribute_dofs (fe); - deallog << "Number of dofs: " << dof_handler.n_dofs() << std::endl; - - ConstraintMatrix constraints; - DoFTools::make_hanging_node_constraints (dof_handler, constraints); - constraints.close (); - deallog << "Number of constraints: " << constraints.n_constraints() << std::endl; - - // compute some boundary values - std::map boundary_values; - VectorTools::interpolate_boundary_values (dof_handler, 0, - ConstantFunction (1.), - boundary_values); - - // then set up a sparsity pattern and two - // matrices on top of it - SparsityPattern sparsity (dof_handler.n_dofs(), - dof_handler.n_dofs(), - dof_handler.max_couplings_between_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, sparsity); - constraints.condense (sparsity); - SparseMatrix A(sparsity), B(sparsity); - Vector a(dof_handler.n_dofs()), b(dof_handler.n_dofs()); - - // then fill the two matrices by setting up - // bogus matrix entries and (1) writing - // them into the matrix and condensing away - // hanging node constraints later on, or - // (2) distributing them right away - std::vector local_dofs (fe.dofs_per_cell); - FullMatrix local_matrix (fe.dofs_per_cell, fe.dofs_per_cell); - Vector local_vector (fe.dofs_per_cell); - - for (typename DoFHandler::active_cell_iterator - cell = dof_handler.begin_active(); - cell != dof_handler.end(); ++cell) - { - cell->get_dof_indices (local_dofs); - local_matrix = 0; - local_vector = 0; - for (unsigned int i=0; i x (dof_handler.n_dofs()); - MatrixTools::apply_boundary_values (boundary_values, A, x, a); - - // we haven't yet set the diagonal entries - // for constrained nodes. we can do so at - // will, since these values don't matter - // anyway - for (unsigned int i=0; i (); - test<3> (); - } - catch (std::exception &exc) - { - std::cerr << std::endl << std::endl - << "----------------------------------------------------" - << std::endl; - std::cerr << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - - return 1; - } - catch (...) - { - std::cerr << std::endl << std::endl - << "----------------------------------------------------" - << std::endl; - std::cerr << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - return 1; - }; -} -- 2.39.5