]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Port coarse_grid_common.h
authorMatthias Maier <tamiko@kyomu.43-1.org>
Thu, 5 Sep 2013 15:35:13 +0000 (15:35 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Thu, 5 Sep 2013 15:35:13 +0000 (15:35 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@30608 0785d39b-7218-0410-832d-ea1e28bc413d

31 files changed:
tests/distributed_grids/2d_coarse_grid_01.cc
tests/distributed_grids/2d_coarse_grid_02.cc
tests/distributed_grids/2d_coarse_grid_03.cc
tests/distributed_grids/2d_coarse_grid_04.cc
tests/distributed_grids/2d_coarsening_01.cc
tests/distributed_grids/2d_coarsening_02.cc
tests/distributed_grids/2d_coarsening_03.cc
tests/distributed_grids/2d_coarsening_05.cc
tests/distributed_grids/2d_refinement_01.cc
tests/distributed_grids/2d_refinement_02.cc
tests/distributed_grids/2d_refinement_03.cc
tests/distributed_grids/2d_refinement_05.cc
tests/distributed_grids/2d_refinement_06.cc
tests/distributed_grids/3d_coarse_grid_01.cc
tests/distributed_grids/3d_coarse_grid_02.cc
tests/distributed_grids/3d_coarse_grid_03.cc
tests/distributed_grids/3d_coarse_grid_04.cc
tests/distributed_grids/3d_coarse_grid_05.cc
tests/distributed_grids/3d_coarsening_01.cc
tests/distributed_grids/3d_coarsening_02.cc
tests/distributed_grids/3d_coarsening_03.cc
tests/distributed_grids/3d_coarsening_04.cc
tests/distributed_grids/3d_coarsening_05.cc
tests/distributed_grids/3d_refinement_01.cc
tests/distributed_grids/3d_refinement_02.cc
tests/distributed_grids/3d_refinement_03.cc
tests/distributed_grids/3d_refinement_05.cc
tests/distributed_grids/3d_refinement_06.cc
tests/distributed_grids/3d_refinement_07.cc
tests/distributed_grids/3d_refinement_08.cc
tests/distributed_grids/coarse_grid_common.h

index b8e3572e31deb6e5be098eba9160442dac9d9028..f97c749b7465929e3488dbb6fb36dfb6ba83d583 100644 (file)
@@ -40,7 +40,7 @@ void test(std::ostream & /*out*/)
       parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
       GridGenerator::hyper_cube(tr);
-      write_vtk (tr, "2d_coarse_grid_01", "1");
+      write_vtk(tr, "1");
     }
 
 
@@ -51,7 +51,7 @@ void test(std::ostream & /*out*/)
       parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
       GridGenerator::hyper_ball(tr, Point<dim>(), 3.);
-      write_vtk (tr, "2d_coarse_grid_01", "2");
+      write_vtk(tr, "2");
     }
 
   if (true)
@@ -61,7 +61,7 @@ void test(std::ostream & /*out*/)
       parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
       GridGenerator::half_hyper_ball(tr, Point<dim>(), 3.);
-      write_vtk (tr, "2d_coarse_grid_01", "3");
+      write_vtk(tr, "3");
     }
 }
 
index ecfdb5ecc7e750d0282a47fcae4f585602222c6d..01c71e48fc84609eca03c7dfb3692c3a3aa4ba50 100644 (file)
@@ -52,7 +52,7 @@ void test(std::ostream & /*out*/)
               << std::endl;
     }
 
-  write_vtk (tr, "2d_coarse_grid_02", "1");
+  write_vtk(tr, "1");
 }
 
 
index 1428c08c16bd6a9fca212c97c4c95d39ea83114b..740f2392e35b5e3a2dde2a653e5adf909e61d68a 100644 (file)
@@ -40,7 +40,7 @@ void test(std::ostream & /*out*/)
   std::ifstream in (SOURCE_DIR "/../deal.II/grid_in/2d.inp");
   gi.read_ucd (in);
 
-  write_vtk (tr, "2d_coarse_grid_03", "1");
+  write_vtk(tr, "1");
 }
 
 
index 1a53a61d2151b0b1b6a22d887aef8aaafdd62e70..66c4ada1dc84046d58eba13c1de6797fcf44d4f3 100644 (file)
@@ -38,7 +38,7 @@ void test(std::ostream & /*out*/)
   gi.attach_triangulation (tr);
   gi.read ("../bits/step-5/circle-grid.inp");
 
-  write_vtk (tr, "2d_coarse_grid_04", "1");
+  write_vtk(tr, "1");
 }
 
 
