From 7e6b7df11948728f341cb7b30246fd4c3dfe61c7 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 18 Aug 2018 12:37:30 -0400 Subject: [PATCH] Ensure initlog() is used in tests/manifold and tests/mappings. --- tests/manifold/polar_manifold_01.cc | 2 -- tests/manifold/polar_manifold_06.cc | 6 +---- tests/manifold/spherical_manifold_02.cc | 16 ++++++-------- .../fe_face_values_1d_mapping_cartesian.cc | 3 +-- .../mappings/fe_face_values_1d_mapping_q2.cc | 3 +-- tests/mappings/mapping.cc | 3 +-- tests/mappings/mapping_c1.cc | 3 +-- .../mapping_fe_field_real_to_unit_b1.cc | 5 +---- ...mapping_fe_field_real_to_unit_b2_curved.cc | 4 +--- .../mapping_fe_field_real_to_unit_b2_mask.cc | 4 +--- ...mapping_fe_field_real_to_unit_b3_curved.cc | 5 +---- ...mapping_fe_field_real_to_unit_b4_curved.cc | 5 +---- ...mapping_fe_field_real_to_unit_b5_curved.cc | 5 +---- .../mapping_fe_field_real_to_unit_q1.cc | 5 +---- ...mapping_fe_field_real_to_unit_q2_curved.cc | 4 +--- .../mapping_fe_field_real_to_unit_q2_mask.cc | 5 +---- ...mapping_fe_field_real_to_unit_q3_curved.cc | 3 +-- ...mapping_fe_field_real_to_unit_q4_curved.cc | 5 +---- ...mapping_fe_field_real_to_unit_q5_curved.cc | 5 +---- tests/mappings/mapping_manifold_03.cc | 5 +---- tests/mappings/mapping_manifold_step-3.cc | 9 ++------ tests/mappings/mapping_q1_eulerian.cc | 7 +----- tests/mappings/mapping_q1_eulerian_01.cc | 4 +--- tests/mappings/mapping_q_eulerian.cc | 5 +---- tests/mappings/mapping_q_eulerian_01.cc | 4 +--- tests/mappings/mapping_q_eulerian_02.cc | 5 ++--- tests/mappings/mapping_q_eulerian_03.cc | 4 +--- tests/mappings/mapping_q_eulerian_04.cc | 8 ++----- tests/mappings/mapping_q_eulerian_05.cc | 7 ++---- tests/mappings/mapping_q_eulerian_06.cc | 5 +---- tests/mappings/mapping_q_manifold_01.cc | 22 ++++++++++--------- .../mappings/mapping_q_mixed_manifolds_01.cc | 3 +-- .../mappings/mapping_q_mixed_manifolds_02.cc | 3 +-- tests/mappings/mapping_real_to_unit_02.cc | 5 +---- tests/mappings/mapping_real_to_unit_q1.cc | 6 +---- .../mapping_real_to_unit_q1_singular.cc | 5 +---- .../mapping_real_to_unit_q4_curved.cc | 6 +---- .../mapping_real_to_unit_q4_curved_codim.cc | 6 +---- .../mapping_real_to_unit_q4_sphere_x.cc | 3 +-- .../mapping_real_to_unit_q4_sphere_y.cc | 5 +---- .../mapping_real_to_unit_q4_sphere_z.cc | 5 +---- .../mapping_real_to_unit_q4_straight.cc | 6 +---- 42 files changed, 62 insertions(+), 167 deletions(-) diff --git a/tests/manifold/polar_manifold_01.cc b/tests/manifold/polar_manifold_01.cc index 93b8755064..ae48c39809 100644 --- a/tests/manifold/polar_manifold_01.cc +++ b/tests/manifold/polar_manifold_01.cc @@ -66,6 +66,4 @@ main() test<2, 2>(); test<3, 3>(); - - return 0; } diff --git a/tests/manifold/polar_manifold_06.cc b/tests/manifold/polar_manifold_06.cc index 9bb904467f..c8da88f7f4 100644 --- a/tests/manifold/polar_manifold_06.cc +++ b/tests/manifold/polar_manifold_06.cc @@ -54,13 +54,9 @@ test() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test<2, 2>(); test<2, 3>(); - test<3, 3>(); - - return 0; } diff --git a/tests/manifold/spherical_manifold_02.cc b/tests/manifold/spherical_manifold_02.cc index c3c8b9bdc5..e784b66d38 100644 --- a/tests/manifold/spherical_manifold_02.cc +++ b/tests/manifold/spherical_manifold_02.cc @@ -98,13 +98,13 @@ test(MappingEnum::type mapping_name, unsigned int refinements = 1) triangulation.refine_global(refinements); dof_handler.distribute_dofs(fe); - { - // Save mesh to file for visualization - GridOut grid_out; - std::ofstream grid_file("grid.vtk"); - grid_out.write_vtk(triangulation, grid_file); - // deallog << "Grid has been saved into grid.vtk" << std::endl; - } + if (false) // reenable for visualization + { + GridOut grid_out; + std::ofstream grid_file("grid.vtk"); + grid_out.write_vtk(triangulation, grid_file); + // deallog << "Grid has been saved into grid.vtk" << std::endl; + } // deallog << "Surface mesh has " << triangulation.n_active_cells() // << " cells." @@ -174,6 +174,4 @@ main() for (unsigned int i = 1; i < 8; ++i) test(MappingEnum::MappingQ, i); deallog << bar << std::endl; - - return 0; } diff --git a/tests/mappings/fe_face_values_1d_mapping_cartesian.cc b/tests/mappings/fe_face_values_1d_mapping_cartesian.cc index fa594f2d55..e826a3aba4 100644 --- a/tests/mappings/fe_face_values_1d_mapping_cartesian.cc +++ b/tests/mappings/fe_face_values_1d_mapping_cartesian.cc @@ -176,9 +176,8 @@ mapping_test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(PRECISION); - deallog.attach(logfile); // ----------------------- // Tests for dim=1 diff --git a/tests/mappings/fe_face_values_1d_mapping_q2.cc b/tests/mappings/fe_face_values_1d_mapping_q2.cc index 702e37b398..df59400f2f 100644 --- a/tests/mappings/fe_face_values_1d_mapping_q2.cc +++ b/tests/mappings/fe_face_values_1d_mapping_q2.cc @@ -176,9 +176,8 @@ mapping_test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(PRECISION); - deallog.attach(logfile); // ----------------------- // Tests for dim=1 diff --git a/tests/mappings/mapping.cc b/tests/mappings/mapping.cc index ea505c0355..48279d61aa 100644 --- a/tests/mappings/mapping.cc +++ b/tests/mappings/mapping.cc @@ -556,9 +556,8 @@ mapping_test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(PRECISION); - deallog.attach(logfile); // ----------------------- // Tests for dim=1 diff --git a/tests/mappings/mapping_c1.cc b/tests/mappings/mapping_c1.cc index 5fdd80812f..5e17940f03 100644 --- a/tests/mappings/mapping_c1.cc +++ b/tests/mappings/mapping_c1.cc @@ -35,10 +35,9 @@ int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::fixed; deallog << std::setprecision(PRECISION) << std::fixed; - deallog.attach(logfile); // create grid of circle, somehow // arbitrarily from only one cell, diff --git a/tests/mappings/mapping_fe_field_real_to_unit_b1.cc b/tests/mappings/mapping_fe_field_real_to_unit_b1.cc index 490a21f3c0..f327402869 100644 --- a/tests/mappings/mapping_fe_field_real_to_unit_b1.cc +++ b/tests/mappings/mapping_fe_field_real_to_unit_b1.cc @@ -135,8 +135,7 @@ test_real_to_unit_cell() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test_real_to_unit_cell<1, 1>(); test_real_to_unit_cell<2, 2>(); @@ -145,6 +144,4 @@ main() test_real_to_unit_cell<1, 2>(); test_real_to_unit_cell<1, 3>(); test_real_to_unit_cell<2, 3>(); - - return 0; } diff --git a/tests/mappings/mapping_fe_field_real_to_unit_b2_curved.cc b/tests/mappings/mapping_fe_field_real_to_unit_b2_curved.cc index bc570a3b21..5c6e794fe2 100644 --- a/tests/mappings/mapping_fe_field_real_to_unit_b2_curved.cc +++ b/tests/mappings/mapping_fe_field_real_to_unit_b2_curved.cc @@ -136,8 +136,7 @@ test_real_to_unit_cell() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test_real_to_unit_cell<1, 1>(); test_real_to_unit_cell<2, 2>(); @@ -147,5 +146,4 @@ main() test_real_to_unit_cell<2, 3>(); // test_real_to_unit_cell<1,3>(); - return 0; } diff --git a/tests/mappings/mapping_fe_field_real_to_unit_b2_mask.cc b/tests/mappings/mapping_fe_field_real_to_unit_b2_mask.cc index 2abd8f3876..96b8d98fbb 100644 --- a/tests/mappings/mapping_fe_field_real_to_unit_b2_mask.cc +++ b/tests/mappings/mapping_fe_field_real_to_unit_b2_mask.cc @@ -138,8 +138,7 @@ test_real_to_unit_cell() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test_real_to_unit_cell<1, 1>(); test_real_to_unit_cell<2, 2>(); @@ -149,5 +148,4 @@ main() test_real_to_unit_cell<2, 3>(); // test_real_to_unit_cell<1,3>(); - return 0; } diff --git a/tests/mappings/mapping_fe_field_real_to_unit_b3_curved.cc b/tests/mappings/mapping_fe_field_real_to_unit_b3_curved.cc index 2c2dfda64a..0531148f3d 100644 --- a/tests/mappings/mapping_fe_field_real_to_unit_b3_curved.cc +++ b/tests/mappings/mapping_fe_field_real_to_unit_b3_curved.cc @@ -136,8 +136,7 @@ test_real_to_unit_cell() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test_real_to_unit_cell<1, 1>(); test_real_to_unit_cell<2, 2>(); @@ -146,7 +145,5 @@ main() test_real_to_unit_cell<1, 2>(); test_real_to_unit_cell<2, 3>(); - // test_real_to_unit_cell<1,3>(); - return 0; } diff --git a/tests/mappings/mapping_fe_field_real_to_unit_b4_curved.cc b/tests/mappings/mapping_fe_field_real_to_unit_b4_curved.cc index fe6d80d726..c7f80618df 100644 --- a/tests/mappings/mapping_fe_field_real_to_unit_b4_curved.cc +++ b/tests/mappings/mapping_fe_field_real_to_unit_b4_curved.cc @@ -135,8 +135,7 @@ test_real_to_unit_cell() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test_real_to_unit_cell<1, 1>(); test_real_to_unit_cell<2, 2>(); @@ -145,7 +144,5 @@ main() test_real_to_unit_cell<1, 2>(); test_real_to_unit_cell<2, 3>(); - // test_real_to_unit_cell<1,3>(); - return 0; } diff --git a/tests/mappings/mapping_fe_field_real_to_unit_b5_curved.cc b/tests/mappings/mapping_fe_field_real_to_unit_b5_curved.cc index 0181092355..9f086cc15b 100644 --- a/tests/mappings/mapping_fe_field_real_to_unit_b5_curved.cc +++ b/tests/mappings/mapping_fe_field_real_to_unit_b5_curved.cc @@ -135,8 +135,7 @@ test_real_to_unit_cell() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test_real_to_unit_cell<1, 1>(); test_real_to_unit_cell<2, 2>(); @@ -145,7 +144,5 @@ main() test_real_to_unit_cell<1, 2>(); test_real_to_unit_cell<2, 3>(); - // test_real_to_unit_cell<1,3>(); - return 0; } diff --git a/tests/mappings/mapping_fe_field_real_to_unit_q1.cc b/tests/mappings/mapping_fe_field_real_to_unit_q1.cc index b485e66aab..ac784f8dc0 100644 --- a/tests/mappings/mapping_fe_field_real_to_unit_q1.cc +++ b/tests/mappings/mapping_fe_field_real_to_unit_q1.cc @@ -133,8 +133,7 @@ test_real_to_unit_cell() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test_real_to_unit_cell<1, 1>(); test_real_to_unit_cell<2, 2>(); @@ -143,6 +142,4 @@ main() test_real_to_unit_cell<1, 2>(); test_real_to_unit_cell<1, 3>(); test_real_to_unit_cell<2, 3>(); - - return 0; } diff --git a/tests/mappings/mapping_fe_field_real_to_unit_q2_curved.cc b/tests/mappings/mapping_fe_field_real_to_unit_q2_curved.cc index c037bf752f..4d96dab647 100644 --- a/tests/mappings/mapping_fe_field_real_to_unit_q2_curved.cc +++ b/tests/mappings/mapping_fe_field_real_to_unit_q2_curved.cc @@ -135,8 +135,7 @@ test_real_to_unit_cell() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test_real_to_unit_cell<1, 1>(); test_real_to_unit_cell<2, 2>(); @@ -146,5 +145,4 @@ main() test_real_to_unit_cell<2, 3>(); // test_real_to_unit_cell<1,3>(); - return 0; } diff --git a/tests/mappings/mapping_fe_field_real_to_unit_q2_mask.cc b/tests/mappings/mapping_fe_field_real_to_unit_q2_mask.cc index 427ecf04cf..1dbabdb561 100644 --- a/tests/mappings/mapping_fe_field_real_to_unit_q2_mask.cc +++ b/tests/mappings/mapping_fe_field_real_to_unit_q2_mask.cc @@ -139,8 +139,7 @@ test_real_to_unit_cell() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test_real_to_unit_cell<1, 1>(); test_real_to_unit_cell<2, 2>(); @@ -149,6 +148,4 @@ main() test_real_to_unit_cell<1, 2>(); test_real_to_unit_cell<1, 3>(); test_real_to_unit_cell<2, 3>(); - - return 0; } diff --git a/tests/mappings/mapping_fe_field_real_to_unit_q3_curved.cc b/tests/mappings/mapping_fe_field_real_to_unit_q3_curved.cc index 890a08cb69..2f0a60d37c 100644 --- a/tests/mappings/mapping_fe_field_real_to_unit_q3_curved.cc +++ b/tests/mappings/mapping_fe_field_real_to_unit_q3_curved.cc @@ -135,8 +135,7 @@ test_real_to_unit_cell() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test_real_to_unit_cell<1, 1>(); test_real_to_unit_cell<2, 2>(); diff --git a/tests/mappings/mapping_fe_field_real_to_unit_q4_curved.cc b/tests/mappings/mapping_fe_field_real_to_unit_q4_curved.cc index 7356bb6b3d..9190c53cd0 100644 --- a/tests/mappings/mapping_fe_field_real_to_unit_q4_curved.cc +++ b/tests/mappings/mapping_fe_field_real_to_unit_q4_curved.cc @@ -134,8 +134,7 @@ test_real_to_unit_cell() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test_real_to_unit_cell<1, 1>(); test_real_to_unit_cell<2, 2>(); @@ -144,7 +143,5 @@ main() test_real_to_unit_cell<1, 2>(); test_real_to_unit_cell<2, 3>(); - // test_real_to_unit_cell<1,3>(); - return 0; } diff --git a/tests/mappings/mapping_fe_field_real_to_unit_q5_curved.cc b/tests/mappings/mapping_fe_field_real_to_unit_q5_curved.cc index c5d330b0b1..7d300e3ec5 100644 --- a/tests/mappings/mapping_fe_field_real_to_unit_q5_curved.cc +++ b/tests/mappings/mapping_fe_field_real_to_unit_q5_curved.cc @@ -135,8 +135,7 @@ test_real_to_unit_cell() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test_real_to_unit_cell<1, 1>(); test_real_to_unit_cell<2, 2>(); @@ -145,7 +144,5 @@ main() test_real_to_unit_cell<1, 2>(); test_real_to_unit_cell<2, 3>(); - // test_real_to_unit_cell<1,3>(); - return 0; } diff --git a/tests/mappings/mapping_manifold_03.cc b/tests/mappings/mapping_manifold_03.cc index 23a32ae785..696605097b 100644 --- a/tests/mappings/mapping_manifold_03.cc +++ b/tests/mappings/mapping_manifold_03.cc @@ -99,8 +99,7 @@ test() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test<1, 1>(); test<1, 2>(); @@ -110,6 +109,4 @@ main() test<2, 3>(); test<3, 3>(); - - return 0; } diff --git a/tests/mappings/mapping_manifold_step-3.cc b/tests/mappings/mapping_manifold_step-3.cc index b870c06e64..4e3293df26 100644 --- a/tests/mappings/mapping_manifold_step-3.cc +++ b/tests/mappings/mapping_manifold_step-3.cc @@ -47,10 +47,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - - class LaplaceProblem { public: @@ -221,10 +217,9 @@ LaplaceProblem::run() int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - - deallog.attach(logfile); + deallog.get_file_stream() << std::setprecision(2); LaplaceProblem laplace_problem; laplace_problem.run(); diff --git a/tests/mappings/mapping_q1_eulerian.cc b/tests/mappings/mapping_q1_eulerian.cc index 94ac443be0..ae8012966d 100644 --- a/tests/mappings/mapping_q1_eulerian.cc +++ b/tests/mappings/mapping_q1_eulerian.cc @@ -105,12 +105,9 @@ show_values() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); - - deallog.push("1d"); show_values<1>(); @@ -123,6 +120,4 @@ main() deallog.push("3d"); show_values<3>(); deallog.pop(); - - return 0; } diff --git a/tests/mappings/mapping_q1_eulerian_01.cc b/tests/mappings/mapping_q1_eulerian_01.cc index b73594138b..ffe46648fa 100644 --- a/tests/mappings/mapping_q1_eulerian_01.cc +++ b/tests/mappings/mapping_q1_eulerian_01.cc @@ -117,10 +117,8 @@ test() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); deallog << std::setprecision(4); - logfile << std::setprecision(4); test<1>(); test<2>(); diff --git a/tests/mappings/mapping_q_eulerian.cc b/tests/mappings/mapping_q_eulerian.cc index 851889f422..aa82f0bbf2 100644 --- a/tests/mappings/mapping_q_eulerian.cc +++ b/tests/mappings/mapping_q_eulerian.cc @@ -46,8 +46,6 @@ #include #include -#include - #include "../tests.h" @@ -260,10 +258,9 @@ MappingTest::graphical_output() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); // convergence studies diff --git a/tests/mappings/mapping_q_eulerian_01.cc b/tests/mappings/mapping_q_eulerian_01.cc index 4cd6a799f8..32e210863f 100644 --- a/tests/mappings/mapping_q_eulerian_01.cc +++ b/tests/mappings/mapping_q_eulerian_01.cc @@ -115,10 +115,8 @@ test() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); deallog << std::setprecision(4); - logfile << std::setprecision(4); test<1>(); test<2>(); diff --git a/tests/mappings/mapping_q_eulerian_02.cc b/tests/mappings/mapping_q_eulerian_02.cc index 6879b4c065..118688c0cd 100644 --- a/tests/mappings/mapping_q_eulerian_02.cc +++ b/tests/mappings/mapping_q_eulerian_02.cc @@ -117,10 +117,9 @@ test() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); deallog << std::setprecision(4); - logfile << std::setprecision(4); + deallog.get_file_stream() << std::setprecision(4); test<1>(); test<2>(); diff --git a/tests/mappings/mapping_q_eulerian_03.cc b/tests/mappings/mapping_q_eulerian_03.cc index b0ba465366..104a0f901c 100644 --- a/tests/mappings/mapping_q_eulerian_03.cc +++ b/tests/mappings/mapping_q_eulerian_03.cc @@ -118,10 +118,8 @@ test() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); deallog << std::setprecision(4); - logfile << std::setprecision(4); test<1>(); test<2>(); diff --git a/tests/mappings/mapping_q_eulerian_04.cc b/tests/mappings/mapping_q_eulerian_04.cc index 2e0d6c7562..baf028348e 100644 --- a/tests/mappings/mapping_q_eulerian_04.cc +++ b/tests/mappings/mapping_q_eulerian_04.cc @@ -40,8 +40,6 @@ #include -std::ofstream logfile("output"); - template void test() @@ -61,7 +59,7 @@ test() 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()); QTrapez quad; MappingQ1Eulerian, spacedim> mapping(shift_dh, shift); @@ -89,11 +87,9 @@ test() int main() { - deallog.attach(logfile); + initlog(); test<1, 1>(); test<2, 2>(); test<3, 3>(); - - return 0; } diff --git a/tests/mappings/mapping_q_eulerian_05.cc b/tests/mappings/mapping_q_eulerian_05.cc index ae6b365561..52eacede43 100644 --- a/tests/mappings/mapping_q_eulerian_05.cc +++ b/tests/mappings/mapping_q_eulerian_05.cc @@ -38,8 +38,6 @@ #include -std::ofstream logfile("output"); - template void test(unsigned int degree) @@ -59,7 +57,7 @@ test(unsigned int degree) 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()); QTrapez quad; MappingQEulerian, spacedim> mapping(degree, @@ -89,7 +87,7 @@ test(unsigned int degree) int main() { - deallog.attach(logfile); + initlog(); test<1, 1>(1); test<2, 2>(1); @@ -98,5 +96,4 @@ main() test<1, 1>(2); test<2, 2>(2); test<3, 3>(2); - return 0; } diff --git a/tests/mappings/mapping_q_eulerian_06.cc b/tests/mappings/mapping_q_eulerian_06.cc index f71de3cf78..118cb9ab8a 100644 --- a/tests/mappings/mapping_q_eulerian_06.cc +++ b/tests/mappings/mapping_q_eulerian_06.cc @@ -36,8 +36,6 @@ #include -std::ofstream logfile("output"); - void test(unsigned int degree) { @@ -83,10 +81,9 @@ test(unsigned int degree) int main() { - deallog.attach(logfile); + initlog(); test(1); test(2); test(3); - return 0; } diff --git a/tests/mappings/mapping_q_manifold_01.cc b/tests/mappings/mapping_q_manifold_01.cc index df4dabb171..e23978fec0 100644 --- a/tests/mappings/mapping_q_manifold_01.cc +++ b/tests/mappings/mapping_q_manifold_01.cc @@ -218,23 +218,25 @@ test(const FiniteElement &fe) deallog << mapping.get_degree() << "\t" << diff.l2_norm() << std::endl; - DataOut data_out; - std::ofstream output( - ("output_" + Utilities::int_to_string(mapping_p) + ".vtk").c_str()); - data_out.attach_dof_handler(dof_handler); - data_out.add_data_vector(v, "v"); - data_out.add_data_vector(diff, "e"); - data_out.build_patches(mapping, fe.degree); - data_out.write_vtk(output); - output.close(); + if (false) // enable for visualization + { + DataOut data_out; + std::ofstream output( + ("output_" + Utilities::int_to_string(mapping_p) + ".vtk").c_str()); + data_out.attach_dof_handler(dof_handler); + data_out.add_data_vector(v, "v"); + data_out.add_data_vector(diff, "e"); + data_out.build_patches(mapping, fe.degree); + data_out.write_vtk(output); + } } } int main() { + initlog(); deallog << std::setprecision(5); - deallog.attach(std::cout); deallog.depth_console(0); const static unsigned dim = 3; diff --git a/tests/mappings/mapping_q_mixed_manifolds_01.cc b/tests/mappings/mapping_q_mixed_manifolds_01.cc index c08b590c7c..4e1cbef552 100644 --- a/tests/mappings/mapping_q_mixed_manifolds_01.cc +++ b/tests/mappings/mapping_q_mixed_manifolds_01.cc @@ -114,8 +114,7 @@ test() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test<2>(); test<3>(); diff --git a/tests/mappings/mapping_q_mixed_manifolds_02.cc b/tests/mappings/mapping_q_mixed_manifolds_02.cc index 32fad4e2ea..20d228f109 100644 --- a/tests/mappings/mapping_q_mixed_manifolds_02.cc +++ b/tests/mappings/mapping_q_mixed_manifolds_02.cc @@ -251,8 +251,7 @@ test() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test<2>(); test<3>(); diff --git a/tests/mappings/mapping_real_to_unit_02.cc b/tests/mappings/mapping_real_to_unit_02.cc index 20468dd46f..82b8c5ce01 100644 --- a/tests/mappings/mapping_real_to_unit_02.cc +++ b/tests/mappings/mapping_real_to_unit_02.cc @@ -82,10 +82,7 @@ test2() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test2<2>(); - - return 0; } diff --git a/tests/mappings/mapping_real_to_unit_q1.cc b/tests/mappings/mapping_real_to_unit_q1.cc index 25c7339869..6eaabc904e 100644 --- a/tests/mappings/mapping_real_to_unit_q1.cc +++ b/tests/mappings/mapping_real_to_unit_q1.cc @@ -114,9 +114,7 @@ test_real_to_unit_cell() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); - + initlog(); test_real_to_unit_cell<1, 1>(); test_real_to_unit_cell<2, 2>(); @@ -125,6 +123,4 @@ main() test_real_to_unit_cell<1, 2>(); test_real_to_unit_cell<1, 3>(); test_real_to_unit_cell<2, 3>(); - - return 0; } diff --git a/tests/mappings/mapping_real_to_unit_q1_singular.cc b/tests/mappings/mapping_real_to_unit_q1_singular.cc index f3ac51c3f9..28b41786e7 100644 --- a/tests/mappings/mapping_real_to_unit_q1_singular.cc +++ b/tests/mappings/mapping_real_to_unit_q1_singular.cc @@ -62,10 +62,7 @@ test_real_to_unit_cell() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test_real_to_unit_cell<2>(); - - return 0; } diff --git a/tests/mappings/mapping_real_to_unit_q4_curved.cc b/tests/mappings/mapping_real_to_unit_q4_curved.cc index 42ccfa5ca3..ed5303bfe5 100644 --- a/tests/mappings/mapping_real_to_unit_q4_curved.cc +++ b/tests/mappings/mapping_real_to_unit_q4_curved.cc @@ -114,9 +114,7 @@ test_real_to_unit_cell() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); - + initlog(); test_real_to_unit_cell<1, 1>(); test_real_to_unit_cell<2, 2>(); @@ -126,6 +124,4 @@ main() // the following is not currently implemented // test_real_to_unit_cell<1,3>(); - - return 0; } diff --git a/tests/mappings/mapping_real_to_unit_q4_curved_codim.cc b/tests/mappings/mapping_real_to_unit_q4_curved_codim.cc index 515d3a1ae5..6530a89543 100644 --- a/tests/mappings/mapping_real_to_unit_q4_curved_codim.cc +++ b/tests/mappings/mapping_real_to_unit_q4_curved_codim.cc @@ -114,11 +114,7 @@ test_real_to_unit_cell() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); - + initlog(); test_real_to_unit_cell<2, 3>(); - - return 0; } diff --git a/tests/mappings/mapping_real_to_unit_q4_sphere_x.cc b/tests/mappings/mapping_real_to_unit_q4_sphere_x.cc index 910a7efb1e..f4917077de 100644 --- a/tests/mappings/mapping_real_to_unit_q4_sphere_x.cc +++ b/tests/mappings/mapping_real_to_unit_q4_sphere_x.cc @@ -95,8 +95,7 @@ test_real_to_unit_cell() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test_real_to_unit_cell(); diff --git a/tests/mappings/mapping_real_to_unit_q4_sphere_y.cc b/tests/mappings/mapping_real_to_unit_q4_sphere_y.cc index 2be4b3b1fa..d3515cc9ef 100644 --- a/tests/mappings/mapping_real_to_unit_q4_sphere_y.cc +++ b/tests/mappings/mapping_real_to_unit_q4_sphere_y.cc @@ -103,10 +103,7 @@ test_real_to_unit_cell() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test_real_to_unit_cell(); - - return 0; } diff --git a/tests/mappings/mapping_real_to_unit_q4_sphere_z.cc b/tests/mappings/mapping_real_to_unit_q4_sphere_z.cc index b1348c7851..6acfc1fcd1 100644 --- a/tests/mappings/mapping_real_to_unit_q4_sphere_z.cc +++ b/tests/mappings/mapping_real_to_unit_q4_sphere_z.cc @@ -86,10 +86,7 @@ test_real_to_unit_cell() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test_real_to_unit_cell(); - - return 0; } diff --git a/tests/mappings/mapping_real_to_unit_q4_straight.cc b/tests/mappings/mapping_real_to_unit_q4_straight.cc index 6a962c77d0..32f3d7c3bc 100644 --- a/tests/mappings/mapping_real_to_unit_q4_straight.cc +++ b/tests/mappings/mapping_real_to_unit_q4_straight.cc @@ -119,9 +119,7 @@ test_real_to_unit_cell() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); - + initlog(); test_real_to_unit_cell<1, 1>(); test_real_to_unit_cell<2, 2>(); @@ -132,6 +130,4 @@ main() // the following is not currently implemented // test_real_to_unit_cell<1,3>(); test_real_to_unit_cell<2, 3>(); - - return 0; } -- 2.39.5