From: leicht Date: Thu, 14 Dec 2006 10:18:27 +0000 (+0000) Subject: new test for the GridReordering::invert_all_cells_of_negative_grid() function X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eee7351862aeed3a4624177e09073d7184a1d701;p=dealii-svn.git new test for the GridReordering::invert_all_cells_of_negative_grid() function git-svn-id: https://svn.dealii.org/trunk@14237 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/deal.II/Makefile b/tests/deal.II/Makefile index 46a7bbb6c1..dd4e51b92f 100644 --- a/tests/deal.II/Makefile +++ b/tests/deal.II/Makefile @@ -29,6 +29,7 @@ tests_x = block_matrices \ dof_test \ dof_renumbering \ error_estimator \ + grid_invert \ grid_out \ grid_test \ grid_transform \ diff --git a/tests/deal.II/grid_invert.cc b/tests/deal.II/grid_invert.cc new file mode 100644 index 0000000000..daeaf44675 --- /dev/null +++ b/tests/deal.II/grid_invert.cc @@ -0,0 +1,76 @@ +//---------------------------- grid_invert.cc --------------------------- +// $Id: grid_in.cc 11749 2005-11-09 19:11:20Z wolf $ +// Version: $Name$ +// +// Copyright (C) 2002, 2003, 2004, 2005 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_invert.cc --------------------------- + + +#include "../tests.h" +#include +#include +#include +#include + +#include +#include + +std::ofstream logfile("grid_invert/output"); + +template +void test (bool second_case=false) +{ + std::vector > vertices(GeometryInfo::vertices_per_cell); + vertices[1](1)=1; + vertices[2](0)=1; + vertices[2](1)=1; + vertices[3](0)=1; + if (dim==3) + { + for (unsigned int i=4; i::vertices_per_cell; ++i) + vertices[i](2)=-1; + vertices[5](1)=1; + vertices[6](0)=1; + vertices[6](1)=1; + vertices[7](0)=1; + } + std::vector > cells(1); + for (unsigned int i=0;i::vertices_per_cell; ++i) + cells[0].vertices[i]=i; + + if (dim==3 && second_case) + { + std::swap(cells[0].vertices[1],cells[0].vertices[3]); + std::swap(cells[0].vertices[5],cells[0].vertices[7]); + for (unsigned int i=4; i::vertices_per_cell; ++i) + vertices[i](2)=1; + } + + SubCellData subcelldata; + GridReordering::invert_all_cells_of_negative_grid(vertices,cells); + + Triangulation tria; + tria.create_triangulation_compatibility(vertices,cells,subcelldata); + + logfile<<"---------------------------------------------" + < (); + test<3> (false); + test<3> (true); +} + diff --git a/tests/deal.II/grid_invert/cmp/generic b/tests/deal.II/grid_invert/cmp/generic new file mode 100644 index 0000000000..47f4a40cf4 --- /dev/null +++ b/tests/deal.II/grid_invert/cmp/generic @@ -0,0 +1,53 @@ +--------------------------------------------- +dim=2, first case + +# This file was generated by the deal.II library. + + +# +# For a description of the UCD format see the AVS Developer's guide. +# +4 1 0 0 0 +1 0 0 0 +2 0 1 0 +3 1 1 0 +4 1 0 0 +1 0 quad 1 4 3 2 +--------------------------------------------- +dim=3, first case + +# This file was generated by the deal.II library. + + +# +# For a description of the UCD format see the AVS Developer's guide. +# +8 1 0 0 0 +1 0 0 0 +2 0 1 0 +3 1 1 0 +4 1 0 0 +5 0 0 -1 +6 0 1 -1 +7 1 1 -1 +8 1 0 -1 +1 0 hex 5 6 7 8 1 2 3 4 +--------------------------------------------- +dim=3, second case + +# This file was generated by the deal.II library. + + +# +# For a description of the UCD format see the AVS Developer's guide. +# +8 1 0 0 0 +1 0 0 0 +2 0 1 0 +3 1 1 0 +4 1 0 0 +5 0 0 1 +6 0 1 1 +7 1 1 1 +8 1 0 1 +1 0 hex 5 8 7 6 1 4 3 2