--- /dev/null
+//---------------------------------------------------------------------------
+// $Id: 2d_coarsening_01.cc 23710 2011-05-17 04:50:10Z bangerth $
+// Version: $Name$
+//
+// Copyright (C) 2008, 2009 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.
+//
+//---------------------------------------------------------------------------
+
+
+// Test the setting
+// parallel::distributed::Triangulation<dim>::mesh_reconstruction_after_repartitioning
+// by looking which order the cells get enumerated. With the flag, the cells
+// stay in z-order. Without it, the order in which the cells are created
+// matters.
+
+#include "../tests.h"
+#include "coarse_grid_common.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/tensor.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/distributed/tria.h>
+#include <deal.II/grid/tria_accessor.h>
+#include <deal.II/grid/tria_iterator.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/grid_out.h>
+
+#include <fstream>
+
+template<int dim>
+void testit(parallel::distributed::Triangulation<dim> & tr)
+{
+ GridGenerator::hyper_cube(tr);
+ tr.refine_global(1);
+
+ (++tr.begin_active())->set_refine_flag();
+ tr.execute_coarsening_and_refinement ();
+
+ tr.begin_active()->set_refine_flag();
+ tr.execute_coarsening_and_refinement ();
+
+ typename parallel::distributed::Triangulation<dim>::active_cell_iterator it=tr.begin_active();
+ for (;it!=tr.end();++it)
+ {
+ deallog << it->center() << ", ";
+ }
+ deallog << std::endl;
+}
+
+
+template<int dim>
+void test(std::ostream& /*out*/)
+{
+ {
+
+ parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
+ dealii::Triangulation<dim>::none,
+ parallel::distributed::Triangulation<dim>::default_setting);
+ testit(tr);
+
+ }
+
+ {
+
+ parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
+ dealii::Triangulation<dim>::none,
+ parallel::distributed::Triangulation<dim>::mesh_reconstruction_after_repartitioning);
+ testit(tr);
+
+ }
+
+
+
+
+
+}
+
+
+int main(int argc, char *argv[])
+{
+#ifdef DEAL_II_COMPILER_SUPPORTS_MPI
+ MPI_Init (&argc,&argv);
+#else
+ (void)argc;
+ (void)argv;
+#endif
+
+ std::ofstream logfile("tria_settings_01/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ deallog.push("2d");
+ test<2>(logfile);
+ deallog.pop();
+
+#ifdef DEAL_II_COMPILER_SUPPORTS_MPI
+ MPI_Finalize();
+#endif
+}
--- /dev/null
+
+DEAL:2d::Checksum: 3115647706
+<?xml version="1.0"?>
+<VTKFile type="PUnstructuredGrid" version="0.1" byte_order="LittleEndian">
+ <PUnstructuredGrid GhostLevel="0">
+ <PPoints>
+ <PDataArray type="Float32" Name="Position" NumberOfComponents="3" format="ascii"/>
+ </PPoints>
+ <PCellData Scalars="mpirank,treeid">
+ <PDataArray type="Int32" Name="mpirank" format="ascii"/>
+ <PDataArray type="Int32" Name="treeid" format="ascii"/>
+ </PCellData>
+ <PPointData>
+ </PPointData>
+ <Piece Source="2_0000.vtu"/>
+ </PUnstructuredGrid>
+</VTKFile>
+
+<?xml version="1.0"?>
+<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">
+ <UnstructuredGrid>
+ <Piece NumberOfPoints="52" NumberOfCells="13">
+ <Points>
+ <DataArray type="Float32" Name="Position" NumberOfComponents="3" format="ascii">
+ 1.25000002e-02 1.25000002e-02 0.00000000e+00
+ 4.87500012e-01 1.25000002e-02 0.00000000e+00
+ 1.25000002e-02 4.87500012e-01 0.00000000e+00
+ 4.87500012e-01 4.87500012e-01 0.00000000e+00
+ 5.06250024e-01 6.25000009e-03 0.00000000e+00
+ 7.43749976e-01 6.25000009e-03 0.00000000e+00
+ 5.06250024e-01 2.43750006e-01 0.00000000e+00
+ 7.43749976e-01 2.43750006e-01 0.00000000e+00
+ 7.56250024e-01 6.25000009e-03 0.00000000e+00
+ 9.93749976e-01 6.25000009e-03 0.00000000e+00
+ 7.56250024e-01 2.43750006e-01 0.00000000e+00
+ 9.93749976e-01 2.43750006e-01 0.00000000e+00
+ 5.06250024e-01 2.56249994e-01 0.00000000e+00
+ 7.43749976e-01 2.56249994e-01 0.00000000e+00
+ 5.06250024e-01 4.93750006e-01 0.00000000e+00
+ 7.43749976e-01 4.93750006e-01 0.00000000e+00
+ 7.56250024e-01 2.56249994e-01 0.00000000e+00
+ 9.93749976e-01 2.56249994e-01 0.00000000e+00
+ 7.56250024e-01 4.93750006e-01 0.00000000e+00
+ 9.93749976e-01 4.93750006e-01 0.00000000e+00
+ 6.25000009e-03 5.06250024e-01 0.00000000e+00
+ 2.43750006e-01 5.06250024e-01 0.00000000e+00
+ 6.25000009e-03 7.43749976e-01 0.00000000e+00
+ 2.43750006e-01 7.43749976e-01 0.00000000e+00
+ 2.56249994e-01 5.06250024e-01 0.00000000e+00
+ 4.93750006e-01 5.06250024e-01 0.00000000e+00
+ 2.56249994e-01 7.43749976e-01 0.00000000e+00
+ 4.93750006e-01 7.43749976e-01 0.00000000e+00
+ 6.25000009e-03 7.56250024e-01 0.00000000e+00
+ 2.43750006e-01 7.56250024e-01 0.00000000e+00
+ 6.25000009e-03 9.93749976e-01 0.00000000e+00
+ 2.43750006e-01 9.93749976e-01 0.00000000e+00
+ 2.56249994e-01 7.56250024e-01 0.00000000e+00
+ 4.93750006e-01 7.56250024e-01 0.00000000e+00
+ 2.56249994e-01 9.93749976e-01 0.00000000e+00
+ 4.93750006e-01 9.93749976e-01 0.00000000e+00
+ 5.06250024e-01 5.06250024e-01 0.00000000e+00
+ 7.43749976e-01 5.06250024e-01 0.00000000e+00
+ 5.06250024e-01 7.43749976e-01 0.00000000e+00
+ 7.43749976e-01 7.43749976e-01 0.00000000e+00
+ 7.56250024e-01 5.06250024e-01 0.00000000e+00
+ 9.93749976e-01 5.06250024e-01 0.00000000e+00
+ 7.56250024e-01 7.43749976e-01 0.00000000e+00
+ 9.93749976e-01 7.43749976e-01 0.00000000e+00
+ 5.06250024e-01 7.56250024e-01 0.00000000e+00
+ 7.43749976e-01 7.56250024e-01 0.00000000e+00
+ 5.06250024e-01 9.93749976e-01 0.00000000e+00
+ 7.43749976e-01 9.93749976e-01 0.00000000e+00
+ 7.56250024e-01 7.56250024e-01 0.00000000e+00
+ 9.93749976e-01 7.56250024e-01 0.00000000e+00
+ 7.56250024e-01 9.93749976e-01 0.00000000e+00
+ 9.93749976e-01 9.93749976e-01 0.00000000e+00
+ </DataArray>
+ </Points>
+ <Cells>
+ <DataArray type="Int32" Name="connectivity" format="ascii">
+ 0 1 2 3
+ 4 5 6 7
+ 8 9 10 11
+ 12 13 14 15
+ 16 17 18 19
+ 20 21 22 23
+ 24 25 26 27
+ 28 29 30 31
+ 32 33 34 35
+ 36 37 38 39
+ 40 41 42 43
+ 44 45 46 47
+ 48 49 50 51
+ </DataArray>
+ <DataArray type="Int32" Name="offsets" format="ascii">
+ 4 8 12 16 20 24 28 32
+ 36 40 44 48 52
+ </DataArray>
+ <DataArray type="UInt8" Name="types" format="ascii">
+ 8 8 8 8 8 8 8 8 8 8 8 8 8
+ </DataArray>
+ </Cells>
+ <CellData Scalars="mpirank,treeid">
+ <DataArray type="Int32" Name="mpirank" format="ascii">
+ 0 0 0 0 0 0 0 0 0 0 0 0 0
+ </DataArray>
+ <DataArray type="Int32" Name="treeid" format="ascii">
+ 0 0 0 0 0 0 0 0 0 0 0 0 0
+ </DataArray>
+ </CellData>
+ <PointData>
+ </PointData>
+ </Piece>
+ </UnstructuredGrid>
+</VTKFile>
+