From ccd1197d5819ba76672d2a052e7aca3b73c7aac8 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Mon, 16 Jan 2006 13:03:31 +0000 Subject: [PATCH] test patches git-svn-id: https://svn.dealii.org/trunk@12047 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/base/patches.h | 70 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 tests/base/patches.h diff --git a/tests/base/patches.h b/tests/base/patches.h new file mode 100644 index 0000000000..3617b53820 --- /dev/null +++ b/tests/base/patches.h @@ -0,0 +1,70 @@ +//----------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2006 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. +// +//----------------------------------------------------------------------------- + +// Function for dreating a set of patches with different subgrids. + +// To be included after all headers + + +double cell_coordinates [3][8] = +{ + { 0, 1, 0, 1, 0, 1, 0, 1 }, + { 0, 0, 1, 1, 0, 0, 1, 1 }, + { 0, 0, 0, 0, 1, 1, 1, 1 } +}; + + +template +void +create_patches(std::vector > & patches) +{ + for (unsigned int p=0;p& patch = patches[p]; + + const unsigned int nsub = p+1; + const unsigned int nsubp = nsub+1; + + patch.n_subdivisions = nsub; + for (unsigned int v=0;v::vertices_per_cell;++v) + for (unsigned int d=0;d=dim) ? v : 0); + + unsigned int n1 = (dim>0) ? nsubp : 1; + unsigned int n2 = (dim>1) ? nsubp : 1; + unsigned int n3 = (dim>2) ? nsubp : 1; + unsigned int n4 = (dim>3) ? nsubp : 1; + patch.data.reinit(5, n1*n2*n3*n4); + + for (unsigned int i4=0;i4