From 4e61d1833c722feaafebda63367d08642ab4fe11 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 12 Oct 2012 03:08:44 +0000 Subject: [PATCH] New test. git-svn-id: https://svn.dealii.org/trunk@27068 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/deal.II/grid_out_03.cc | 63 +++++++++++++++++++++++++++ tests/deal.II/grid_out_03/cmp/generic | 21 +++++++++ 2 files changed, 84 insertions(+) create mode 100644 tests/deal.II/grid_out_03.cc create mode 100644 tests/deal.II/grid_out_03/cmp/generic diff --git a/tests/deal.II/grid_out_03.cc b/tests/deal.II/grid_out_03.cc new file mode 100644 index 0000000000..695488519e --- /dev/null +++ b/tests/deal.II/grid_out_03.cc @@ -0,0 +1,63 @@ +//---------------------------- grid_out_03.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2002, 2003, 2004, 2005, 2008, 2012 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. +// +//---------------------------- grid_out_03.cc --------------------------- + +// make sure that we write boundary lines marked with a non-zero boundary +// indicator correctly in UCD format + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +std::ofstream logfile("grid_out_03/output"); + + +template +void test () +{ + Triangulation tria; + GridGenerator::hyper_cube (tria); + tria.begin_active()->line(0)->set_boundary_indicator(1); + tria.begin_active()->face(2*dim-1)->set_boundary_indicator(2); + + GridOut grid_out; + GridOutFlags::Ucd flags; + flags.write_lines = flags.write_faces = true; + grid_out.set_flags (flags); + grid_out.write_ucd (tria, logfile); +} + + +int main () +{ + deallog << std::setprecision (2); + logfile << std::setprecision (2); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + test<2> (); + test<3> (); +} + diff --git a/tests/deal.II/grid_out_03/cmp/generic b/tests/deal.II/grid_out_03/cmp/generic new file mode 100644 index 0000000000..53428aa5d2 --- /dev/null +++ b/tests/deal.II/grid_out_03/cmp/generic @@ -0,0 +1,21 @@ + +4 3 0 0 0 +1 0.0 0.0 0 +2 1.0 0.0 0 +3 0.0 1.0 0 +4 1.0 1.0 0 +1 0 quad 1 2 4 3 +2 1 line 1 3 +3 2 line 3 4 +8 3 0 0 0 +1 0.0 0.0 0.0 +2 1.0 0.0 0.0 +3 0.0 1.0 0.0 +4 1.0 1.0 0.0 +5 0.0 0.0 1.0 +6 1.0 0.0 1.0 +7 0.0 1.0 1.0 +8 1.0 1.0 1.0 +1 0 hex 1 2 6 5 3 4 8 7 +2 2 quad 5 6 8 7 +2 1 line 1 3 -- 2.39.5