From acdf494797cafe69ca756602a01f9e0b36c97976 Mon Sep 17 00:00:00 2001 From: bangerth Date: Fri, 17 Jun 2011 19:55:32 +0000 Subject: [PATCH] New function GridGenerator::merge_triangulations. git-svn-id: https://svn.dealii.org/trunk@23835 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/deal.II/merge_triangulations_01.cc | 98 +++++++++ .../merge_triangulations_01/cmp/generic | 199 ++++++++++++++++++ 2 files changed, 297 insertions(+) create mode 100644 tests/deal.II/merge_triangulations_01.cc create mode 100644 tests/deal.II/merge_triangulations_01/cmp/generic diff --git a/tests/deal.II/merge_triangulations_01.cc b/tests/deal.II/merge_triangulations_01.cc new file mode 100644 index 0000000000..dc8363bf1d --- /dev/null +++ b/tests/deal.II/merge_triangulations_01.cc @@ -0,0 +1,98 @@ +//---------------------------- merge_triangulations_01.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 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. +// +//---------------------------- merge_triangulations_01.cc --------------------------- + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +std::ofstream logfile("merge_triangulations_01/output"); + + + +// testcase=0: +// create two cubes; translate them so that no vertices overlap +// +// testcase=1: +// create two cubes; translate them so that a whole face overlaps +// +// testcase=2: +// create two cubes; translate them so that exactly one vertices overlaps +template +void test (const int testcase) +{ + Triangulation tria_1, tria_2, tria_3; + GridGenerator::hyper_cube(tria_1); + GridGenerator::hyper_cube(tria_2); + Point shift; + switch (testcase) + { + case 0: + shift[0] = 2; + break; + case 1: + shift[0] = 1; + break; + case 2: + for (unsigned int d=0; d