parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
GridGenerator::hyper_cube(tr);
- write_vtk (tr, "2d_coarse_grid_01", "1");
+ write_vtk(tr, "1");
}
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)
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");
}
}
<< std::endl;
}
- write_vtk (tr, "2d_coarse_grid_02", "1");
+ write_vtk(tr, "1");
}
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");
}
gi.attach_triangulation (tr);
gi.read ("../bits/step-5/circle-grid.inp");
- write_vtk (tr, "2d_coarse_grid_04", "1");
+ write_vtk(tr, "1");
}
tr.begin(1)->child(c)->set_coarsen_flag();
tr.execute_coarsening_and_refinement ();
- write_vtk (tr, "2d_coarsening_01", "2");
+ write_vtk(tr, "2");
}
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);
}
}
}
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)
{
<< tr.n_active_cells() << ' '
<< tr2.n_active_cells()
<< std::endl;
- assert_tria_equal("2d_coarsening_03", tr, tr2);
+ assert_tria_equal(tr, tr2);
}
}
<< tr2.n_active_cells()
<< std::endl;
- assert_tria_equal("2d_coarsening_05", tr, tr2);
+ assert_tria_equal(tr, tr2);
}
}
tr.begin_active()->set_refine_flag();
tr.execute_coarsening_and_refinement ();
- write_vtk (tr, "2d_refinement_01", "2");
+ write_vtk(tr, "2");
}
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: "
<< tr2.n_active_cells()
<< std::endl;
- assert_tria_equal("2d_refinement_02", tr, tr2);
+ assert_tria_equal(tr, tr2);
}
}
<< std::endl;
}
-// write_vtk (tr, "2d_refinement_03", "1");
+// write_vtk(tr, "1");
deallog << std::endl;
deallog << i << " Number of cells: "
<< tr2.n_active_cells()
<< std::endl;
- assert_tria_equal("2d_refinement_03", tr, tr2);
+ assert_tria_equal(tr, tr2);
}
}
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)
{
<< tr2.n_active_cells()
<< std::endl;
- assert_tria_equal("2d_refinement_05", tr, tr2);
+ assert_tria_equal(tr, tr2);
}
}
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;
}
{
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;
}
parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
GridGenerator::hyper_cube(tr);
- write_vtk (tr, "3d_coarse_grid_01", "1");
+ write_vtk(tr, "1");
}
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)
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");
}
}
std::ifstream in (filename);
gi.read_xda (in);
- write_vtk (tr, "3d_coarse_grid_02", "1");
+ write_vtk(tr, "1");
deallog.pop ();
}
std::ifstream in ("../bits/gerold_1.inp");
gi.read_ucd (in);
- write_vtk (tr, "3d_coarse_grid_03", "1");
+ write_vtk(tr, "1");
}
gi.attach_triangulation (tr);
gi.read ("../bits/two_cubes.inp");
- write_vtk (tr, "3d_coarse_grid_04", "1");
+ write_vtk(tr, "1");
}
create_disconnected_mesh (tr);
- write_vtk (tr, "3d_coarse_grid_05", "1");
+ write_vtk(tr, "1");
}
tr.begin(1)->child(c)->set_coarsen_flag();
tr.execute_coarsening_and_refinement ();
- write_vtk (tr, "3d_coarsening_01", "2");
+ write_vtk(tr, "2");
}
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: "
<< tr2.n_active_cells()
<< std::endl;
- assert_tria_equal("3d_coarsening_02", tr, tr2);
+ assert_tria_equal(tr, tr2);
}
}
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: "
<< tr2.n_active_cells()
<< std::endl;
- assert_tria_equal("3d_coarsening_03", tr, tr2);
+ assert_tria_equal(tr, tr2);
}
}
<< tr2.n_active_cells()
<< std::endl;
- assert_tria_equal("3d_coarsening_04", tr, tr2);
+ assert_tria_equal(tr, tr2);
}
}
<< tr2.n_active_cells()
<< std::endl;
- assert_tria_equal("3d_coarsening_05", tr, tr2);
+ assert_tria_equal(tr, tr2);
}
}
tr.begin_active()->set_refine_flag();
tr.execute_coarsening_and_refinement ();
- write_vtk (tr, "3d_refinement_01", "2");
+ write_vtk(tr, "2");
}
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: "
<< tr2.n_active_cells()
<< std::endl;
- assert_tria_equal("3d_refinement_02", tr, tr2);
+ assert_tria_equal(tr, tr2);
}
}
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: "
<< tr2.n_active_cells()
<< std::endl;
- assert_tria_equal("3d_refinement_03", tr, tr2);
+ assert_tria_equal(tr, tr2);
}
}
<< tr2.n_active_cells()
<< std::endl;
- assert_tria_equal("3d_refinement_05", tr, tr2);
+ assert_tria_equal(tr, tr2);
}
}
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());
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());
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());
<< tr2.n_active_cells()
<< std::endl;
- assert_tria_equal("3d_refinement_08", tr, tr2);
+ assert_tria_equal(tr, tr2);
}
}
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
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);