From: heister Date: Wed, 26 Oct 2011 16:25:43 +0000 (+0000) Subject: test for parallel::distributed::Triangulation::mesh_reconstruction_after_reparti... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1584ac1c485418bb4772e5502d849425d42f1e57;p=dealii-svn.git test for parallel::distributed::Triangulation::mesh_reconstruction_after_repartitioning git-svn-id: https://svn.dealii.org/trunk@24679 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/distributed_grids/tria_settings_01.cc b/tests/distributed_grids/tria_settings_01.cc new file mode 100644 index 0000000000..8a7b9209d7 --- /dev/null +++ b/tests/distributed_grids/tria_settings_01.cc @@ -0,0 +1,104 @@ +//--------------------------------------------------------------------------- +// $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::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 +#include +#include +#include +#include +#include +#include +#include + +#include + +template +void testit(parallel::distributed::Triangulation & 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::active_cell_iterator it=tr.begin_active(); + for (;it!=tr.end();++it) + { + deallog << it->center() << ", "; + } + deallog << std::endl; +} + + +template +void test(std::ostream& /*out*/) +{ + { + + parallel::distributed::Triangulation tr(MPI_COMM_WORLD, + dealii::Triangulation::none, + parallel::distributed::Triangulation::default_setting); + testit(tr); + + } + + { + + parallel::distributed::Triangulation tr(MPI_COMM_WORLD, + dealii::Triangulation::none, + parallel::distributed::Triangulation::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 +} diff --git a/tests/distributed_grids/tria_settings_01/cmp/generic b/tests/distributed_grids/tria_settings_01/cmp/generic new file mode 100644 index 0000000000..b80d24e84e --- /dev/null +++ b/tests/distributed_grids/tria_settings_01/cmp/generic @@ -0,0 +1,116 @@ + +DEAL:2d::Checksum: 3115647706 + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + 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 + + + 4 8 12 16 20 24 28 32 + 36 40 44 48 52 + + + 8 8 8 8 8 8 8 8 8 8 8 8 8 + + + + + 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 + + + + + + + +