index 8dab24c414b9dc46ba040e3cfa6f43c0f8476ae4..6b12535c93c5ad834b4d36a28c3c7f4d998fef41 100644 (file)
@@ -44,7 +44,7 @@ void test(std::ostream & /*out*/)
     tr.begin(1)->child(c)->set_coarsen_flag();
   tr.execute_coarsening_and_refinement ();
 
-  write_vtk (tr, "2d_coarsening_01", "2");
+  write_vtk(tr, "2");
 }
 
 
index 4b090cb7b1a81970cff34b04f81dd332966cade0..47d8cd5a7d6e0925bf736075bde932c66d10ff9e 100644 (file)
@@ -106,14 +106,14 @@ void test(std::ostream & /*out*/)
       tr.execute_coarsening_and_refinement ();
       tr2.execute_coarsening_and_refinement ();
 
-      write_vtk (tr, "2d_coarsening_02", "1");
+      write_vtk(tr, "1");
       deallog << std::endl;
 
       deallog << i << " Number of cells: "
               << tr.n_active_cells() << ' '
               << tr2.n_active_cells()
               << std::endl;
-      assert_tria_equal("2d_coarsening_02", tr, tr2);
+      assert_tria_equal(tr, tr2);
     }
 }
 
index 2c560adf1011fe98d4b32d88462d7079706d2db4..f70ae0d303861eca9ccc87c4afbc8a9f7ecd06f6 100644 (file)
@@ -104,7 +104,7 @@ void test(std::ostream & /*out*/)
     }
 
   deallog << tr.n_active_cells() << ' ' << tr2.n_active_cells() << std::endl;
-  assert_tria_equal("2d_coarsening_03", tr, tr2);
+  assert_tria_equal(tr, tr2);
 
   for (unsigned int i=0; i<1; ++i)
     {
@@ -174,7 +174,7 @@ void test(std::ostream & /*out*/)
               << tr.n_active_cells() << ' '
               << tr2.n_active_cells()
               << std::endl;
-      assert_tria_equal("2d_coarsening_03", tr, tr2);
+      assert_tria_equal(tr, tr2);
     }
 }
 
index 3b5374b6f1f2118f83b4557f73181939ba6d9aef..c700b92bf6c23867cf27f8eb732e7b23991fadfc 100644 (file)
@@ -101,7 +101,7 @@ void test(std::ostream & /*out*/)
               << tr2.n_active_cells()
               << std::endl;
 
-      assert_tria_equal("2d_coarsening_05", tr, tr2);
+      assert_tria_equal(tr, tr2);
     }
 }
 
index 05e7adeab673e944734df4f0ee54e1357c541d9d..881a735f67544a9a61756de4ad9dfe695ea2253a 100644 (file)
@@ -42,7 +42,7 @@ void test(std::ostream & /*out*/)
   tr.begin_active()->set_refine_flag();
   tr.execute_coarsening_and_refinement ();
 
-  write_vtk (tr, "2d_refinement_01", "2");
+  write_vtk(tr, "2");
 }
 
 
index 6e43150188db5ce26722fcb80eaab8dc5edfa390..6162921d86bca725ae7a16a11c1ad904d20b7a05 100644 (file)
@@ -93,7 +93,7 @@ void test(std::ostream & /*out*/)
       tr.execute_coarsening_and_refinement ();
       tr2.execute_coarsening_and_refinement ();
 
-      write_vtk (tr, "2d_refinement_02", "1");
+      write_vtk(tr, "1");
       deallog << std::endl;
 
       deallog << i << " Number of cells: "
@@ -101,7 +101,7 @@ void test(std::ostream & /*out*/)
               << tr2.n_active_cells()
               << std::endl;
 
-      assert_tria_equal("2d_refinement_02", tr, tr2);
+      assert_tria_equal(tr, tr2);
 
     }
 }
index bd195cf4d032abbb435cab59c051a890d6c083d2..a7cc481cdc11b34bf3b34ad965e2327737a499a4 100644 (file)
@@ -123,7 +123,7 @@ void test(std::ostream & /*out*/)
                   << std::endl;
         }
 
-//      write_vtk (tr, "2d_refinement_03", "1");
+//      write_vtk(tr, "1");
       deallog << std::endl;
 
       deallog << i << " Number of cells: "
@@ -131,7 +131,7 @@ void test(std::ostream & /*out*/)
               << tr2.n_active_cells()
               << std::endl;
 
-      assert_tria_equal("2d_refinement_03", tr, tr2);
+      assert_tria_equal(tr, tr2);
 
     }
 }
