From 7ee4003f1397150a85fac8666c3a4f2c120beb90 Mon Sep 17 00:00:00 2001 From: bangerth Date: Sat, 3 Sep 2011 00:04:52 +0000 Subject: [PATCH] New test. git-svn-id: https://svn.dealii.org/trunk@24244 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/deal.II/grid_tools_02.cc | 69 +++++++++++++++++++++++++ tests/deal.II/grid_tools_02/cmp/generic | 5 ++ 2 files changed, 74 insertions(+) create mode 100644 tests/deal.II/grid_tools_02.cc create mode 100644 tests/deal.II/grid_tools_02/cmp/generic diff --git a/tests/deal.II/grid_tools_02.cc b/tests/deal.II/grid_tools_02.cc new file mode 100644 index 0000000000..1169640fd7 --- /dev/null +++ b/tests/deal.II/grid_tools_02.cc @@ -0,0 +1,69 @@ +//---------------------------- grid_tools.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2011 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_tools.cc --------------------------- + + +// check GridTools::diameter for codim-1 meshes + + +#include "../tests.h" +#include +#include +#include +#include +#include + +#include +#include + +std::ofstream logfile("grid_tools_02/output"); + + + +template +void test1 () +{ + // test 1: hypercube + if (true) + { + Triangulation tria; + GridGenerator::hyper_cube(tria); + + for (unsigned int i=0; i<2; ++i) + { + tria.refine_global(2); + deallog << dim << "d, " + << "hypercube diameter, " + << i*2 + << " refinements: " + << GridTools::diameter (tria) + << std::endl; + } + } +} + + + +int main () +{ + deallog << std::setprecision(4); + logfile << std::setprecision(4); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + test1<1> (); + test1<2> (); + + return 0; +} + diff --git a/tests/deal.II/grid_tools_02/cmp/generic b/tests/deal.II/grid_tools_02/cmp/generic new file mode 100644 index 0000000000..2513d56a9a --- /dev/null +++ b/tests/deal.II/grid_tools_02/cmp/generic @@ -0,0 +1,5 @@ + +DEAL::1d, hypercube diameter, 0 refinements: 1.000 +DEAL::1d, hypercube diameter, 2 refinements: 1.000 +DEAL::2d, hypercube diameter, 0 refinements: 1.414 +DEAL::2d, hypercube diameter, 2 refinements: 1.414 -- 2.39.5