From f7f85a86079afaf0dedc83318e449c3035e2f0bf Mon Sep 17 00:00:00 2001 From: bangerth Date: Mon, 6 Dec 2010 00:34:04 +0000 Subject: [PATCH] New test. git-svn-id: https://svn.dealii.org/trunk@22922 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/codim_one/extract_boundary_mesh_05.cc | 77 +++++++++++++++++++ .../extract_boundary_mesh_05/cmp/generic | 18 +++++ 2 files changed, 95 insertions(+) create mode 100644 tests/codim_one/extract_boundary_mesh_05.cc create mode 100644 tests/codim_one/extract_boundary_mesh_05/cmp/generic diff --git a/tests/codim_one/extract_boundary_mesh_05.cc b/tests/codim_one/extract_boundary_mesh_05.cc new file mode 100644 index 0000000000..ffd07a5ec6 --- /dev/null +++ b/tests/codim_one/extract_boundary_mesh_05.cc @@ -0,0 +1,77 @@ +//---------------------------- extract_boundary_mesh_03.cc --------------------------- +// $Id: bem.cc 22693 2010-11-11 20:11:47Z kanschat $ +// Version: $Name$ +// +// Copyright (C) 2010 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. +// +//---------------------------- extract_boundary_mesh_03.cc --------------------------- + + +#include "../tests.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +using namespace std; + + +void test () +{ + const unsigned int dim=2; + + Triangulation boundary_mesh; + map::cell_iterator,Triangulation::face_iterator > + surface_to_volume_mapping; + Triangulation volume_mesh; + GridGenerator::hyper_cube(volume_mesh); + + GridTools::extract_boundary_mesh (volume_mesh, boundary_mesh, + surface_to_volume_mapping); + + FE_Q boundary_fe (1); + DoFHandler boundary_dh(boundary_mesh); + boundary_dh.distribute_dofs (boundary_fe); + + deallog << "n_dofs=" << boundary_dh.n_dofs() << std::endl; + + for (DoFHandler::active_cell_iterator + cell = boundary_dh.begin_active(), + endc = boundary_dh.end(); cell!=endc; ++cell) + { + deallog << "Cell: " << cell << std::endl; + for (unsigned int v=0; v::vertices_per_cell; ++v) + { + unsigned int index = cell->vertex_dof_index(v,0); + deallog << "vertex: " << v + << ", global: " << cell->vertex_index(v) + << " index: " << index << std::endl; + } + + deallog << std::endl; + } +} + + + +int main () +{ + + ofstream logfile("extract_boundary_mesh_05/output"); + deallog.attach(logfile); + deallog.depth_console(0); + + test (); + } diff --git a/tests/codim_one/extract_boundary_mesh_05/cmp/generic b/tests/codim_one/extract_boundary_mesh_05/cmp/generic new file mode 100644 index 0000000000..b66eda80c7 --- /dev/null +++ b/tests/codim_one/extract_boundary_mesh_05/cmp/generic @@ -0,0 +1,18 @@ + +DEAL::n_dofs=4 +DEAL::Cell: 0.0 +DEAL::vertex: 0, global: 0 index: 0 +DEAL::vertex: 1, global: 1 index: 1 +DEAL:: +DEAL::Cell: 0.1 +DEAL::vertex: 0, global: 2 index: 2 +DEAL::vertex: 1, global: 3 index: 3 +DEAL:: +DEAL::Cell: 0.2 +DEAL::vertex: 0, global: 0 index: 0 +DEAL::vertex: 1, global: 2 index: 2 +DEAL:: +DEAL::Cell: 0.3 +DEAL::vertex: 0, global: 1 index: 1 +DEAL::vertex: 1, global: 3 index: 3 +DEAL:: -- 2.39.5