From 1a75900cc2fd8a75e5c70da6afe4b692b6ab4c75 Mon Sep 17 00:00:00 2001 From: guido Date: Wed, 5 Jul 2006 09:45:15 +0000 Subject: [PATCH] Test for face mg dofs\ These do not work anymore since faces lost their levels git-svn-id: https://svn.dealii.org/trunk@13337 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/multigrid/dof_02.cc | 112 +++++++++++++++++++++++++++++ tests/multigrid/dof_02/.cvsignore | 1 + tests/multigrid/dof_02/cmp/generic | 0 3 files changed, 113 insertions(+) create mode 100644 tests/multigrid/dof_02.cc create mode 100644 tests/multigrid/dof_02/.cvsignore create mode 100644 tests/multigrid/dof_02/cmp/generic diff --git a/tests/multigrid/dof_02.cc b/tests/multigrid/dof_02.cc new file mode 100644 index 0000000000..2fda5ac677 --- /dev/null +++ b/tests/multigrid/dof_02.cc @@ -0,0 +1,112 @@ +//---------------------------------------------------------------------------- +// $Id$ +// 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. +// +//---------------------------------------------------------------------------- + +// check MGDoFAccessor::get_mg_dof_indices for faces + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +using namespace std; + + +template +void dofs(const MGDoFHandler& dof) +{ + typename MGDoFHandler::cell_iterator cell; + const typename MGDoFHandler::cell_iterator end = dof.end(); + + std::vector indices; + + for (cell = dof.begin(); cell != end; ++cell) + { + indices.resize(cell->get_fe().dofs_per_face); + + deallog << "Level " << cell->level(); + for (unsigned int f=0;f::faces_per_cell;++f) + { + typename MGDoFHandler::face_iterator face = cell->face(f); + face->get_mg_dof_indices(indices); + + for (unsigned int i=0;i::vertices_per_face;++i) + deallog << " v" << face->vertex(i); + deallog << " dofs "; + for (unsigned int i=0;i +void check_fe(FiniteElement& fe) +{ + deallog << fe.get_name() << std::endl; + + Triangulation tr; + GridGenerator::hyper_cube(tr); + tr.refine_global(2); + ZeroFunction zero; + typename FunctionMap::type fmap; + fmap.insert(std::make_pair(0, &zero)); + + MGDoFHandler mgdof(tr); + mgdof.distribute_dofs(fe); + dofs(mgdof); +} + + +template +void check() +{ + FE_Q q1(1); + FE_Q q2(2); +// FE_DGQ dq1(1); + + FESystem s1(q1, 2, q2,1); + + check_fe(q1); + check_fe(q2); + check_fe(s1); +} + +int main() +{ + std::ofstream logfile("dof_02/output"); + logfile.precision(3); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + check<2> (); + check<3> (); +} diff --git a/tests/multigrid/dof_02/.cvsignore b/tests/multigrid/dof_02/.cvsignore new file mode 100644 index 0000000000..d196dfb299 --- /dev/null +++ b/tests/multigrid/dof_02/.cvsignore @@ -0,0 +1 @@ +obj.* exe OK output diff --git a/tests/multigrid/dof_02/cmp/generic b/tests/multigrid/dof_02/cmp/generic new file mode 100644 index 0000000000..e69de29bb2 -- 2.39.5