From e3557a53ae8db7b5ec136b9986054db310de77b2 Mon Sep 17 00:00:00 2001 From: bangerth Date: Thu, 9 Dec 2010 14:02:18 +0000 Subject: [PATCH] New test. git-svn-id: https://svn.dealii.org/trunk@22949 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/codim_one/direction_flag_02.cc | 71 +++++++++++++++++++ tests/codim_one/direction_flag_02/cmp/generic | 55 ++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 tests/codim_one/direction_flag_02.cc create mode 100644 tests/codim_one/direction_flag_02/cmp/generic diff --git a/tests/codim_one/direction_flag_02.cc b/tests/codim_one/direction_flag_02.cc new file mode 100644 index 0000000000..525209c614 --- /dev/null +++ b/tests/codim_one/direction_flag_02.cc @@ -0,0 +1,71 @@ +//---------------------------- direction_flag_02.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. +// +//---------------------------- direction_flag_02.cc --------------------------- + +// test direction flags in a 2d mesh embedded in 3d + +#include "../tests.h" + +#include +#include +#include +#include +#include + +using namespace std; + + +void test () +{ + const unsigned int spacedim = 3; + const unsigned int dim = spacedim-1; + + 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); + for (Triangulation::active_cell_iterator + cell = boundary_mesh.begin_active(); + cell != boundary_mesh.end(); ++cell) + { + deallog << "Cell=" << cell; + deallog << ", direction flag=" + << (cell->direction_flag() ? "true" : "false") + << std::endl; + } + + boundary_mesh.refine_global(1); + + for (Triangulation::active_cell_iterator + cell = boundary_mesh.begin_active(); + cell != boundary_mesh.end(); ++cell) + { + deallog << "Cell=" << cell << std::endl; + deallog << ", direction flag=" + << (cell->direction_flag() ? "true" : "false") + << std::endl; + } +} + + + +int main () +{ + ofstream logfile("direction_flag_02/output"); + deallog.attach(logfile); + deallog.depth_console(0); + + test (); + } diff --git a/tests/codim_one/direction_flag_02/cmp/generic b/tests/codim_one/direction_flag_02/cmp/generic new file mode 100644 index 0000000000..74324d1f0d --- /dev/null +++ b/tests/codim_one/direction_flag_02/cmp/generic @@ -0,0 +1,55 @@ + +DEAL::Cell=0.0, direction flag=true +DEAL::Cell=0.1, direction flag=false +DEAL::Cell=0.2, direction flag=true +DEAL::Cell=0.3, direction flag=false +DEAL::Cell=0.4, direction flag=true +DEAL::Cell=0.5, direction flag=false +DEAL::Cell=1.0 +DEAL::, direction flag=true +DEAL::Cell=1.1 +DEAL::, direction flag=true +DEAL::Cell=1.2 +DEAL::, direction flag=true +DEAL::Cell=1.3 +DEAL::, direction flag=true +DEAL::Cell=1.4 +DEAL::, direction flag=false +DEAL::Cell=1.5 +DEAL::, direction flag=false +DEAL::Cell=1.6 +DEAL::, direction flag=false +DEAL::Cell=1.7 +DEAL::, direction flag=false +DEAL::Cell=1.8 +DEAL::, direction flag=true +DEAL::Cell=1.9 +DEAL::, direction flag=true +DEAL::Cell=1.10 +DEAL::, direction flag=true +DEAL::Cell=1.11 +DEAL::, direction flag=true +DEAL::Cell=1.12 +DEAL::, direction flag=false +DEAL::Cell=1.13 +DEAL::, direction flag=false +DEAL::Cell=1.14 +DEAL::, direction flag=false +DEAL::Cell=1.15 +DEAL::, direction flag=false +DEAL::Cell=1.16 +DEAL::, direction flag=true +DEAL::Cell=1.17 +DEAL::, direction flag=true +DEAL::Cell=1.18 +DEAL::, direction flag=true +DEAL::Cell=1.19 +DEAL::, direction flag=true +DEAL::Cell=1.20 +DEAL::, direction flag=false +DEAL::Cell=1.21 +DEAL::, direction flag=false +DEAL::Cell=1.22 +DEAL::, direction flag=false +DEAL::Cell=1.23 +DEAL::, direction flag=false -- 2.39.5