index 80ac7fb7fd3546d28b7ce51a900230b6df342011..013ed860b24d23320c0c4db9aadd55f105e92c35 100644 (file)
@@ -51,7 +51,7 @@ void test(std::ostream & /*out*/)
   GridGenerator::hyper_cube(tr2);
   tr2.refine_global (1);
 
-  assert_tria_equal("2d_refinement_05", tr, tr2);
+  assert_tria_equal(tr, tr2);
 
   while (tr.n_active_cells() < 50000)
     {
@@ -88,7 +88,7 @@ void test(std::ostream & /*out*/)
               << tr2.n_active_cells()
               << std::endl;
 
-      assert_tria_equal("2d_refinement_05", tr, tr2);
+      assert_tria_equal(tr, tr2);
 
     }
 }
index 5b0e24d06644f8c44cea7779b9b91dfbfdd78026..f877e4f83ae4b2eaa5c71922475a6f4a27da9b4a 100644 (file)
@@ -49,7 +49,7 @@ void test(std::ostream & /*out*/)
     tr.begin(1)->child(3)->set_refine_flag();
     tr.execute_coarsening_and_refinement ();
 
-//    write_vtk (tr, "2d_refinement_06", "1");
+//    write_vtk(tr, "1");
     deallog << "cells test1: " << tr.n_active_cells() << std::endl;
   }
   {
@@ -61,7 +61,7 @@ void test(std::ostream & /*out*/)
     tr.begin(0)->child(3)->set_refine_flag();
     tr.execute_coarsening_and_refinement ();
 
-//    write_vtk (tr, "2d_refinement_06", "2");
+//    write_vtk(tr, "2");
     deallog << "cells test2: " << tr.n_active_cells() << std::endl;
 
   }
index 9e6e8a8c6c45f5197b9cc17c0c6ee205509b7f80..61b4979ecd8ea1511a0b5b78ecec9eed1b7757bb 100644 (file)
@@ -40,7 +40,7 @@ void test(std::ostream & /*out*/)
       parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
       GridGenerator::hyper_cube(tr);
-      write_vtk (tr, "3d_coarse_grid_01", "1");
+      write_vtk(tr, "1");
     }
 
 
@@ -51,7 +51,7 @@ void test(std::ostream & /*out*/)
       parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
       GridGenerator::hyper_ball(tr, Point<dim>(), 3.);
-      write_vtk (tr, "3d_coarse_grid_01", "2");
+      write_vtk(tr, "2");
     }
 
   if (true)
@@ -61,7 +61,7 @@ void test(std::ostream & /*out*/)
       parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
       GridGenerator::half_hyper_ball(tr, Point<dim>(), 3.);
-      write_vtk (tr, "3d_coarse_grid_01", "3");
+      write_vtk(tr, "3");
     }
 }
 
index 80191cab0689cf333c92a677404402c00faf0b5f..c3d1abd922a572d21c2b10b272a1da357eb9e517 100644 (file)
@@ -44,7 +44,7 @@ void test(const char *filename)
   std::ifstream in (filename);
   gi.read_xda (in);
 
-  write_vtk (tr, "3d_coarse_grid_02", "1");
+  write_vtk(tr, "1");
 
   deallog.pop ();
 }
index 996c529876f72125e55f6b50be80da39a3d7af3e..272f0ca1fb7054f51298bbdc471e34daf85e8fc1 100644 (file)
@@ -40,7 +40,7 @@ void test(std::ostream & /*out*/)
   std::ifstream in ("../bits/gerold_1.inp");
   gi.read_ucd (in);
 
-  write_vtk (tr, "3d_coarse_grid_03", "1");
+  write_vtk(tr, "1");
 }
 
 
index 2f45b18236ca0a1ce729fc3951e267a9abd0f88e..0d2bf946ada59b4cb4a5bcda4aea24aa1d06dd72 100644 (file)
@@ -38,7 +38,7 @@ void test(std::ostream & /*out*/)
   gi.attach_triangulation (tr);
   gi.read ("../bits/two_cubes.inp");
 
-  write_vtk (tr, "3d_coarse_grid_04", "1");
+  write_vtk(tr, "1");
 }
 
 
index 420d62b8e373e3aa5b823df98779ef742df26d0e..1057112fb7e74416c0a00f008d56001129331e29 100644 (file)
@@ -139,7 +139,7 @@ void test(std::ostream & /*out*/)
 
   create_disconnected_mesh (tr);
 
