From f493e26e6fc4de20cf44ea2c99af3d6167c8635d Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 10 Apr 2013 03:15:07 +0000 Subject: [PATCH] New test. git-svn-id: https://svn.dealii.org/trunk@29233 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/codim_one/extract_boundary_mesh_07.cc | 118 ++++++++++++++++++ .../extract_boundary_mesh_07/cmp/generic | 5 + 2 files changed, 123 insertions(+) create mode 100644 tests/codim_one/extract_boundary_mesh_07.cc create mode 100644 tests/codim_one/extract_boundary_mesh_07/cmp/generic diff --git a/tests/codim_one/extract_boundary_mesh_07.cc b/tests/codim_one/extract_boundary_mesh_07.cc new file mode 100644 index 0000000000..a1237e0a75 --- /dev/null +++ b/tests/codim_one/extract_boundary_mesh_07.cc @@ -0,0 +1,118 @@ +//---------------------------- extract_boundary_mesh_07.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2010, 2013 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_07.cc --------------------------- + +// verify that we can indeed call extract_boundary_mesh with DoFHandler +// arguments. based on a test by Korosh Taebi + +#include "../tests.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace Step38 +{ + using namespace dealii; + + template + class Extract_Mesh_Test + { + public: + Extract_Mesh_Test (); + void run (); + + private: + static const unsigned int boundary_dim = spacedim-1; + + Triangulation volume_mesh_triangulation; + Triangulation boundary_triangulation; + + FE_Q space_fe; + FE_Q boundary_fe; + + DoFHandler space_dof_handler; + DoFHandler contact_dof_handler; + + }; + + + template + Extract_Mesh_Test:: + Extract_Mesh_Test () + : + space_fe (spacedim), + boundary_fe (1), + space_dof_handler(volume_mesh_triangulation), + contact_dof_handler(boundary_triangulation) + {} + + template + void Extract_Mesh_Test::run () + { + GridGenerator::hyper_cube(volume_mesh_triangulation); + std::set boundary_ids; + boundary_ids.insert(0); + + space_dof_handler.distribute_dofs(space_fe); + + std::map::cell_iterator, + typename DoFHandler::face_iterator> + element_assignment = + GridTools::extract_boundary_mesh(space_dof_handler, + contact_dof_handler, + boundary_ids); + + contact_dof_handler.distribute_dofs(boundary_fe); + + typename std::map::cell_iterator,typename DoFHandler::face_iterator>::iterator Iterator; + + for (Iterator = element_assignment.begin();Iterator != element_assignment.end(); ++Iterator) + { + deallog << "element_assignment maps " << Iterator->first << " onto " << Iterator->second << std::endl; + } + + } +} + + +int main () +{ + std::ofstream logfile("extract_boundary_mesh_07/output"); + deallog.attach(logfile); + deallog.depth_console(0); + + { + using namespace dealii; + using namespace Step38; + + Extract_Mesh_Test<2> Test; + Test.run(); + } + } diff --git a/tests/codim_one/extract_boundary_mesh_07/cmp/generic b/tests/codim_one/extract_boundary_mesh_07/cmp/generic new file mode 100644 index 0000000000..8b93bf1439 --- /dev/null +++ b/tests/codim_one/extract_boundary_mesh_07/cmp/generic @@ -0,0 +1,5 @@ + +DEAL::element_assignment maps 0.0 onto 1 +DEAL::element_assignment maps 0.1 onto 2 +DEAL::element_assignment maps 0.2 onto 0 +DEAL::element_assignment maps 0.3 onto 3 -- 2.39.5