From 21cfbd459c0c8f3bdfef0c5d923e90cb6fa0e2d3 Mon Sep 17 00:00:00 2001 From: leicht Date: Mon, 15 Jan 2007 07:11:28 +0000 Subject: [PATCH] new testcase grid_out_02 to test the bug fix in GridOut::write_dx() -> renumber vertices due to implicit vertex numbering in dx format git-svn-id: https://svn.dealii.org/trunk@14311 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/deal.II/Makefile | 2 + tests/deal.II/grid_out_02.cc | 67 ++++ tests/deal.II/grid_out_02/cmp/generic | 541 ++++++++++++++++++++++++++ 3 files changed, 610 insertions(+) create mode 100644 tests/deal.II/grid_out_02.cc create mode 100644 tests/deal.II/grid_out_02/cmp/generic diff --git a/tests/deal.II/Makefile b/tests/deal.II/Makefile index a43019f59f..2fa710c861 100644 --- a/tests/deal.II/Makefile +++ b/tests/deal.II/Makefile @@ -22,6 +22,7 @@ default: run-tests ############################################################ tests_x = block_matrices \ + adigma\ constraints \ data_out \ derivative_* \ @@ -31,6 +32,7 @@ tests_x = block_matrices \ error_estimator \ grid_invert \ grid_out \ + grid_out_* \ grid_test \ grid_transform \ grid_transform_3d \ diff --git a/tests/deal.II/grid_out_02.cc b/tests/deal.II/grid_out_02.cc new file mode 100644 index 0000000000..84dfa43e43 --- /dev/null +++ b/tests/deal.II/grid_out_02.cc @@ -0,0 +1,67 @@ +//---------------------------- grid_out_02.cc --------------------------- +// $Id: grid_out.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_out_02.cc --------------------------- + +// test, if the grid is written correctly in dx format. the vertices have to be +// renumbered after coarsening, as the dx format uses an implicit vertex +// numbering. + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +std::ofstream logfile("grid_out_02/output"); + + +template +void test () +{ + Triangulation tria; + GridGenerator::hyper_cube (tria); + tria.refine_global(2); + + GridOut grid_out; + grid_out.write_dx (tria, logfile); + + typename Triangulation::active_cell_iterator cell=tria.begin_active(); + for (unsigned int i=0; i::children_per_cell; ++i) + { + cell->set_coarsen_flag(); + ++cell; + } + tria.execute_coarsening_and_refinement(); + grid_out.write_dx (tria, logfile); +} + + +int main () +{ + logfile.precision (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_02/cmp/generic b/tests/deal.II/grid_out_02/cmp/generic new file mode 100644 index 0000000000..342082de95 --- /dev/null +++ b/tests/deal.II/grid_out_02/cmp/generic @@ -0,0 +1,541 @@ + +object "vertices" class array type float rank 1 shape 2 items 25 data follows + 0.0 0.0 + 1.0 0.0 + 0.0 1.0 + 1.0 1.0 + 0.50 0.0 + 0.0 0.50 + 1.0 0.50 + 0.50 1.0 + 0.50 0.50 + 0.25 0.0 + 0.75 0.0 + 0.0 0.25 + 0.0 0.75 + 1.0 0.25 + 1.0 0.75 + 0.25 1.0 + 0.75 1.0 + 0.50 0.25 + 0.50 0.75 + 0.25 0.50 + 0.75 0.50 + 0.25 0.25 + 0.75 0.25 + 0.25 0.75 + 0.75 0.75 +object "cells" class array type int rank 1 shape 4 items 16 data follows + 0 11 9 21 + 9 21 4 17 + 11 5 21 19 + 21 19 17 8 + 4 17 10 22 + 10 22 1 13 + 17 8 22 20 + 22 20 13 6 + 5 12 19 23 + 19 23 8 18 + 12 2 23 15 + 23 15 18 7 + 8 18 20 24 + 20 24 6 14 + 18 7 24 16 + 24 16 14 3 +attribute "element type" string "quads" +attribute "ref" string "positions" + +object "material" class array type int rank 0 items 16 data follows + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +attribute "dep" string "connections" + +object "level" class array type int rank 0 items 16 data follows + 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +attribute "dep" string "connections" + +object "deal data" class field +component "positions" value "vertices" +component "connections" value "cells" +object "cell data" class field +component "positions" value "vertices" +component "connections" value "cells" +component "material" value "material" +component "level" value "level" + +object "grid data" class group +member "cells" value "cell data" +end +object "vertices" class array type float rank 1 shape 2 items 22 data follows + 0.0 0.0 + 1.0 0.0 + 0.0 1.0 + 1.0 1.0 + 0.50 0.0 + 0.0 0.50 + 1.0 0.50 + 0.50 1.0 + 0.50 0.50 + 0.75 0.0 + 0.0 0.75 + 1.0 0.25 + 1.0 0.75 + 0.25 1.0 + 0.75 1.0 + 0.50 0.25 + 0.50 0.75 + 0.25 0.50 + 0.75 0.50 + 0.75 0.25 + 0.25 0.75 + 0.75 0.75 +object "cells" class array type int rank 1 shape 4 items 13 data follows + 0 5 4 8 + 4 15 9 19 + 9 19 1 11 + 15 8 19 18 + 19 18 11 6 + 5 10 17 20 + 17 20 8 16 + 10 2 20 13 + 20 13 16 7 + 8 16 18 21 + 18 21 6 12 + 16 7 21 14 + 21 14 12 3 +attribute "element type" string "quads" +attribute "ref" string "positions" + +object "material" class array type int rank 0 items 13 data follows + 0 0 0 0 0 0 0 0 0 0 0 0 0 +attribute "dep" string "connections" + +object "level" class array type int rank 0 items 13 data follows + 1 2 2 2 2 2 2 2 2 2 2 2 2 +attribute "dep" string "connections" + +object "deal data" class field +component "positions" value "vertices" +component "connections" value "cells" +object "cell data" class field +component "positions" value "vertices" +component "connections" value "cells" +component "material" value "material" +component "level" value "level" + +object "grid data" class group +member "cells" value "cell data" +end +object "vertices" class array type float rank 1 shape 3 items 125 data follows + 0.0 0.0 0.0 + 1.0 0.0 0.0 + 0.0 1.0 0.0 + 1.0 1.0 0.0 + 0.0 0.0 1.0 + 1.0 0.0 1.0 + 0.0 1.0 1.0 + 1.0 1.0 1.0 + 0.50 0.0 0.0 + 0.0 0.50 0.0 + 0.0 0.0 0.50 + 1.0 0.50 0.0 + 1.0 0.0 0.50 + 0.50 1.0 0.0 + 0.0 1.0 0.50 + 1.0 1.0 0.50 + 0.50 0.0 1.0 + 0.0 0.50 1.0 + 1.0 0.50 1.0 + 0.50 1.0 1.0 + 0.50 0.0 0.50 + 0.50 0.50 0.0 + 0.0 0.50 0.50 + 1.0 0.50 0.50 + 0.50 1.0 0.50 + 0.50 0.50 1.0 + 0.50 0.50 0.50 + 0.25 0.0 0.0 + 0.75 0.0 0.0 + 0.0 0.25 0.0 + 0.0 0.75 0.0 + 0.0 0.0 0.25 + 0.0 0.0 0.75 + 1.0 0.25 0.0 + 1.0 0.75 0.0 + 1.0 0.0 0.25 + 1.0 0.0 0.75 + 0.25 1.0 0.0 + 0.75 1.0 0.0 + 0.0 1.0 0.25 + 0.0 1.0 0.75 + 1.0 1.0 0.25 + 1.0 1.0 0.75 + 0.25 0.0 1.0 + 0.75 0.0 1.0 + 0.0 0.25 1.0 + 0.0 0.75 1.0 + 1.0 0.25 1.0 + 1.0 0.75 1.0 + 0.25 1.0 1.0 + 0.75 1.0 1.0 + 0.25 0.0 0.50 + 0.75 0.0 0.50 + 0.50 0.0 0.25 + 0.50 0.0 0.75 + 0.50 0.25 0.0 + 0.50 0.75 0.0 + 0.25 0.50 0.0 + 0.75 0.50 0.0 + 0.0 0.50 0.25 + 0.0 0.50 0.75 + 0.0 0.25 0.50 + 0.0 0.75 0.50 + 1.0 0.50 0.25 + 1.0 0.50 0.75 + 1.0 0.25 0.50 + 1.0 0.75 0.50 + 0.25 1.0 0.50 + 0.75 1.0 0.50 + 0.50 1.0 0.25 + 0.50 1.0 0.75 + 0.50 0.25 1.0 + 0.50 0.75 1.0 + 0.25 0.50 1.0 + 0.75 0.50 1.0 + 0.50 0.25 0.50 + 0.50 0.75 0.50 + 0.25 0.50 0.50 + 0.75 0.50 0.50 + 0.50 0.50 0.25 + 0.50 0.50 0.75 + 0.25 0.0 0.25 + 0.25 0.0 0.75 + 0.75 0.0 0.25 + 0.75 0.0 0.75 + 0.25 0.25 0.0 + 0.75 0.25 0.0 + 0.25 0.75 0.0 + 0.75 0.75 0.0 + 0.0 0.25 0.25 + 0.0 0.75 0.25 + 0.0 0.25 0.75 + 0.0 0.75 0.75 + 1.0 0.25 0.25 + 1.0 0.75 0.25 + 1.0 0.25 0.75 + 1.0 0.75 0.75 + 0.25 1.0 0.25 + 0.25 1.0 0.75 + 0.75 1.0 0.25 + 0.75 1.0 0.75 + 0.25 0.25 1.0 + 0.75 0.25 1.0 + 0.25 0.75 1.0 + 0.75 0.75 1.0 + 0.50 0.25 0.25 + 0.50 0.75 0.25 + 0.50 0.25 0.75 + 0.50 0.75 0.75 + 0.25 0.50 0.25 + 0.25 0.50 0.75 + 0.75 0.50 0.25 + 0.75 0.50 0.75 + 0.25 0.25 0.50 + 0.75 0.25 0.50 + 0.25 0.75 0.50 + 0.75 0.75 0.50 + 0.25 0.25 0.25 + 0.75 0.25 0.25 + 0.25 0.75 0.25 + 0.75 0.75 0.25 + 0.25 0.25 0.75 + 0.75 0.25 0.75 + 0.25 0.75 0.75 + 0.75 0.75 0.75 +object "cells" class array type int rank 1 shape 8 items 64 data follows + 0 31 29 89 27 81 85 117 + 27 81 85 117 8 53 55 105 + 29 89 9 59 85 117 57 109 + 85 117 57 109 55 105 21 79 + 31 10 89 61 81 51 117 113 + 81 51 117 113 53 20 105 75 + 89 61 59 22 117 113 109 77 + 117 113 109 77 105 75 79 26 + 8 53 55 105 28 83 86 118 + 28 83 86 118 1 35 33 93 + 55 105 21 79 86 118 58 111 + 86 118 58 111 33 93 11 63 + 53 20 105 75 83 52 118 114 + 83 52 118 114 35 12 93 65 + 105 75 79 26 118 114 111 78 + 118 114 111 78 93 65 63 23 + 9 59 30 90 57 109 87 119 + 57 109 87 119 21 79 56 106 + 30 90 2 39 87 119 37 97 + 87 119 37 97 56 106 13 69 + 59 22 90 62 109 77 119 115 + 109 77 119 115 79 26 106 76 + 90 62 39 14 119 115 97 67 + 119 115 97 67 106 76 69 24 + 21 79 56 106 58 111 88 120 + 58 111 88 120 11 63 34 94 + 56 106 13 69 88 120 38 99 + 88 120 38 99 34 94 3 41 + 79 26 106 76 111 78 120 116 + 111 78 120 116 63 23 94 66 + 106 76 69 24 120 116 99 68 + 120 116 99 68 94 66 41 15 + 10 32 61 91 51 82 113 121 + 51 82 113 121 20 54 75 107 + 61 91 22 60 113 121 77 110 + 113 121 77 110 75 107 26 80 + 32 4 91 45 82 43 121 101 + 82 43 121 101 54 16 107 71 + 91 45 60 17 121 101 110 73 + 121 101 110 73 107 71 80 25 + 20 54 75 107 52 84 114 122 + 52 84 114 122 12 36 65 95 + 75 107 26 80 114 122 78 112 + 114 122 78 112 65 95 23 64 + 54 16 107 71 84 44 122 102 + 84 44 122 102 36 5 95 47 + 107 71 80 25 122 102 112 74 + 122 102 112 74 95 47 64 18 + 22 60 62 92 77 110 115 123 + 77 110 115 123 26 80 76 108 + 62 92 14 40 115 123 67 98 + 115 123 67 98 76 108 24 70 + 60 17 92 46 110 73 123 103 + 110 73 123 103 80 25 108 72 + 92 46 40 6 123 103 98 49 + 123 103 98 49 108 72 70 19 + 26 80 76 108 78 112 116 124 + 78 112 116 124 23 64 66 96 + 76 108 24 70 116 124 68 100 + 116 124 68 100 66 96 15 42 + 80 25 108 72 112 74 124 104 + 112 74 124 104 64 18 96 48 + 108 72 70 19 124 104 100 50 + 124 104 100 50 96 48 42 7 +attribute "element type" string "cubes" +attribute "ref" string "positions" + +object "material" class array type int rank 0 items 64 data follows + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +attribute "dep" string "connections" + +object "level" class array type int rank 0 items 64 data follows + 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +attribute "dep" string "connections" + +object "deal data" class field +component "positions" value "vertices" +component "connections" value "cells" +object "cell data" class field +component "positions" value "vertices" +component "connections" value "cells" +component "material" value "material" +component "level" value "level" + +object "grid data" class group +member "cells" value "cell data" +end +object "vertices" class array type float rank 1 shape 3 items 118 data follows + 0.0 0.0 0.0 + 1.0 0.0 0.0 + 0.0 1.0 0.0 + 1.0 1.0 0.0 + 0.0 0.0 1.0 + 1.0 0.0 1.0 + 0.0 1.0 1.0 + 1.0 1.0 1.0 + 0.50 0.0 0.0 + 0.0 0.50 0.0 + 0.0 0.0 0.50 + 1.0 0.50 0.0 + 1.0 0.0 0.50 + 0.50 1.0 0.0 + 0.0 1.0 0.50 + 1.0 1.0 0.50 + 0.50 0.0 1.0 + 0.0 0.50 1.0 + 1.0 0.50 1.0 + 0.50 1.0 1.0 + 0.50 0.0 0.50 + 0.50 0.50 0.0 + 0.0 0.50 0.50 + 1.0 0.50 0.50 + 0.50 1.0 0.50 + 0.50 0.50 1.0 + 0.50 0.50 0.50 + 0.75 0.0 0.0 + 0.0 0.75 0.0 + 0.0 0.0 0.75 + 1.0 0.25 0.0 + 1.0 0.75 0.0 + 1.0 0.0 0.25 + 1.0 0.0 0.75 + 0.25 1.0 0.0 + 0.75 1.0 0.0 + 0.0 1.0 0.25 + 0.0 1.0 0.75 + 1.0 1.0 0.25 + 1.0 1.0 0.75 + 0.25 0.0 1.0 + 0.75 0.0 1.0 + 0.0 0.25 1.0 + 0.0 0.75 1.0 + 1.0 0.25 1.0 + 1.0 0.75 1.0 + 0.25 1.0 1.0 + 0.75 1.0 1.0 + 0.25 0.0 0.50 + 0.75 0.0 0.50 + 0.50 0.0 0.25 + 0.50 0.0 0.75 + 0.50 0.25 0.0 + 0.50 0.75 0.0 + 0.25 0.50 0.0 + 0.75 0.50 0.0 + 0.0 0.50 0.25 + 0.0 0.50 0.75 + 0.0 0.25 0.50 + 0.0 0.75 0.50 + 1.0 0.50 0.25 + 1.0 0.50 0.75 + 1.0 0.25 0.50 + 1.0 0.75 0.50 + 0.25 1.0 0.50 + 0.75 1.0 0.50 + 0.50 1.0 0.25 + 0.50 1.0 0.75 + 0.50 0.25 1.0 + 0.50 0.75 1.0 + 0.25 0.50 1.0 + 0.75 0.50 1.0 + 0.50 0.25 0.50 + 0.50 0.75 0.50 + 0.25 0.50 0.50 + 0.75 0.50 0.50 + 0.50 0.50 0.25 + 0.50 0.50 0.75 + 0.25 0.0 0.75 + 0.75 0.0 0.25 + 0.75 0.0 0.75 + 0.75 0.25 0.0 + 0.25 0.75 0.0 + 0.75 0.75 0.0 + 0.0 0.75 0.25 + 0.0 0.25 0.75 + 0.0 0.75 0.75 + 1.0 0.25 0.25 + 1.0 0.75 0.25 + 1.0 0.25 0.75 + 1.0 0.75 0.75 + 0.25 1.0 0.25 + 0.25 1.0 0.75 + 0.75 1.0 0.25 + 0.75 1.0 0.75 + 0.25 0.25 1.0 + 0.75 0.25 1.0 + 0.25 0.75 1.0 + 0.75 0.75 1.0 + 0.50 0.25 0.25 + 0.50 0.75 0.25 + 0.50 0.25 0.75 + 0.50 0.75 0.75 + 0.25 0.50 0.25 + 0.25 0.50 0.75 + 0.75 0.50 0.25 + 0.75 0.50 0.75 + 0.25 0.25 0.50 + 0.75 0.25 0.50 + 0.25 0.75 0.50 + 0.75 0.75 0.50 + 0.75 0.25 0.25 + 0.25 0.75 0.25 + 0.75 0.75 0.25 + 0.25 0.25 0.75 + 0.75 0.25 0.75 + 0.25 0.75 0.75 + 0.75 0.75 0.75 +object "cells" class array type int rank 1 shape 8 items 57 data follows + 0 10 9 22 8 20 21 26 + 8 50 52 99 27 79 81 111 + 27 79 81 111 1 32 30 87 + 52 99 21 76 81 111 55 105 + 81 111 55 105 30 87 11 60 + 50 20 99 72 79 49 111 108 + 79 49 111 108 32 12 87 62 + 99 72 76 26 111 108 105 75 + 111 108 105 75 87 62 60 23 + 9 56 28 84 54 103 82 112 + 54 103 82 112 21 76 53 100 + 28 84 2 36 82 112 34 91 + 82 112 34 91 53 100 13 66 + 56 22 84 59 103 74 112 109 + 103 74 112 109 76 26 100 73 + 84 59 36 14 112 109 91 64 + 112 109 91 64 100 73 66 24 + 21 76 53 100 55 105 83 113 + 55 105 83 113 11 60 31 88 + 53 100 13 66 83 113 35 93 + 83 113 35 93 31 88 3 38 + 76 26 100 73 105 75 113 110 + 105 75 113 110 60 23 88 63 + 100 73 66 24 113 110 93 65 + 113 110 93 65 88 63 38 15 + 10 29 58 85 48 78 107 114 + 48 78 107 114 20 51 72 101 + 58 85 22 57 107 114 74 104 + 107 114 74 104 72 101 26 77 + 29 4 85 42 78 40 114 95 + 78 40 114 95 51 16 101 68 + 85 42 57 17 114 95 104 70 + 114 95 104 70 101 68 77 25 + 20 51 72 101 49 80 108 115 + 49 80 108 115 12 33 62 89 + 72 101 26 77 108 115 75 106 + 108 115 75 106 62 89 23 61 + 51 16 101 68 80 41 115 96 + 80 41 115 96 33 5 89 44 + 101 68 77 25 115 96 106 71 + 115 96 106 71 89 44 61 18 + 22 57 59 86 74 104 109 116 + 74 104 109 116 26 77 73 102 + 59 86 14 37 109 116 64 92 + 109 116 64 92 73 102 24 67 + 57 17 86 43 104 70 116 97 + 104 70 116 97 77 25 102 69 + 86 43 37 6 116 97 92 46 + 116 97 92 46 102 69 67 19 + 26 77 73 102 75 106 110 117 + 75 106 110 117 23 61 63 90 + 73 102 24 67 110 117 65 94 + 110 117 65 94 63 90 15 39 + 77 25 102 69 106 71 117 98 + 106 71 117 98 61 18 90 45 + 102 69 67 19 117 98 94 47 + 117 98 94 47 90 45 39 7 +attribute "element type" string "cubes" +attribute "ref" string "positions" + +object "material" class array type int rank 0 items 57 data follows + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +attribute "dep" string "connections" + +object "level" class array type int rank 0 items 57 data follows + 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +attribute "dep" string "connections" + +object "deal data" class field +component "positions" value "vertices" +component "connections" value "cells" +object "cell data" class field +component "positions" value "vertices" +component "connections" value "cells" +component "material" value "material" +component "level" value "level" + +object "grid data" class group +member "cells" value "cell data" +end -- 2.39.5