-  write_vtk (tr, "3d_coarse_grid_05", "1");
+  write_vtk(tr, "1");
 }
 
 
index c7ef9acc9526c8ae39cc7cc96c22b50262839ce5..fcc635e6376c9bb7dd538350b8ca529114699523 100644 (file)
@@ -44,7 +44,7 @@ void test(std::ostream & /*out*/)
     tr.begin(1)->child(c)->set_coarsen_flag();
   tr.execute_coarsening_and_refinement ();
 
-  write_vtk (tr, "3d_coarsening_01", "2");
+  write_vtk(tr, "2");
 }
 
 
index b74ea13b74aaa526da47eee2a995d1fe10596db5..2fb86d4f5ed315acf394bba19fa0723851b88b79 100644 (file)
@@ -106,7 +106,7 @@ void test(std::ostream & /*out*/)
       tr.execute_coarsening_and_refinement ();
       tr2.execute_coarsening_and_refinement ();
 
-      write_vtk (tr, "3d_coarsening_02", "1");
+      write_vtk(tr, "1");
       deallog << std::endl;
 
       deallog << i << " Number of cells: "
@@ -114,7 +114,7 @@ void test(std::ostream & /*out*/)
               << tr2.n_active_cells()
               << std::endl;
 
-      assert_tria_equal("3d_coarsening_02", tr, tr2);
+      assert_tria_equal(tr, tr2);
 
     }
 }
index f9428c145bc16b824393dda972f614044f99225e..b1f2b811f263a6c0c0e6c225aaa556e2d4ce9415 100644 (file)
@@ -103,7 +103,7 @@ void test(std::ostream & /*out*/)
       tr.execute_coarsening_and_refinement ();
       tr2.execute_coarsening_and_refinement ();
 
-//write_vtk (tr, "3d_coarsening_02", "1");
+//write_vtk(tr, "1");
       deallog << std::endl;
 
       deallog << i << " Number of cells: "
@@ -111,7 +111,7 @@ void test(std::ostream & /*out*/)
               << tr2.n_active_cells()
               << std::endl;
 
-      assert_tria_equal("3d_coarsening_03", tr, tr2);
+      assert_tria_equal(tr, tr2);
 
     }
 }
index ef15527c94af98e770186a920e26dab5134c2cf4..fc48d22fee2430e0526898ca8128dabaf7e0ba21 100644 (file)
@@ -112,7 +112,7 @@ void test(std::ostream & /*out*/)
               << tr2.n_active_cells()
               << std::endl;
 
-      assert_tria_equal("3d_coarsening_04", tr, tr2);
+      assert_tria_equal(tr, tr2);
 
     }
 }
index 5ba688788aa4912262e6b5f95495a60a55b46c5f..b067cc3288b15299127a1e5b206e8555f4329777 100644 (file)
@@ -101,7 +101,7 @@ void test(std::ostream & /*out*/)
               << tr2.n_active_cells()
               << std::endl;
 
-      assert_tria_equal("3d_coarsening_05", tr, tr2);
+      assert_tria_equal(tr, tr2);
 
     }
 }
index 6571b41bdbd8a377ab5eebd46fe38be8baf749e4..d287132a1966535350775f2577f7331ab2c5d32d 100644 (file)
@@ -42,7 +42,7 @@ void test(std::ostream & /*out*/)
   tr.begin_active()->set_refine_flag();
   tr.execute_coarsening_and_refinement ();
 
-  write_vtk (tr, "3d_refinement_01", "2");
+  write_vtk(tr, "2");
 }
 
 
index b126caa0c89727baaff53ba3008d368f3fb8435e..19e01a0634c473e4dedd84cffd024cfbe4f16499 100644 (file)
@@ -93,7 +93,7 @@ void test(std::ostream & /*out*/)
       tr.execute_coarsening_and_refinement ();
       tr2.execute_coarsening_and_refinement ();
 
-      write_vtk (tr, "3d_refinement_02", "1");
+      write_vtk(tr, "1");
       deallog << std::endl;
 
       deallog << i << " Number of cells: "
@@ -101,7 +101,7 @@ void test(std::ostream & /*out*/)
               << tr2.n_active_cells()
               << std::endl;
 
-      assert_tria_equal("3d_refinement_02", tr, tr2);
+      assert_tria_equal(tr, tr2);
 
     }
 }
index d6a96ee56aa19106764548fb0dc7d48e87c1ee59..f5cbabe0316abac30106ef8ff8b91f7ac85c6cb3 100644 (file)
@@ -82,7 +82,7 @@ void test(std::ostream & /*out*/)
       tr.execute_coarsening_and_refinement ();
       tr2.execute_coarsening_and_refinement ();
 
