From 9c9787445d002cd7feabd83135ee415350ef1f1d Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Sat, 4 Jul 2015 14:25:11 +0200 Subject: [PATCH] VTK and VTU output in GridOut restructured to use iterator ranges internally Add output of level number, material id, and subdomain ids --- doc/news/changes.h | 6 + source/base/data_out_base.cc | 37 +- source/grid/grid_out.cc | 55 ++- tests/deal.II/grid_out_06.cc | 31 +- tests/deal.II/grid_out_06.output | 424 ++++++++++++------ tests/deal.II/grid_out_07.cc | 31 +- tests/deal.II/grid_out_07.with_zlib=on.output | 90 ++-- tests/deal.II/grid_out_08.with_zlib=on.output | 8 + 8 files changed, 452 insertions(+), 230 deletions(-) diff --git a/doc/news/changes.h b/doc/news/changes.h index ff5aad8054..a3b6646cac 100644 --- a/doc/news/changes.h +++ b/doc/news/changes.h @@ -541,6 +541,12 @@ inconvenience this causes.
    +
  1. Improved: GridOut::write_vtk() and GridOut::write_vtu() now + output material id, level and subdomain ids of the cells. +
    + (Guido Kanschat, 2015/07/05) +
  2. +
  3. New: GridGenerator::cheese() for a mesh with many holes; GridGenerator::simplex() for simplices in 2 and 3 dimensions; GridGenerator::hyper_cross() for crosses in 2 and 3 dimensions. diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index 57e3ca85d0..6892437529 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -4656,17 +4656,15 @@ namespace DataOutBase const unsigned int n_data_sets = data_names.size(); // check against # of data sets in - // first patch. checks against all - // other patches are made in - // write_gmv_reorder_data_vectors - Assert ((patches[0].data.n_rows() == n_data_sets && !patches[0].points_are_available) || - (patches[0].data.n_rows() == n_data_sets+spacedim && patches[0].points_are_available), - ExcDimensionMismatch (patches[0].points_are_available - ? - (n_data_sets + spacedim) - : - n_data_sets, - patches[0].data.n_rows())); + // first patch. + if (patches[0].points_are_available) + { + AssertDimension(n_data_sets + spacedim, patches[0].data.n_rows()) + } + else + { + AssertDimension(n_data_sets, patches[0].data.n_rows()) + } /////////////////////// // preamble @@ -5081,15 +5079,14 @@ namespace DataOutBase // first patch. checks against all // other patches are made in // write_gmv_reorder_data_vectors - Assert ((patches[0].data.n_rows() == n_data_sets && !patches[0].points_are_available) || - (patches[0].data.n_rows() == n_data_sets+spacedim && patches[0].points_are_available), - ExcDimensionMismatch (patches[0].points_are_available - ? - (n_data_sets + spacedim) - : - n_data_sets, - patches[0].data.n_rows())); - + if (patches[0].points_are_available) + { + AssertDimension(n_data_sets + spacedim, patches[0].data.n_rows()) + } + else + { + AssertDimension(n_data_sets, patches[0].data.n_rows()) + } #ifdef DEAL_II_WITH_ZLIB const char *ascii_or_binary = "binary"; diff --git a/source/grid/grid_out.cc b/source/grid/grid_out.cc index ee2ef0a984..73efbe4b41 100644 --- a/source/grid/grid_out.cc +++ b/source/grid/grid_out.cc @@ -2422,32 +2422,43 @@ namespace * A function that is able to convert each cell of a triangulation into * a patch that can then be output by the functions in DataOutBase. * This is made particularly simple because the patch only needs to - * contain geometry info -- we attach no data at all + * contain geometry info and additional properties of cells */ - template - std::vector > - triangulation_to_patches (const Triangulation &triangulation) + template + void + generate_triangulation_patches (std::vector > &patches, + ITERATOR cell, END end) { - std::vector > patches; - patches.reserve (triangulation.n_active_cells()); - // convert each of the active cells into a patch - for (typename Triangulation::active_cell_iterator cell = triangulation.begin_active(); - cell != triangulation.end(); ++cell) + for (; cell != end; ++cell) { DataOutBase::Patch patch; patch.n_subdivisions = 1; + patch.data.reinit (4,GeometryInfo::vertices_per_cell); for (unsigned int v=0; v::vertices_per_cell; ++v) - patch.vertices[v] = cell->vertex(v); - - // no data - patch.data.reinit (0,0); - + { + patch.vertices[v] = cell->vertex(v); + patch.data(0, v) = cell->level(); + patch.data(1, v) = cell->material_id(); + if (!cell->has_children()) + patch.data(2, v) = cell->subdomain_id(); + else + patch.data(2, v) = -1; + patch.data(3, v) = cell->level_subdomain_id(); + } patches.push_back (patch); } + } - return patches; + std::vector triangulation_patch_data_names () + { + std::vector v(4); + v[0] = "level"; + v[1] = "material"; + v[2] = "leaf_subdomain"; + v[3] = "level_subdomain"; + return v; } } @@ -2463,8 +2474,11 @@ void GridOut::write_vtk (const Triangulation &tria, // and then have them output. since there is no data attached to // the geometry, we also do not have to provide any names, identifying // information, etc. - DataOutBase::write_vtk (triangulation_to_patches(tria), - std::vector(), + std::vector > patches; + patches.reserve (tria.n_active_cells()); + generate_triangulation_patches(patches, tria.begin_active(), tria.end()); + DataOutBase::write_vtk (patches, + triangulation_patch_data_names(), std::vector >(), vtk_flags, out); @@ -2484,8 +2498,11 @@ void GridOut::write_vtu (const Triangulation &tria, // and then have them output. since there is no data attached to // the geometry, we also do not have to provide any names, identifying // information, etc. - DataOutBase::write_vtu (triangulation_to_patches(tria), - std::vector(), + std::vector > patches; + patches.reserve (tria.n_active_cells()); + generate_triangulation_patches(patches, tria.begin_active(), tria.end()); + DataOutBase::write_vtu (patches, + triangulation_patch_data_names(), std::vector >(), vtu_flags, out); diff --git a/tests/deal.II/grid_out_06.cc b/tests/deal.II/grid_out_06.cc index dd03b2299c..247cd8b82d 100644 --- a/tests/deal.II/grid_out_06.cc +++ b/tests/deal.II/grid_out_06.cc @@ -32,15 +32,17 @@ #include -std::ofstream logfile("output"); - - template -void test () +void test (std::ostream& logfile) { Triangulation tria; - GridGenerator::hyper_cube (tria); - tria.refine_global (1); + std::vector legs(2*dim, 1); + if (dim > 1) + GridGenerator::hyper_cross (tria, legs, true); + else + GridGenerator::subdivided_hyper_cube(tria, 2); + tria.begin_active()->set_refine_flag(); + tria.execute_coarsening_and_refinement(); GridOut grid_out; grid_out.write_vtk (tria, logfile); @@ -49,16 +51,11 @@ void test () int main () { - deallog << std::setprecision (2); - logfile << std::setprecision (2); - deallog.attach(logfile); - deallog.depth_console(0); - deallog.threshold_double(1.e-10); - - test<1,1> (); - test<1,2> (); - test<2,2> (); - test<2,3> (); - test<3,3> (); + initlog("output"); + test<1,1> (deallog.get_file_stream()); + test<1,2> (deallog.get_file_stream()); + test<2,2> (deallog.get_file_stream()); + test<2,3> (deallog.get_file_stream()); + test<3,3> (deallog.get_file_stream()); } diff --git a/tests/deal.II/grid_out_06.output b/tests/deal.II/grid_out_06.output index 13bdc060dd..69104988d9 100644 --- a/tests/deal.II/grid_out_06.output +++ b/tests/deal.II/grid_out_06.output @@ -4,173 +4,315 @@ ASCII DATASET UNSTRUCTURED_GRID -POINTS 4 double -0.0 0 0 -0.50 0 0 -0.50 0 0 -1.0 0 0 +POINTS 6 double +0.500000 0 0 +1.00000 0 0 +0.00000 0 0 +0.250000 0 0 +0.250000 0 0 +0.500000 0 0 -CELLS 2 6 +CELLS 3 9 2 0 1 2 2 3 +2 4 5 -CELL_TYPES 2 - 3 3 -POINT_DATA 4 +CELL_TYPES 3 + 3 3 3 +POINT_DATA 6 +SCALARS level double 1 +LOOKUP_TABLE default +0.00000 0.00000 1.00000 1.00000 1.00000 1.00000 +SCALARS material double 1 +LOOKUP_TABLE default +0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 +SCALARS leaf_subdomain double 1 +LOOKUP_TABLE default +0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 +SCALARS level_subdomain double 1 +LOOKUP_TABLE default +0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 # vtk DataFile Version 3.0 #This file was generated ASCII DATASET UNSTRUCTURED_GRID -POINTS 4 double -0.0 0.0 0 -0.50 0.0 0 -0.50 0.0 0 -1.0 0.0 0 +POINTS 6 double +0.500000 0.00000 0 +1.00000 0.00000 0 +0.00000 0.00000 0 +0.250000 0.00000 0 +0.250000 0.00000 0 +0.500000 0.00000 0 -CELLS 2 6 +CELLS 3 9 2 0 1 2 2 3 +2 4 5 -CELL_TYPES 2 - 3 3 -POINT_DATA 4 +CELL_TYPES 3 + 3 3 3 +POINT_DATA 6 +SCALARS level double 1 +LOOKUP_TABLE default +0.00000 0.00000 1.00000 1.00000 1.00000 1.00000 +SCALARS material double 1 +LOOKUP_TABLE default +0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 +SCALARS leaf_subdomain double 1 +LOOKUP_TABLE default +0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 +SCALARS level_subdomain double 1 +LOOKUP_TABLE default +0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 # vtk DataFile Version 3.0 #This file was generated ASCII DATASET UNSTRUCTURED_GRID -POINTS 16 double -0.0 0.0 0 -0.50 0.0 0 -0.0 0.50 0 -0.50 0.50 0 -0.50 0.0 0 -1.0 0.0 0 -0.50 0.50 0 -1.0 0.50 0 -0.0 0.50 0 -0.50 0.50 0 -0.0 1.0 0 -0.50 1.0 0 -0.50 0.50 0 -1.0 0.50 0 -0.50 1.0 0 -1.0 1.0 0 - -CELLS 4 20 +POINTS 32 double +-1.50000 -0.500000 0 +-0.500000 -0.500000 0 +-1.50000 0.500000 0 +-0.500000 0.500000 0 +0.500000 -0.500000 0 +1.50000 -0.500000 0 +0.500000 0.500000 0 +1.50000 0.500000 0 +-0.500000 -1.50000 0 +0.500000 -1.50000 0 +-0.500000 -0.500000 0 +0.500000 -0.500000 0 +-0.500000 0.500000 0 +0.500000 0.500000 0 +-0.500000 1.50000 0 +0.500000 1.50000 0 +-0.500000 -0.500000 0 +0.00000 -0.500000 0 +-0.500000 0.00000 0 +0.00000 0.00000 0 +0.00000 -0.500000 0 +0.500000 -0.500000 0 +0.00000 0.00000 0 +0.500000 0.00000 0 +-0.500000 0.00000 0 +0.00000 0.00000 0 +-0.500000 0.500000 0 +0.00000 0.500000 0 +0.00000 0.00000 0 +0.500000 0.00000 0 +0.00000 0.500000 0 +0.500000 0.500000 0 + +CELLS 8 40 4 0 1 3 2 4 4 5 7 6 4 8 9 11 10 4 12 13 15 14 +4 16 17 19 18 +4 20 21 23 22 +4 24 25 27 26 +4 28 29 31 30 -CELL_TYPES 4 - 9 9 9 9 -POINT_DATA 16 +CELL_TYPES 8 + 9 9 9 9 9 9 9 9 +POINT_DATA 32 +SCALARS level double 1 +LOOKUP_TABLE default +0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 +SCALARS material double 1 +LOOKUP_TABLE default +1.00000 1.00000 1.00000 1.00000 2.00000 2.00000 2.00000 2.00000 3.00000 3.00000 3.00000 3.00000 4.00000 4.00000 4.00000 4.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 +SCALARS leaf_subdomain double 1 +LOOKUP_TABLE default +0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 +SCALARS level_subdomain double 1 +LOOKUP_TABLE default +0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 # vtk DataFile Version 3.0 #This file was generated ASCII DATASET UNSTRUCTURED_GRID -POINTS 16 double -0.0 0.0 0.0 -0.50 0.0 0.0 -0.0 0.50 0.0 -0.50 0.50 0.0 -0.50 0.0 0.0 -1.0 0.0 0.0 -0.50 0.50 0.0 -1.0 0.50 0.0 -0.0 0.50 0.0 -0.50 0.50 0.0 -0.0 1.0 0.0 -0.50 1.0 0.0 -0.50 0.50 0.0 -1.0 0.50 0.0 -0.50 1.0 0.0 -1.0 1.0 0.0 - -CELLS 4 20 +POINTS 32 double +-1.50000 -0.500000 0.00000 +-0.500000 -0.500000 0.00000 +-1.50000 0.500000 0.00000 +-0.500000 0.500000 0.00000 +0.500000 -0.500000 0.00000 +1.50000 -0.500000 0.00000 +0.500000 0.500000 0.00000 +1.50000 0.500000 0.00000 +-0.500000 -1.50000 0.00000 +0.500000 -1.50000 0.00000 +-0.500000 -0.500000 0.00000 +0.500000 -0.500000 0.00000 +-0.500000 0.500000 0.00000 +0.500000 0.500000 0.00000 +-0.500000 1.50000 0.00000 +0.500000 1.50000 0.00000 +-0.500000 -0.500000 0.00000 +0.00000 -0.500000 0.00000 +-0.500000 0.00000 0.00000 +0.00000 0.00000 0.00000 +0.00000 -0.500000 0.00000 +0.500000 -0.500000 0.00000 +0.00000 0.00000 0.00000 +0.500000 0.00000 0.00000 +-0.500000 0.00000 0.00000 +0.00000 0.00000 0.00000 +-0.500000 0.500000 0.00000 +0.00000 0.500000 0.00000 +0.00000 0.00000 0.00000 +0.500000 0.00000 0.00000 +0.00000 0.500000 0.00000 +0.500000 0.500000 0.00000 + +CELLS 8 40 4 0 1 3 2 4 4 5 7 6 4 8 9 11 10 4 12 13 15 14 +4 16 17 19 18 +4 20 21 23 22 +4 24 25 27 26 +4 28 29 31 30 -CELL_TYPES 4 - 9 9 9 9 -POINT_DATA 16 +CELL_TYPES 8 + 9 9 9 9 9 9 9 9 +POINT_DATA 32 +SCALARS level double 1 +LOOKUP_TABLE default +0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 +SCALARS material double 1 +LOOKUP_TABLE default +1.00000 1.00000 1.00000 1.00000 2.00000 2.00000 2.00000 2.00000 3.00000 3.00000 3.00000 3.00000 4.00000 4.00000 4.00000 4.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 +SCALARS leaf_subdomain double 1 +LOOKUP_TABLE default +0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 +SCALARS level_subdomain double 1 +LOOKUP_TABLE default +0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 # vtk DataFile Version 3.0 #This file was generated ASCII DATASET UNSTRUCTURED_GRID -POINTS 64 double -0.0 0.0 0.0 -0.50 0.0 0.0 -0.0 0.50 0.0 -0.50 0.50 0.0 -0.0 0.0 0.50 -0.50 0.0 0.50 -0.0 0.50 0.50 -0.50 0.50 0.50 -0.50 0.0 0.0 -1.0 0.0 0.0 -0.50 0.50 0.0 -1.0 0.50 0.0 -0.50 0.0 0.50 -1.0 0.0 0.50 -0.50 0.50 0.50 -1.0 0.50 0.50 -0.0 0.50 0.0 -0.50 0.50 0.0 -0.0 1.0 0.0 -0.50 1.0 0.0 -0.0 0.50 0.50 -0.50 0.50 0.50 -0.0 1.0 0.50 -0.50 1.0 0.50 -0.50 0.50 0.0 -1.0 0.50 0.0 -0.50 1.0 0.0 -1.0 1.0 0.0 -0.50 0.50 0.50 -1.0 0.50 0.50 -0.50 1.0 0.50 -1.0 1.0 0.50 -0.0 0.0 0.50 -0.50 0.0 0.50 -0.0 0.50 0.50 -0.50 0.50 0.50 -0.0 0.0 1.0 -0.50 0.0 1.0 -0.0 0.50 1.0 -0.50 0.50 1.0 -0.50 0.0 0.50 -1.0 0.0 0.50 -0.50 0.50 0.50 -1.0 0.50 0.50 -0.50 0.0 1.0 -1.0 0.0 1.0 -0.50 0.50 1.0 -1.0 0.50 1.0 -0.0 0.50 0.50 -0.50 0.50 0.50 -0.0 1.0 0.50 -0.50 1.0 0.50 -0.0 0.50 1.0 -0.50 0.50 1.0 -0.0 1.0 1.0 -0.50 1.0 1.0 -0.50 0.50 0.50 -1.0 0.50 0.50 -0.50 1.0 0.50 -1.0 1.0 0.50 -0.50 0.50 1.0 -1.0 0.50 1.0 -0.50 1.0 1.0 -1.0 1.0 1.0 - -CELLS 8 72 +POINTS 112 double +-1.50000 -0.500000 -0.500000 +-0.500000 -0.500000 -0.500000 +-1.50000 0.500000 -0.500000 +-0.500000 0.500000 -0.500000 +-1.50000 -0.500000 0.500000 +-0.500000 -0.500000 0.500000 +-1.50000 0.500000 0.500000 +-0.500000 0.500000 0.500000 +0.500000 -0.500000 -0.500000 +1.50000 -0.500000 -0.500000 +0.500000 0.500000 -0.500000 +1.50000 0.500000 -0.500000 +0.500000 -0.500000 0.500000 +1.50000 -0.500000 0.500000 +0.500000 0.500000 0.500000 +1.50000 0.500000 0.500000 +-0.500000 -1.50000 -0.500000 +0.500000 -1.50000 -0.500000 +-0.500000 -0.500000 -0.500000 +0.500000 -0.500000 -0.500000 +-0.500000 -1.50000 0.500000 +0.500000 -1.50000 0.500000 +-0.500000 -0.500000 0.500000 +0.500000 -0.500000 0.500000 +-0.500000 0.500000 -0.500000 +0.500000 0.500000 -0.500000 +-0.500000 1.50000 -0.500000 +0.500000 1.50000 -0.500000 +-0.500000 0.500000 0.500000 +0.500000 0.500000 0.500000 +-0.500000 1.50000 0.500000 +0.500000 1.50000 0.500000 +-0.500000 -0.500000 -1.50000 +0.500000 -0.500000 -1.50000 +-0.500000 0.500000 -1.50000 +0.500000 0.500000 -1.50000 +-0.500000 -0.500000 -0.500000 +0.500000 -0.500000 -0.500000 +-0.500000 0.500000 -0.500000 +0.500000 0.500000 -0.500000 +-0.500000 -0.500000 0.500000 +0.500000 -0.500000 0.500000 +-0.500000 0.500000 0.500000 +0.500000 0.500000 0.500000 +-0.500000 -0.500000 1.50000 +0.500000 -0.500000 1.50000 +-0.500000 0.500000 1.50000 +0.500000 0.500000 1.50000 +-0.500000 -0.500000 -0.500000 +0.00000 -0.500000 -0.500000 +-0.500000 0.00000 -0.500000 +0.00000 0.00000 -0.500000 +-0.500000 -0.500000 0.00000 +0.00000 -0.500000 0.00000 +-0.500000 0.00000 0.00000 +0.00000 0.00000 6.93889e-18 +0.00000 -0.500000 -0.500000 +0.500000 -0.500000 -0.500000 +0.00000 0.00000 -0.500000 +0.500000 0.00000 -0.500000 +0.00000 -0.500000 0.00000 +0.500000 -0.500000 0.00000 +0.00000 0.00000 6.93889e-18 +0.500000 0.00000 0.00000 +-0.500000 0.00000 -0.500000 +0.00000 0.00000 -0.500000 +-0.500000 0.500000 -0.500000 +0.00000 0.500000 -0.500000 +-0.500000 0.00000 0.00000 +0.00000 0.00000 6.93889e-18 +-0.500000 0.500000 0.00000 +0.00000 0.500000 0.00000 +0.00000 0.00000 -0.500000 +0.500000 0.00000 -0.500000 +0.00000 0.500000 -0.500000 +0.500000 0.500000 -0.500000 +0.00000 0.00000 6.93889e-18 +0.500000 0.00000 0.00000 +0.00000 0.500000 0.00000 +0.500000 0.500000 0.00000 +-0.500000 -0.500000 0.00000 +0.00000 -0.500000 0.00000 +-0.500000 0.00000 0.00000 +0.00000 0.00000 6.93889e-18 +-0.500000 -0.500000 0.500000 +0.00000 -0.500000 0.500000 +-0.500000 0.00000 0.500000 +0.00000 0.00000 0.500000 +0.00000 -0.500000 0.00000 +0.500000 -0.500000 0.00000 +0.00000 0.00000 6.93889e-18 +0.500000 0.00000 0.00000 +0.00000 -0.500000 0.500000 +0.500000 -0.500000 0.500000 +0.00000 0.00000 0.500000 +0.500000 0.00000 0.500000 +-0.500000 0.00000 0.00000 +0.00000 0.00000 6.93889e-18 +-0.500000 0.500000 0.00000 +0.00000 0.500000 0.00000 +-0.500000 0.00000 0.500000 +0.00000 0.00000 0.500000 +-0.500000 0.500000 0.500000 +0.00000 0.500000 0.500000 +0.00000 0.00000 6.93889e-18 +0.500000 0.00000 0.00000 +0.00000 0.500000 0.00000 +0.500000 0.500000 0.00000 +0.00000 0.00000 0.500000 +0.500000 0.00000 0.500000 +0.00000 0.500000 0.500000 +0.500000 0.500000 0.500000 + +CELLS 14 126 8 0 1 3 2 4 5 7 6 8 8 9 11 10 12 13 15 14 8 16 17 19 18 20 21 23 22 @@ -179,7 +321,25 @@ CELLS 8 72 8 40 41 43 42 44 45 47 46 8 48 49 51 50 52 53 55 54 8 56 57 59 58 60 61 63 62 +8 64 65 67 66 68 69 71 70 +8 72 73 75 74 76 77 79 78 +8 80 81 83 82 84 85 87 86 +8 88 89 91 90 92 93 95 94 +8 96 97 99 98 100 101 103 102 +8 104 105 107 106 108 109 111 110 -CELL_TYPES 8 - 12 12 12 12 12 12 12 12 -POINT_DATA 64 +CELL_TYPES 14 + 12 12 12 12 12 12 12 12 12 12 12 12 12 12 +POINT_DATA 112 +SCALARS level double 1 +LOOKUP_TABLE default +0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 +SCALARS material double 1 +LOOKUP_TABLE default +1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 2.00000 2.00000 2.00000 2.00000 2.00000 2.00000 2.00000 2.00000 3.00000 3.00000 3.00000 3.00000 3.00000 3.00000 3.00000 3.00000 4.00000 4.00000 4.00000 4.00000 4.00000 4.00000 4.00000 4.00000 5.00000 5.00000 5.00000 5.00000 5.00000 5.00000 5.00000 5.00000 6.00000 6.00000 6.00000 6.00000 6.00000 6.00000 6.00000 6.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 +SCALARS leaf_subdomain double 1 +LOOKUP_TABLE default +0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 +SCALARS level_subdomain double 1 +LOOKUP_TABLE default +0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 diff --git a/tests/deal.II/grid_out_07.cc b/tests/deal.II/grid_out_07.cc index abbdf19c63..28df903c86 100644 --- a/tests/deal.II/grid_out_07.cc +++ b/tests/deal.II/grid_out_07.cc @@ -32,15 +32,17 @@ #include -std::ofstream logfile("output"); - - template -void test () +void test (std::ostream& logfile) { Triangulation tria; - GridGenerator::hyper_cube (tria); - tria.refine_global (1); + std::vector legs(2*dim, 1); + if (dim > 1) + GridGenerator::hyper_cross (tria, legs, true); + else + GridGenerator::subdivided_hyper_cube(tria, 2); + tria.begin_active()->set_refine_flag(); + tria.execute_coarsening_and_refinement(); GridOut grid_out; grid_out.write_vtu (tria, logfile); @@ -49,16 +51,11 @@ void test () int main () { - deallog << std::setprecision (2); - logfile << std::setprecision (2); - deallog.attach(logfile); - deallog.depth_console(0); - deallog.threshold_double(1.e-10); - - test<1,1> (); - test<1,2> (); - test<2,2> (); - test<2,3> (); - test<3,3> (); + initlog("output"); + test<1,1> (deallog.get_file_stream()); + test<1,2> (deallog.get_file_stream()); + test<2,2> (deallog.get_file_stream()); + test<2,3> (deallog.get_file_stream()); + test<3,3> (deallog.get_file_stream()); } diff --git a/tests/deal.II/grid_out_07.with_zlib=on.output b/tests/deal.II/grid_out_07.with_zlib=on.output index 75378b48ba..d7fb9b83a8 100644 --- a/tests/deal.II/grid_out_07.with_zlib=on.output +++ b/tests/deal.II/grid_out_07.with_zlib=on.output @@ -6,25 +6,33 @@ --> - + -AQAAAGAAAABgAAAAEwAAAA==eNpjYMAHHtiTJv4BQxwAjgUDbg== +AQAAAJAAAACQAAAAHAAAAA==eNpjYACBB/YMWMEHHOK4wAV70sQx7QUAp4oFjA== -AQAAABAAAAAQAAAAEwAAAA==eNpjYGBgYARiJiBmBmIAADgABw== +AQAAABgAAAAYAAAAGAAAAA==eNpjYGBgYARiJiBmBmIWIGYFYgAApAAQ -AQAAAAgAAAAIAAAADgAAAA==eNpjYmBgYAFiAAAoAAc= +AQAAAAwAAAAMAAAAEQAAAA==eNpjYmBgYAFiNiAGAABcAA0= -AQAAAAIAAAACAAAACgAAAA==eNpjZgYAAAsABw== +AQAAAAMAAAADAAAACwAAAA==eNpjZmYGAAAVAAo= + +AQAAADAAAAAwAAAADwAAAA==eNpjYMAGPtjjogFBfAS9 + +AQAAADAAAAAwAAAADAAAAA==eNpjYCANAAAAMAAB + +AQAAADAAAAAwAAAADAAAAA==eNpjYCANAAAAMAAB + +AQAAADAAAAAwAAAADAAAAA==eNpjYCANAAAAMAAB @@ -36,25 +44,33 @@ AQAAAAIAAAACAAAACgAAAA==eNpjZgYAAAsABw== --> - + -AQAAAGAAAABgAAAAEwAAAA==eNpjYMAHHtiTJv4BQxwAjgUDbg== +AQAAAJAAAACQAAAAHAAAAA==eNpjYACBB/YMWMEHHOK4wAV70sQx7QUAp4oFjA== -AQAAABAAAAAQAAAAEwAAAA==eNpjYGBgYARiJiBmBmIAADgABw== +AQAAABgAAAAYAAAAGAAAAA==eNpjYGBgYARiJiBmBmIWIGYFYgAApAAQ -AQAAAAgAAAAIAAAADgAAAA==eNpjYmBgYAFiAAAoAAc= +AQAAAAwAAAAMAAAAEQAAAA==eNpjYmBgYAFiNiAGAABcAA0= -AQAAAAIAAAACAAAACgAAAA==eNpjZgYAAAsABw== +AQAAAAMAAAADAAAACwAAAA==eNpjZmYGAAAVAAo= + +AQAAADAAAAAwAAAADwAAAA==eNpjYMAGPtjjogFBfAS9 + +AQAAADAAAAAwAAAADAAAAA==eNpjYCANAAAAMAAB + +AQAAADAAAAAwAAAADAAAAA==eNpjYCANAAAAMAAB + +AQAAADAAAAAwAAAADAAAAA==eNpjYCANAAAAMAAB @@ -66,25 +82,33 @@ AQAAAAIAAAACAAAACgAAAA==eNpjZgYAAAsABw== --> - + -AQAAAIABAACAAQAAMwAAAA==eNpjYMAHHtgzkCQP4+MSRwcf7PGbi67vgz1+84h1Dy77Yeo+2FPmHlzmfMAQBwBtNxtp +AQAAAAADAAAAAwAAWQAAAA==eNqlkcEJACAMA7tZRncVx+hTFPWhHAbMp5jGmGBER5Yxos65UIHfeoH+5AU+wG+9QA/vJvik2YtyPntRHtCnvDznns4u3L54X56vmwP99JeH9vd/NcNJQpE= -AQAAAEAAAABAAAAAKAAAAA==eNoNwwkSwBAQALB1VIvi/7+VzCQiIlnMVh9fm5/d6fB3edxeCvAAeQ== +AQAAAIAAAACAAAAAPAAAAA==eNoNwwUOg0AAALCD4Q7DZfv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TmPG7bLbhD32mrTPfgccctBhRxxz1HEnnHLSaWecc9Z5F1xy0ZRpV1x21TU3XHfTLTNuu+Ou++554KHHHnniqeeeeeGl115546333vngo88++eKr77754afffvnjr1n//AdNYhhJ -AQAAACAAAAAgAAAAHQAAAA==eNrjYGBgEABiCSBWAGINIDYAYgsgdgBiAA8gASE= +AQAAADgAAAA4AAAALAAAAA==eNrjYGBgEABiCSBWAGINIDYAYgsgdgBiDyAOAOIIIE4A4gwgLgBiAEY4A0k= -AQAAAAgAAAAIAAAACwAAAA==eNrj4YEAAAG4AGE= +AQAAAA4AAAAOAAAACwAAAA==eNrj4UEGAAT6AKk= + +AQAAAIADAACAAwAAFAAAAA==eNpjYBgFAw8+2I/SI5MGACClS8E= + +AQAAAIADAACAAwAAJAAAAA==eNpjYACBD/YMFNEMDpTRHBTSAhTSIhTSEhTSo2CkAgAhCRWZ + +AQAAAIADAACAAwAAEQAAAA==eNpjYBgFo2AUDBQAAAOAAAE= + +AQAAAIADAACAAwAAEQAAAA==eNpjYBgFo2AUDBQAAAOAAAE= diff --git a/tests/deal.II/grid_out_08.with_zlib=on.output b/tests/deal.II/grid_out_08.with_zlib=on.output index e32b8886e5..e86c055750 100644 --- a/tests/deal.II/grid_out_08.with_zlib=on.output +++ b/tests/deal.II/grid_out_08.with_zlib=on.output @@ -25,6 +25,14 @@ AQAAABgAAAAYAAAACwAAAA==eNpjZsYOAAOcAEk= + +AQAAAIABAACAAQAAEgAAAA==eNpjYACBD/YMo/SA0AAihjjR + +AQAAAIABAACAAQAADQAAAA==eNpjYBgFAwkAAYAAAQ== + +AQAAAIABAACAAQAADQAAAA==eNpjYBgFAwkAAYAAAQ== + +AQAAAIABAACAAQAADQAAAA==eNpjYBgFAwkAAYAAAQ== -- 2.39.5