From 41389e76381ef3955770d120df331d314f38df61 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sun, 5 Aug 2018 19:40:06 -0400 Subject: [PATCH] Use initlog() in grid/ tests. --- tests/grid/enclosing_sphere_01.cc | 3 +-- tests/grid/grid_hyper_shell.cc | 7 ++----- tests/grid/grid_hyper_shell_02.cc | 7 ++----- tests/grid/grid_hyper_shell_03.cc | 7 ++----- tests/grid/grid_hyper_shell_04.cc | 7 ++----- tests/grid/grid_hyper_shell_05.cc | 5 +---- tests/grid/grid_hyper_shell_06.cc | 5 +---- tests/grid/grid_in.cc | 10 +++------- tests/grid/grid_in_3d.cc | 5 +---- tests/grid/grid_in_3d_02.cc | 7 +------ tests/grid/grid_in_msh.cc | 8 ++------ tests/grid/grid_in_msh_02.cc | 6 +----- tests/grid/grid_in_msh_02_13.cc | 6 +----- tests/grid/grid_in_msh_03.cc | 8 ++------ tests/grid/grid_in_msh_version_1.cc | 8 ++------ tests/grid/grid_in_msh_version_2.cc | 8 ++------ tests/grid/grid_in_tecplot.cc | 9 ++++----- tests/grid/grid_in_tecplot.output | 1 + tests/grid/grid_in_unv_2d.cc | 6 +----- tests/grid/grid_in_unv_3d.cc | 8 ++------ tests/grid/grid_in_unv_3d_02.cc | 8 ++------ tests/grid/grid_in_vtk_2d.cc | 6 +----- tests/grid/grid_in_vtk_3d.cc | 6 +----- tests/grid/grid_in_vtk_3d_02.cc | 6 +----- tests/grid/grid_in_vtk_3d_03.cc | 6 +----- tests/grid/grid_in_vtk_3d_04.cc | 6 +----- tests/grid/grid_invert.cc | 4 ++-- tests/grid/grid_invert.output | 7 ++++--- tests/grid/grid_out.cc | 16 ++++++---------- tests/grid/grid_out_02.cc | 10 +++------- tests/grid/grid_out_03.cc | 10 ++-------- tests/grid/grid_out_04.cc | 10 ++-------- tests/grid/grid_out_08.cc | 12 +++--------- tests/grid/grid_out_09.cc | 10 ++-------- tests/grid/grid_output_input.cc | 5 ++--- tests/grid/grid_parallelepiped.cc | 7 +++---- tests/grid/grid_parallelepiped.output | 1 + tests/grid/grid_parallelepiped_01.cc | 8 ++++---- tests/grid/grid_parallelepiped_01.output | 1 + tests/grid/grid_parallelepiped_02.cc | 17 +++++++---------- tests/grid/grid_parallelepiped_02.output | 6 +++--- tests/grid/grid_parallelepiped_03.cc | 7 +++---- tests/grid/grid_parallelepiped_03.output | 1 + tests/grid/grid_remove_anisotropy.cc | 5 ++--- tests/grid/grid_remove_anisotropy.output | 13 +++++++------ tests/grid/grid_remove_hanging_nodes.cc | 7 ++----- tests/grid/grid_remove_hanging_nodes.output | 13 +++++++------ tests/grid/grid_test.cc | 10 +++------- tests/grid/grid_tools.cc | 9 +++------ tests/grid/grid_tools_02.cc | 8 +------- tests/grid/grid_tools_03.cc | 7 +------ tests/grid/grid_tools_04.cc | 8 +------- tests/grid/grid_tools_05.cc | 8 +------- tests/grid/grid_tools_05.output | 1 + tests/grid/grid_tools_06.cc | 9 +-------- tests/grid/grid_tools_06.output | 1 + tests/grid/grid_tools_vertex_to_cell_map_02.cc | 5 +---- tests/grid/have_same_coarse_mesh_01.cc | 3 +-- tests/grid/have_same_coarse_mesh_02.cc | 3 +-- tests/grid/have_same_coarse_mesh_03.cc | 3 +-- tests/grid/intergrid_map.cc | 4 +--- tests/grid/line_coarsening_3d.cc | 9 +++------ tests/grid/maximal_cell_diameter.cc | 8 +------- tests/grid/measure_et_al.cc | 3 +-- tests/grid/measure_et_al_02.cc | 3 +-- tests/grid/measure_of_3d_face_01.cc | 3 +-- tests/grid/merge_triangulations_01.cc | 9 ++------- tests/grid/merge_triangulations_02.cc | 7 ++----- tests/grid/merge_triangulations_03.cc | 6 +----- tests/grid/mesh_3d_22.cc | 3 +-- tests/grid/mesh_3d_23.cc | 3 +-- tests/grid/mesh_3d_24.cc | 3 +-- tests/grid/mesh_3d_25.cc | 4 +--- tests/grid/mesh_3d_26.cc | 4 +--- tests/grid/minimal_cell_diameter.cc | 8 +------- tests/grid/normal_vector_01.cc | 3 +-- tests/grid/normal_vector_01_2d.cc | 3 +-- tests/grid/normal_vector_02.cc | 3 +-- tests/grid/normal_vector_02_2d.cc | 3 +-- tests/grid/normal_vector_03.cc | 3 +-- tests/grid/normal_vector_03_2d.cc | 3 +-- tests/grid/normals_at_vertices_01.cc | 3 +-- tests/grid/normals_at_vertices_02.cc | 3 +-- tests/grid/number_cache_01.cc | 6 +----- tests/grid/number_cache_02.cc | 6 +----- tests/grid/number_cache_03.cc | 6 +----- tests/grid/recursively_set_material_id.cc | 4 +--- tests/grid/refinement_listener_02.cc | 7 +------ tests/grid/refinement_listener_03.cc | 8 +------- tests/grid/subdomain_ids.cc | 5 +---- tests/grid/subdomain_on_refinement.cc | 5 +---- tests/grid/tria_iterator_with_one_header.cc | 6 +----- tests/grid/tria_last.cc | 8 +------- tests/grid/twisted_parallelepiped_02.cc | 14 +++++++------- .../twisted_parallelepiped_02.release.output | 1 + tests/grid/union_triangulation.cc | 10 ++-------- 96 files changed, 172 insertions(+), 429 deletions(-) diff --git a/tests/grid/enclosing_sphere_01.cc b/tests/grid/enclosing_sphere_01.cc index 13218c85ad..45a0dd7af6 100644 --- a/tests/grid/enclosing_sphere_01.cc +++ b/tests/grid/enclosing_sphere_01.cc @@ -207,9 +207,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(PRECISION); - deallog.attach(logfile); test<2>(); test<3>(); diff --git a/tests/grid/grid_hyper_shell.cc b/tests/grid/grid_hyper_shell.cc index 58b103ebe3..62fa18e90d 100644 --- a/tests/grid/grid_hyper_shell.cc +++ b/tests/grid/grid_hyper_shell.cc @@ -30,9 +30,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void check(double r1, double r2, unsigned int n) @@ -85,15 +82,15 @@ check(double r1, double r2, unsigned int n) GridOutFlags::DX flags; flags.write_faces = true; grid_out.set_flags(flags); - grid_out.write_dx(tria, logfile); + grid_out.write_dx(tria, deallog.get_file_stream()); } int main() { + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); check<2>(4., 5., 10); check<3>(3., 5., 6); diff --git a/tests/grid/grid_hyper_shell_02.cc b/tests/grid/grid_hyper_shell_02.cc index fe35a7f257..7aae10a5aa 100644 --- a/tests/grid/grid_hyper_shell_02.cc +++ b/tests/grid/grid_hyper_shell_02.cc @@ -29,9 +29,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void check(double r1, double r2, unsigned int n) @@ -44,15 +41,15 @@ check(double r1, double r2, unsigned int n) tria.refine_global(1); GridOut grid_out; - grid_out.write_gnuplot(tria, logfile); + grid_out.write_gnuplot(tria, deallog.get_file_stream()); } int main() { + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); check<3>(.5, 1, 6); } diff --git a/tests/grid/grid_hyper_shell_03.cc b/tests/grid/grid_hyper_shell_03.cc index b2a078eace..ea0b4b94c3 100644 --- a/tests/grid/grid_hyper_shell_03.cc +++ b/tests/grid/grid_hyper_shell_03.cc @@ -29,9 +29,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void check(double r1, double r2, unsigned int n) @@ -44,15 +41,15 @@ check(double r1, double r2, unsigned int n) tria.refine_global(1); GridOut grid_out; - grid_out.write_gnuplot(tria, logfile); + grid_out.write_gnuplot(tria, deallog.get_file_stream()); } int main() { + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); check<3>(.5, 1, 12); } diff --git a/tests/grid/grid_hyper_shell_04.cc b/tests/grid/grid_hyper_shell_04.cc index f3de8a083d..b6b9f5e436 100644 --- a/tests/grid/grid_hyper_shell_04.cc +++ b/tests/grid/grid_hyper_shell_04.cc @@ -29,9 +29,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void check(double r1, double r2, unsigned int n) @@ -43,15 +40,15 @@ check(double r1, double r2, unsigned int n) tria.set_manifold(0, boundary); GridOut grid_out; - grid_out.write_gnuplot(tria, logfile); + grid_out.write_gnuplot(tria, deallog.get_file_stream()); } int main() { + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); check<3>(.5, 1, 96); } diff --git a/tests/grid/grid_hyper_shell_05.cc b/tests/grid/grid_hyper_shell_05.cc index 4c21bd45db..85afd94be3 100644 --- a/tests/grid/grid_hyper_shell_05.cc +++ b/tests/grid/grid_hyper_shell_05.cc @@ -35,9 +35,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void check(const unsigned int n) @@ -74,8 +71,8 @@ check(const unsigned int n) int main() { + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); check<3>(6); check<3>(12); diff --git a/tests/grid/grid_hyper_shell_06.cc b/tests/grid/grid_hyper_shell_06.cc index 2cc5f1b29e..734866bf0f 100644 --- a/tests/grid/grid_hyper_shell_06.cc +++ b/tests/grid/grid_hyper_shell_06.cc @@ -31,9 +31,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void check(double r1, double r2, unsigned int n) @@ -61,8 +58,8 @@ check(double r1, double r2, unsigned int n) int main() { + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); check<3>(.5, 1, 6); check<3>(.5, 1, 12); diff --git a/tests/grid/grid_in.cc b/tests/grid/grid_in.cc index a701a260ef..ce1ad6d3f5 100644 --- a/tests/grid/grid_in.cc +++ b/tests/grid/grid_in.cc @@ -29,9 +29,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void test1() @@ -44,7 +41,7 @@ test1() GridOut grid_out; grid_out.set_flags(GridOutFlags::Ucd(true)); - grid_out.write_ucd(tria, logfile); + grid_out.write_ucd(tria, deallog.get_file_stream()); } @@ -145,9 +142,8 @@ filename_resolution() int main() { - deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream() << std::setprecision(2); test1<2>(); test2<2>(); diff --git a/tests/grid/grid_in_3d.cc b/tests/grid/grid_in_3d.cc index 7c4190e8d2..8a32da41ec 100644 --- a/tests/grid/grid_in_3d.cc +++ b/tests/grid/grid_in_3d.cc @@ -32,9 +32,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - void test(const char *filename) { @@ -85,8 +82,8 @@ test1() int main() { + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); test(SOURCE_DIR "/grid_in_3d/1.in"); test(SOURCE_DIR "/grid_in_3d/2.in"); diff --git a/tests/grid/grid_in_3d_02.cc b/tests/grid/grid_in_3d_02.cc index 95f5c43793..7619f7829f 100644 --- a/tests/grid/grid_in_3d_02.cc +++ b/tests/grid/grid_in_3d_02.cc @@ -35,11 +35,6 @@ // #include // #include - - -std::ofstream logfile("output"); - - void test(const char *filename) { @@ -88,8 +83,8 @@ test(const char *filename) int main() { + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); test(SOURCE_DIR "/grid_in_3d_02/747.ucd"); } diff --git a/tests/grid/grid_in_msh.cc b/tests/grid/grid_in_msh.cc index 761388a03e..08f24b4bf1 100644 --- a/tests/grid/grid_in_msh.cc +++ b/tests/grid/grid_in_msh.cc @@ -30,9 +30,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void check_file(const std::string name, typename GridIn::Format format) @@ -57,9 +54,8 @@ filename_resolution() int main() { - deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream() << std::setprecision(2); filename_resolution(); } diff --git a/tests/grid/grid_in_msh_02.cc b/tests/grid/grid_in_msh_02.cc index d141085972..65cbc60f0a 100644 --- a/tests/grid/grid_in_msh_02.cc +++ b/tests/grid/grid_in_msh_02.cc @@ -34,9 +34,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - void check_file() { @@ -64,9 +61,8 @@ check_file() int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); check_file(); } diff --git a/tests/grid/grid_in_msh_02_13.cc b/tests/grid/grid_in_msh_02_13.cc index 90e81e0170..b8f977500a 100644 --- a/tests/grid/grid_in_msh_02_13.cc +++ b/tests/grid/grid_in_msh_02_13.cc @@ -38,9 +38,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - void check_file() { @@ -68,9 +65,8 @@ check_file() int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); check_file(); } diff --git a/tests/grid/grid_in_msh_03.cc b/tests/grid/grid_in_msh_03.cc index 7552402293..5a89e890cd 100644 --- a/tests/grid/grid_in_msh_03.cc +++ b/tests/grid/grid_in_msh_03.cc @@ -32,9 +32,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void check_file(const std::string name, typename GridIn::Format format) @@ -62,9 +59,8 @@ filename_resolution() int main() { - deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); + initlog(false, std::ios_base::fmtflags()); + deallog.get_file_stream() << std::setprecision(2); filename_resolution(); } diff --git a/tests/grid/grid_in_msh_version_1.cc b/tests/grid/grid_in_msh_version_1.cc index 825417d2ff..6f17681852 100644 --- a/tests/grid/grid_in_msh_version_1.cc +++ b/tests/grid/grid_in_msh_version_1.cc @@ -32,9 +32,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void check_file(const std::string name, typename GridIn::Format format) @@ -66,9 +63,8 @@ filename_resolution() int main() { - deallog << std::setprecision(5); - logfile << std::setprecision(5); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream() << std::setprecision(5); filename_resolution(); } diff --git a/tests/grid/grid_in_msh_version_2.cc b/tests/grid/grid_in_msh_version_2.cc index b8fa7fa054..f7692c6785 100644 --- a/tests/grid/grid_in_msh_version_2.cc +++ b/tests/grid/grid_in_msh_version_2.cc @@ -31,9 +31,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void check_file(const std::string name, typename GridIn::Format format) @@ -61,9 +58,8 @@ filename_resolution() int main() { - deallog << std::setprecision(5); - logfile << std::setprecision(5); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream() << std::setprecision(5); filename_resolution(); } diff --git a/tests/grid/grid_in_tecplot.cc b/tests/grid/grid_in_tecplot.cc index e2158c4554..ba6091680a 100644 --- a/tests/grid/grid_in_tecplot.cc +++ b/tests/grid/grid_in_tecplot.cc @@ -24,9 +24,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void test(const std::string &infilename) @@ -36,16 +33,18 @@ test(const std::string &infilename) gi.attach_triangulation(tria); gi.read(infilename); - logfile << "------------------------------------------" << std::endl; + deallog.get_file_stream() + << "------------------------------------------" << std::endl; GridOut grid_out; grid_out.set_flags(GridOutFlags::Ucd(true)); - grid_out.write_ucd(tria, logfile); + grid_out.write_ucd(tria, deallog.get_file_stream()); } int main() { + initlog(); test<2>(std::string(SOURCE_DIR "/grid_in_tecplot/1.dat")); test<2>(std::string(SOURCE_DIR "/grid_in_tecplot/2.dat")); test<2>(std::string(SOURCE_DIR "/grid_in_tecplot/3.dat")); diff --git a/tests/grid/grid_in_tecplot.output b/tests/grid/grid_in_tecplot.output index ed7fc29fe1..5a49ddc6ad 100644 --- a/tests/grid/grid_in_tecplot.output +++ b/tests/grid/grid_in_tecplot.output @@ -1,3 +1,4 @@ + ------------------------------------------ # This file was generated by the deal.II library. diff --git a/tests/grid/grid_in_unv_2d.cc b/tests/grid/grid_in_unv_2d.cc index e4f528414f..1ee3f8c561 100644 --- a/tests/grid/grid_in_unv_2d.cc +++ b/tests/grid/grid_in_unv_2d.cc @@ -33,9 +33,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void check_file(const std::string name, typename GridIn::Format format) @@ -63,9 +60,8 @@ filename_resolution() int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); filename_resolution(); } diff --git a/tests/grid/grid_in_unv_3d.cc b/tests/grid/grid_in_unv_3d.cc index 37eb155525..5bec4f673d 100644 --- a/tests/grid/grid_in_unv_3d.cc +++ b/tests/grid/grid_in_unv_3d.cc @@ -33,9 +33,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void check_file(const std::string name, typename GridIn::Format format) @@ -60,9 +57,8 @@ filename_resolution() int main() { - deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream() << std::setprecision(2); filename_resolution(); } diff --git a/tests/grid/grid_in_unv_3d_02.cc b/tests/grid/grid_in_unv_3d_02.cc index cb1646a1e9..98b5ebbbea 100644 --- a/tests/grid/grid_in_unv_3d_02.cc +++ b/tests/grid/grid_in_unv_3d_02.cc @@ -34,9 +34,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void check_file(const std::string name, typename GridIn::Format format) @@ -62,9 +59,8 @@ filename_resolution() int main() { - deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream() << std::setprecision(2); filename_resolution(); } diff --git a/tests/grid/grid_in_vtk_2d.cc b/tests/grid/grid_in_vtk_2d.cc index bb7cdb3c81..29f74c26b5 100644 --- a/tests/grid/grid_in_vtk_2d.cc +++ b/tests/grid/grid_in_vtk_2d.cc @@ -30,9 +30,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void check_file(const std::string name, typename GridIn::Format format) @@ -57,9 +54,8 @@ filename_resolution() int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); filename_resolution(); } diff --git a/tests/grid/grid_in_vtk_3d.cc b/tests/grid/grid_in_vtk_3d.cc index fb609b60ab..aeae3864fc 100644 --- a/tests/grid/grid_in_vtk_3d.cc +++ b/tests/grid/grid_in_vtk_3d.cc @@ -30,9 +30,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void check_file(const std::string name, typename GridIn::Format format) @@ -57,9 +54,8 @@ filename_resolution() int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); filename_resolution(); } diff --git a/tests/grid/grid_in_vtk_3d_02.cc b/tests/grid/grid_in_vtk_3d_02.cc index d5770a0f65..4a389b9215 100644 --- a/tests/grid/grid_in_vtk_3d_02.cc +++ b/tests/grid/grid_in_vtk_3d_02.cc @@ -30,9 +30,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void check_file(const std::string name, typename GridIn::Format format) @@ -58,9 +55,8 @@ filename_resolution() int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); filename_resolution(); } diff --git a/tests/grid/grid_in_vtk_3d_03.cc b/tests/grid/grid_in_vtk_3d_03.cc index afe9039871..83f5ad9474 100644 --- a/tests/grid/grid_in_vtk_3d_03.cc +++ b/tests/grid/grid_in_vtk_3d_03.cc @@ -30,9 +30,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void check_file(const std::string name, typename GridIn::Format format) @@ -58,9 +55,8 @@ filename_resolution() int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); filename_resolution(); } diff --git a/tests/grid/grid_in_vtk_3d_04.cc b/tests/grid/grid_in_vtk_3d_04.cc index 448c8d4af6..726e677fc3 100644 --- a/tests/grid/grid_in_vtk_3d_04.cc +++ b/tests/grid/grid_in_vtk_3d_04.cc @@ -30,9 +30,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void check_file(const std::string name, typename GridIn::Format format) @@ -70,9 +67,8 @@ filename_resolution() int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); filename_resolution(); } diff --git a/tests/grid/grid_invert.cc b/tests/grid/grid_invert.cc index bb4fb929f1..33411dc5de 100644 --- a/tests/grid/grid_invert.cc +++ b/tests/grid/grid_invert.cc @@ -24,8 +24,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - template void test(bool second_case = false) @@ -62,6 +60,7 @@ test(bool second_case = false) Triangulation tria; tria.create_triangulation_compatibility(vertices, cells, subcelldata); + std::ostream &logfile = deallog.get_file_stream(); logfile << "---------------------------------------------" << std::endl << "dim=" << dim << (second_case ? ", second case" : ", first case") << std::endl @@ -75,6 +74,7 @@ test(bool second_case = false) int main() { + initlog(false, std::ios_base::fmtflags()); test<2>(); test<3>(false); test<3>(true); diff --git a/tests/grid/grid_invert.output b/tests/grid/grid_invert.output index 47f4a40cf4..26db67300d 100644 --- a/tests/grid/grid_invert.output +++ b/tests/grid/grid_invert.output @@ -1,3 +1,4 @@ + --------------------------------------------- dim=2, first case @@ -12,7 +13,7 @@ dim=2, first case 2 0 1 0 3 1 1 0 4 1 0 0 -1 0 quad 1 4 3 2 +1 0 quad 1 4 3 2 --------------------------------------------- dim=3, first case @@ -31,7 +32,7 @@ dim=3, first case 6 0 1 -1 7 1 1 -1 8 1 0 -1 -1 0 hex 5 6 7 8 1 2 3 4 +1 0 hex 5 6 7 8 1 2 3 4 --------------------------------------------- dim=3, second case @@ -50,4 +51,4 @@ dim=3, second case 6 0 1 1 7 1 1 1 8 1 0 1 -1 0 hex 5 8 7 6 1 4 3 2 +1 0 hex 5 8 7 6 1 4 3 2 diff --git a/tests/grid/grid_out.cc b/tests/grid/grid_out.cc index a22b8b149f..707a72f680 100644 --- a/tests/grid/grid_out.cc +++ b/tests/grid/grid_out.cc @@ -26,9 +26,6 @@ -std::ofstream logfile("output"); - - template void test() @@ -50,21 +47,20 @@ test() grid_out.set_flags(eps2); if (dim != 1) - grid_out.write_eps(tria, logfile); - grid_out.write_gnuplot(tria, logfile); + grid_out.write_eps(tria, deallog.get_file_stream()); + grid_out.write_gnuplot(tria, deallog.get_file_stream()); grid_out.set_flags(GridOutFlags::Ucd(true)); - grid_out.write_ucd(tria, logfile); + grid_out.write_ucd(tria, deallog.get_file_stream()); if (dim != 1) - grid_out.write_dx(tria, logfile); + grid_out.write_dx(tria, deallog.get_file_stream()); } int main() { - deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream() << std::setprecision(2); test<1>(); test<2>(); diff --git a/tests/grid/grid_out_02.cc b/tests/grid/grid_out_02.cc index a9969984f4..d619414c71 100644 --- a/tests/grid/grid_out_02.cc +++ b/tests/grid/grid_out_02.cc @@ -33,9 +33,6 @@ -std::ofstream logfile("output"); - - template void test() @@ -45,7 +42,7 @@ test() tria.refine_global(2); GridOut grid_out; - grid_out.write_dx(tria, logfile); + grid_out.write_dx(tria, deallog.get_file_stream()); typename Triangulation::active_cell_iterator cell = tria.begin_active(); for (unsigned int i = 0; i < GeometryInfo::max_children_per_cell; ++i) @@ -54,16 +51,15 @@ test() ++cell; } tria.execute_coarsening_and_refinement(); - grid_out.write_dx(tria, logfile); + grid_out.write_dx(tria, deallog.get_file_stream()); } int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); test<2>(); test<3>(); diff --git a/tests/grid/grid_out_03.cc b/tests/grid/grid_out_03.cc index c796ce0131..f7464d57aa 100644 --- a/tests/grid/grid_out_03.cc +++ b/tests/grid/grid_out_03.cc @@ -30,11 +30,6 @@ #include "../tests.h" - - -std::ofstream logfile("output"); - - template void test() @@ -48,16 +43,15 @@ test() GridOutFlags::Ucd flags; flags.write_lines = flags.write_faces = true; grid_out.set_flags(flags); - grid_out.write_ucd(tria, logfile); + grid_out.write_ucd(tria, deallog.get_file_stream()); } int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); test<2>(); test<3>(); diff --git a/tests/grid/grid_out_04.cc b/tests/grid/grid_out_04.cc index 78a3a9145c..7a82024651 100644 --- a/tests/grid/grid_out_04.cc +++ b/tests/grid/grid_out_04.cc @@ -30,11 +30,6 @@ #include "../tests.h" - - -std::ofstream logfile("output"); - - template void test() @@ -48,16 +43,15 @@ test() GridOutFlags::Msh flags; flags.write_lines = flags.write_faces = true; grid_out.set_flags(flags); - grid_out.write_msh(tria, logfile); + grid_out.write_msh(tria, deallog.get_file_stream()); } int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); test<2>(); test<3>(); diff --git a/tests/grid/grid_out_08.cc b/tests/grid/grid_out_08.cc index bbd29cb04d..e990471957 100644 --- a/tests/grid/grid_out_08.cc +++ b/tests/grid/grid_out_08.cc @@ -29,11 +29,6 @@ #include "../tests.h" - - -std::ofstream logfile("output"); - - void test() { @@ -77,16 +72,15 @@ test() tria.refine_global(1); GridOut grid_out; - grid_out.write_vtu(tria, logfile); + grid_out.write_vtu(tria, deallog.get_file_stream()); } int main() { - deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream() << std::setprecision(2); test(); } diff --git a/tests/grid/grid_out_09.cc b/tests/grid/grid_out_09.cc index 60f92899a2..5cb672dd87 100644 --- a/tests/grid/grid_out_09.cc +++ b/tests/grid/grid_out_09.cc @@ -29,11 +29,6 @@ #include "../tests.h" - - -std::ofstream logfile("output"); - - void test() { @@ -77,16 +72,15 @@ test() tria.refine_global(1); GridOut grid_out; - grid_out.write_gnuplot(tria, logfile); + grid_out.write_gnuplot(tria, deallog.get_file_stream()); } int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); test(); } diff --git a/tests/grid/grid_output_input.cc b/tests/grid/grid_output_input.cc index 83693318d0..848512197a 100644 --- a/tests/grid/grid_output_input.cc +++ b/tests/grid/grid_output_input.cc @@ -79,10 +79,9 @@ test(std::ostream &out) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/grid/grid_parallelepiped.cc b/tests/grid/grid_parallelepiped.cc index 6c59377a51..8b54483979 100644 --- a/tests/grid/grid_parallelepiped.cc +++ b/tests/grid/grid_parallelepiped.cc @@ -28,9 +28,6 @@ #include "../tests.h" -// Output -std::ofstream logfile("output"); - // The simplest test case is to create a parallelepiped grid, output // the result, and hope for the best. template @@ -69,7 +66,7 @@ check_parallelepiped(bool colorize, bool log) GridOut grid_out; if (log) - grid_out.write_gnuplot(triangulation, logfile); + grid_out.write_gnuplot(triangulation, deallog.get_file_stream()); else grid_out.write_gnuplot(triangulation, std::cout); @@ -80,6 +77,8 @@ check_parallelepiped(bool colorize, bool log) int main() { + initlog(false, std::ios_base::fmtflags()); + deallog.get_file_stream() << std::setprecision(2); // Check parallelepiped check_parallelepiped<1>(false, true); check_parallelepiped<2>(false, true); diff --git a/tests/grid/grid_parallelepiped.output b/tests/grid/grid_parallelepiped.output index 0d29404628..c67771b9b8 100644 --- a/tests/grid/grid_parallelepiped.output +++ b/tests/grid/grid_parallelepiped.output @@ -1,3 +1,4 @@ + 0 0 0 0.5 0 0 diff --git a/tests/grid/grid_parallelepiped_01.cc b/tests/grid/grid_parallelepiped_01.cc index 5200bf8ab8..b8cd5c5bb8 100644 --- a/tests/grid/grid_parallelepiped_01.cc +++ b/tests/grid/grid_parallelepiped_01.cc @@ -29,9 +29,6 @@ #include "../tests.h" -// Output -std::ofstream logfile("output"); - // As sketched in the deal.II docs, the parallelepiped class is just a // hyper_rectangle in 1d and a parallelogram in 2d. That can checked // by simple comparison to a reference triangulation. @@ -53,6 +50,7 @@ check_1d_parallelepiped_by_comparison(bool log) if (log) { + std::ostream &logfile = deallog.get_file_stream(); logfile << "\ncheck 1d parallelepiped (hyper_cube): "; if (GridTools::have_same_coarse_mesh(triangulation_parallelepiped, triangulation_cube)) @@ -82,6 +80,7 @@ check_2d_parallelepiped_by_comparison(bool log) if (log) { + std::ostream &logfile = deallog.get_file_stream(); logfile << "\ncheck 2d parallelepiped (parallelogram): "; if (GridTools::have_same_coarse_mesh(triangulation_parallelepiped, triangulation_parallelogram)) @@ -96,8 +95,9 @@ check_2d_parallelepiped_by_comparison(bool log) int main() { + initlog(); // Check parallelepiped check_1d_parallelepiped_by_comparison(true); check_2d_parallelepiped_by_comparison(true); - logfile << "\n"; + deallog.get_file_stream() << "\n"; } diff --git a/tests/grid/grid_parallelepiped_01.output b/tests/grid/grid_parallelepiped_01.output index 00d8d10f25..4357ca77d7 100644 --- a/tests/grid/grid_parallelepiped_01.output +++ b/tests/grid/grid_parallelepiped_01.output @@ -1,3 +1,4 @@ + check 1d parallelepiped (hyper_cube): OK check 2d parallelepiped (parallelogram): OK diff --git a/tests/grid/grid_parallelepiped_02.cc b/tests/grid/grid_parallelepiped_02.cc index 6dbb90b760..0ee6e79a5a 100644 --- a/tests/grid/grid_parallelepiped_02.cc +++ b/tests/grid/grid_parallelepiped_02.cc @@ -29,9 +29,6 @@ #include "../tests.h" -// Output -std::ofstream logfile("output"); - // This test creates a parallelepiped (one element) and the same // parallelepiped (one element); because the code that makes the two // one-element grids is not the same, but should result in the same @@ -82,26 +79,26 @@ check_nd_parallelepiped_by_comparison(bool log) if (log) { - logfile << "\ncheck " << dim - << "d parallelepiped (subdivided_parallelepiped): "; + deallog << "check " << dim + << "d parallelepiped (subdivided_parallelepiped):"; if (GridTools::have_same_coarse_mesh( triangulation_parallelepiped, triangulation_subdivided_parallelepiped)) - logfile << "OK"; + deallog << "OK" << std::endl; else - logfile - << "not OK... coarse grids are different but they should be the same"; + deallog + << "not OK... coarse grids are different but they should be the same" + << std::endl; } } int main() { + initlog(); // Check parallelepiped check_nd_parallelepiped_by_comparison<1>(true); check_nd_parallelepiped_by_comparison<2>(true); check_nd_parallelepiped_by_comparison<3>(true); - - logfile << "\n"; } diff --git a/tests/grid/grid_parallelepiped_02.output b/tests/grid/grid_parallelepiped_02.output index b7e4598603..469e54b6d7 100644 --- a/tests/grid/grid_parallelepiped_02.output +++ b/tests/grid/grid_parallelepiped_02.output @@ -1,4 +1,4 @@ -check 1d parallelepiped (subdivided_parallelepiped): OK -check 2d parallelepiped (subdivided_parallelepiped): OK -check 3d parallelepiped (subdivided_parallelepiped): OK +DEAL::check 1d parallelepiped (subdivided_parallelepiped):OK +DEAL::check 2d parallelepiped (subdivided_parallelepiped):OK +DEAL::check 3d parallelepiped (subdivided_parallelepiped):OK diff --git a/tests/grid/grid_parallelepiped_03.cc b/tests/grid/grid_parallelepiped_03.cc index 6ffec8f142..784821a3ae 100644 --- a/tests/grid/grid_parallelepiped_03.cc +++ b/tests/grid/grid_parallelepiped_03.cc @@ -28,9 +28,6 @@ #include "../tests.h" -// Output -std::ofstream logfile("output"); - // The simplest test case is to create a parallelepiped grid with a // number of subdivisions and output the result. template @@ -75,7 +72,7 @@ check_subdivided_parallelepiped(bool colorize, bool log) GridOut grid_out; if (log) - grid_out.write_gnuplot(triangulation, logfile); + grid_out.write_gnuplot(triangulation, deallog.get_file_stream()); else grid_out.write_gnuplot(triangulation, std::cout); @@ -86,6 +83,8 @@ check_subdivided_parallelepiped(bool colorize, bool log) int main() { + initlog(false, std::ios_base::fmtflags()); + // deallog.get_file_stream() << std::setprecision(2); // Check parallelepiped check_subdivided_parallelepiped<1>(false, true); check_subdivided_parallelepiped<2>(false, true); diff --git a/tests/grid/grid_parallelepiped_03.output b/tests/grid/grid_parallelepiped_03.output index 7d23a5f235..541aa3ef57 100644 --- a/tests/grid/grid_parallelepiped_03.output +++ b/tests/grid/grid_parallelepiped_03.output @@ -1,3 +1,4 @@ + 0 0 0 0.166667 0 0 diff --git a/tests/grid/grid_remove_anisotropy.cc b/tests/grid/grid_remove_anisotropy.cc index 506ca55136..3dbbcdf02b 100644 --- a/tests/grid/grid_remove_anisotropy.cc +++ b/tests/grid/grid_remove_anisotropy.cc @@ -29,8 +29,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - void check_remove_anisotropy() { @@ -50,7 +48,7 @@ check_remove_anisotropy() /*max ratio =*/1.2); GridOut grid_out; - grid_out.write_vtk(triangulation, logfile); + grid_out.write_vtk(triangulation, deallog.get_file_stream()); triangulation.clear(); } @@ -58,5 +56,6 @@ check_remove_anisotropy() int main() { + initlog(); check_remove_anisotropy(); } diff --git a/tests/grid/grid_remove_anisotropy.output b/tests/grid/grid_remove_anisotropy.output index 923eec1c9a..15567c75f7 100644 --- a/tests/grid/grid_remove_anisotropy.output +++ b/tests/grid/grid_remove_anisotropy.output @@ -1,5 +1,6 @@ + # vtk DataFile Version 3.0 -#This file was generated +#This file was generated ASCII DATASET UNSTRUCTURED_GRID @@ -84,16 +85,16 @@ CELL_TYPES 8 POINT_DATA 64 SCALARS level double 1 LOOKUP_TABLE default -3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 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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 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 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 0 0 0 0 0 0 0 SCALARS level_subdomain double 1 LOOKUP_TABLE default -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 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 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 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/tests/grid/grid_remove_hanging_nodes.cc b/tests/grid/grid_remove_hanging_nodes.cc index 3ff91faf69..fa44c88a76 100644 --- a/tests/grid/grid_remove_hanging_nodes.cc +++ b/tests/grid/grid_remove_hanging_nodes.cc @@ -23,12 +23,8 @@ #include #include -#include - #include "../tests.h" -std::ofstream logfile("output"); - void check_remove_hanging_nodes() { @@ -52,7 +48,7 @@ check_remove_hanging_nodes() dealii::GridTools::remove_hanging_nodes(tria, /*isotropic=*/false); GridOut grid_out; - grid_out.write_vtk(tria, logfile); + grid_out.write_vtk(tria, deallog.get_file_stream()); tria.clear(); } @@ -60,5 +56,6 @@ check_remove_hanging_nodes() int main() { + initlog(); check_remove_hanging_nodes(); } diff --git a/tests/grid/grid_remove_hanging_nodes.output b/tests/grid/grid_remove_hanging_nodes.output index 704daab87c..ae22cee470 100644 --- a/tests/grid/grid_remove_hanging_nodes.output +++ b/tests/grid/grid_remove_hanging_nodes.output @@ -1,5 +1,6 @@ + # vtk DataFile Version 3.0 -#This file was generated +#This file was generated ASCII DATASET UNSTRUCTURED_GRID @@ -192,16 +193,16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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 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 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 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/tests/grid/grid_test.cc b/tests/grid/grid_test.cc index 298da36b87..6480431430 100644 --- a/tests/grid/grid_test.cc +++ b/tests/grid/grid_test.cc @@ -25,13 +25,10 @@ #include "../tests.h" -std::ofstream logfile("output"); - // 1: continuous refinement of the unit square always in the middle // 2: refinement of the circle at the boundary // 2: refinement of a wiggled area at the boundary - template class Ball : public FlatManifold { @@ -250,7 +247,7 @@ test(const int test_case) GridOut go; go.set_flags(GridOutFlags::Ucd(true)); - go.write_ucd(tria, logfile); + go.write_ucd(tria, deallog.get_file_stream()); deallog << " Total number of cells = " << tria.n_cells() << std::endl @@ -264,9 +261,8 @@ test(const int test_case) int main() { - deallog << std::setprecision(8); - logfile << std::setprecision(8); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream() << std::setprecision(8); for (unsigned int i = 1; i <= 3; ++i) test<2>(i); diff --git a/tests/grid/grid_tools.cc b/tests/grid/grid_tools.cc index 1f0bb6707c..55a0f17611 100644 --- a/tests/grid/grid_tools.cc +++ b/tests/grid/grid_tools.cc @@ -23,10 +23,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - - // check GridTools::diameter template void @@ -68,6 +64,7 @@ test1() void test2() { + std::ostream & logfile = deallog.get_file_stream(); Triangulation<2> tria; GridGenerator::hyper_cube(tria); @@ -88,9 +85,9 @@ test2() int main() { + initlog(); deallog << std::setprecision(4); - logfile << std::setprecision(4); - deallog.attach(logfile); + deallog.get_file_stream() << std::setprecision(4); test1<1>(); test1<2>(); diff --git a/tests/grid/grid_tools_02.cc b/tests/grid/grid_tools_02.cc index 16d1850f94..2dacbe81c8 100644 --- a/tests/grid/grid_tools_02.cc +++ b/tests/grid/grid_tools_02.cc @@ -25,11 +25,6 @@ #include "../tests.h" - -std::ofstream logfile("output"); - - - template void test1() @@ -55,9 +50,8 @@ test1() int main() { + initlog(); deallog << std::setprecision(4); - logfile << std::setprecision(4); - deallog.attach(logfile); test1<1>(); test1<2>(); diff --git a/tests/grid/grid_tools_03.cc b/tests/grid/grid_tools_03.cc index db7cf8691b..cb1aeeb6b2 100644 --- a/tests/grid/grid_tools_03.cc +++ b/tests/grid/grid_tools_03.cc @@ -26,10 +26,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - - template void test1() @@ -74,9 +70,8 @@ test1() int main() { + initlog(); deallog << std::setprecision(4); - logfile << std::setprecision(4); - deallog.attach(logfile); test1<1>(); test1<2>(); diff --git a/tests/grid/grid_tools_04.cc b/tests/grid/grid_tools_04.cc index 65d00e5abf..9e6c7a6201 100644 --- a/tests/grid/grid_tools_04.cc +++ b/tests/grid/grid_tools_04.cc @@ -25,11 +25,6 @@ #include "../tests.h" - -std::ofstream logfile("output"); - - - template void test1() @@ -54,9 +49,8 @@ test1() int main() { + initlog(); deallog << std::setprecision(4); - logfile << std::setprecision(4); - deallog.attach(logfile); test1<1>(); test1<2>(); diff --git a/tests/grid/grid_tools_05.cc b/tests/grid/grid_tools_05.cc index ff31c7b0c0..430332ff10 100644 --- a/tests/grid/grid_tools_05.cc +++ b/tests/grid/grid_tools_05.cc @@ -26,11 +26,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - -using namespace dealii; - - /* * Generate a grid consisting of two disjoint cells, colorize the two * outermost faces. They will be matched via collect_periodic_faces. @@ -183,9 +178,8 @@ print_match(const FaceIterator & face_1, int main() { + initlog(); deallog << std::setprecision(4); - logfile << std::setprecision(4); - deallog.attach(logfile, false); deallog << "Test for 2D: Hypercube" << std::endl << std::endl; diff --git a/tests/grid/grid_tools_05.output b/tests/grid/grid_tools_05.output index 9cc1d11673..0ea1f966ee 100644 --- a/tests/grid/grid_tools_05.output +++ b/tests/grid/grid_tools_05.output @@ -1,3 +1,4 @@ + DEAL::Test for 2D: Hypercube DEAL:: DEAL::face 1 :: -1.000 -3.000 :: 1.000 -3.000 diff --git a/tests/grid/grid_tools_06.cc b/tests/grid/grid_tools_06.cc index 6bc5d226a2..859184bfb8 100644 --- a/tests/grid/grid_tools_06.cc +++ b/tests/grid/grid_tools_06.cc @@ -26,11 +26,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - -using namespace dealii; - - /* * Generate a grid consisting of two disjoint cells, colorize the two * outermost faces. They will be matched via collect_periodic_faces @@ -195,10 +190,8 @@ print_match(const FaceIterator & face_1, int main() { + initlog(); deallog << std::setprecision(4); - logfile << std::setprecision(4); - deallog.attach(logfile, false); - deallog << "Test for 2D: Hypercube" << std::endl << std::endl; for (int i = 0; i < 2; ++i) diff --git a/tests/grid/grid_tools_06.output b/tests/grid/grid_tools_06.output index e9ebc525af..1fde49825d 100644 --- a/tests/grid/grid_tools_06.output +++ b/tests/grid/grid_tools_06.output @@ -1,3 +1,4 @@ + DEAL::Test for 2D: Hypercube DEAL:: DEAL::Triangulation: 0 diff --git a/tests/grid/grid_tools_vertex_to_cell_map_02.cc b/tests/grid/grid_tools_vertex_to_cell_map_02.cc index c306eb5902..e329c037b4 100644 --- a/tests/grid/grid_tools_vertex_to_cell_map_02.cc +++ b/tests/grid/grid_tools_vertex_to_cell_map_02.cc @@ -25,8 +25,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - void test() { @@ -70,9 +68,8 @@ test() int main(int argc, char *argv[]) { + initlog(); deallog << std::setprecision(4); - logfile << std::setprecision(4); - deallog.attach(logfile); test(); diff --git a/tests/grid/have_same_coarse_mesh_01.cc b/tests/grid/have_same_coarse_mesh_01.cc index d18163a9c4..7e6444ba0d 100644 --- a/tests/grid/have_same_coarse_mesh_01.cc +++ b/tests/grid/have_same_coarse_mesh_01.cc @@ -69,8 +69,7 @@ test() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test<1>(); test<2>(); diff --git a/tests/grid/have_same_coarse_mesh_02.cc b/tests/grid/have_same_coarse_mesh_02.cc index 948e37bc97..7c55e00b6f 100644 --- a/tests/grid/have_same_coarse_mesh_02.cc +++ b/tests/grid/have_same_coarse_mesh_02.cc @@ -77,8 +77,7 @@ test() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test<1>(); test<2>(); diff --git a/tests/grid/have_same_coarse_mesh_03.cc b/tests/grid/have_same_coarse_mesh_03.cc index 0117d06fc7..80a621b8de 100644 --- a/tests/grid/have_same_coarse_mesh_03.cc +++ b/tests/grid/have_same_coarse_mesh_03.cc @@ -77,8 +77,7 @@ test() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test<1>(); test<2>(); diff --git a/tests/grid/intergrid_map.cc b/tests/grid/intergrid_map.cc index b65daedaf5..7406b61a1c 100644 --- a/tests/grid/intergrid_map.cc +++ b/tests/grid/intergrid_map.cc @@ -114,11 +114,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); - check<1>(); check<2>(); check<3>(); diff --git a/tests/grid/line_coarsening_3d.cc b/tests/grid/line_coarsening_3d.cc index c9644c28d0..08a869ebaa 100644 --- a/tests/grid/line_coarsening_3d.cc +++ b/tests/grid/line_coarsening_3d.cc @@ -24,9 +24,6 @@ -std::ofstream logfile("output"); - - // create a triangulation of a cylinder, where the line along the axis is common // to all cells, thus n_cells are neighboring at this line. in delete_children, // this is not accounted for (for n_cells>5) and the child lines are deleted, @@ -90,7 +87,7 @@ check() // write grid to file GridOut go; go.set_flags(GridOutFlags::Ucd(true)); - go.write_ucd(tria, logfile); + go.write_ucd(tria, deallog.get_file_stream()); // coarsen the first cell again cell = tria.begin_active(1); for (unsigned int c = 0; c < 8; ++c) @@ -100,14 +97,14 @@ check() } tria.execute_coarsening_and_refinement(); - go.write_ucd(tria, logfile); + go.write_ucd(tria, deallog.get_file_stream()); } int main() { - deallog.attach(logfile); + initlog(); check(); return 0; } diff --git a/tests/grid/maximal_cell_diameter.cc b/tests/grid/maximal_cell_diameter.cc index 30a884b7cd..105a3f92be 100644 --- a/tests/grid/maximal_cell_diameter.cc +++ b/tests/grid/maximal_cell_diameter.cc @@ -22,12 +22,6 @@ #include "../tests.h" - - -std::ofstream logfile("output"); - - - template void test1() @@ -74,8 +68,8 @@ test1() int main() { + initlog(); deallog << std::setprecision(4); - deallog.attach(logfile); test1<1>(); test1<2>(); diff --git a/tests/grid/measure_et_al.cc b/tests/grid/measure_et_al.cc index 33e3c5d4dc..48f4fa4717 100644 --- a/tests/grid/measure_et_al.cc +++ b/tests/grid/measure_et_al.cc @@ -105,9 +105,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(PRECISION); - deallog.attach(logfile); test<2>(); test<3>(); diff --git a/tests/grid/measure_et_al_02.cc b/tests/grid/measure_et_al_02.cc index 14c5253f1e..8d8a85a2cf 100644 --- a/tests/grid/measure_et_al_02.cc +++ b/tests/grid/measure_et_al_02.cc @@ -118,9 +118,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(PRECISION); - deallog.attach(logfile); test<2>(); test<3>(); diff --git a/tests/grid/measure_of_3d_face_01.cc b/tests/grid/measure_of_3d_face_01.cc index 54b7dafa18..baf94425cf 100644 --- a/tests/grid/measure_of_3d_face_01.cc +++ b/tests/grid/measure_of_3d_face_01.cc @@ -102,9 +102,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(5); - deallog.attach(logfile); // run the tests but continue when finding an exception: we will try // out a distorted cell for which TriaAccessor::measure() will error diff --git a/tests/grid/merge_triangulations_01.cc b/tests/grid/merge_triangulations_01.cc index fec0733ec4..bf64e43797 100644 --- a/tests/grid/merge_triangulations_01.cc +++ b/tests/grid/merge_triangulations_01.cc @@ -25,10 +25,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - - // testcase=0: // create two cubes; translate them so that no vertices overlap // @@ -71,7 +67,7 @@ test(const int testcase) // now merge triangulations GridGenerator::merge_triangulations(tria_1, tria_2, tria_3); - GridOut().write_gnuplot(tria_3, logfile); + GridOut().write_gnuplot(tria_3, deallog.get_file_stream()); deallog << " Total number of cells = " << tria_3.n_cells() << std::endl @@ -83,9 +79,8 @@ test(const int testcase) int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); for (unsigned int t = 0; t < 3; ++t) { diff --git a/tests/grid/merge_triangulations_02.cc b/tests/grid/merge_triangulations_02.cc index b8c8ccf585..5acf6f075c 100644 --- a/tests/grid/merge_triangulations_02.cc +++ b/tests/grid/merge_triangulations_02.cc @@ -29,8 +29,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - template void mesh_info(const Triangulation &tria) @@ -99,9 +97,8 @@ make_grid() int main() { - deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream() << std::setprecision(2); make_grid(); } diff --git a/tests/grid/merge_triangulations_03.cc b/tests/grid/merge_triangulations_03.cc index a7f639617b..80857d9911 100644 --- a/tests/grid/merge_triangulations_03.cc +++ b/tests/grid/merge_triangulations_03.cc @@ -35,9 +35,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void flatten_triangulation(Triangulation &tria_in, Triangulation &tria_out) @@ -163,9 +160,8 @@ test() int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); test(); diff --git a/tests/grid/mesh_3d_22.cc b/tests/grid/mesh_3d_22.cc index 62480dfc1a..3e181b016f 100644 --- a/tests/grid/mesh_3d_22.cc +++ b/tests/grid/mesh_3d_22.cc @@ -119,8 +119,7 @@ test(Triangulation &triangulation) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); Triangulation<3> triangulation; GridIn<3> grid_in; diff --git a/tests/grid/mesh_3d_23.cc b/tests/grid/mesh_3d_23.cc index edd08c5035..32d6b689dc 100644 --- a/tests/grid/mesh_3d_23.cc +++ b/tests/grid/mesh_3d_23.cc @@ -51,8 +51,7 @@ int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); Triangulation<3> triangulation; GridIn<3> grid_in; diff --git a/tests/grid/mesh_3d_24.cc b/tests/grid/mesh_3d_24.cc index e2b80b5880..e444bbfff0 100644 --- a/tests/grid/mesh_3d_24.cc +++ b/tests/grid/mesh_3d_24.cc @@ -53,8 +53,7 @@ int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); Triangulation<3> triangulation; GridIn<3> grid_in; diff --git a/tests/grid/mesh_3d_25.cc b/tests/grid/mesh_3d_25.cc index 07e50bb80e..c3d2b16b53 100644 --- a/tests/grid/mesh_3d_25.cc +++ b/tests/grid/mesh_3d_25.cc @@ -115,9 +115,7 @@ test(Triangulation &triangulation) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); - + initlog(); Triangulation<3> triangulation; create_two_cubes_rotation(triangulation, 1); diff --git a/tests/grid/mesh_3d_26.cc b/tests/grid/mesh_3d_26.cc index 649da576ff..d3fdfb9b39 100644 --- a/tests/grid/mesh_3d_26.cc +++ b/tests/grid/mesh_3d_26.cc @@ -117,9 +117,7 @@ test(Triangulation &triangulation) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); - + initlog(); Triangulation<3> triangulation; GridGenerator::hyper_ball(triangulation); triangulation.reset_manifold(0); diff --git a/tests/grid/minimal_cell_diameter.cc b/tests/grid/minimal_cell_diameter.cc index d5608d7335..57654caf24 100644 --- a/tests/grid/minimal_cell_diameter.cc +++ b/tests/grid/minimal_cell_diameter.cc @@ -22,12 +22,6 @@ #include "../tests.h" - - -std::ofstream logfile("output"); - - - template void test1() @@ -69,8 +63,8 @@ test1() int main() { + initlog(); deallog << std::setprecision(4); - deallog.attach(logfile); test1<1>(); test1<2>(); diff --git a/tests/grid/normal_vector_01.cc b/tests/grid/normal_vector_01.cc index b3118201c8..977b84b5f0 100644 --- a/tests/grid/normal_vector_01.cc +++ b/tests/grid/normal_vector_01.cc @@ -59,10 +59,9 @@ create_triangulation(const unsigned int case_no, Triangulation<3> &tria) int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); deallog << std::fixed; - deallog.attach(logfile); Triangulation<3> tria; FlatManifold<3> boundary; diff --git a/tests/grid/normal_vector_01_2d.cc b/tests/grid/normal_vector_01_2d.cc index 809a4993e0..79ec860520 100644 --- a/tests/grid/normal_vector_01_2d.cc +++ b/tests/grid/normal_vector_01_2d.cc @@ -59,10 +59,9 @@ create_triangulation(const unsigned int case_no, Triangulation<2> &tria) int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); deallog << std::fixed; - deallog.attach(logfile); Triangulation<2> tria; FlatManifold<2> boundary; diff --git a/tests/grid/normal_vector_02.cc b/tests/grid/normal_vector_02.cc index 2366cb87c4..5978613f90 100644 --- a/tests/grid/normal_vector_02.cc +++ b/tests/grid/normal_vector_02.cc @@ -30,10 +30,9 @@ int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); deallog << std::fixed; - deallog.attach(logfile); SphericalManifold<3> boundary(Point<3>(1, 0, 0)); diff --git a/tests/grid/normal_vector_02_2d.cc b/tests/grid/normal_vector_02_2d.cc index fa8322767e..d782e9add3 100644 --- a/tests/grid/normal_vector_02_2d.cc +++ b/tests/grid/normal_vector_02_2d.cc @@ -30,10 +30,9 @@ int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); deallog << std::fixed; - deallog.attach(logfile); SphericalManifold<2> boundary(Point<2>(1, 0)); diff --git a/tests/grid/normal_vector_03.cc b/tests/grid/normal_vector_03.cc index f4f46a1726..67556849fd 100644 --- a/tests/grid/normal_vector_03.cc +++ b/tests/grid/normal_vector_03.cc @@ -61,10 +61,9 @@ create_triangulation(const unsigned int case_no, Triangulation<3> &tria) int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); deallog << std::fixed; - deallog.attach(logfile); FE_Q<2> linear_interpolator(1); diff --git a/tests/grid/normal_vector_03_2d.cc b/tests/grid/normal_vector_03_2d.cc index 8ede3dc75e..9fa12eccb6 100644 --- a/tests/grid/normal_vector_03_2d.cc +++ b/tests/grid/normal_vector_03_2d.cc @@ -61,10 +61,9 @@ create_triangulation(const unsigned int case_no, Triangulation<2> &tria) int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); deallog << std::fixed; - deallog.attach(logfile); FE_Q<1> linear_interpolator(1); diff --git a/tests/grid/normals_at_vertices_01.cc b/tests/grid/normals_at_vertices_01.cc index a3dc8308fd..1bc99f5b08 100644 --- a/tests/grid/normals_at_vertices_01.cc +++ b/tests/grid/normals_at_vertices_01.cc @@ -58,10 +58,9 @@ create_triangulation(const unsigned int case_no, Triangulation<3> &tria) int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); deallog << std::fixed; - deallog.attach(logfile); Triangulation<3> tria; FlatManifold<3> boundary; diff --git a/tests/grid/normals_at_vertices_02.cc b/tests/grid/normals_at_vertices_02.cc index 98129cc09f..fd05cd03cd 100644 --- a/tests/grid/normals_at_vertices_02.cc +++ b/tests/grid/normals_at_vertices_02.cc @@ -30,10 +30,9 @@ int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); deallog << std::fixed; - deallog.attach(logfile); SphericalManifold<3> boundary(Point<3>(1, 0, 0)); diff --git a/tests/grid/number_cache_01.cc b/tests/grid/number_cache_01.cc index 9c7aca9b0e..f23717342a 100644 --- a/tests/grid/number_cache_01.cc +++ b/tests/grid/number_cache_01.cc @@ -32,10 +32,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - - template void output(const Triangulation &tria) @@ -97,8 +93,8 @@ test() int main() { + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); test<1>(); test<2>(); diff --git a/tests/grid/number_cache_02.cc b/tests/grid/number_cache_02.cc index 24dec98282..8fce78e76a 100644 --- a/tests/grid/number_cache_02.cc +++ b/tests/grid/number_cache_02.cc @@ -32,10 +32,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - - template void output(const Triangulation &tria) @@ -118,8 +114,8 @@ test(const char *filename) int main() { + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); test<2>(SOURCE_DIR "/grid_in/2d.xda"); diff --git a/tests/grid/number_cache_03.cc b/tests/grid/number_cache_03.cc index b00dd412cb..fe5a2ee213 100644 --- a/tests/grid/number_cache_03.cc +++ b/tests/grid/number_cache_03.cc @@ -37,10 +37,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - - template void output(const Triangulation &tria) @@ -106,8 +102,8 @@ test() int main() { + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); test<1>(); test<2>(); diff --git a/tests/grid/recursively_set_material_id.cc b/tests/grid/recursively_set_material_id.cc index ddaa2b8fe4..6147fc1db1 100644 --- a/tests/grid/recursively_set_material_id.cc +++ b/tests/grid/recursively_set_material_id.cc @@ -96,11 +96,9 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); - test<1>(); test<2>(); test<3>(); diff --git a/tests/grid/refinement_listener_02.cc b/tests/grid/refinement_listener_02.cc index 1addbef46b..ae73bcba13 100644 --- a/tests/grid/refinement_listener_02.cc +++ b/tests/grid/refinement_listener_02.cc @@ -25,10 +25,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - - template void pre_refinement_notification(const std::string & prefix, @@ -128,9 +124,8 @@ test() int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); test<1>(); test<2>(); diff --git a/tests/grid/refinement_listener_03.cc b/tests/grid/refinement_listener_03.cc index c79fa3994d..80fbfa5e45 100644 --- a/tests/grid/refinement_listener_03.cc +++ b/tests/grid/refinement_listener_03.cc @@ -23,11 +23,6 @@ #include "../tests.h" - -std::ofstream logfile("output"); - - - template void pre_refinement_notification(const std::string & prefix, @@ -150,9 +145,8 @@ test() int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); test<1>(); test<2>(); diff --git a/tests/grid/subdomain_ids.cc b/tests/grid/subdomain_ids.cc index b9f8cc7cde..b85ca63c8c 100644 --- a/tests/grid/subdomain_ids.cc +++ b/tests/grid/subdomain_ids.cc @@ -33,9 +33,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - DeclException2(ExcNumberMismatch, int, int, @@ -178,8 +175,8 @@ test() int main() { + initlog(); deallog << std::setprecision(4); - deallog.attach(logfile); test<1>(); test<2>(); diff --git a/tests/grid/subdomain_on_refinement.cc b/tests/grid/subdomain_on_refinement.cc index 845be6573e..ba9f886964 100644 --- a/tests/grid/subdomain_on_refinement.cc +++ b/tests/grid/subdomain_on_refinement.cc @@ -33,9 +33,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - DeclException2(ExcNumberMismatch, int, int, @@ -62,8 +59,8 @@ test() int main() { + initlog(); deallog << std::setprecision(4); - deallog.attach(logfile); test<1>(); test<2>(); diff --git a/tests/grid/tria_iterator_with_one_header.cc b/tests/grid/tria_iterator_with_one_header.cc index 6cf5a15f78..d008b5d42c 100644 --- a/tests/grid/tria_iterator_with_one_header.cc +++ b/tests/grid/tria_iterator_with_one_header.cc @@ -27,9 +27,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void test() @@ -43,9 +40,8 @@ test() int main() { + initlog(); deallog << std::setprecision(4); - logfile << std::setprecision(4); - deallog.attach(logfile); test<1>(); test<2>(); diff --git a/tests/grid/tria_last.cc b/tests/grid/tria_last.cc index 57641e64f2..ac1e143df0 100644 --- a/tests/grid/tria_last.cc +++ b/tests/grid/tria_last.cc @@ -27,11 +27,6 @@ #include "../tests.h" - -std::ofstream logfile("output"); - - - template void test() @@ -57,9 +52,8 @@ test() int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); test<1>(); test<2>(); diff --git a/tests/grid/twisted_parallelepiped_02.cc b/tests/grid/twisted_parallelepiped_02.cc index 37af4d3cf3..b23c046fc8 100644 --- a/tests/grid/twisted_parallelepiped_02.cc +++ b/tests/grid/twisted_parallelepiped_02.cc @@ -34,7 +34,7 @@ template void -check_parallelepiped(std::ofstream &logfile) +check_parallelepiped() { // Data structure defining dim coordinates that make up a // parallelepiped. @@ -73,7 +73,7 @@ check_parallelepiped(std::ofstream &logfile) } catch (ExceptionBase &exc) { - logfile << exc.get_exc_name() << std::endl; + deallog.get_file_stream() << exc.get_exc_name() << std::endl; } } @@ -81,10 +81,10 @@ int main() { deal_II_exceptions::disable_abort_on_exception(); - std::ofstream logfile("output"); + initlog(); - check_parallelepiped<1>(logfile); - check_parallelepiped<2>(logfile); - check_parallelepiped<3>(logfile); - logfile << "OK" << std::endl; + check_parallelepiped<1>(); + check_parallelepiped<2>(); + check_parallelepiped<3>(); + deallog.get_file_stream() << "OK" << std::endl; } diff --git a/tests/grid/twisted_parallelepiped_02.release.output b/tests/grid/twisted_parallelepiped_02.release.output index b4453d8f8f..0d659f65f9 100644 --- a/tests/grid/twisted_parallelepiped_02.release.output +++ b/tests/grid/twisted_parallelepiped_02.release.output @@ -1,3 +1,4 @@ + ExcGridHasInvalidCell(cell_no) ExcGridHasInvalidCell(cell_no) ExcGridHasInvalidCell(cell_no) diff --git a/tests/grid/union_triangulation.cc b/tests/grid/union_triangulation.cc index 711a77f120..1b994ff710 100644 --- a/tests/grid/union_triangulation.cc +++ b/tests/grid/union_triangulation.cc @@ -24,11 +24,6 @@ #include "../tests.h" - -std::ofstream logfile("output"); - - - template void test() @@ -57,7 +52,7 @@ test() GridGenerator::create_union_triangulation(tria_1, tria_2, tria_3); - GridOut().write_gnuplot(tria_3, logfile); + GridOut().write_gnuplot(tria_3, deallog.get_file_stream()); deallog << " Total number of cells = " << tria_3.n_cells() << std::endl @@ -69,9 +64,8 @@ test() int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); test<1>(); test<2>(); -- 2.39.5