-      write_vtk (tr, "3d_refinement_03", "1");
+      write_vtk(tr, "1");
       deallog << std::endl;
 
       deallog << i << " Number of cells: "
@@ -90,7 +90,7 @@ void test(std::ostream & /*out*/)
               << tr2.n_active_cells()
               << std::endl;
 
-      assert_tria_equal("3d_refinement_03", tr, tr2);
+      assert_tria_equal(tr, tr2);
 
     }
 }
index 25e94326d601abc3affb09a2339680980610a2fc..83b046570a430e566b724b9efc6bbe6dbf1934d5 100644 (file)
@@ -89,7 +89,7 @@ void test(std::ostream & /*out*/)
               << tr2.n_active_cells()
               << std::endl;
 
-      assert_tria_equal("3d_refinement_05", tr, tr2);
+      assert_tria_equal(tr, tr2);
 
     }
 }
index d0e6e4d570a49d8ec92e447ca5d8c152cd6a704f..20465863de3b240fac36b69cc8c1107357cc4bb4 100644 (file)
@@ -59,7 +59,7 @@ void test(std::ostream & /*out*/)
       tr.begin(1)->child(c)->set_refine_flag();
     tr.execute_coarsening_and_refinement ();
 
-//    write_vtk (tr, "3d_refinement_06", "1");
+//    write_vtk(tr, "1");
     deallog << "cells test1: " << tr.n_active_cells() << std::endl;
 
     Assert (tr.n_active_cells() == 120, ExcInternalError());
@@ -74,7 +74,7 @@ void test(std::ostream & /*out*/)
       tr.begin(0)->child(c)->set_refine_flag();
     tr.execute_coarsening_and_refinement ();
 
-//    write_vtk (tr, "3d_refinement_06", "2");
+//    write_vtk(tr, "2");
     deallog << "cells test2: " << tr.n_active_cells() << std::endl;
 
     Assert (tr.n_active_cells() == 120, ExcInternalError());
index b3c9c84caef2f9c237782f61ae46e4c6052ca597..3dd43826f870b0166b64fa039d034781477ca79d 100644 (file)
@@ -50,7 +50,7 @@ void test(std::ostream & /*out*/)
       tr.begin(0)->child(c)->set_refine_flag();
     tr.execute_coarsening_and_refinement ();
 
-//    write_vtk (tr, "3d_refinement_07", "2");
+//    write_vtk(tr, "2");
     deallog << "cells test2: " << tr.n_active_cells() << std::endl;
 
     Assert (tr.n_active_cells() == 88, ExcInternalError());
index 3824ea066ad8c48f498c2c2079d073b5831863f6..d0c7502a413caab30773837416dcc1a99f220145 100644 (file)
@@ -91,7 +91,7 @@ void test(std::ostream & /*out*/)
               << tr2.n_active_cells()
               << std::endl;
 
-      assert_tria_equal("3d_refinement_08", tr, tr2);
+      assert_tria_equal(tr, tr2);
 
     }
 }
index d724c5c9058489f6b1c956a8034e52ffe6a14fa6..deda5c05b1f1d08bc7dd0e5604b9d2fed5964169 100644 (file)
 
 template <int dim>
 void write_vtk (const parallel::distributed::Triangulation<dim> &tria,
-                const char                                *dirname,
                 const char                                *filename)
 {
   deallog << "Checksum: "
           << tria.get_checksum ()
           << std::endl;
 
-  chdir (dirname);
   tria.write_mesh_vtk (filename);
 
   // copy the .pvtu and .vtu files
@@ -59,19 +57,17 @@ void write_vtk (const parallel::distributed::Triangulation<dim> &tria,
         deallog.get_file_stream() << s << "\n";
       }
   }
-
-  chdir ("..");
 }
 
 
 template <int dim>
-void assert_tria_equal(const char *testdir, const Triangulation<dim> &a, const Triangulation<dim> &b)
+void assert_tria_equal(const Triangulation<dim> &a, const Triangulation<dim> &b)
 {
   Assert (a.n_active_cells() == b.n_active_cells(),
           ExcInternalError());
 
-  std::string file1=std::string(testdir)+"/tmp_grid1";
-  std::string file2=std::string(testdir)+"/tmp_grid2";
+  std::string file1 = "tmp_grid1";
+  std::string file2 = "tmp_grid2";
 
   std::ofstream out1(file1.c_str());
   GridOut().write_gnuplot (a, out1);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.