From: David Wells Date: Sat, 15 Sep 2018 18:20:46 +0000 (-0400) Subject: Convert a lot of tests to use initlog(). X-Git-Tag: v9.1.0-rc1~715^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5331f79561a5666176ad73b89d85eb6c4f437e43;p=dealii.git Convert a lot of tests to use initlog(). --- diff --git a/tests/aniso/anisotropic_crash.cc b/tests/aniso/anisotropic_crash.cc index 69c8eccddb..fa9887f28a 100644 --- a/tests/aniso/anisotropic_crash.cc +++ b/tests/aniso/anisotropic_crash.cc @@ -37,10 +37,9 @@ using namespace dealii; int main() { - std::ofstream logfile("output"); - logfile.precision(3); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); + deallog.get_file_stream().setf(std::ios::fixed); // Create triangulation Triangulation<2> tri; diff --git a/tests/aniso/fe_tools.cc b/tests/aniso/fe_tools.cc index a102f742e6..198b4702c4 100644 --- a/tests/aniso/fe_tools.cc +++ b/tests/aniso/fe_tools.cc @@ -166,10 +166,9 @@ test_projection(std::ostream &out) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); deallog << std::setprecision(8); - test_projection<2>(logfile); - test_projection<3>(logfile); + test_projection<2>(deallog.get_file_stream()); + test_projection<3>(deallog.get_file_stream()); } diff --git a/tests/aniso/refine_and_coarsen_anisotropic.cc b/tests/aniso/refine_and_coarsen_anisotropic.cc index df2de12361..eae698e6fc 100644 --- a/tests/aniso/refine_and_coarsen_anisotropic.cc +++ b/tests/aniso/refine_and_coarsen_anisotropic.cc @@ -51,7 +51,7 @@ const unsigned int max_cells = 50000; template void -test_isotropic(int type, std::ostream *logfile) +test_isotropic(int type, std::ostream &logfile) { const RefinementCase ref_cases[7] = { RefinementCase::cut_x, @@ -77,7 +77,7 @@ test_isotropic(int type, std::ostream *logfile) tria.reset_manifold(0); tria.refine_global(1); - *logfile << "cycle: 0, number of cells: " << tria.n_cells() << std::endl; + logfile << "cycle: 0, number of cells: " << tria.n_cells() << std::endl; typename Triangulation::active_cell_iterator cell = tria.begin_active(), endc = tria.end(); @@ -110,8 +110,8 @@ test_isotropic(int type, std::ostream *logfile) grid_out.write_eps(tria, outfile); } - *logfile << "cycle: " << cycle << ", number of cells: " << tria.n_cells() - << std::endl; + logfile << "cycle: " << cycle << ", number of cells: " << tria.n_cells() + << std::endl; if (tria.n_cells() > max_cells || cycle == max_cycle) break; @@ -123,35 +123,26 @@ test_isotropic(int type, std::ostream *logfile) int main() { - std::ostream *logfile; + initlog(); - if (single_file) - logfile = new std::ofstream("output"); - else - logfile = &std::cout; + std::ostream &logfile = deallog.get_file_stream(); - *logfile << std::endl - << " 2D" << std::endl - << "-----------------------" << std::endl; + logfile << " 2D" << std::endl + << "-----------------------" << std::endl; - *logfile << "HyperCube:" << std::endl; + logfile << "HyperCube:" << std::endl; test_isotropic<2>(0, logfile); - *logfile << "HyperBall:" << std::endl; + logfile << "HyperBall:" << std::endl; test_isotropic<2>(1, logfile); - *logfile << std::endl; - *logfile << " 3D" << std::endl - << "-----------------------" << std::endl; + logfile << std::endl; + logfile << " 3D" << std::endl + << "-----------------------" << std::endl; - *logfile << "HyperCube:" << std::endl; + logfile << "HyperCube:" << std::endl; test_isotropic<3>(0, logfile); - *logfile << "HyperBall:" << std::endl; + logfile << "HyperBall:" << std::endl; test_isotropic<3>(1, logfile); - - // clear whatever is in the buffer - *logfile << std::flush; - if (single_file) - delete logfile; } diff --git a/tests/aniso/solution_transfer.cc b/tests/aniso/solution_transfer.cc index 3064501e53..c2b36e1847 100644 --- a/tests/aniso/solution_transfer.cc +++ b/tests/aniso/solution_transfer.cc @@ -137,11 +137,9 @@ transfer(std::ostream &out) int main() { - std::ofstream logfile("output"); - deallog << std::setprecision(4); - logfile << std::setprecision(4); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream() << std::setprecision(4); - transfer<2>(logfile); - transfer<3>(logfile); + transfer<2>(deallog.get_file_stream()); + transfer<3>(deallog.get_file_stream()); } diff --git a/tests/aniso/up_and_down.cc b/tests/aniso/up_and_down.cc index 9d0b047f42..ab9b1cc388 100644 --- a/tests/aniso/up_and_down.cc +++ b/tests/aniso/up_and_down.cc @@ -248,10 +248,9 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(PRECISION); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(PRECISION); + deallog.get_file_stream().setf(std::ios::fixed); test<1>(); test<2>(); diff --git a/tests/base/auto_derivative_function.cc b/tests/base/auto_derivative_function.cc index cdd66b68e0..528fb87416 100644 --- a/tests/base/auto_derivative_function.cc +++ b/tests/base/auto_derivative_function.cc @@ -125,9 +125,8 @@ ExactSinExp::vector_gradient( int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(4); - deallog.attach(logfile); const unsigned int dim = 2; AutoSinExp auto_function; diff --git a/tests/base/conditional_ostream.cc b/tests/base/conditional_ostream.cc index 320d1694e9..c02b1c5e8f 100644 --- a/tests/base/conditional_ostream.cc +++ b/tests/base/conditional_ostream.cc @@ -28,10 +28,9 @@ int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); - ConditionalOStream o(logfile, true); + ConditionalOStream o(deallog.get_file_stream(), true); o << "Yes" << std::endl; deallog << o.is_active() << std::endl; diff --git a/tests/base/full_tensor_01.cc b/tests/base/full_tensor_01.cc index daa235480a..5d0b7b9fc9 100644 --- a/tests/base/full_tensor_01.cc +++ b/tests/base/full_tensor_01.cc @@ -23,9 +23,8 @@ int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); Tensor<2, 2> t; t[0][0] = 1; diff --git a/tests/base/full_tensor_02.cc b/tests/base/full_tensor_02.cc index e0344df82c..f9d7f23ea1 100644 --- a/tests/base/full_tensor_02.cc +++ b/tests/base/full_tensor_02.cc @@ -23,9 +23,8 @@ int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); Tensor<2, 3> t; t[0][0] = 1; diff --git a/tests/base/full_tensor_03.cc b/tests/base/full_tensor_03.cc index 558aef67cc..888f9f76f0 100644 --- a/tests/base/full_tensor_03.cc +++ b/tests/base/full_tensor_03.cc @@ -23,9 +23,8 @@ int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); Tensor<4, 2> t; t[0][0][0][0] = 1; diff --git a/tests/base/full_tensor_04.cc b/tests/base/full_tensor_04.cc index a5808d5fdf..cb52034b40 100644 --- a/tests/base/full_tensor_04.cc +++ b/tests/base/full_tensor_04.cc @@ -23,9 +23,8 @@ int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); Tensor<4, 3> t; t[0][0][0][0] = 1; diff --git a/tests/base/full_tensor_05.cc b/tests/base/full_tensor_05.cc index 6211a166f5..a6fc8904d9 100644 --- a/tests/base/full_tensor_05.cc +++ b/tests/base/full_tensor_05.cc @@ -76,9 +76,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test<2>(); test<3>(); diff --git a/tests/base/full_tensor_06.cc b/tests/base/full_tensor_06.cc index 63f8115a5e..b1af06cdb2 100644 --- a/tests/base/full_tensor_06.cc +++ b/tests/base/full_tensor_06.cc @@ -78,9 +78,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test<2>(); test<3>(); diff --git a/tests/base/full_tensor_08.cc b/tests/base/full_tensor_08.cc index 2ba0f00281..0a3e1f2e35 100644 --- a/tests/base/full_tensor_08.cc +++ b/tests/base/full_tensor_08.cc @@ -61,9 +61,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test<2>(); test<3>(); diff --git a/tests/base/full_tensor_09.cc b/tests/base/full_tensor_09.cc index 1f090c8f7f..8ba4043ece 100644 --- a/tests/base/full_tensor_09.cc +++ b/tests/base/full_tensor_09.cc @@ -45,9 +45,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test<2>(); test<3>(); diff --git a/tests/base/full_tensor_10.cc b/tests/base/full_tensor_10.cc index 1d4bbe45c1..6318bf86b8 100644 --- a/tests/base/full_tensor_10.cc +++ b/tests/base/full_tensor_10.cc @@ -46,9 +46,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test<4>(); test<5>(); diff --git a/tests/base/functions_04.cc b/tests/base/functions_04.cc index 27c018addb..925f82dff4 100644 --- a/tests/base/functions_04.cc +++ b/tests/base/functions_04.cc @@ -204,22 +204,20 @@ check_function(const Functions::FlowFunction &f, int main() { - std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - deallog.attach(logfile); + initlog(); if (true) { deallog << " Functions::StokesCosine<2>" << std::endl; Functions::StokesCosine<2> f(1.); - check_function(f, 4, logfile); + check_function(f, 4, deallog.get_file_stream()); } if (true) { deallog << " Functions::StokesCosine<3>" << std::endl; Functions::StokesCosine<3> f(1.); - check_function(f, 4, logfile); + check_function(f, 4, deallog.get_file_stream()); } if (true) @@ -229,27 +227,27 @@ main() // Use odd number of points to // avoid lines with // discontinuous derivatives. - check_function(f, 5, logfile); + check_function(f, 5, deallog.get_file_stream()); } if (true) { deallog << "Functions::Kovasznay" << std::endl; Functions::Kovasznay f(10.); - check_function(f, 4, logfile); + check_function(f, 4, deallog.get_file_stream()); } if (true) { deallog << "Functions::PoisseuilleFlow<2>" << std::endl; Functions::PoisseuilleFlow<2> f(.8, 10.); - check_function(f, 4, logfile); + check_function(f, 4, deallog.get_file_stream()); } if (true) { deallog << "Functions::PoisseuilleFlow<3>" << std::endl; Functions::PoisseuilleFlow<3> f(.8, 10.); - check_function(f, 4, logfile); + check_function(f, 4, deallog.get_file_stream()); } } diff --git a/tests/base/functions_05.cc b/tests/base/functions_05.cc index 4775a3ad66..de885c881c 100644 --- a/tests/base/functions_05.cc +++ b/tests/base/functions_05.cc @@ -67,9 +67,7 @@ check2() int main() { - std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - deallog.attach(logfile); + initlog(); check1<1>(); check1<2>(); diff --git a/tests/base/functions_06.cc b/tests/base/functions_06.cc index be9d0a1458..e21f128601 100644 --- a/tests/base/functions_06.cc +++ b/tests/base/functions_06.cc @@ -78,9 +78,7 @@ check2() int main() { - std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - deallog.attach(logfile); + initlog(); check1<1>(); check1<2>(); diff --git a/tests/base/functions_07.cc b/tests/base/functions_07.cc index f806c2ccc2..478a2da3b6 100644 --- a/tests/base/functions_07.cc +++ b/tests/base/functions_07.cc @@ -65,9 +65,7 @@ check() int main() { - std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - deallog.attach(logfile); + initlog(); check<1>(); check<2>(); diff --git a/tests/base/functions_08.cc b/tests/base/functions_08.cc index b9eb3f839a..47d974f2e1 100644 --- a/tests/base/functions_08.cc +++ b/tests/base/functions_08.cc @@ -82,9 +82,7 @@ check1() int main() { - std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - deallog.attach(logfile); + initlog(); check1<1>(); check1<2>(); diff --git a/tests/base/functions_09.cc b/tests/base/functions_09.cc index 8e91151567..9904952f0e 100644 --- a/tests/base/functions_09.cc +++ b/tests/base/functions_09.cc @@ -133,9 +133,7 @@ check() int main() { - std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - deallog.attach(logfile); + initlog(); check<1, 1>(); check<2, 1>(); diff --git a/tests/base/functions_10.cc b/tests/base/functions_10.cc index 68561a37cf..9832b346bf 100644 --- a/tests/base/functions_10.cc +++ b/tests/base/functions_10.cc @@ -128,9 +128,7 @@ check() int main() { - std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - deallog.attach(logfile); + initlog(); check<1>(); check<2>(); diff --git a/tests/base/functions_11.cc b/tests/base/functions_11.cc index e03cab4361..0944391531 100644 --- a/tests/base/functions_11.cc +++ b/tests/base/functions_11.cc @@ -133,9 +133,7 @@ check() int main() { - std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - deallog.attach(logfile); + initlog(); check<1>(); check<2>(); diff --git a/tests/base/functions_12.cc b/tests/base/functions_12.cc index d590333c24..c22f7056b5 100644 --- a/tests/base/functions_12.cc +++ b/tests/base/functions_12.cc @@ -69,9 +69,7 @@ check() int main() { - std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - deallog.attach(logfile); + initlog(); check<1>(); check<2>(); diff --git a/tests/base/functions_constant_function_00.cc b/tests/base/functions_constant_function_00.cc index 3a5643924e..6bbc9fdd31 100644 --- a/tests/base/functions_constant_function_00.cc +++ b/tests/base/functions_constant_function_00.cc @@ -27,7 +27,6 @@ #define MAX_DIM 3 #define MAX_N_COMPONENT 7 -#define LOG_FILE "output" #define NUMBER double #define TESTEE Functions::ConstantFunction @@ -204,6 +203,7 @@ test_n_components(const std::vector &component_data) int main() { + initlog(); // Create data for each component std::vector component_data(MAX_N_COMPONENT); @@ -212,9 +212,6 @@ main() component_data.assign(data, data + MAX_N_COMPONENT); } - std::ofstream logfile(LOG_FILE); - deallog.attach(logfile); - test_n_components<1, NUMBER>(component_data); test_n_components<2, NUMBER>(component_data); test_n_components<3, NUMBER>(component_data); diff --git a/tests/base/functions_cspline.cc b/tests/base/functions_cspline.cc index 1e157f2cdb..06c67e9cb2 100644 --- a/tests/base/functions_cspline.cc +++ b/tests/base/functions_cspline.cc @@ -74,9 +74,7 @@ check() int main() { - std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - deallog.attach(logfile); + initlog(); check<1>(); } diff --git a/tests/base/functions_cspline_02.cc b/tests/base/functions_cspline_02.cc index bf5d0ff689..eab9d564fa 100644 --- a/tests/base/functions_cspline_02.cc +++ b/tests/base/functions_cspline_02.cc @@ -72,9 +72,7 @@ check() int main() { - std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - deallog.attach(logfile); + initlog(); check<1>(); } diff --git a/tests/base/functions_singularity.cc b/tests/base/functions_singularity.cc index 8e610a73bb..fa0c2cead4 100644 --- a/tests/base/functions_singularity.cc +++ b/tests/base/functions_singularity.cc @@ -238,9 +238,7 @@ check_function_derivative(const Functions::FlowFunction &f, int main() { - std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - deallog.attach(logfile); + initlog(); Functions::LSingularityFunction fl; Functions::LSingularityGradFunction flg; diff --git a/tests/base/functions_spherical_01.cc b/tests/base/functions_spherical_01.cc index 1163a2cc8f..b355e3c0e6 100644 --- a/tests/base/functions_spherical_01.cc +++ b/tests/base/functions_spherical_01.cc @@ -163,9 +163,7 @@ check() int main() { - std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - deallog.attach(logfile); + initlog(); check<3>(); } diff --git a/tests/base/functions_spherical_02.cc b/tests/base/functions_spherical_02.cc index 08dcc056f0..08e43e0542 100644 --- a/tests/base/functions_spherical_02.cc +++ b/tests/base/functions_spherical_02.cc @@ -214,9 +214,7 @@ check() int main() { - std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - deallog.attach(logfile); + initlog(); check<3>(); } diff --git a/tests/base/graph_coloring_01.cc b/tests/base/graph_coloring_01.cc index b75b9ceff5..605d488200 100644 --- a/tests/base/graph_coloring_01.cc +++ b/tests/base/graph_coloring_01.cc @@ -84,10 +84,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(4); deallog << std::fixed; - deallog.attach(logfile); check<2>(); diff --git a/tests/base/graph_coloring_02.cc b/tests/base/graph_coloring_02.cc index 7b8cd4e748..a552dcb783 100644 --- a/tests/base/graph_coloring_02.cc +++ b/tests/base/graph_coloring_02.cc @@ -93,10 +93,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(4); deallog << std::fixed; - deallog.attach(logfile); check<2>(); diff --git a/tests/base/graph_coloring_02a.cc b/tests/base/graph_coloring_02a.cc index 86763ab049..9bdd16e229 100644 --- a/tests/base/graph_coloring_02a.cc +++ b/tests/base/graph_coloring_02a.cc @@ -115,10 +115,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(4); deallog << std::fixed; - deallog.attach(logfile); check<1>(); check<2>(); diff --git a/tests/base/graph_coloring_03.cc b/tests/base/graph_coloring_03.cc index ce0ad4fd62..0f8658ed77 100644 --- a/tests/base/graph_coloring_03.cc +++ b/tests/base/graph_coloring_03.cc @@ -95,10 +95,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(4); deallog << std::fixed; - deallog.attach(logfile); check<2>(); diff --git a/tests/base/graph_coloring_05.cc b/tests/base/graph_coloring_05.cc index f9ce032f73..b54f3fa7f3 100644 --- a/tests/base/graph_coloring_05.cc +++ b/tests/base/graph_coloring_05.cc @@ -103,10 +103,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(4); deallog << std::fixed; - deallog.attach(logfile); check<2>(); diff --git a/tests/base/graph_coloring_06.cc b/tests/base/graph_coloring_06.cc index e11e27a4de..c86310d0a5 100644 --- a/tests/base/graph_coloring_06.cc +++ b/tests/base/graph_coloring_06.cc @@ -92,10 +92,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(4); deallog << std::fixed; - deallog.attach(logfile); check<1>(); check<2>(); diff --git a/tests/base/hierarchical.cc b/tests/base/hierarchical.cc index 20ccc24fda..034b6b9422 100644 --- a/tests/base/hierarchical.cc +++ b/tests/base/hierarchical.cc @@ -29,9 +29,8 @@ using namespace Polynomials; int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); const std::vector> p = Hierarchical::generate_complete_basis(10); diff --git a/tests/base/is_finite.cc b/tests/base/is_finite.cc index dc5dc53b40..9ce57f7a65 100644 --- a/tests/base/is_finite.cc +++ b/tests/base/is_finite.cc @@ -57,9 +57,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); // the isnan() function (which we call in is_finite()) helpfully // produces a floating point exception when called with a signalling diff --git a/tests/base/is_finite_complex.cc b/tests/base/is_finite_complex.cc index 9b48fdcab2..e2c7c41d12 100644 --- a/tests/base/is_finite_complex.cc +++ b/tests/base/is_finite_complex.cc @@ -138,9 +138,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); // the isnan() function (which we call in is_finite()) helpfully // produces a floating point exception when called with a signalling diff --git a/tests/base/log_infinity.cc b/tests/base/log_infinity.cc index ce8a3f06ea..5dfd94999d 100644 --- a/tests/base/log_infinity.cc +++ b/tests/base/log_infinity.cc @@ -23,9 +23,8 @@ int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); deallog << std::numeric_limits::infinity() << std::endl; deallog << -std::numeric_limits::infinity() << std::endl; diff --git a/tests/base/log_nan.cc b/tests/base/log_nan.cc index 708f8b82b2..733e26d432 100644 --- a/tests/base/log_nan.cc +++ b/tests/base/log_nan.cc @@ -25,9 +25,8 @@ int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); // the isnan() function (which we call in is_finite()) helpfully // produces a floating point exception when called with a signalling diff --git a/tests/base/log_precision.cc b/tests/base/log_precision.cc index 6f2a31d750..7a9cb3b049 100644 --- a/tests/base/log_precision.cc +++ b/tests/base/log_precision.cc @@ -23,9 +23,8 @@ int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); deallog << numbers::PI << std::endl; diff --git a/tests/base/log_width.cc b/tests/base/log_width.cc index 1b8a2d639e..448d8068c2 100644 --- a/tests/base/log_width.cc +++ b/tests/base/log_width.cc @@ -23,9 +23,8 @@ int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); deallog << numbers::PI * 2 << 42 << std::endl; diff --git a/tests/base/logstream_end.cc b/tests/base/logstream_end.cc index f0fb3d4c95..ab96b69763 100644 --- a/tests/base/logstream_end.cc +++ b/tests/base/logstream_end.cc @@ -30,13 +30,12 @@ int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); { LogStream log; - log.attach(logfile); + log.attach(deallog.get_file_stream()); log.log_thread_id(false); log << "This should be printed!"; diff --git a/tests/base/number_traits_complex.cc b/tests/base/number_traits_complex.cc index 02b2d584c8..955a87c410 100644 --- a/tests/base/number_traits_complex.cc +++ b/tests/base/number_traits_complex.cc @@ -59,9 +59,8 @@ check(const number &x) int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); check(std::complex(1.5, 2.5)); check(std::complex(-1.5, -2.5)); diff --git a/tests/base/number_traits_real.cc b/tests/base/number_traits_real.cc index 92998d01d4..3c75312e41 100644 --- a/tests/base/number_traits_real.cc +++ b/tests/base/number_traits_real.cc @@ -44,9 +44,8 @@ check(const number &x) int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); check((float)1.5); check((float)-1.5); diff --git a/tests/base/point_01.cc b/tests/base/point_01.cc index a723b20ec6..cec989b280 100644 --- a/tests/base/point_01.cc +++ b/tests/base/point_01.cc @@ -39,9 +39,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); check<1>(); check<2>(); diff --git a/tests/base/point_02.cc b/tests/base/point_02.cc index 9d0a34173f..c9735fd758 100644 --- a/tests/base/point_02.cc +++ b/tests/base/point_02.cc @@ -46,9 +46,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); check<1>(); check<2>(); diff --git a/tests/base/point_03.cc b/tests/base/point_03.cc index f87ab6dc98..04786e796e 100644 --- a/tests/base/point_03.cc +++ b/tests/base/point_03.cc @@ -60,9 +60,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); check<1, float>(); check<2, float>(); diff --git a/tests/base/polynomial_hermite_interpolation.cc b/tests/base/polynomial_hermite_interpolation.cc index 64e2034023..34d3703cb4 100644 --- a/tests/base/polynomial_hermite_interpolation.cc +++ b/tests/base/polynomial_hermite_interpolation.cc @@ -52,9 +52,7 @@ interpolation_conditions(const std::vector> &polynomials) int main() { - std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - deallog.attach(logfile); + initlog(); interpolation_conditions(HermiteInterpolation::generate_complete_basis(6)); plot(HermiteInterpolation::generate_complete_basis(6)); diff --git a/tests/base/polynomial_lagrange.cc b/tests/base/polynomial_lagrange.cc index d42cfff4eb..7cd8d02d38 100644 --- a/tests/base/polynomial_lagrange.cc +++ b/tests/base/polynomial_lagrange.cc @@ -79,9 +79,8 @@ check_lge(unsigned int n) int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); QTrapez<1> trapez; QSimpson<1> simpson; diff --git a/tests/base/polynomial_lagrange_ops.cc b/tests/base/polynomial_lagrange_ops.cc index 55591e9c9e..bd969f8b7f 100644 --- a/tests/base/polynomial_lagrange_ops.cc +++ b/tests/base/polynomial_lagrange_ops.cc @@ -226,9 +226,8 @@ check_poly(const Quadrature<1> &q) int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); deallog.push("LagrangeEquidistant"); for (unsigned i = 1; i < 10; i += 2) diff --git a/tests/base/polynomial_lagrange_order.cc b/tests/base/polynomial_lagrange_order.cc index 72f32f57a7..304c0d4c04 100644 --- a/tests/base/polynomial_lagrange_order.cc +++ b/tests/base/polynomial_lagrange_order.cc @@ -114,9 +114,8 @@ check_lge(unsigned int n) int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); deallog.push("LagrangeEquidistant"); for (unsigned i = 8; i < 18; i += 2) diff --git a/tests/base/polynomial_lagrange_product.cc b/tests/base/polynomial_lagrange_product.cc index 439464edaf..cd061778fa 100644 --- a/tests/base/polynomial_lagrange_product.cc +++ b/tests/base/polynomial_lagrange_product.cc @@ -93,9 +93,8 @@ check_lge(unsigned int n) int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); deallog.push("LagrangeEquidistant"); for (unsigned i = 1; i < 8; i += 2) diff --git a/tests/base/polynomial_legendre_order.cc b/tests/base/polynomial_legendre_order.cc index bda0abf6a2..3434818947 100644 --- a/tests/base/polynomial_legendre_order.cc +++ b/tests/base/polynomial_legendre_order.cc @@ -57,9 +57,8 @@ check_poly(const unsigned int n) int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); check_poly(10); check_poly(50); diff --git a/tests/base/polynomial_test.cc b/tests/base/polynomial_test.cc index 633f581697..385a179647 100644 --- a/tests/base/polynomial_test.cc +++ b/tests/base/polynomial_test.cc @@ -164,9 +164,8 @@ check_dimensions(const std::vector> &p) int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); deallog.push("Lagrange"); std::vector> p; diff --git a/tests/base/polynomials_bdm_01.cc b/tests/base/polynomials_bdm_01.cc index bb16c598d4..8c2b1fd3e1 100644 --- a/tests/base/polynomials_bdm_01.cc +++ b/tests/base/polynomials_bdm_01.cc @@ -58,10 +58,8 @@ plot(const PolynomialsBDM &poly) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); PolynomialsBDM<2> p20(0); PolynomialsBDM<2> p21(1); diff --git a/tests/base/polynomials_bdm_02.cc b/tests/base/polynomials_bdm_02.cc index c1264c1c12..e578a85e4b 100644 --- a/tests/base/polynomials_bdm_02.cc +++ b/tests/base/polynomials_bdm_02.cc @@ -81,11 +81,8 @@ plot(const PolynomialsBDM &poly) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); - PolynomialsBDM<3> p31(1); PolynomialsBDM<3> p32(2); diff --git a/tests/base/polynomials_br.cc b/tests/base/polynomials_br.cc index 7bca2553b4..ad7dde0993 100644 --- a/tests/base/polynomials_br.cc +++ b/tests/base/polynomials_br.cc @@ -167,9 +167,8 @@ check_poly_bubble(const PolynomialsBernardiRaugel &poly) int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); PolynomialsBernardiRaugel<2> p_2d(1); check_poly_q(p_2d); diff --git a/tests/base/polynomials_integrated_legendre_sz.cc b/tests/base/polynomials_integrated_legendre_sz.cc index 59133e8c22..8dc9a4844d 100644 --- a/tests/base/polynomials_integrated_legendre_sz.cc +++ b/tests/base/polynomials_integrated_legendre_sz.cc @@ -81,9 +81,8 @@ check_poly(const unsigned int n) int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); check_poly(25); } diff --git a/tests/base/polynomials_rt.cc b/tests/base/polynomials_rt.cc index df3fe6ffb9..2bde054a3e 100644 --- a/tests/base/polynomials_rt.cc +++ b/tests/base/polynomials_rt.cc @@ -58,9 +58,8 @@ plot(const PolynomialsRaviartThomas &poly) int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); PolynomialsRaviartThomas<2> p20(0); PolynomialsRaviartThomas<2> p21(1); diff --git a/tests/base/polynomials_rt_bubbles.cc b/tests/base/polynomials_rt_bubbles.cc index 8c2467f244..484c8e87ac 100644 --- a/tests/base/polynomials_rt_bubbles.cc +++ b/tests/base/polynomials_rt_bubbles.cc @@ -59,9 +59,8 @@ plot(const PolynomialsRT_Bubbles &poly) int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); PolynomialsRT_Bubbles<2> p20(1); PolynomialsRT_Bubbles<2> p21(2); diff --git a/tests/base/polynomials_tensor.cc b/tests/base/polynomials_tensor.cc index 7674990c34..8654777e4a 100644 --- a/tests/base/polynomials_tensor.cc +++ b/tests/base/polynomials_tensor.cc @@ -103,9 +103,8 @@ check_rt() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(0); - deallog.attach(logfile); deallog.push("BDM"); check_bdm<2>(); diff --git a/tests/base/scalar_01.cc b/tests/base/scalar_01.cc index 73bb4e4413..1a06046da6 100644 --- a/tests/base/scalar_01.cc +++ b/tests/base/scalar_01.cc @@ -35,9 +35,8 @@ compare(const U &u, const V &v) int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); typedef Tensor<0, 1> T; T t1(13.), t2(42); diff --git a/tests/base/signaling_nan_derivative_form.cc b/tests/base/signaling_nan_derivative_form.cc index 20bac1dceb..6acc1b35a4 100644 --- a/tests/base/signaling_nan_derivative_form.cc +++ b/tests/base/signaling_nan_derivative_form.cc @@ -44,9 +44,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); check(); check(); diff --git a/tests/base/signaling_nan_point.cc b/tests/base/signaling_nan_point.cc index 9c7d4d70f2..6d3db44c66 100644 --- a/tests/base/signaling_nan_point.cc +++ b/tests/base/signaling_nan_point.cc @@ -44,9 +44,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); check(); check(); diff --git a/tests/base/signaling_nan_symmetric_tensor.cc b/tests/base/signaling_nan_symmetric_tensor.cc index 962bc49f62..93149f4be8 100644 --- a/tests/base/signaling_nan_symmetric_tensor.cc +++ b/tests/base/signaling_nan_symmetric_tensor.cc @@ -43,9 +43,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); check(); check(); diff --git a/tests/base/signaling_nan_table.cc b/tests/base/signaling_nan_table.cc index 43490e494b..204446a66f 100644 --- a/tests/base/signaling_nan_table.cc +++ b/tests/base/signaling_nan_table.cc @@ -46,9 +46,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); check(); check(); diff --git a/tests/base/signaling_nan_tensor.cc b/tests/base/signaling_nan_tensor.cc index 555863f986..67bba0355f 100644 --- a/tests/base/signaling_nan_tensor.cc +++ b/tests/base/signaling_nan_tensor.cc @@ -44,9 +44,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); check(); check(); diff --git a/tests/base/table.cc b/tests/base/table.cc index eb43d016c9..5b6b77b840 100644 --- a/tests/base/table.cc +++ b/tests/base/table.cc @@ -27,10 +27,9 @@ const int entries[] = {11, 12, 13, 21, 22, 23, 31, 32, 33, 58, 65, 78, int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::fixed; deallog << std::setprecision(0); - deallog.attach(logfile); // a square table if (true) diff --git a/tests/base/table_02.cc b/tests/base/table_02.cc index 4c5f8aa7ad..3009be9a78 100644 --- a/tests/base/table_02.cc +++ b/tests/base/table_02.cc @@ -25,10 +25,9 @@ int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::fixed; deallog << std::setprecision(0); - deallog.attach(logfile); // rank=1 { diff --git a/tests/base/table_03.cc b/tests/base/table_03.cc index cd210140d9..1a145b4ad9 100644 --- a/tests/base/table_03.cc +++ b/tests/base/table_03.cc @@ -25,10 +25,9 @@ int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::fixed; deallog << std::setprecision(0); - deallog.attach(logfile); const std::string elements = "1 2 3 4 5 6"; { diff --git a/tests/base/table_04.cc b/tests/base/table_04.cc index 3cc6728b50..c2fe2ad08e 100644 --- a/tests/base/table_04.cc +++ b/tests/base/table_04.cc @@ -26,10 +26,9 @@ int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::fixed; deallog << std::setprecision(0); - deallog.attach(logfile); // rank=1 { diff --git a/tests/base/table_05.cc b/tests/base/table_05.cc index 33352b543b..09d3e33711 100644 --- a/tests/base/table_05.cc +++ b/tests/base/table_05.cc @@ -38,10 +38,9 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::fixed; deallog << std::setprecision(0); - deallog.attach(logfile); test<1>(); test<2>(); diff --git a/tests/base/table_handler_12.cc b/tests/base/table_handler_12.cc index e2ed890087..7e7ae6e48d 100644 --- a/tests/base/table_handler_12.cc +++ b/tests/base/table_handler_12.cc @@ -31,12 +31,11 @@ int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); // set precision on the output // stream to 4 digits - logfile << std::setprecision(4); + deallog.get_file_stream() << std::setprecision(4); // but then set precision on the // table output to 2 @@ -45,9 +44,9 @@ main() table.set_precision("key", 2); // now output the table... - table.write_text(logfile); + table.write_text(deallog.get_file_stream()); // ...and then output some other // number, hopefully with 4 digits // of precision - logfile << 0.123456789 << std::endl; + deallog.get_file_stream() << 0.123456789 << std::endl; } diff --git a/tests/base/table_indices_01.cc b/tests/base/table_indices_01.cc index 65a7bc9e37..287f21a505 100644 --- a/tests/base/table_indices_01.cc +++ b/tests/base/table_indices_01.cc @@ -25,9 +25,8 @@ int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); const TableIndices<2> t1(84, 42); TableIndices<2> t2; diff --git a/tests/base/task_03.cc b/tests/base/task_03.cc index 48f54bae8a..bb95594c67 100644 --- a/tests/base/task_03.cc +++ b/tests/base/task_03.cc @@ -35,8 +35,7 @@ test(int i) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); { Threads::Task<> t1 = Threads::new_task(test, 1); @@ -50,7 +49,10 @@ main() deallog << "OK" << std::endl; } + std::ofstream *out_stream = + dynamic_cast(&deallog.get_file_stream()); + Assert(out_stream != nullptr, ExcInternalError()); deallog.detach(); - logfile.close(); + out_stream->close(); sort_file_contents("output"); } diff --git a/tests/base/task_04.cc b/tests/base/task_04.cc index 28126f0f45..3d2029aa2c 100644 --- a/tests/base/task_04.cc +++ b/tests/base/task_04.cc @@ -44,8 +44,7 @@ test(int i) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); Threads::Task<> t1 = Threads::new_task(test, 1); Threads::Task<> t2 = Threads::new_task(test, 2); @@ -55,7 +54,10 @@ main() deallog << "OK" << std::endl; + std::ofstream *out_stream = + dynamic_cast(&deallog.get_file_stream()); + Assert(out_stream != nullptr, ExcInternalError()); deallog.detach(); - logfile.close(); + out_stream->close(); sort_file_contents("output"); } diff --git a/tests/base/task_06.cc b/tests/base/task_06.cc index d5232f5be9..e06a6e3ddf 100644 --- a/tests/base/task_06.cc +++ b/tests/base/task_06.cc @@ -39,8 +39,7 @@ test(int i) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); { Threads::Thread<> t1 = Threads::new_thread(test, 1); @@ -52,7 +51,10 @@ main() deallog << "OK" << std::endl; } + std::ofstream *out_stream = + dynamic_cast(&deallog.get_file_stream()); + Assert(out_stream != nullptr, ExcInternalError()); deallog.detach(); - logfile.close(); + out_stream->close(); sort_file_contents("output"); } diff --git a/tests/base/task_07.cc b/tests/base/task_07.cc index 4d48d4ce0d..0d6deb1be7 100644 --- a/tests/base/task_07.cc +++ b/tests/base/task_07.cc @@ -34,8 +34,7 @@ test(int i) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); Threads::TaskGroup<> tg; tg += Threads::new_task(test, 1); @@ -45,7 +44,10 @@ main() deallog << "OK" << std::endl; + std::ofstream *out_stream = + dynamic_cast(&deallog.get_file_stream()); + Assert(out_stream != nullptr, ExcInternalError()); deallog.detach(); - logfile.close(); + out_stream->close(); sort_file_contents("output"); } diff --git a/tests/base/task_08.cc b/tests/base/task_08.cc index a37709cd04..5b57956692 100644 --- a/tests/base/task_08.cc +++ b/tests/base/task_08.cc @@ -35,8 +35,7 @@ test(int i) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); { Threads::new_task(test, 1); @@ -44,7 +43,10 @@ main() deallog << "OK" << std::endl; } + std::ofstream *out_stream = + dynamic_cast(&deallog.get_file_stream()); + Assert(out_stream != nullptr, ExcInternalError()); deallog.detach(); - logfile.close(); + out_stream->close(); sort_file_contents("output"); } diff --git a/tests/base/task_12.cc b/tests/base/task_12.cc index f0f48d472b..c3f3dbae67 100644 --- a/tests/base/task_12.cc +++ b/tests/base/task_12.cc @@ -39,8 +39,7 @@ test(int i) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); Threads::TaskGroup tg; tg += Threads::new_task(std::bind(test, 1)); @@ -50,7 +49,10 @@ main() deallog << "OK" << std::endl; + std::ofstream *out_stream = + dynamic_cast(&deallog.get_file_stream()); + Assert(out_stream != nullptr, ExcInternalError()); deallog.detach(); - logfile.close(); + out_stream->close(); sort_file_contents("output"); } diff --git a/tests/base/task_12_capture.cc b/tests/base/task_12_capture.cc index 69275975a9..f84c7179f3 100644 --- a/tests/base/task_12_capture.cc +++ b/tests/base/task_12_capture.cc @@ -42,8 +42,7 @@ test(int i) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); int arg1 = 1; int arg2 = 2; @@ -58,7 +57,10 @@ main() deallog << "OK" << std::endl; + std::ofstream *out_stream = + dynamic_cast(&deallog.get_file_stream()); + Assert(out_stream != nullptr, ExcInternalError()); deallog.detach(); - logfile.close(); + out_stream->close(); sort_file_contents("output"); } diff --git a/tests/base/task_13.cc b/tests/base/task_13.cc index d46352df61..5fa5fd3ca7 100644 --- a/tests/base/task_13.cc +++ b/tests/base/task_13.cc @@ -42,8 +42,7 @@ test(int i) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); Threads::TaskGroup tg; @@ -55,7 +54,10 @@ main() deallog << "OK" << std::endl; + std::ofstream *out_stream = + dynamic_cast(&deallog.get_file_stream()); + Assert(out_stream != nullptr, ExcInternalError()); deallog.detach(); - logfile.close(); + out_stream->close(); sort_file_contents("output"); } diff --git a/tests/base/thread_12.cc b/tests/base/thread_12.cc index aec486c3b6..4f06ce1370 100644 --- a/tests/base/thread_12.cc +++ b/tests/base/thread_12.cc @@ -39,8 +39,7 @@ test(int i) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); Threads::ThreadGroup tg; tg += Threads::new_thread(std::bind(test, 1)); @@ -50,7 +49,10 @@ main() deallog << "OK" << std::endl; + std::ofstream *out_stream = + dynamic_cast(&deallog.get_file_stream()); + Assert(out_stream != nullptr, ExcInternalError()); deallog.detach(); - logfile.close(); + out_stream->close(); sort_file_contents("output"); } diff --git a/tests/base/thread_validity_06.cc b/tests/base/thread_validity_06.cc index 587c35c534..cd789ca10e 100644 --- a/tests/base/thread_validity_06.cc +++ b/tests/base/thread_validity_06.cc @@ -83,11 +83,7 @@ test() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test(); - - deallog.detach(); - logfile.close(); } diff --git a/tests/base/thread_validity_07.cc b/tests/base/thread_validity_07.cc index 004e04af7e..744574136a 100644 --- a/tests/base/thread_validity_07.cc +++ b/tests/base/thread_validity_07.cc @@ -45,8 +45,7 @@ waiter(int i) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); worker_thread = Threads::new_thread(worker); @@ -57,7 +56,10 @@ main() waiter_threads.join_all(); deallog << "All waiting threads finished." << std::endl; + std::ofstream *out_stream = + dynamic_cast(&deallog.get_file_stream()); + Assert(out_stream != nullptr, ExcInternalError()); deallog.detach(); - logfile.close(); + out_stream->close(); sort_file_contents("output"); } diff --git a/tests/base/threads_02.cc b/tests/base/threads_02.cc index 861983bc3d..21b4291916 100644 --- a/tests/base/threads_02.cc +++ b/tests/base/threads_02.cc @@ -3164,8 +3164,8 @@ struct U int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); + using namespace Threads; ThreadGroup> tg; ThreadGroup &> tgr; @@ -3662,7 +3662,10 @@ main() tgr.join_all(); tgcr.join_all(); + std::ofstream *out_stream = + dynamic_cast(&deallog.get_file_stream()); + Assert(out_stream != nullptr, ExcInternalError()); deallog.detach(); - logfile.close(); + out_stream->close(); sort_file_contents("output"); } diff --git a/tests/base/timer_02.cc b/tests/base/timer_02.cc index 33e5cc2b71..25f3fe113c 100644 --- a/tests/base/timer_02.cc +++ b/tests/base/timer_02.cc @@ -27,8 +27,7 @@ int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); { // use std::cout so that no output is saved to the logfile, because it diff --git a/tests/base/timer_03.cc b/tests/base/timer_03.cc index 50dd744cc8..c8f708bb76 100644 --- a/tests/base/timer_03.cc +++ b/tests/base/timer_03.cc @@ -72,8 +72,7 @@ burn(unsigned int n) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); Timer t1, t2; TimerOutput tO(std::cout, TimerOutput::summary, TimerOutput::cpu_times); diff --git a/tests/base/vectorization_07.cc b/tests/base/vectorization_07.cc index 56fdab9353..7125f82b5d 100644 --- a/tests/base/vectorization_07.cc +++ b/tests/base/vectorization_07.cc @@ -22,17 +22,15 @@ int main() { - std::string logname = "output"; - std::ofstream logfile(logname); + initlog(); if (!std::is_pod>::value) - logfile << "Not OK because VectorizedArray is not POD!" - << std::endl; + deallog.get_file_stream() + << "Not OK because VectorizedArray is not POD!" << std::endl; if (!std::is_trivial>::value) - logfile << "Not OK because VectorizedArray is not trivial!" - << std::endl; + deallog.get_file_stream() + << "Not OK because VectorizedArray is not trivial!" << std::endl; - logfile << "OK" << std::endl; - logfile.close(); + deallog.get_file_stream() << "OK" << std::endl; } diff --git a/tests/base/vectorization_07.output b/tests/base/vectorization_07.output index d86bac9de5..6acbd104b1 100644 --- a/tests/base/vectorization_07.output +++ b/tests/base/vectorization_07.output @@ -1 +1,2 @@ + OK diff --git a/tests/base/work_stream_03.cc b/tests/base/work_stream_03.cc index f2d42a2ba9..1164fc9c1d 100644 --- a/tests/base/work_stream_03.cc +++ b/tests/base/work_stream_03.cc @@ -178,10 +178,8 @@ do_project() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); - do_project(); } diff --git a/tests/base/work_stream_03_graph.cc b/tests/base/work_stream_03_graph.cc index 8b43ab9061..093ea7a37b 100644 --- a/tests/base/work_stream_03_graph.cc +++ b/tests/base/work_stream_03_graph.cc @@ -189,10 +189,7 @@ do_project() int main() { - std::ofstream logfile("output"); - deallog << std::setprecision(3); - - deallog.attach(logfile); + initlog(); do_project(); } diff --git a/tests/codim_one/bem.cc b/tests/codim_one/bem.cc index add33ca06d..7ca7726b66 100644 --- a/tests/codim_one/bem.cc +++ b/tests/codim_one/bem.cc @@ -56,8 +56,6 @@ #include #include -std::ofstream logfile("output"); - template class BEM { @@ -114,8 +112,6 @@ template void BEM::run() { - deallog.attach(logfile); - ConvergenceTable table; if (spacedim == 2) @@ -422,7 +418,7 @@ BEM::output_results() "error", DataOut>::type_cell_data); dataout.build_patches(); - dataout.write_vtk(logfile); + dataout.write_vtk(deallog.get_file_stream()); } template @@ -445,13 +441,15 @@ BEM::write_grid(std::string filename) { GridOut grid_out; grid_out.set_flags(GridOutFlags::Ucd(true)); - grid_out.write_ucd(tria, logfile); - grid_out.write_msh(tria, logfile); + grid_out.write_ucd(tria, deallog.get_file_stream()); + grid_out.write_msh(tria, deallog.get_file_stream()); } int main() { + initlog(); + BEM<2> bem; bem.run(); diff --git a/tests/codim_one/data_out.cc b/tests/codim_one/data_out.cc index cf55f5b19f..e432aca6a1 100644 --- a/tests/codim_one/data_out.cc +++ b/tests/codim_one/data_out.cc @@ -41,9 +41,6 @@ #include -std::ofstream logfile("output"); - - template void test(std::string filename) @@ -68,7 +65,7 @@ test(std::string filename) DataOut> dataout; dataout.add_data_vector(dof_handler, numbering, "numbering"); dataout.build_patches(); - dataout.write_vtk(logfile); + dataout.write_vtk(deallog.get_file_stream()); } @@ -76,7 +73,7 @@ test(std::string filename) int main() { - deallog.attach(logfile); + initlog(); deallog << "Test<1,2>" << std::endl; test<1, 2>(SOURCE_DIR "/grids/circle_2.inp"); diff --git a/tests/codim_one/data_out_02.cc b/tests/codim_one/data_out_02.cc index 0437e257a8..55c31ea656 100644 --- a/tests/codim_one/data_out_02.cc +++ b/tests/codim_one/data_out_02.cc @@ -37,13 +37,10 @@ #include "../tests.h" -std::ofstream logfile("output"); - - int main() { - deallog.attach(logfile); + initlog(); const unsigned int dim = 1; diff --git a/tests/codim_one/data_out_03.cc b/tests/codim_one/data_out_03.cc index 4f65e6b2b4..ce10c131c9 100644 --- a/tests/codim_one/data_out_03.cc +++ b/tests/codim_one/data_out_03.cc @@ -39,8 +39,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - template class Identity : public Function { @@ -68,7 +66,7 @@ public: int main() { - deallog.attach(logfile); + initlog(); int fe_degree = 2; int mapping_degree = 2; diff --git a/tests/codim_one/error_estimator_01.cc b/tests/codim_one/error_estimator_01.cc index e35d6e6812..11f1f79530 100644 --- a/tests/codim_one/error_estimator_01.cc +++ b/tests/codim_one/error_estimator_01.cc @@ -203,10 +203,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1, 2>(); diff --git a/tests/codim_one/fe_values_extractor_01.cc b/tests/codim_one/fe_values_extractor_01.cc index a4791fe20a..02a850b408 100644 --- a/tests/codim_one/fe_values_extractor_01.cc +++ b/tests/codim_one/fe_values_extractor_01.cc @@ -41,13 +41,10 @@ #include "../tests.h" -std::ofstream logfile("output"); - - int main() { - deallog.attach(logfile); + initlog(); const unsigned int dim = 1; diff --git a/tests/codim_one/gradients.cc b/tests/codim_one/gradients.cc index 96a07b9835..1885175dfa 100644 --- a/tests/codim_one/gradients.cc +++ b/tests/codim_one/gradients.cc @@ -49,10 +49,6 @@ #include #include - - -std::ofstream logfile("output"); - template void test(std::string filename) @@ -183,7 +179,7 @@ test(std::string filename) dataout.attach_triangulation(triangulation); dataout.add_data_vector(projected_directional_derivative, "derivative"); dataout.build_patches(); - dataout.write_vtk(logfile); + dataout.write_vtk(deallog.get_file_stream()); } @@ -191,8 +187,8 @@ test(std::string filename) int main() { - logfile.precision(4); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(4); deallog << "Test <1,2>" << std::endl; test<1, 2>(SOURCE_DIR "/grids/circle_4.inp"); diff --git a/tests/codim_one/gradients_1.cc b/tests/codim_one/gradients_1.cc index 4f12d8a2cd..9ebb885a93 100644 --- a/tests/codim_one/gradients_1.cc +++ b/tests/codim_one/gradients_1.cc @@ -49,9 +49,6 @@ #include - -std::ofstream logfile("output"); - template void test(std::string filename, unsigned int degree = 1) @@ -118,8 +115,8 @@ test(std::string filename, unsigned int degree = 1) int main() { - logfile.precision(4); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(4); deallog << "Test <1,2>, Q1, Q2, Q3" << std::endl; test<1, 2>(SOURCE_DIR "/grids/circle_4.inp", 1); diff --git a/tests/codim_one/grid_in_out.cc b/tests/codim_one/grid_in_out.cc index 26139981a8..a87fefb2bf 100644 --- a/tests/codim_one/grid_in_out.cc +++ b/tests/codim_one/grid_in_out.cc @@ -25,8 +25,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - template void test(std::string filename) @@ -39,14 +37,14 @@ test(std::string filename) GridOut grid_out; grid_out.set_flags(GridOutFlags::Ucd(true)); - grid_out.write_ucd(tria, logfile); - grid_out.write_msh(tria, logfile); + grid_out.write_ucd(tria, deallog.get_file_stream()); + grid_out.write_msh(tria, deallog.get_file_stream()); } int main() { - deallog.attach(logfile); + initlog(); test<1, 2>(SOURCE_DIR "/grids/circle_1.inp"); test<2, 3>(SOURCE_DIR "/grids/square.inp"); diff --git a/tests/codim_one/grid_in_out_02.cc b/tests/codim_one/grid_in_out_02.cc index 71ebab3659..d1f21b2b1a 100644 --- a/tests/codim_one/grid_in_out_02.cc +++ b/tests/codim_one/grid_in_out_02.cc @@ -25,8 +25,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - template void test(std::string filename) @@ -38,13 +36,13 @@ test(std::string filename) gi.read_ucd(in); GridOut grid_out; - grid_out.write_gnuplot(tria, logfile); + grid_out.write_gnuplot(tria, deallog.get_file_stream()); } int main() { - deallog.attach(logfile); + initlog(); test<2, 3>(SOURCE_DIR "/grids/square.inp"); test<2, 3>(SOURCE_DIR "/grids/sphere_1.inp"); diff --git a/tests/codim_one/grid_in_out_03.cc b/tests/codim_one/grid_in_out_03.cc index 6a81b5d5a3..8f65a7f553 100644 --- a/tests/codim_one/grid_in_out_03.cc +++ b/tests/codim_one/grid_in_out_03.cc @@ -27,13 +27,12 @@ #include "../tests.h" -std::ofstream logfile("output"); - template void test(std::string filename) { - logfile << " Tria<" << dim << "," << spacedim << ">: " << std::endl; + deallog.get_file_stream() + << " Tria<" << dim << "," << spacedim << ">: " << std::endl; Triangulation tria; GridIn gi; gi.attach_triangulation(tria); @@ -52,13 +51,13 @@ test(std::string filename) ptria.execute_coarsening_and_refinement(); } - ptria.write_flags(logfile); + ptria.write_flags(deallog.get_file_stream()); } int main() { - deallog.attach(logfile); + initlog(); test<2, 3>(SOURCE_DIR "/grids/square.inp"); test<2, 3>(SOURCE_DIR "/grids/sphere_1.inp"); diff --git a/tests/codim_one/grid_refinement.cc b/tests/codim_one/grid_refinement.cc index 24ff532979..90a23cf0b1 100644 --- a/tests/codim_one/grid_refinement.cc +++ b/tests/codim_one/grid_refinement.cc @@ -29,8 +29,6 @@ #include -std::ofstream logfile("output"); - template void test(std::string filename) @@ -49,14 +47,14 @@ test(std::string filename) for (unsigned int cycle = 0; cycle < 3; ++cycle) { tria.refine_global(1); - grid_out.write_msh(tria, logfile); + grid_out.write_msh(tria, deallog.get_file_stream()); } } int main() { - deallog.attach(logfile); + initlog(); deallog << "Test<1,2>" << std::endl; test<1, 2>(SOURCE_DIR "/grids/circle_1.inp"); diff --git a/tests/codim_one/integrate_log.cc b/tests/codim_one/integrate_log.cc index 645b990a81..2f83bd5214 100644 --- a/tests/codim_one/integrate_log.cc +++ b/tests/codim_one/integrate_log.cc @@ -43,8 +43,6 @@ #include -std::ofstream logfile("output"); - double test(const unsigned int n, const unsigned int exponent, @@ -135,7 +133,7 @@ newton_binomial(unsigned int a, unsigned int b) int main() { - deallog.attach(logfile); + initlog(); deallog << std::fixed; deallog << std::setprecision(5); const double a = 1, b = 5.; diff --git a/tests/codim_one/integrate_log_2.cc b/tests/codim_one/integrate_log_2.cc index e72874b152..5656b63f8d 100644 --- a/tests/codim_one/integrate_log_2.cc +++ b/tests/codim_one/integrate_log_2.cc @@ -45,9 +45,6 @@ using namespace std; -std::ofstream logfile("output"); - - // Returns the following integral: /int_0^1 x^N * ln(|x-point|/alpha) dx double log_integral(const unsigned int N, const double point, const double alpha); @@ -55,7 +52,8 @@ log_integral(const unsigned int N, const double point, const double alpha); int main() { - deallog.attach(logfile); + initlog(); + deallog << std::fixed; deallog << std::setprecision(10); diff --git a/tests/codim_one/interpolate_boundary_values_01.cc b/tests/codim_one/interpolate_boundary_values_01.cc index 421a4e062e..d9e2f87eb9 100644 --- a/tests/codim_one/interpolate_boundary_values_01.cc +++ b/tests/codim_one/interpolate_boundary_values_01.cc @@ -32,8 +32,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - template void test(std::string filename) @@ -86,7 +84,7 @@ test(std::string filename) int main() { - deallog.attach(logfile); + initlog(); test<2, 3>(SOURCE_DIR "/grids/square.inp"); test<2, 3>(SOURCE_DIR "/grids/sphere_1.inp"); diff --git a/tests/codim_one/interpolate_boundary_values_01_vector_valued.cc b/tests/codim_one/interpolate_boundary_values_01_vector_valued.cc index d05a913552..a03e7f55dc 100644 --- a/tests/codim_one/interpolate_boundary_values_01_vector_valued.cc +++ b/tests/codim_one/interpolate_boundary_values_01_vector_valued.cc @@ -34,8 +34,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - template class X : public Function { @@ -101,7 +99,7 @@ test(std::string filename) int main() { - deallog.attach(logfile); + initlog(); test<2, 3>(SOURCE_DIR "/grids/square.inp"); test<2, 3>(SOURCE_DIR "/grids/sphere_1.inp"); diff --git a/tests/codim_one/interpolate_boundary_values_02.cc b/tests/codim_one/interpolate_boundary_values_02.cc index 7e47db450e..5689147209 100644 --- a/tests/codim_one/interpolate_boundary_values_02.cc +++ b/tests/codim_one/interpolate_boundary_values_02.cc @@ -33,8 +33,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - void test() { @@ -93,7 +91,7 @@ test() int main() { - deallog.attach(logfile); + initlog(); test(); diff --git a/tests/codim_one/interpolate_boundary_values_02_vector_valued.cc b/tests/codim_one/interpolate_boundary_values_02_vector_valued.cc index 449ed1d838..692392c69a 100644 --- a/tests/codim_one/interpolate_boundary_values_02_vector_valued.cc +++ b/tests/codim_one/interpolate_boundary_values_02_vector_valued.cc @@ -34,8 +34,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - template class X : public Function { @@ -111,7 +109,7 @@ test() int main() { - deallog.attach(logfile); + initlog(); test(); diff --git a/tests/codim_one/interpolate_boundary_values_03.cc b/tests/codim_one/interpolate_boundary_values_03.cc index 19574936b3..5097d08c8a 100644 --- a/tests/codim_one/interpolate_boundary_values_03.cc +++ b/tests/codim_one/interpolate_boundary_values_03.cc @@ -34,8 +34,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - void test() { @@ -100,7 +98,7 @@ test() int main() { - deallog.attach(logfile); + initlog(); test(); diff --git a/tests/codim_one/interpolate_boundary_values_1d_closed_ring.cc b/tests/codim_one/interpolate_boundary_values_1d_closed_ring.cc index dda5141420..403fa3f546 100644 --- a/tests/codim_one/interpolate_boundary_values_1d_closed_ring.cc +++ b/tests/codim_one/interpolate_boundary_values_1d_closed_ring.cc @@ -43,8 +43,6 @@ using namespace dealii; -std::ofstream logfile("output"); - void test() { @@ -109,7 +107,7 @@ test() int main() { - deallog.attach(logfile); + initlog(); test(); diff --git a/tests/codim_one/interpolation.cc b/tests/codim_one/interpolation.cc index d62faa88d8..c3971a9fac 100644 --- a/tests/codim_one/interpolation.cc +++ b/tests/codim_one/interpolation.cc @@ -41,9 +41,6 @@ #include -std::ofstream logfile("output"); - - template void test(std::string filename, unsigned int n) @@ -82,7 +79,7 @@ test(std::string filename, unsigned int n) int main() { - deallog.attach(logfile); + initlog(); for (unsigned int n = 1; n < 8; ++n) { diff --git a/tests/codim_one/interpolation_2.cc b/tests/codim_one/interpolation_2.cc index 5d1f00c870..559310ec83 100644 --- a/tests/codim_one/interpolation_2.cc +++ b/tests/codim_one/interpolation_2.cc @@ -43,9 +43,6 @@ #include -std::ofstream logfile("output"); - - template void test(std::string filename) @@ -72,7 +69,7 @@ test(std::string filename) DataOut> dataout; dataout.add_data_vector(dof_handler, interpolated_one, "numbering"); dataout.build_patches(); - dataout.write_vtk(logfile); + dataout.write_vtk(deallog.get_file_stream()); } @@ -80,7 +77,7 @@ test(std::string filename) int main() { - deallog.attach(logfile); + initlog(); deallog << "Test<1,2>" << std::endl; test<1, 2>(SOURCE_DIR "/grids/circle_2.inp"); diff --git a/tests/codim_one/interpolation_3.cc b/tests/codim_one/interpolation_3.cc index d1b749114d..dc0ca07544 100644 --- a/tests/codim_one/interpolation_3.cc +++ b/tests/codim_one/interpolation_3.cc @@ -43,9 +43,6 @@ #include - -std::ofstream logfile("output"); - // Test interpolation on system of finite elements. template @@ -82,7 +79,7 @@ test(std::string filename) dataout.attach_dof_handler(dof_handler); dataout.add_data_vector(interpolated_one, "test"); dataout.build_patches(); - dataout.write_vtk(logfile); + dataout.write_vtk(deallog.get_file_stream()); } @@ -90,7 +87,7 @@ test(std::string filename) int main() { - deallog.attach(logfile); + initlog(); deallog << "Test<1,2>" << std::endl; test<1, 2>(SOURCE_DIR "/grids/circle_2.inp"); diff --git a/tests/codim_one/mapping_q1.cc b/tests/codim_one/mapping_q1.cc index 5e48d51e83..3aad29399b 100644 --- a/tests/codim_one/mapping_q1.cc +++ b/tests/codim_one/mapping_q1.cc @@ -33,8 +33,6 @@ #include -std::ofstream logfile("output"); - template void test(std::string filename) @@ -47,7 +45,7 @@ test(std::string filename) 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; MappingQGeneric mapping(1); @@ -75,7 +73,7 @@ test(std::string filename) int main() { - deallog.attach(logfile); + initlog(); test<1, 2>(SOURCE_DIR "/grids/circle_1.inp"); test<2, 3>(SOURCE_DIR "/grids/square.inp"); diff --git a/tests/codim_one/mapping_q1_eulerian.cc b/tests/codim_one/mapping_q1_eulerian.cc index 4098a5f050..81ff4f7ee1 100644 --- a/tests/codim_one/mapping_q1_eulerian.cc +++ b/tests/codim_one/mapping_q1_eulerian.cc @@ -39,8 +39,6 @@ #include -std::ofstream logfile("output"); - template void test(std::string filename) @@ -64,7 +62,7 @@ test(std::string filename) 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); @@ -92,7 +90,7 @@ test(std::string filename) int main() { - deallog.attach(logfile); + initlog(); test<1, 2>(SOURCE_DIR "/grids/circle_1.inp"); test<2, 3>(SOURCE_DIR "/grids/square.inp"); diff --git a/tests/codim_one/mapping_q_eulerian.cc b/tests/codim_one/mapping_q_eulerian.cc index cf442e89b0..aa9f546c0b 100644 --- a/tests/codim_one/mapping_q_eulerian.cc +++ b/tests/codim_one/mapping_q_eulerian.cc @@ -39,8 +39,6 @@ #include -std::ofstream logfile("output"); - template void test(std::string filename, unsigned int degree) @@ -64,7 +62,7 @@ test(std::string filename, 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, @@ -95,7 +93,7 @@ test(std::string filename, unsigned int degree) int main() { - deallog.attach(logfile); + initlog(); test<1, 2>(SOURCE_DIR "/grids/circle_1.inp", 1); test<1, 2>(SOURCE_DIR "/grids/circle_1.inp", 2); diff --git a/tests/codim_one/mean_value.cc b/tests/codim_one/mean_value.cc index 3403389d93..e853200c9d 100644 --- a/tests/codim_one/mean_value.cc +++ b/tests/codim_one/mean_value.cc @@ -42,9 +42,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void test() @@ -73,7 +70,7 @@ test() int main() { - deallog.attach(logfile); + initlog(); test<1, 2>(); test<2, 3>(); diff --git a/tests/codim_one/mesh_bug.cc b/tests/codim_one/mesh_bug.cc index ac990d3cb0..7672fe0e4b 100644 --- a/tests/codim_one/mesh_bug.cc +++ b/tests/codim_one/mesh_bug.cc @@ -34,7 +34,7 @@ int main() { - std::ofstream logfile("output"); + initlog(); Triangulation<2, 3> tria; GridIn<2, 3> gi; @@ -50,7 +50,7 @@ main() GridOut go; - go.write_ucd(tria, logfile); + go.write_ucd(tria, deallog.get_file_stream()); return 0; } diff --git a/tests/codim_one/mesh_bug.output b/tests/codim_one/mesh_bug.output index 32a20427df..841453dd9a 100644 --- a/tests/codim_one/mesh_bug.output +++ b/tests/codim_one/mesh_bug.output @@ -1,6 +1,7 @@ + 4 1 0 0 0 1 -1.25 0 -0.0195312 2 -1.25 0 -0.00976562 3 -1.09375 0.0288444 -0.0195312 4 -1.09375 0.0291878 -0.00976562 -1 10 quad 3 1 2 4 +1 10 quad 3 1 2 4 diff --git a/tests/codim_one/projection.cc b/tests/codim_one/projection.cc index c59014867c..8c7d354fa7 100644 --- a/tests/codim_one/projection.cc +++ b/tests/codim_one/projection.cc @@ -45,9 +45,6 @@ #include -std::ofstream logfile("output"); - - template void test(std::string filename, unsigned int n) @@ -78,7 +75,7 @@ test(std::string filename, unsigned int n) DataOut> dataout; dataout.add_data_vector(dof_handler, projected_one, "projection"); dataout.build_patches(); - dataout.write_vtk(logfile); + dataout.write_vtk(deallog.get_file_stream()); } @@ -86,7 +83,7 @@ test(std::string filename, unsigned int n) int main() { - deallog.attach(logfile); + initlog(); for (unsigned int n = 1; n < 5; n++) { diff --git a/tests/codim_one/projection_dgp.cc b/tests/codim_one/projection_dgp.cc index 20a0e267cf..9d70d69f25 100644 --- a/tests/codim_one/projection_dgp.cc +++ b/tests/codim_one/projection_dgp.cc @@ -46,9 +46,6 @@ #include -std::ofstream logfile("output"); - - template void test(std::string filename, unsigned int n) @@ -81,7 +78,7 @@ test(std::string filename, unsigned int n) dataout.attach_dof_handler(dof_handler); dataout.add_data_vector(interpolated_one, "numbering"); dataout.build_patches(); - dataout.write_vtk(logfile); + dataout.write_vtk(deallog.get_file_stream()); } @@ -89,7 +86,7 @@ test(std::string filename, unsigned int n) int main() { - deallog.attach(logfile); + initlog(); for (unsigned int n = 1; n < 5; n++) { diff --git a/tests/codim_one/renumber_component_wise_01.cc b/tests/codim_one/renumber_component_wise_01.cc index 8d7f1ce881..31f4a8eec4 100644 --- a/tests/codim_one/renumber_component_wise_01.cc +++ b/tests/codim_one/renumber_component_wise_01.cc @@ -33,8 +33,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - template void test(std::string filename) @@ -73,7 +71,7 @@ test(std::string filename) int main() { - deallog.attach(logfile); + initlog(); test<2, 3>(SOURCE_DIR "/grids/square.inp"); test<2, 3>(SOURCE_DIR "/grids/sphere_1.inp"); diff --git a/tests/codim_one/surface.cc b/tests/codim_one/surface.cc index 96e6d608bf..14d2f1e22a 100644 --- a/tests/codim_one/surface.cc +++ b/tests/codim_one/surface.cc @@ -37,8 +37,6 @@ #include -std::ofstream logfile("output"); - // Computes the area and the outer normals of circles and spheres // which are more and more refined, and prints the error on the // output. @@ -103,7 +101,7 @@ test(std::string filename) int main() { - deallog.attach(logfile); + initlog(); deallog << "Test <1,2>" << std::endl; test<1, 2>(SOURCE_DIR "/grids/circle_1.inp"); diff --git a/tests/codim_one/tensor_matrix_conversion.cc b/tests/codim_one/tensor_matrix_conversion.cc index f1b2b0d866..07a6f93713 100644 --- a/tests/codim_one/tensor_matrix_conversion.cc +++ b/tests/codim_one/tensor_matrix_conversion.cc @@ -25,9 +25,6 @@ #include -std::ofstream logfile("output"); - - template void fill_matrix(FullMatrix &A) @@ -74,7 +71,7 @@ void display_tensor_2(Tensor<2, b> &T) int main() { - deallog.attach(logfile); + initlog(); FullMatrix A1(10, 10); Tensor<2, 3> T1; diff --git a/tests/distributed_grids/2d_coarse_grid_01.cc b/tests/distributed_grids/2d_coarse_grid_01.cc index 42c358a7f4..a2ee0ad0fd 100644 --- a/tests/distributed_grids/2d_coarse_grid_01.cc +++ b/tests/distributed_grids/2d_coarse_grid_01.cc @@ -70,12 +70,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/2d_coarse_grid_02.cc b/tests/distributed_grids/2d_coarse_grid_02.cc index f20bf8419f..faebe85a0e 100644 --- a/tests/distributed_grids/2d_coarse_grid_02.cc +++ b/tests/distributed_grids/2d_coarse_grid_02.cc @@ -60,12 +60,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/2d_coarse_grid_03.cc b/tests/distributed_grids/2d_coarse_grid_03.cc index 8c91164aac..c496e88ef8 100644 --- a/tests/distributed_grids/2d_coarse_grid_03.cc +++ b/tests/distributed_grids/2d_coarse_grid_03.cc @@ -49,12 +49,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/2d_coarse_grid_04.cc b/tests/distributed_grids/2d_coarse_grid_04.cc index fe6d816215..e4ceb39b0a 100644 --- a/tests/distributed_grids/2d_coarse_grid_04.cc +++ b/tests/distributed_grids/2d_coarse_grid_04.cc @@ -47,12 +47,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/2d_coarse_grid_x_01.cc b/tests/distributed_grids/2d_coarse_grid_x_01.cc index d48151b1d8..a2690b8fff 100644 --- a/tests/distributed_grids/2d_coarse_grid_x_01.cc +++ b/tests/distributed_grids/2d_coarse_grid_x_01.cc @@ -80,12 +80,11 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); + initlog(); - std::ofstream logfile("output"); - deallog.attach(logfile); + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/2d_coarsening_01.cc b/tests/distributed_grids/2d_coarsening_01.cc index eb8208ceb2..965e3e05c9 100644 --- a/tests/distributed_grids/2d_coarsening_01.cc +++ b/tests/distributed_grids/2d_coarsening_01.cc @@ -52,12 +52,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/2d_coarsening_02.cc b/tests/distributed_grids/2d_coarsening_02.cc index 6abc3524b0..4cc2f7d636 100644 --- a/tests/distributed_grids/2d_coarsening_02.cc +++ b/tests/distributed_grids/2d_coarsening_02.cc @@ -121,12 +121,11 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); + initlog(); - std::ofstream logfile("output"); - deallog.attach(logfile); + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/2d_coarsening_03.cc b/tests/distributed_grids/2d_coarsening_03.cc index 9137b371b9..6f586513ca 100644 --- a/tests/distributed_grids/2d_coarsening_03.cc +++ b/tests/distributed_grids/2d_coarsening_03.cc @@ -182,12 +182,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/2d_coarsening_05.cc b/tests/distributed_grids/2d_coarsening_05.cc index 1261bb311a..68a5166c77 100644 --- a/tests/distributed_grids/2d_coarsening_05.cc +++ b/tests/distributed_grids/2d_coarsening_05.cc @@ -109,12 +109,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/2d_refinement_01.cc b/tests/distributed_grids/2d_refinement_01.cc index b36fc8e120..5aad076a93 100644 --- a/tests/distributed_grids/2d_refinement_01.cc +++ b/tests/distributed_grids/2d_refinement_01.cc @@ -50,12 +50,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/2d_refinement_02.cc b/tests/distributed_grids/2d_refinement_02.cc index 32d4f61c73..3b0b6d8441 100644 --- a/tests/distributed_grids/2d_refinement_02.cc +++ b/tests/distributed_grids/2d_refinement_02.cc @@ -108,12 +108,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/2d_refinement_03.cc b/tests/distributed_grids/2d_refinement_03.cc index bd9461c3aa..2026c63197 100644 --- a/tests/distributed_grids/2d_refinement_03.cc +++ b/tests/distributed_grids/2d_refinement_03.cc @@ -140,12 +140,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/2d_refinement_04.cc b/tests/distributed_grids/2d_refinement_04.cc index 7c074be460..252dcdf51f 100644 --- a/tests/distributed_grids/2d_refinement_04.cc +++ b/tests/distributed_grids/2d_refinement_04.cc @@ -73,12 +73,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/2d_refinement_05.cc b/tests/distributed_grids/2d_refinement_05.cc index 9617b11542..363e7dd8a9 100644 --- a/tests/distributed_grids/2d_refinement_05.cc +++ b/tests/distributed_grids/2d_refinement_05.cc @@ -97,12 +97,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/2d_refinement_06.cc b/tests/distributed_grids/2d_refinement_06.cc index d6514dc3ed..9cd21dc264 100644 --- a/tests/distributed_grids/2d_refinement_06.cc +++ b/tests/distributed_grids/2d_refinement_06.cc @@ -71,12 +71,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/2d_refinement_07.cc b/tests/distributed_grids/2d_refinement_07.cc index 67456aa87e..3bc474ca57 100644 --- a/tests/distributed_grids/2d_refinement_07.cc +++ b/tests/distributed_grids/2d_refinement_07.cc @@ -66,13 +66,11 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); deal_II_exceptions::disable_abort_on_exception(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/2d_refinement_10.cc b/tests/distributed_grids/2d_refinement_10.cc index 638f9988e1..25e697b4dd 100644 --- a/tests/distributed_grids/2d_refinement_10.cc +++ b/tests/distributed_grids/2d_refinement_10.cc @@ -116,11 +116,9 @@ main(int argc, char *argv[]) ExcMessage("Current code works properly only with one process.")); const unsigned int dim = 2; - std::ofstream logfile; if (I_am_host) { - logfile.open("output"); - deallog.attach(logfile); + initlog(); deallog.push("2d"); } diff --git a/tests/distributed_grids/3d_coarse_grid_01.cc b/tests/distributed_grids/3d_coarse_grid_01.cc index f65040cf30..997fceb332 100644 --- a/tests/distributed_grids/3d_coarse_grid_01.cc +++ b/tests/distributed_grids/3d_coarse_grid_01.cc @@ -70,12 +70,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/3d_coarse_grid_03.cc b/tests/distributed_grids/3d_coarse_grid_03.cc index b8f84735b0..554c243cb3 100644 --- a/tests/distributed_grids/3d_coarse_grid_03.cc +++ b/tests/distributed_grids/3d_coarse_grid_03.cc @@ -49,12 +49,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/3d_coarse_grid_04.cc b/tests/distributed_grids/3d_coarse_grid_04.cc index 0e72bcc734..bca4109b16 100644 --- a/tests/distributed_grids/3d_coarse_grid_04.cc +++ b/tests/distributed_grids/3d_coarse_grid_04.cc @@ -47,12 +47,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/3d_coarse_grid_05.cc b/tests/distributed_grids/3d_coarse_grid_05.cc index c62032ef69..087252c524 100644 --- a/tests/distributed_grids/3d_coarse_grid_05.cc +++ b/tests/distributed_grids/3d_coarse_grid_05.cc @@ -157,16 +157,14 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/3d_coarse_grid_06.cc b/tests/distributed_grids/3d_coarse_grid_06.cc index 34c6b47285..d6d7624b4f 100644 --- a/tests/distributed_grids/3d_coarse_grid_06.cc +++ b/tests/distributed_grids/3d_coarse_grid_06.cc @@ -48,12 +48,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/3d_coarse_grid_x_01.cc b/tests/distributed_grids/3d_coarse_grid_x_01.cc index 4dc6dd735c..ffa2423112 100644 --- a/tests/distributed_grids/3d_coarse_grid_x_01.cc +++ b/tests/distributed_grids/3d_coarse_grid_x_01.cc @@ -80,12 +80,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/3d_coarsening_01.cc b/tests/distributed_grids/3d_coarsening_01.cc index 4dfedc0ab0..d8044149c9 100644 --- a/tests/distributed_grids/3d_coarsening_01.cc +++ b/tests/distributed_grids/3d_coarsening_01.cc @@ -52,12 +52,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/3d_coarsening_02.cc b/tests/distributed_grids/3d_coarsening_02.cc index fbc48bf415..363877882b 100644 --- a/tests/distributed_grids/3d_coarsening_02.cc +++ b/tests/distributed_grids/3d_coarsening_02.cc @@ -122,12 +122,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/3d_coarsening_03.cc b/tests/distributed_grids/3d_coarsening_03.cc index cd33573fca..d351428b34 100644 --- a/tests/distributed_grids/3d_coarsening_03.cc +++ b/tests/distributed_grids/3d_coarsening_03.cc @@ -119,12 +119,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/3d_coarsening_04.cc b/tests/distributed_grids/3d_coarsening_04.cc index c01cef1e46..90743e5ce5 100644 --- a/tests/distributed_grids/3d_coarsening_04.cc +++ b/tests/distributed_grids/3d_coarsening_04.cc @@ -118,12 +118,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/3d_coarsening_05.cc b/tests/distributed_grids/3d_coarsening_05.cc index dcdbc8c6c7..75c4bc4103 100644 --- a/tests/distributed_grids/3d_coarsening_05.cc +++ b/tests/distributed_grids/3d_coarsening_05.cc @@ -109,12 +109,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/3d_refinement_01.cc b/tests/distributed_grids/3d_refinement_01.cc index 12ff4d6a12..774bbd390a 100644 --- a/tests/distributed_grids/3d_refinement_01.cc +++ b/tests/distributed_grids/3d_refinement_01.cc @@ -50,12 +50,11 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); + initlog(); - std::ofstream logfile("output"); - deallog.attach(logfile); + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/3d_refinement_02.cc b/tests/distributed_grids/3d_refinement_02.cc index e52ecca6ea..c6cd18798b 100644 --- a/tests/distributed_grids/3d_refinement_02.cc +++ b/tests/distributed_grids/3d_refinement_02.cc @@ -108,12 +108,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/3d_refinement_03.cc b/tests/distributed_grids/3d_refinement_03.cc index 1fcf4b5a50..b2af8ffbce 100644 --- a/tests/distributed_grids/3d_refinement_03.cc +++ b/tests/distributed_grids/3d_refinement_03.cc @@ -97,6 +97,7 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); #ifdef DEAL_II_WITH_MPI Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); #else @@ -104,10 +105,7 @@ main(int argc, char *argv[]) (void)argv; #endif - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/3d_refinement_04.cc b/tests/distributed_grids/3d_refinement_04.cc index 170594a55d..ecda3881a8 100644 --- a/tests/distributed_grids/3d_refinement_04.cc +++ b/tests/distributed_grids/3d_refinement_04.cc @@ -73,6 +73,7 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); #ifdef DEAL_II_WITH_MPI Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); #else @@ -80,10 +81,7 @@ main(int argc, char *argv[]) (void)argv; #endif - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/3d_refinement_05.cc b/tests/distributed_grids/3d_refinement_05.cc index 712bf448ee..b4ddbcd964 100644 --- a/tests/distributed_grids/3d_refinement_05.cc +++ b/tests/distributed_grids/3d_refinement_05.cc @@ -97,6 +97,7 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); #ifdef DEAL_II_WITH_MPI Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); #else @@ -104,10 +105,7 @@ main(int argc, char *argv[]) (void)argv; #endif - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/3d_refinement_06.cc b/tests/distributed_grids/3d_refinement_06.cc index 7bc4f38d76..65111464bb 100644 --- a/tests/distributed_grids/3d_refinement_06.cc +++ b/tests/distributed_grids/3d_refinement_06.cc @@ -86,6 +86,7 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); #ifdef DEAL_II_WITH_MPI Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); #else @@ -93,10 +94,7 @@ main(int argc, char *argv[]) (void)argv; #endif - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/3d_refinement_07.cc b/tests/distributed_grids/3d_refinement_07.cc index c024d42eb2..fceda6ad79 100644 --- a/tests/distributed_grids/3d_refinement_07.cc +++ b/tests/distributed_grids/3d_refinement_07.cc @@ -65,6 +65,7 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); #ifdef DEAL_II_WITH_MPI Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); #else @@ -72,10 +73,7 @@ main(int argc, char *argv[]) (void)argv; #endif - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/3d_refinement_08.cc b/tests/distributed_grids/3d_refinement_08.cc index eedede2805..6abed2c8d0 100644 --- a/tests/distributed_grids/3d_refinement_08.cc +++ b/tests/distributed_grids/3d_refinement_08.cc @@ -97,6 +97,7 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); #ifdef DEAL_II_WITH_MPI Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); #else @@ -104,8 +105,5 @@ main(int argc, char *argv[]) (void)argv; #endif - std::ofstream logfile("output"); - deallog.attach(logfile); - - test<3>(logfile); + test<3>(deallog.get_file_stream()); } diff --git a/tests/distributed_grids/3d_refinement_09.cc b/tests/distributed_grids/3d_refinement_09.cc index 39472e857e..ab25f19f21 100644 --- a/tests/distributed_grids/3d_refinement_09.cc +++ b/tests/distributed_grids/3d_refinement_09.cc @@ -66,13 +66,12 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); + deal_II_exceptions::disable_abort_on_exception(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/3d_refinement_12.cc b/tests/distributed_grids/3d_refinement_12.cc index 2760a0a33a..4d1fc27cc4 100644 --- a/tests/distributed_grids/3d_refinement_12.cc +++ b/tests/distributed_grids/3d_refinement_12.cc @@ -116,11 +116,9 @@ main(int argc, char *argv[]) ExcMessage("Current code works properly only with one process.")); const unsigned int dim = 3; - std::ofstream logfile; if (I_am_host) { - logfile.open("output"); - deallog.attach(logfile); + initlog(); deallog.push("3d"); } diff --git a/tests/distributed_grids/anisotropic.cc b/tests/distributed_grids/anisotropic.cc index 808f9bb092..3f09de1013 100644 --- a/tests/distributed_grids/anisotropic.cc +++ b/tests/distributed_grids/anisotropic.cc @@ -56,6 +56,8 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); + deal_II_exceptions::disable_abort_on_exception(); #ifdef DEAL_II_WITH_MPI @@ -65,13 +67,10 @@ main(int argc, char *argv[]) (void)argv; #endif - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); deallog.push("2d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/intergrid_transfer_representation_parallel.cc b/tests/distributed_grids/intergrid_transfer_representation_parallel.cc index d1502756d1..00cb10e7bc 100644 --- a/tests/distributed_grids/intergrid_transfer_representation_parallel.cc +++ b/tests/distributed_grids/intergrid_transfer_representation_parallel.cc @@ -40,8 +40,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - template void test(unsigned n_refinements) @@ -134,8 +132,7 @@ main(int argc, char *argv[]) if (rank == 0) { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); deallog.push("2d"); test<2>(n_refinements); diff --git a/tests/distributed_grids/solution_transfer_01.cc b/tests/distributed_grids/solution_transfer_01.cc index 2f98a0217b..59e9180e6e 100644 --- a/tests/distributed_grids/solution_transfer_01.cc +++ b/tests/distributed_grids/solution_transfer_01.cc @@ -79,6 +79,7 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); #ifdef DEAL_II_WITH_MPI Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); #else @@ -86,13 +87,10 @@ main(int argc, char *argv[]) (void)argv; #endif - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/solution_transfer_02.cc b/tests/distributed_grids/solution_transfer_02.cc index a29640225e..0d93aa7af8 100644 --- a/tests/distributed_grids/solution_transfer_02.cc +++ b/tests/distributed_grids/solution_transfer_02.cc @@ -114,6 +114,7 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); #ifdef DEAL_II_WITH_MPI Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); #else @@ -121,13 +122,10 @@ main(int argc, char *argv[]) (void)argv; #endif - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/solution_transfer_03.cc b/tests/distributed_grids/solution_transfer_03.cc index 3c17d5fe05..4a02929501 100644 --- a/tests/distributed_grids/solution_transfer_03.cc +++ b/tests/distributed_grids/solution_transfer_03.cc @@ -137,6 +137,7 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); #ifdef DEAL_II_WITH_MPI Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); #else @@ -144,13 +145,10 @@ main(int argc, char *argv[]) (void)argv; #endif - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/solution_transfer_04.cc b/tests/distributed_grids/solution_transfer_04.cc index a41b937958..815a271d27 100644 --- a/tests/distributed_grids/solution_transfer_04.cc +++ b/tests/distributed_grids/solution_transfer_04.cc @@ -103,15 +103,13 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); deallog.push("3d"); - test<3>(logfile); + test<3>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/distributed_grids/tria_settings_01.cc b/tests/distributed_grids/tria_settings_01.cc index 43f61da191..3458c52912 100644 --- a/tests/distributed_grids/tria_settings_01.cc +++ b/tests/distributed_grids/tria_settings_01.cc @@ -84,12 +84,10 @@ test(std::ostream & /*out*/) int main(int argc, char *argv[]) { + initlog(); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.push("2d"); - test<2>(logfile); + test<2>(deallog.get_file_stream()); deallog.pop(); } diff --git a/tests/hp/boundary_matrices.cc b/tests/hp/boundary_matrices.cc index 3d40fdeb87..73575c9026 100644 --- a/tests/hp/boundary_matrices.cc +++ b/tests/hp/boundary_matrices.cc @@ -141,10 +141,9 @@ check() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); + deallog.get_file_stream().setf(std::ios::fixed); deallog.push("2d"); check<2>(); diff --git a/tests/hp/boundary_matrices_hp.cc b/tests/hp/boundary_matrices_hp.cc index a6717ec54d..054be965d8 100644 --- a/tests/hp/boundary_matrices_hp.cc +++ b/tests/hp/boundary_matrices_hp.cc @@ -162,10 +162,9 @@ check() int main() { - std::ofstream logfile("output"); - logfile.precision(3); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); + deallog.get_file_stream().setf(std::ios::fixed); deallog.push("2d"); check<2>(); diff --git a/tests/hp/compare_hp_vs_nonhp_01.cc b/tests/hp/compare_hp_vs_nonhp_01.cc index 0a15919668..26a65d65ae 100644 --- a/tests/hp/compare_hp_vs_nonhp_01.cc +++ b/tests/hp/compare_hp_vs_nonhp_01.cc @@ -49,9 +49,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template class ExactSolution : public Function { @@ -412,11 +409,9 @@ test() int main() { - logfile.precision(2); + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); - test<1>(); test<2>(); test<3>(); diff --git a/tests/hp/continuous_1d_01.cc b/tests/hp/continuous_1d_01.cc index 777dd5fe75..d566bfe5b0 100644 --- a/tests/hp/continuous_1d_01.cc +++ b/tests/hp/continuous_1d_01.cc @@ -71,10 +71,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); diff --git a/tests/hp/continuous_2d_01.cc b/tests/hp/continuous_2d_01.cc index cd81096da6..9ce751e158 100644 --- a/tests/hp/continuous_2d_01.cc +++ b/tests/hp/continuous_2d_01.cc @@ -71,10 +71,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); diff --git a/tests/hp/continuous_3d_01.cc b/tests/hp/continuous_3d_01.cc index 6831d078e2..434eda0138 100644 --- a/tests/hp/continuous_3d_01.cc +++ b/tests/hp/continuous_3d_01.cc @@ -71,10 +71,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<3>(); diff --git a/tests/hp/count_dofs_per_block_01.cc b/tests/hp/count_dofs_per_block_01.cc index afd113eefe..0aa2f0b5a9 100644 --- a/tests/hp/count_dofs_per_block_01.cc +++ b/tests/hp/count_dofs_per_block_01.cc @@ -143,10 +143,8 @@ check() int main() { - std::ofstream logfile("output"); - logfile << std::setprecision(2); + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); check<1>(); check<2>(); diff --git a/tests/hp/count_dofs_per_block_02.cc b/tests/hp/count_dofs_per_block_02.cc index 2146dd8aef..bc6bc19470 100644 --- a/tests/hp/count_dofs_per_block_02.cc +++ b/tests/hp/count_dofs_per_block_02.cc @@ -143,10 +143,8 @@ check() int main() { - std::ofstream logfile("output"); - logfile << std::setprecision(2); + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); check<1>(); check<2>(); diff --git a/tests/hp/crash_01.cc b/tests/hp/crash_01.cc index 351ca5b7b4..e43a26077d 100644 --- a/tests/hp/crash_01.cc +++ b/tests/hp/crash_01.cc @@ -58,10 +58,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/crash_02.cc b/tests/hp/crash_02.cc index 00364cd8ff..de2beacf17 100644 --- a/tests/hp/crash_02.cc +++ b/tests/hp/crash_02.cc @@ -57,10 +57,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/crash_03.cc b/tests/hp/crash_03.cc index eb9098bcce..41751bc052 100644 --- a/tests/hp/crash_03.cc +++ b/tests/hp/crash_03.cc @@ -64,10 +64,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/crash_04.cc b/tests/hp/crash_04.cc index cb05882b12..5adf3dc57c 100644 --- a/tests/hp/crash_04.cc +++ b/tests/hp/crash_04.cc @@ -57,10 +57,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/crash_05.cc b/tests/hp/crash_05.cc index 8273994054..7077dc0016 100644 --- a/tests/hp/crash_05.cc +++ b/tests/hp/crash_05.cc @@ -83,10 +83,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/crash_06.cc b/tests/hp/crash_06.cc index 5fdc48e4b5..6b2a558d9c 100644 --- a/tests/hp/crash_06.cc +++ b/tests/hp/crash_06.cc @@ -105,10 +105,8 @@ test_with_wrong_face_orientation(const hp::FECollection<3> &fe) int main() { - std::ofstream logfile(logname); - logfile.precision(3); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); hp::FECollection<3> fe; for (unsigned int i = 0; i < 4; ++i) diff --git a/tests/hp/crash_07.cc b/tests/hp/crash_07.cc index 7b9edc2526..75e846c5f2 100644 --- a/tests/hp/crash_07.cc +++ b/tests/hp/crash_07.cc @@ -52,11 +52,8 @@ char logname[] = "output"; int main() { - std::ofstream logfile(logname); - logfile.precision(3); - - deallog.attach(logfile); - + initlog(); + deallog.get_file_stream().precision(3); std::vector> points_glob; std::vector> points; diff --git a/tests/hp/crash_08.cc b/tests/hp/crash_08.cc index 7cbbe57313..cb5ec78d7d 100644 --- a/tests/hp/crash_08.cc +++ b/tests/hp/crash_08.cc @@ -19,9 +19,6 @@ // constraint between degrees of freedom 3->14->17->6->3 with the algorithm // that is presently in make_hanging_node_constraints -char logname[] = "output"; - - #include #include @@ -53,10 +50,8 @@ char logname[] = "output"; int main() { - std::ofstream logfile(logname); - logfile.precision(3); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); // create a mesh like this: diff --git a/tests/hp/crash_09.cc b/tests/hp/crash_09.cc index 5701e66584..2b6f3f39a4 100644 --- a/tests/hp/crash_09.cc +++ b/tests/hp/crash_09.cc @@ -52,10 +52,8 @@ char logname[] = "output"; int main() { - std::ofstream logfile(logname); - logfile.precision(3); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); // create a mesh like this (viewed diff --git a/tests/hp/crash_10.cc b/tests/hp/crash_10.cc index 0a7bd2b563..8382f194c0 100644 --- a/tests/hp/crash_10.cc +++ b/tests/hp/crash_10.cc @@ -36,9 +36,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void test() @@ -101,9 +98,8 @@ test() int main() { - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); // this test depends on the right // starting value of the random diff --git a/tests/hp/crash_11.cc b/tests/hp/crash_11.cc index af5008c1f9..f57acbb964 100644 --- a/tests/hp/crash_11.cc +++ b/tests/hp/crash_11.cc @@ -18,9 +18,6 @@ // a test where a degree of freedom was constrained multiple times, // but with different weights. see the hp paper for more on this -char logname[] = "output"; - - #include #include @@ -52,11 +49,8 @@ char logname[] = "output"; int main() { - std::ofstream logfile(logname); - logfile.precision(3); - - deallog.attach(logfile); - + initlog(); + deallog.get_file_stream().precision(3); // create a mesh like this (viewed // from top): diff --git a/tests/hp/crash_12.cc b/tests/hp/crash_12.cc index 1a738df6d8..6f1c339e58 100644 --- a/tests/hp/crash_12.cc +++ b/tests/hp/crash_12.cc @@ -117,10 +117,8 @@ test() int main() { - std::ofstream logfile(logname); - logfile.precision(7); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(7); test<2>(); diff --git a/tests/hp/crash_14.cc b/tests/hp/crash_14.cc index e37b9199b1..3a6f97345c 100644 --- a/tests/hp/crash_14.cc +++ b/tests/hp/crash_14.cc @@ -114,10 +114,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/crash_15.cc b/tests/hp/crash_15.cc index 0204276906..c1f9687bca 100644 --- a/tests/hp/crash_15.cc +++ b/tests/hp/crash_15.cc @@ -127,10 +127,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/crash_16.cc b/tests/hp/crash_16.cc index 5078355460..d75145a4e6 100644 --- a/tests/hp/crash_16.cc +++ b/tests/hp/crash_16.cc @@ -138,10 +138,8 @@ test() int main() { - std::ofstream logfile(logname); - logfile.precision(3); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); test<3>(); } diff --git a/tests/hp/crash_17.cc b/tests/hp/crash_17.cc index 3a16a026d0..22ef021c9b 100644 --- a/tests/hp/crash_17.cc +++ b/tests/hp/crash_17.cc @@ -17,9 +17,6 @@ // a modified version of step-27 that crashes because of circular constraints. -char logname[] = "output"; - - #include #include #include @@ -674,11 +671,10 @@ LaplaceProblem::run() int main() { - std::ofstream logfile(logname); - logfile << std::setprecision(4); + initlog(); + deallog.get_file_stream().precision(4); deallog << std::setprecision(4); - deallog.attach(logfile); try { LaplaceProblem<3> laplace_problem_2d; diff --git a/tests/hp/crash_18.cc b/tests/hp/crash_18.cc index ebf0e0d0ac..483f5cd211 100644 --- a/tests/hp/crash_18.cc +++ b/tests/hp/crash_18.cc @@ -679,11 +679,9 @@ LaplaceProblem::run() int main() { - std::ofstream logfile(logname); - logfile.precision(3); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); try { LaplaceProblem<3> laplace_problem_2d; diff --git a/tests/hp/crash_19.cc b/tests/hp/crash_19.cc index b146c9ee5d..49108435cf 100644 --- a/tests/hp/crash_19.cc +++ b/tests/hp/crash_19.cc @@ -19,10 +19,6 @@ // used with hp::DoFHandler in 1d. Test that this is no longer the case -#include "../tests.h" -std::ofstream logfile("output"); - - #include #include #include @@ -58,6 +54,8 @@ std::ofstream logfile("output"); #include #include +#include "../tests.h" + template class ExactSolution : public Function @@ -118,11 +116,9 @@ main() { try { - logfile.precision(2); + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); - test<1>(); test<2>(); test<3>(); diff --git a/tests/hp/crash_20.cc b/tests/hp/crash_20.cc index c330fc00a4..a83e4b9c31 100644 --- a/tests/hp/crash_20.cc +++ b/tests/hp/crash_20.cc @@ -63,10 +63,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/crash_21.cc b/tests/hp/crash_21.cc index d88bb4a127..882775c698 100644 --- a/tests/hp/crash_21.cc +++ b/tests/hp/crash_21.cc @@ -158,10 +158,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/create_laplace_matrix_03.cc b/tests/hp/create_laplace_matrix_03.cc index 0eba53d967..4629dd1e55 100644 --- a/tests/hp/create_laplace_matrix_03.cc +++ b/tests/hp/create_laplace_matrix_03.cc @@ -144,10 +144,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/create_laplace_matrix_03b.cc b/tests/hp/create_laplace_matrix_03b.cc index dadabc2dcc..9cde4cd304 100644 --- a/tests/hp/create_laplace_matrix_03b.cc +++ b/tests/hp/create_laplace_matrix_03b.cc @@ -137,10 +137,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/create_laplace_matrix_04.cc b/tests/hp/create_laplace_matrix_04.cc index 4292b80bc2..8873bc5c50 100644 --- a/tests/hp/create_laplace_matrix_04.cc +++ b/tests/hp/create_laplace_matrix_04.cc @@ -151,10 +151,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/create_laplace_matrix_04b.cc b/tests/hp/create_laplace_matrix_04b.cc index 116fc56305..2acea70da1 100644 --- a/tests/hp/create_laplace_matrix_04b.cc +++ b/tests/hp/create_laplace_matrix_04b.cc @@ -144,10 +144,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/create_laplace_matrix_constraints_02.cc b/tests/hp/create_laplace_matrix_constraints_02.cc index d4d16ee4e6..90f95cd323 100644 --- a/tests/hp/create_laplace_matrix_constraints_02.cc +++ b/tests/hp/create_laplace_matrix_constraints_02.cc @@ -150,9 +150,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/create_laplace_matrix_constraints_02b.cc b/tests/hp/create_laplace_matrix_constraints_02b.cc index f119709809..459d3fc57c 100644 --- a/tests/hp/create_laplace_matrix_constraints_02b.cc +++ b/tests/hp/create_laplace_matrix_constraints_02b.cc @@ -139,9 +139,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/create_mass_matrix_01.cc b/tests/hp/create_mass_matrix_01.cc index 77200dce17..a969e345ab 100644 --- a/tests/hp/create_mass_matrix_01.cc +++ b/tests/hp/create_mass_matrix_01.cc @@ -143,10 +143,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/create_mass_matrix_01b.cc b/tests/hp/create_mass_matrix_01b.cc index 8738b57ad3..02c140564d 100644 --- a/tests/hp/create_mass_matrix_01b.cc +++ b/tests/hp/create_mass_matrix_01b.cc @@ -134,10 +134,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/create_mass_matrix_02.cc b/tests/hp/create_mass_matrix_02.cc index e8b7d1b669..843685c439 100644 --- a/tests/hp/create_mass_matrix_02.cc +++ b/tests/hp/create_mass_matrix_02.cc @@ -150,10 +150,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/create_mass_matrix_02b.cc b/tests/hp/create_mass_matrix_02b.cc index 4c9158c9d7..f7cdd50a14 100644 --- a/tests/hp/create_mass_matrix_02b.cc +++ b/tests/hp/create_mass_matrix_02b.cc @@ -141,10 +141,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/create_mass_matrix_03.cc b/tests/hp/create_mass_matrix_03.cc index bb015547e7..829bfd03eb 100644 --- a/tests/hp/create_mass_matrix_03.cc +++ b/tests/hp/create_mass_matrix_03.cc @@ -144,10 +144,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/create_mass_matrix_03b.cc b/tests/hp/create_mass_matrix_03b.cc index 12b7cc614b..10091ed8b5 100644 --- a/tests/hp/create_mass_matrix_03b.cc +++ b/tests/hp/create_mass_matrix_03b.cc @@ -139,10 +139,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/create_mass_matrix_04.cc b/tests/hp/create_mass_matrix_04.cc index 182760d267..fdf72d4bc2 100644 --- a/tests/hp/create_mass_matrix_04.cc +++ b/tests/hp/create_mass_matrix_04.cc @@ -151,10 +151,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/create_mass_matrix_04b.cc b/tests/hp/create_mass_matrix_04b.cc index afda482723..22232d4ec6 100644 --- a/tests/hp/create_mass_matrix_04b.cc +++ b/tests/hp/create_mass_matrix_04b.cc @@ -144,10 +144,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/create_mass_matrix_05.cc b/tests/hp/create_mass_matrix_05.cc index 2b26917c03..23aba4c6d2 100644 --- a/tests/hp/create_mass_matrix_05.cc +++ b/tests/hp/create_mass_matrix_05.cc @@ -140,10 +140,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("2d"); check<2>(); diff --git a/tests/hp/create_mass_matrix_constraints_02.cc b/tests/hp/create_mass_matrix_constraints_02.cc index f78fe7ba85..e901dc12da 100644 --- a/tests/hp/create_mass_matrix_constraints_02.cc +++ b/tests/hp/create_mass_matrix_constraints_02.cc @@ -150,9 +150,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/create_mass_matrix_constraints_02b.cc b/tests/hp/create_mass_matrix_constraints_02b.cc index ca526172f6..db1cef1c52 100644 --- a/tests/hp/create_mass_matrix_constraints_02b.cc +++ b/tests/hp/create_mass_matrix_constraints_02b.cc @@ -139,9 +139,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/create_rhs_01.cc b/tests/hp/create_rhs_01.cc index ca87c0b223..d4bb0251a0 100644 --- a/tests/hp/create_rhs_01.cc +++ b/tests/hp/create_rhs_01.cc @@ -113,12 +113,9 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); - test(); deallog << "OK" << std::endl; diff --git a/tests/hp/dof_renumbering_04.cc b/tests/hp/dof_renumbering_04.cc index 8b29c828de..b3fd2ea661 100644 --- a/tests/hp/dof_renumbering_04.cc +++ b/tests/hp/dof_renumbering_04.cc @@ -119,10 +119,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/dof_renumbering_05.cc b/tests/hp/dof_renumbering_05.cc index 60a918fca2..ee6916366f 100644 --- a/tests/hp/dof_renumbering_05.cc +++ b/tests/hp/dof_renumbering_05.cc @@ -119,10 +119,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/dof_renumbering_06.cc b/tests/hp/dof_renumbering_06.cc index e42723b2b7..b950b2b516 100644 --- a/tests/hp/dof_renumbering_06.cc +++ b/tests/hp/dof_renumbering_06.cc @@ -119,10 +119,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/fe_collection_01.cc b/tests/hp/fe_collection_01.cc index b61ab8e9f2..4cf7423dc8 100644 --- a/tests/hp/fe_collection_01.cc +++ b/tests/hp/fe_collection_01.cc @@ -49,10 +49,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/fe_collection_02.cc b/tests/hp/fe_collection_02.cc index 8a328ae485..6e58e64e95 100644 --- a/tests/hp/fe_collection_02.cc +++ b/tests/hp/fe_collection_02.cc @@ -59,10 +59,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/fe_collection_03.cc b/tests/hp/fe_collection_03.cc index 98bc92c3b8..a335717709 100644 --- a/tests/hp/fe_collection_03.cc +++ b/tests/hp/fe_collection_03.cc @@ -63,10 +63,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/fe_collection_04.cc b/tests/hp/fe_collection_04.cc index b80a96e756..1e76a66e02 100644 --- a/tests/hp/fe_collection_04.cc +++ b/tests/hp/fe_collection_04.cc @@ -66,10 +66,8 @@ main() { deal_II_exceptions::disable_abort_on_exception(); - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/fe_collection_05.cc b/tests/hp/fe_collection_05.cc index c4c4e33e4f..af047f07dd 100644 --- a/tests/hp/fe_collection_05.cc +++ b/tests/hp/fe_collection_05.cc @@ -162,10 +162,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/fe_nothing_01.cc b/tests/hp/fe_nothing_01.cc index 51c0fd1078..bf2163bc51 100644 --- a/tests/hp/fe_nothing_01.cc +++ b/tests/hp/fe_nothing_01.cc @@ -88,10 +88,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/fe_nothing_02.cc b/tests/hp/fe_nothing_02.cc index 6d21867b7e..e42cafd7aa 100644 --- a/tests/hp/fe_nothing_02.cc +++ b/tests/hp/fe_nothing_02.cc @@ -128,10 +128,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/fe_nothing_03.cc b/tests/hp/fe_nothing_03.cc index a15b81a304..361da870ab 100644 --- a/tests/hp/fe_nothing_03.cc +++ b/tests/hp/fe_nothing_03.cc @@ -101,10 +101,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/fe_nothing_05.cc b/tests/hp/fe_nothing_05.cc index 6066d23788..44bb61fad6 100644 --- a/tests/hp/fe_nothing_05.cc +++ b/tests/hp/fe_nothing_05.cc @@ -151,10 +151,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); deallog << "Try dim == 1" << std::flush << std::endl; test<1>(); diff --git a/tests/hp/fe_nothing_06.cc b/tests/hp/fe_nothing_06.cc index c525e421a0..51293a4fc5 100644 --- a/tests/hp/fe_nothing_06.cc +++ b/tests/hp/fe_nothing_06.cc @@ -153,10 +153,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); deallog << "Try dim == 1" << std::flush << std::endl; test<1>(); diff --git a/tests/hp/fe_nothing_07.cc b/tests/hp/fe_nothing_07.cc index cb3f8f5d0e..be2a2f52d3 100644 --- a/tests/hp/fe_nothing_07.cc +++ b/tests/hp/fe_nothing_07.cc @@ -185,10 +185,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); deallog << "Try dim == 1" << std::flush << std::endl; test<1>(); diff --git a/tests/hp/fe_nothing_08.cc b/tests/hp/fe_nothing_08.cc index ee66245275..5ff15dcef1 100644 --- a/tests/hp/fe_nothing_08.cc +++ b/tests/hp/fe_nothing_08.cc @@ -86,10 +86,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/fe_nothing_09.cc b/tests/hp/fe_nothing_09.cc index 33575702da..e42d7804b4 100644 --- a/tests/hp/fe_nothing_09.cc +++ b/tests/hp/fe_nothing_09.cc @@ -88,10 +88,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/fe_nothing_10.cc b/tests/hp/fe_nothing_10.cc index 1302a35b02..3ad9074485 100644 --- a/tests/hp/fe_nothing_10.cc +++ b/tests/hp/fe_nothing_10.cc @@ -45,10 +45,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/fe_nothing_11.cc b/tests/hp/fe_nothing_11.cc index 66d2eb64f2..6af89e0d00 100644 --- a/tests/hp/fe_nothing_11.cc +++ b/tests/hp/fe_nothing_11.cc @@ -88,10 +88,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/fe_nothing_12.cc b/tests/hp/fe_nothing_12.cc index f65bfde681..9eb618d1e2 100644 --- a/tests/hp/fe_nothing_12.cc +++ b/tests/hp/fe_nothing_12.cc @@ -119,10 +119,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); diff --git a/tests/hp/fe_nothing_13.cc b/tests/hp/fe_nothing_13.cc index 140b10c504..d4c3265a0a 100644 --- a/tests/hp/fe_nothing_13.cc +++ b/tests/hp/fe_nothing_13.cc @@ -124,10 +124,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); diff --git a/tests/hp/fe_nothing_14.cc b/tests/hp/fe_nothing_14.cc index 262a639c8a..8eb0747691 100644 --- a/tests/hp/fe_nothing_14.cc +++ b/tests/hp/fe_nothing_14.cc @@ -139,10 +139,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(3); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); test<2>(); diff --git a/tests/hp/fe_nothing_15.cc b/tests/hp/fe_nothing_15.cc index 4eaf9648a5..c06f942dfb 100644 --- a/tests/hp/fe_nothing_15.cc +++ b/tests/hp/fe_nothing_15.cc @@ -68,10 +68,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); deallog << "Try dim == 1" << std::flush << std::endl; test<1>(); diff --git a/tests/hp/fe_nothing_16.cc b/tests/hp/fe_nothing_16.cc index 7c0086e066..93c7900184 100644 --- a/tests/hp/fe_nothing_16.cc +++ b/tests/hp/fe_nothing_16.cc @@ -80,10 +80,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); diff --git a/tests/hp/fe_nothing_17.cc b/tests/hp/fe_nothing_17.cc index c01e005b29..86a7db660f 100644 --- a/tests/hp/fe_nothing_17.cc +++ b/tests/hp/fe_nothing_17.cc @@ -109,15 +109,14 @@ transfer(std::ostream &out) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); deallog << " 1D solution transfer" << std::endl; - transfer<1>(logfile); + transfer<1>(deallog.get_file_stream()); deallog << " 2D solution transfer" << std::endl; - transfer<2>(logfile); + transfer<2>(deallog.get_file_stream()); deallog << " 3D solution transfer" << std::endl; - transfer<3>(logfile); + transfer<3>(deallog.get_file_stream()); } diff --git a/tests/hp/flux_sparsity.cc b/tests/hp/flux_sparsity.cc index 88848946de..4fc2bd6da3 100644 --- a/tests/hp/flux_sparsity.cc +++ b/tests/hp/flux_sparsity.cc @@ -132,8 +132,7 @@ check() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); deallog.push("2d"); check<2>(); diff --git a/tests/hp/get_active_fe_indices.cc b/tests/hp/get_active_fe_indices.cc index b6190d6e67..55eb5db8b7 100644 --- a/tests/hp/get_active_fe_indices.cc +++ b/tests/hp/get_active_fe_indices.cc @@ -73,10 +73,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/get_interpolated_dof_values_01.cc b/tests/hp/get_interpolated_dof_values_01.cc index 36ea801048..ffe8737520 100644 --- a/tests/hp/get_interpolated_dof_values_01.cc +++ b/tests/hp/get_interpolated_dof_values_01.cc @@ -104,10 +104,9 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(PRECISION); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(PRECISION); + deallog.get_file_stream().setf(std::ios::fixed); deal_II_exceptions::disable_abort_on_exception(); diff --git a/tests/hp/get_interpolated_dof_values_03.cc b/tests/hp/get_interpolated_dof_values_03.cc index b1345e4e86..c0582e13e5 100644 --- a/tests/hp/get_interpolated_dof_values_03.cc +++ b/tests/hp/get_interpolated_dof_values_03.cc @@ -102,10 +102,9 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(1); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(1); + deallog.get_file_stream().setf(std::ios::fixed); test<1>(); test<2>(); diff --git a/tests/hp/hp_constraints_common.h b/tests/hp/hp_constraints_common.h index 73b13df47a..aadaeab422 100644 --- a/tests/hp/hp_constraints_common.h +++ b/tests/hp/hp_constraints_common.h @@ -472,11 +472,8 @@ test_interpolation(const hp::FECollection & fe, int main() { - std::ofstream logfile(logname); - logfile.precision(7); - - deallog.attach(logfile); - deallog.depth_console(0); + initlog(); + deallog.get_file_stream().precision(7); test<1>(); test<2>(); diff --git a/tests/hp/hp_constraints_common_no_support.h b/tests/hp/hp_constraints_common_no_support.h index 1aa7be3f69..cf5b6d4373 100644 --- a/tests/hp/hp_constraints_common_no_support.h +++ b/tests/hp/hp_constraints_common_no_support.h @@ -472,11 +472,8 @@ test_interpolation(const hp::FECollection & fe, int main() { - std::ofstream logfile(logname); - logfile.precision(7); - - deallog.attach(logfile); - deallog.depth_console(0); + initlog(); + deallog.get_file_stream().precision(7); test<1>(); test<2>(); diff --git a/tests/hp/hp_constraints_neither_dominate_01.cc b/tests/hp/hp_constraints_neither_dominate_01.cc index 600c05c04e..7fea1bbee0 100644 --- a/tests/hp/hp_constraints_neither_dominate_01.cc +++ b/tests/hp/hp_constraints_neither_dominate_01.cc @@ -219,11 +219,9 @@ test2cells(const unsigned int p1 = 2, const unsigned int p2 = 1) int main(int argc, char **argv) { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(4); deallog << std::fixed; - deallog.attach(logfile); - try { diff --git a/tests/hp/hp_constraints_neither_dominate_02.cc b/tests/hp/hp_constraints_neither_dominate_02.cc index 08469d737f..f25e9367dd 100644 --- a/tests/hp/hp_constraints_neither_dominate_02.cc +++ b/tests/hp/hp_constraints_neither_dominate_02.cc @@ -309,11 +309,9 @@ test2cells(const FiniteElement &fe_0, int main(int argc, char **argv) { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(4); deallog << std::fixed; - deallog.attach(logfile); - try { diff --git a/tests/hp/hp_hanging_nodes_01.cc b/tests/hp/hp_hanging_nodes_01.cc index 2e860cd4be..b1fb63391e 100644 --- a/tests/hp/hp_hanging_nodes_01.cc +++ b/tests/hp/hp_hanging_nodes_01.cc @@ -157,10 +157,8 @@ test_constraints_old(FiniteElement &fe) int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); FE_Q<2> fe_1(1); FE_Q<2> fe_2(2); diff --git a/tests/hp/hp_hanging_nodes_02.cc b/tests/hp/hp_hanging_nodes_02.cc index 52dcc7fa0d..4adf3a949c 100644 --- a/tests/hp/hp_hanging_nodes_02.cc +++ b/tests/hp/hp_hanging_nodes_02.cc @@ -50,9 +50,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template void run(bool random_p, unsigned int *indx) @@ -136,9 +133,8 @@ run_test(unsigned int *indx) int main() { - logfile.precision(8); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(8); unsigned int index[] = {1, 2, 3, 4, 5, 6, 7}; diff --git a/tests/hp/hp_line_dof_identities_dgp.cc b/tests/hp/hp_line_dof_identities_dgp.cc index 3fa72bc4fc..77f9763494 100644 --- a/tests/hp/hp_line_dof_identities_dgp.cc +++ b/tests/hp/hp_line_dof_identities_dgp.cc @@ -62,10 +62,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_line_dof_identities_dgp_monomial.cc b/tests/hp/hp_line_dof_identities_dgp_monomial.cc index b7cda8716e..e15126fdf9 100644 --- a/tests/hp/hp_line_dof_identities_dgp_monomial.cc +++ b/tests/hp/hp_line_dof_identities_dgp_monomial.cc @@ -62,10 +62,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_line_dof_identities_dgp_monomial_system_01.cc b/tests/hp/hp_line_dof_identities_dgp_monomial_system_01.cc index d54a5dbb36..823679167f 100644 --- a/tests/hp/hp_line_dof_identities_dgp_monomial_system_01.cc +++ b/tests/hp/hp_line_dof_identities_dgp_monomial_system_01.cc @@ -63,10 +63,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_line_dof_identities_dgp_monomial_system_02.cc b/tests/hp/hp_line_dof_identities_dgp_monomial_system_02.cc index d107f8b279..25c848021f 100644 --- a/tests/hp/hp_line_dof_identities_dgp_monomial_system_02.cc +++ b/tests/hp/hp_line_dof_identities_dgp_monomial_system_02.cc @@ -84,10 +84,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_line_dof_identities_dgp_nonparametric.cc b/tests/hp/hp_line_dof_identities_dgp_nonparametric.cc index 633fc47f85..7c937c5bef 100644 --- a/tests/hp/hp_line_dof_identities_dgp_nonparametric.cc +++ b/tests/hp/hp_line_dof_identities_dgp_nonparametric.cc @@ -62,10 +62,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_line_dof_identities_dgp_nonparametric_system_01.cc b/tests/hp/hp_line_dof_identities_dgp_nonparametric_system_01.cc index b66caedaf3..d1c4f40db4 100644 --- a/tests/hp/hp_line_dof_identities_dgp_nonparametric_system_01.cc +++ b/tests/hp/hp_line_dof_identities_dgp_nonparametric_system_01.cc @@ -63,10 +63,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_line_dof_identities_dgp_nonparametric_system_02.cc b/tests/hp/hp_line_dof_identities_dgp_nonparametric_system_02.cc index 37f448833a..e81ba01ce2 100644 --- a/tests/hp/hp_line_dof_identities_dgp_nonparametric_system_02.cc +++ b/tests/hp/hp_line_dof_identities_dgp_nonparametric_system_02.cc @@ -86,10 +86,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_line_dof_identities_dgp_system_01.cc b/tests/hp/hp_line_dof_identities_dgp_system_01.cc index 6dea58dce7..0275811ad7 100644 --- a/tests/hp/hp_line_dof_identities_dgp_system_01.cc +++ b/tests/hp/hp_line_dof_identities_dgp_system_01.cc @@ -63,10 +63,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_line_dof_identities_dgp_system_02.cc b/tests/hp/hp_line_dof_identities_dgp_system_02.cc index e74af12ec9..3cf6b1af41 100644 --- a/tests/hp/hp_line_dof_identities_dgp_system_02.cc +++ b/tests/hp/hp_line_dof_identities_dgp_system_02.cc @@ -84,10 +84,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_line_dof_identities_dgq.cc b/tests/hp/hp_line_dof_identities_dgq.cc index f2b46b2dec..c3b31609ae 100644 --- a/tests/hp/hp_line_dof_identities_dgq.cc +++ b/tests/hp/hp_line_dof_identities_dgq.cc @@ -62,10 +62,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_line_dof_identities_dgq_system_01.cc b/tests/hp/hp_line_dof_identities_dgq_system_01.cc index 49a5c9693e..999b819136 100644 --- a/tests/hp/hp_line_dof_identities_dgq_system_01.cc +++ b/tests/hp/hp_line_dof_identities_dgq_system_01.cc @@ -63,10 +63,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_line_dof_identities_dgq_system_02.cc b/tests/hp/hp_line_dof_identities_dgq_system_02.cc index 2473b45020..f9d265f712 100644 --- a/tests/hp/hp_line_dof_identities_dgq_system_02.cc +++ b/tests/hp/hp_line_dof_identities_dgq_system_02.cc @@ -84,10 +84,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_line_dof_identities_q.cc b/tests/hp/hp_line_dof_identities_q.cc index 765db3f065..492c6ecbda 100644 --- a/tests/hp/hp_line_dof_identities_q.cc +++ b/tests/hp/hp_line_dof_identities_q.cc @@ -64,10 +64,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_line_dof_identities_q_gl.cc b/tests/hp/hp_line_dof_identities_q_gl.cc index 4ae4f691d0..f4d11d5f4f 100644 --- a/tests/hp/hp_line_dof_identities_q_gl.cc +++ b/tests/hp/hp_line_dof_identities_q_gl.cc @@ -64,10 +64,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_line_dof_identities_q_system_01.cc b/tests/hp/hp_line_dof_identities_q_system_01.cc index 4beb20b240..27d90b9779 100644 --- a/tests/hp/hp_line_dof_identities_q_system_01.cc +++ b/tests/hp/hp_line_dof_identities_q_system_01.cc @@ -66,10 +66,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_line_dof_identities_q_system_02.cc b/tests/hp/hp_line_dof_identities_q_system_02.cc index 600a52bbaf..b068e72cd0 100644 --- a/tests/hp/hp_line_dof_identities_q_system_02.cc +++ b/tests/hp/hp_line_dof_identities_q_system_02.cc @@ -93,10 +93,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_line_dof_identities_q_system_03.cc b/tests/hp/hp_line_dof_identities_q_system_03.cc index baa54863c5..af164c19b3 100644 --- a/tests/hp/hp_line_dof_identities_q_system_03.cc +++ b/tests/hp/hp_line_dof_identities_q_system_03.cc @@ -71,10 +71,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_line_dof_identities_rt_nodal.cc b/tests/hp/hp_line_dof_identities_rt_nodal.cc index 0db59c4a16..d6d9ecbaa9 100644 --- a/tests/hp/hp_line_dof_identities_rt_nodal.cc +++ b/tests/hp/hp_line_dof_identities_rt_nodal.cc @@ -62,10 +62,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/hp_q_hierarchical_constraints.cc b/tests/hp/hp_q_hierarchical_constraints.cc index b31e2e7330..b0e001cbf6 100644 --- a/tests/hp/hp_q_hierarchical_constraints.cc +++ b/tests/hp/hp_q_hierarchical_constraints.cc @@ -133,8 +133,7 @@ test(const bool apply_constrains, const unsigned int hp) int main(int argc, char *argv[]) { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test<2>(true, 0); test<2>(true, 1); diff --git a/tests/hp/hp_quad_dof_identities_dgp.cc b/tests/hp/hp_quad_dof_identities_dgp.cc index a0284e7dfa..0ef9411cb9 100644 --- a/tests/hp/hp_quad_dof_identities_dgp.cc +++ b/tests/hp/hp_quad_dof_identities_dgp.cc @@ -62,10 +62,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/hp_quad_dof_identities_dgp_monomial.cc b/tests/hp/hp_quad_dof_identities_dgp_monomial.cc index dec36daee1..6fce363877 100644 --- a/tests/hp/hp_quad_dof_identities_dgp_monomial.cc +++ b/tests/hp/hp_quad_dof_identities_dgp_monomial.cc @@ -62,10 +62,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/hp_quad_dof_identities_dgp_monomial_system_01.cc b/tests/hp/hp_quad_dof_identities_dgp_monomial_system_01.cc index d9e1e54ac1..85842eebc7 100644 --- a/tests/hp/hp_quad_dof_identities_dgp_monomial_system_01.cc +++ b/tests/hp/hp_quad_dof_identities_dgp_monomial_system_01.cc @@ -63,10 +63,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/hp_quad_dof_identities_dgp_monomial_system_02.cc b/tests/hp/hp_quad_dof_identities_dgp_monomial_system_02.cc index c8a033f3d0..e179cd5bb1 100644 --- a/tests/hp/hp_quad_dof_identities_dgp_monomial_system_02.cc +++ b/tests/hp/hp_quad_dof_identities_dgp_monomial_system_02.cc @@ -73,10 +73,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/hp_quad_dof_identities_dgp_nonparametric.cc b/tests/hp/hp_quad_dof_identities_dgp_nonparametric.cc index e57cddb8a3..7187dac811 100644 --- a/tests/hp/hp_quad_dof_identities_dgp_nonparametric.cc +++ b/tests/hp/hp_quad_dof_identities_dgp_nonparametric.cc @@ -62,10 +62,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/hp_quad_dof_identities_dgp_nonparametric_system_01.cc b/tests/hp/hp_quad_dof_identities_dgp_nonparametric_system_01.cc index a96f25245b..29a1ebc1e1 100644 --- a/tests/hp/hp_quad_dof_identities_dgp_nonparametric_system_01.cc +++ b/tests/hp/hp_quad_dof_identities_dgp_nonparametric_system_01.cc @@ -63,10 +63,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/hp_quad_dof_identities_dgp_nonparametric_system_02.cc b/tests/hp/hp_quad_dof_identities_dgp_nonparametric_system_02.cc index 4e9046f794..6da8a369ab 100644 --- a/tests/hp/hp_quad_dof_identities_dgp_nonparametric_system_02.cc +++ b/tests/hp/hp_quad_dof_identities_dgp_nonparametric_system_02.cc @@ -74,10 +74,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/hp_quad_dof_identities_dgp_system_01.cc b/tests/hp/hp_quad_dof_identities_dgp_system_01.cc index ec322d01fc..c8bae11563 100644 --- a/tests/hp/hp_quad_dof_identities_dgp_system_01.cc +++ b/tests/hp/hp_quad_dof_identities_dgp_system_01.cc @@ -63,10 +63,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/hp_quad_dof_identities_dgp_system_02.cc b/tests/hp/hp_quad_dof_identities_dgp_system_02.cc index 1fa198f760..cb4ca92005 100644 --- a/tests/hp/hp_quad_dof_identities_dgp_system_02.cc +++ b/tests/hp/hp_quad_dof_identities_dgp_system_02.cc @@ -73,10 +73,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/hp_quad_dof_identities_dgq.cc b/tests/hp/hp_quad_dof_identities_dgq.cc index e6aa290f9c..ebc6bdb298 100644 --- a/tests/hp/hp_quad_dof_identities_dgq.cc +++ b/tests/hp/hp_quad_dof_identities_dgq.cc @@ -62,10 +62,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/hp_quad_dof_identities_dgq_system_01.cc b/tests/hp/hp_quad_dof_identities_dgq_system_01.cc index 7783a82c6f..9bbdef5578 100644 --- a/tests/hp/hp_quad_dof_identities_dgq_system_01.cc +++ b/tests/hp/hp_quad_dof_identities_dgq_system_01.cc @@ -63,10 +63,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/hp_quad_dof_identities_dgq_system_02.cc b/tests/hp/hp_quad_dof_identities_dgq_system_02.cc index 9706fbee9a..b4353c5ba4 100644 --- a/tests/hp/hp_quad_dof_identities_dgq_system_02.cc +++ b/tests/hp/hp_quad_dof_identities_dgq_system_02.cc @@ -73,10 +73,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/hp_quad_dof_identities_q.cc b/tests/hp/hp_quad_dof_identities_q.cc index de466ce601..e6707d524a 100644 --- a/tests/hp/hp_quad_dof_identities_q.cc +++ b/tests/hp/hp_quad_dof_identities_q.cc @@ -62,10 +62,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/hp_quad_dof_identities_q_gl.cc b/tests/hp/hp_quad_dof_identities_q_gl.cc index 89ba55847c..ecb4c2b764 100644 --- a/tests/hp/hp_quad_dof_identities_q_gl.cc +++ b/tests/hp/hp_quad_dof_identities_q_gl.cc @@ -64,10 +64,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/hp_quad_dof_identities_q_system_01.cc b/tests/hp/hp_quad_dof_identities_q_system_01.cc index 98e8205c07..cccecfb230 100644 --- a/tests/hp/hp_quad_dof_identities_q_system_01.cc +++ b/tests/hp/hp_quad_dof_identities_q_system_01.cc @@ -63,10 +63,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/hp_quad_dof_identities_q_system_02.cc b/tests/hp/hp_quad_dof_identities_q_system_02.cc index b57a2fc230..974663fee8 100644 --- a/tests/hp/hp_quad_dof_identities_q_system_02.cc +++ b/tests/hp/hp_quad_dof_identities_q_system_02.cc @@ -71,10 +71,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/hp_quad_dof_identities_rt_nodal.cc b/tests/hp/hp_quad_dof_identities_rt_nodal.cc index 3e9714e656..ce4a56ca37 100644 --- a/tests/hp/hp_quad_dof_identities_rt_nodal.cc +++ b/tests/hp/hp_quad_dof_identities_rt_nodal.cc @@ -62,10 +62,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/hp_vertex_dof_identities_dgp.cc b/tests/hp/hp_vertex_dof_identities_dgp.cc index eb3901c0a4..f38afdcb7c 100644 --- a/tests/hp/hp_vertex_dof_identities_dgp.cc +++ b/tests/hp/hp_vertex_dof_identities_dgp.cc @@ -62,10 +62,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_vertex_dof_identities_dgp_monomial.cc b/tests/hp/hp_vertex_dof_identities_dgp_monomial.cc index f64b242a5c..dd47910115 100644 --- a/tests/hp/hp_vertex_dof_identities_dgp_monomial.cc +++ b/tests/hp/hp_vertex_dof_identities_dgp_monomial.cc @@ -62,10 +62,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_vertex_dof_identities_dgp_monomial_system_01.cc b/tests/hp/hp_vertex_dof_identities_dgp_monomial_system_01.cc index 3441e552f3..78fa4f900f 100644 --- a/tests/hp/hp_vertex_dof_identities_dgp_monomial_system_01.cc +++ b/tests/hp/hp_vertex_dof_identities_dgp_monomial_system_01.cc @@ -63,10 +63,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_vertex_dof_identities_dgp_monomial_system_02.cc b/tests/hp/hp_vertex_dof_identities_dgp_monomial_system_02.cc index f2450f1a2e..f7bbcac6c5 100644 --- a/tests/hp/hp_vertex_dof_identities_dgp_monomial_system_02.cc +++ b/tests/hp/hp_vertex_dof_identities_dgp_monomial_system_02.cc @@ -74,10 +74,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_vertex_dof_identities_dgp_nonparametric.cc b/tests/hp/hp_vertex_dof_identities_dgp_nonparametric.cc index 2b26436445..6f33c96c8d 100644 --- a/tests/hp/hp_vertex_dof_identities_dgp_nonparametric.cc +++ b/tests/hp/hp_vertex_dof_identities_dgp_nonparametric.cc @@ -62,10 +62,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_vertex_dof_identities_dgp_nonparametric_system_01.cc b/tests/hp/hp_vertex_dof_identities_dgp_nonparametric_system_01.cc index 7298fbec5b..1963af759f 100644 --- a/tests/hp/hp_vertex_dof_identities_dgp_nonparametric_system_01.cc +++ b/tests/hp/hp_vertex_dof_identities_dgp_nonparametric_system_01.cc @@ -63,10 +63,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_vertex_dof_identities_dgp_nonparametric_system_02.cc b/tests/hp/hp_vertex_dof_identities_dgp_nonparametric_system_02.cc index 6ac262da9a..8fe36f0e56 100644 --- a/tests/hp/hp_vertex_dof_identities_dgp_nonparametric_system_02.cc +++ b/tests/hp/hp_vertex_dof_identities_dgp_nonparametric_system_02.cc @@ -74,10 +74,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_vertex_dof_identities_dgp_system_01.cc b/tests/hp/hp_vertex_dof_identities_dgp_system_01.cc index fee9c00824..73f49dbdc5 100644 --- a/tests/hp/hp_vertex_dof_identities_dgp_system_01.cc +++ b/tests/hp/hp_vertex_dof_identities_dgp_system_01.cc @@ -63,10 +63,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_vertex_dof_identities_dgp_system_02.cc b/tests/hp/hp_vertex_dof_identities_dgp_system_02.cc index 4c78ceab2e..45576c28f7 100644 --- a/tests/hp/hp_vertex_dof_identities_dgp_system_02.cc +++ b/tests/hp/hp_vertex_dof_identities_dgp_system_02.cc @@ -73,10 +73,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_vertex_dof_identities_dgq.cc b/tests/hp/hp_vertex_dof_identities_dgq.cc index 70abc0491d..1807fb812b 100644 --- a/tests/hp/hp_vertex_dof_identities_dgq.cc +++ b/tests/hp/hp_vertex_dof_identities_dgq.cc @@ -62,10 +62,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_vertex_dof_identities_dgq_system_01.cc b/tests/hp/hp_vertex_dof_identities_dgq_system_01.cc index 3d40eb2186..dc4d9ed8af 100644 --- a/tests/hp/hp_vertex_dof_identities_dgq_system_01.cc +++ b/tests/hp/hp_vertex_dof_identities_dgq_system_01.cc @@ -63,10 +63,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_vertex_dof_identities_dgq_system_02.cc b/tests/hp/hp_vertex_dof_identities_dgq_system_02.cc index c8bb9b9314..495cc9cc83 100644 --- a/tests/hp/hp_vertex_dof_identities_dgq_system_02.cc +++ b/tests/hp/hp_vertex_dof_identities_dgq_system_02.cc @@ -73,10 +73,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_vertex_dof_identities_q.cc b/tests/hp/hp_vertex_dof_identities_q.cc index 867e1319c5..303eef281d 100644 --- a/tests/hp/hp_vertex_dof_identities_q.cc +++ b/tests/hp/hp_vertex_dof_identities_q.cc @@ -62,10 +62,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_vertex_dof_identities_q_system_01.cc b/tests/hp/hp_vertex_dof_identities_q_system_01.cc index 4eaf69d61d..a74263d022 100644 --- a/tests/hp/hp_vertex_dof_identities_q_system_01.cc +++ b/tests/hp/hp_vertex_dof_identities_q_system_01.cc @@ -63,10 +63,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_vertex_dof_identities_q_system_02.cc b/tests/hp/hp_vertex_dof_identities_q_system_02.cc index 83262951f8..ad9e7a2e04 100644 --- a/tests/hp/hp_vertex_dof_identities_q_system_02.cc +++ b/tests/hp/hp_vertex_dof_identities_q_system_02.cc @@ -71,10 +71,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/hp_vertex_dof_identities_rt_nodal.cc b/tests/hp/hp_vertex_dof_identities_rt_nodal.cc index 471be38541..333c1cfb5a 100644 --- a/tests/hp/hp_vertex_dof_identities_rt_nodal.cc +++ b/tests/hp/hp_vertex_dof_identities_rt_nodal.cc @@ -62,10 +62,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<2>(); test<3>(); diff --git a/tests/hp/integrate_difference.cc b/tests/hp/integrate_difference.cc index 782eccf2aa..d7dd9c9a64 100644 --- a/tests/hp/integrate_difference.cc +++ b/tests/hp/integrate_difference.cc @@ -104,12 +104,9 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); - test<1>(); test<2>(); test<3>(); diff --git a/tests/hp/integrate_difference_02.cc b/tests/hp/integrate_difference_02.cc index 214eb7082b..8cfb42f522 100644 --- a/tests/hp/integrate_difference_02.cc +++ b/tests/hp/integrate_difference_02.cc @@ -148,11 +148,9 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); + initlog(); deallog << std::setprecision(2); - - deallog.attach(logfile); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/integrate_difference_03.cc b/tests/hp/integrate_difference_03.cc index 92a093741d..139d456363 100644 --- a/tests/hp/integrate_difference_03.cc +++ b/tests/hp/integrate_difference_03.cc @@ -131,12 +131,9 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); - test<1>(); test<2>(); test<3>(); diff --git a/tests/hp/interpolate_dgq_01.cc b/tests/hp/interpolate_dgq_01.cc index 5db994cff0..4257c455ef 100644 --- a/tests/hp/interpolate_dgq_01.cc +++ b/tests/hp/interpolate_dgq_01.cc @@ -115,12 +115,10 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(3); + initlog(); + deallog.get_file_stream().precision(3); deallog << std::setprecision(3); - deallog.attach(logfile); - test<1>(); test<2>(); test<3>(); diff --git a/tests/hp/interpolate_dgq_02.cc b/tests/hp/interpolate_dgq_02.cc index 0d63b05649..df6f374830 100644 --- a/tests/hp/interpolate_dgq_02.cc +++ b/tests/hp/interpolate_dgq_02.cc @@ -124,12 +124,9 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(3); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); - test<1>(); test<2>(); test<3>(); diff --git a/tests/hp/interpolate_nothing_01.cc b/tests/hp/interpolate_nothing_01.cc index 3bdcee5b4b..0fef4614ae 100644 --- a/tests/hp/interpolate_nothing_01.cc +++ b/tests/hp/interpolate_nothing_01.cc @@ -79,12 +79,9 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(3); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); - test<1>(); test<2>(); test<3>(); diff --git a/tests/hp/interpolate_nothing_02.cc b/tests/hp/interpolate_nothing_02.cc index cb374a1a87..e2e84cb56e 100644 --- a/tests/hp/interpolate_nothing_02.cc +++ b/tests/hp/interpolate_nothing_02.cc @@ -262,12 +262,9 @@ diffusionMechanics::run() int main() { - std::ofstream logfile("output"); - logfile.precision(3); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); - diffusionMechanics problem(1, 1); problem.run(); } diff --git a/tests/hp/interpolate_nothing_03.cc b/tests/hp/interpolate_nothing_03.cc index 23e4554bce..9dfb24c565 100644 --- a/tests/hp/interpolate_nothing_03.cc +++ b/tests/hp/interpolate_nothing_03.cc @@ -88,12 +88,9 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(3); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); - test<1>(); test<2>(); test<3>(); diff --git a/tests/hp/interpolate_q_01.cc b/tests/hp/interpolate_q_01.cc index 6247ce5965..c58227f6df 100644 --- a/tests/hp/interpolate_q_01.cc +++ b/tests/hp/interpolate_q_01.cc @@ -116,12 +116,10 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(3); + initlog(); + deallog.get_file_stream().precision(3); deallog << std::setprecision(3); - deallog.attach(logfile); - test<1>(); test<2>(); test<3>(); diff --git a/tests/hp/interpolate_q_02.cc b/tests/hp/interpolate_q_02.cc index b81f05e22e..d4a28deb9b 100644 --- a/tests/hp/interpolate_q_02.cc +++ b/tests/hp/interpolate_q_02.cc @@ -124,12 +124,9 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(3); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); - test<1>(); test<2>(); test<3>(); diff --git a/tests/hp/interpolate_q_system_01.cc b/tests/hp/interpolate_q_system_01.cc index 17c1ea72a4..7db6c7a373 100644 --- a/tests/hp/interpolate_q_system_01.cc +++ b/tests/hp/interpolate_q_system_01.cc @@ -121,12 +121,9 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(3); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); - test<1>(); test<2>(); test<3>(); diff --git a/tests/hp/interpolate_q_system_02.cc b/tests/hp/interpolate_q_system_02.cc index d3373f22d5..1638313ce0 100644 --- a/tests/hp/interpolate_q_system_02.cc +++ b/tests/hp/interpolate_q_system_02.cc @@ -130,12 +130,9 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(3); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); - test<1>(); test<2>(); test<3>(); diff --git a/tests/hp/mapping_collection_01.cc b/tests/hp/mapping_collection_01.cc index 625d90dedd..160632bdb6 100644 --- a/tests/hp/mapping_collection_01.cc +++ b/tests/hp/mapping_collection_01.cc @@ -50,10 +50,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/mapping_collection_02.cc b/tests/hp/mapping_collection_02.cc index c8371528da..93a1013787 100644 --- a/tests/hp/mapping_collection_02.cc +++ b/tests/hp/mapping_collection_02.cc @@ -39,10 +39,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/mapping_collection_03.cc b/tests/hp/mapping_collection_03.cc index 0dad7694c4..9626ed52a7 100644 --- a/tests/hp/mapping_collection_03.cc +++ b/tests/hp/mapping_collection_03.cc @@ -45,10 +45,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/mapping_collection_04.cc b/tests/hp/mapping_collection_04.cc index 3264ce1d67..46b3eed5bf 100644 --- a/tests/hp/mapping_collection_04.cc +++ b/tests/hp/mapping_collection_04.cc @@ -45,10 +45,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/matrices.cc b/tests/hp/matrices.cc index 1e02295103..7eb6691dbf 100644 --- a/tests/hp/matrices.cc +++ b/tests/hp/matrices.cc @@ -223,10 +223,9 @@ check() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); + deallog.get_file_stream().setf(std::ios::fixed); deallog.push("1d"); check<1>(); diff --git a/tests/hp/n_active_fe_indices.cc b/tests/hp/n_active_fe_indices.cc index 250e034769..b885eb4a16 100644 --- a/tests/hp/n_active_fe_indices.cc +++ b/tests/hp/n_active_fe_indices.cc @@ -156,10 +156,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/n_dofs.cc b/tests/hp/n_dofs.cc index 000e684385..f36510418b 100644 --- a/tests/hp/n_dofs.cc +++ b/tests/hp/n_dofs.cc @@ -105,10 +105,8 @@ test(const FiniteElement &fe) int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); CHECK_ALL(Q, 1); CHECK_ALL(Q, 2); diff --git a/tests/hp/project_01.cc b/tests/hp/project_01.cc index 0879ef64e6..2ff545ba86 100644 --- a/tests/hp/project_01.cc +++ b/tests/hp/project_01.cc @@ -106,8 +106,7 @@ test() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test<1>(); test<2>(); diff --git a/tests/hp/project_01_curved_boundary.cc b/tests/hp/project_01_curved_boundary.cc index e9f5992ddc..824edab224 100644 --- a/tests/hp/project_01_curved_boundary.cc +++ b/tests/hp/project_01_curved_boundary.cc @@ -200,8 +200,7 @@ test() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test<2>(); test<3>(); diff --git a/tests/hp/project_02.cc b/tests/hp/project_02.cc index c27b803ad7..6f433e0a4b 100644 --- a/tests/hp/project_02.cc +++ b/tests/hp/project_02.cc @@ -109,8 +109,7 @@ test() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test<1>(); test<2>(); diff --git a/tests/hp/q_collection_01.cc b/tests/hp/q_collection_01.cc index 99830d9eff..ce4300b012 100644 --- a/tests/hp/q_collection_01.cc +++ b/tests/hp/q_collection_01.cc @@ -49,10 +49,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/q_vs_dgq.cc b/tests/hp/q_vs_dgq.cc index 9a6832243b..7596395dd8 100644 --- a/tests/hp/q_vs_dgq.cc +++ b/tests/hp/q_vs_dgq.cc @@ -99,10 +99,8 @@ namespace Step27 int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); Step27::MixedFECollection<1>().run(); Step27::MixedFECollection<2>().run(); diff --git a/tests/hp/random.cc b/tests/hp/random.cc index c2a91c0719..c368348c1a 100644 --- a/tests/hp/random.cc +++ b/tests/hp/random.cc @@ -82,10 +82,8 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); test<1>(); test<2>(); diff --git a/tests/hp/renumber_block_wise_01.cc b/tests/hp/renumber_block_wise_01.cc index d158aadd49..0cc645d639 100644 --- a/tests/hp/renumber_block_wise_01.cc +++ b/tests/hp/renumber_block_wise_01.cc @@ -129,10 +129,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/renumber_block_wise_01a.cc b/tests/hp/renumber_block_wise_01a.cc index bf46dea3bc..eeb47f7d90 100644 --- a/tests/hp/renumber_block_wise_01a.cc +++ b/tests/hp/renumber_block_wise_01a.cc @@ -115,10 +115,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("3d"); check<3>(); diff --git a/tests/hp/renumber_block_wise_01b.cc b/tests/hp/renumber_block_wise_01b.cc index 4a51755f51..32e06851dd 100644 --- a/tests/hp/renumber_block_wise_01b.cc +++ b/tests/hp/renumber_block_wise_01b.cc @@ -111,10 +111,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); check<3>(); } diff --git a/tests/hp/renumber_block_wise_02.cc b/tests/hp/renumber_block_wise_02.cc index ed5dcf197a..59e80ccfbd 100644 --- a/tests/hp/renumber_block_wise_02.cc +++ b/tests/hp/renumber_block_wise_02.cc @@ -141,10 +141,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("2d"); check<2>(); diff --git a/tests/hp/renumber_component_wise.cc b/tests/hp/renumber_component_wise.cc index d5ec1a6adc..9a446709f1 100644 --- a/tests/hp/renumber_component_wise.cc +++ b/tests/hp/renumber_component_wise.cc @@ -122,10 +122,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/set_dof_values_by_interpolation_01.cc b/tests/hp/set_dof_values_by_interpolation_01.cc index 0435e7fd49..df663c201e 100644 --- a/tests/hp/set_dof_values_by_interpolation_01.cc +++ b/tests/hp/set_dof_values_by_interpolation_01.cc @@ -104,10 +104,9 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(PRECISION); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(PRECISION); + deallog.get_file_stream().setf(std::ios::fixed); deal_II_exceptions::disable_abort_on_exception(); diff --git a/tests/hp/set_dof_values_by_interpolation_02.cc b/tests/hp/set_dof_values_by_interpolation_02.cc index 1e68e2353a..455ecd842f 100644 --- a/tests/hp/set_dof_values_by_interpolation_02.cc +++ b/tests/hp/set_dof_values_by_interpolation_02.cc @@ -107,10 +107,9 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(PRECISION); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(PRECISION); + deallog.get_file_stream().setf(std::ios::fixed); test<1>(); test<2>(); diff --git a/tests/hp/set_dof_values_by_interpolation_03.cc b/tests/hp/set_dof_values_by_interpolation_03.cc index 5c436fc249..b1a1d8ff4d 100644 --- a/tests/hp/set_dof_values_by_interpolation_03.cc +++ b/tests/hp/set_dof_values_by_interpolation_03.cc @@ -98,10 +98,9 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(1); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(1); + deallog.get_file_stream().setf(std::ios::fixed); test<1>(); test<2>(); diff --git a/tests/hp/solution_transfer.cc b/tests/hp/solution_transfer.cc index f4c606f2f1..0902922bc4 100644 --- a/tests/hp/solution_transfer.cc +++ b/tests/hp/solution_transfer.cc @@ -240,15 +240,14 @@ transfer(std::ostream &out) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); deallog << " 1D solution transfer" << std::endl; - transfer<1>(logfile); + transfer<1>(deallog.get_file_stream()); deallog << " 2D solution transfer" << std::endl; - transfer<2>(logfile); + transfer<2>(deallog.get_file_stream()); deallog << " 3D solution transfer" << std::endl; - transfer<3>(logfile); + transfer<3>(deallog.get_file_stream()); } diff --git a/tests/hp/solution_transfer_02.cc b/tests/hp/solution_transfer_02.cc index 4ad67e2e82..3231fc4af8 100644 --- a/tests/hp/solution_transfer_02.cc +++ b/tests/hp/solution_transfer_02.cc @@ -99,15 +99,14 @@ transfer(std::ostream &out) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); deallog << " 1D solution transfer" << std::endl; - transfer<1>(logfile); + transfer<1>(deallog.get_file_stream()); deallog << " 2D solution transfer" << std::endl; - transfer<2>(logfile); + transfer<2>(deallog.get_file_stream()); deallog << " 3D solution transfer" << std::endl; - transfer<3>(logfile); + transfer<3>(deallog.get_file_stream()); } diff --git a/tests/hp/solution_transfer_11.cc b/tests/hp/solution_transfer_11.cc index 107118f292..a7f0abdeed 100644 --- a/tests/hp/solution_transfer_11.cc +++ b/tests/hp/solution_transfer_11.cc @@ -86,15 +86,14 @@ transfer(std::ostream &out) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); deallog << " 1D solution transfer" << std::endl; - transfer<1>(logfile); + transfer<1>(deallog.get_file_stream()); deallog << " 2D solution transfer" << std::endl; - transfer<2>(logfile); + transfer<2>(deallog.get_file_stream()); deallog << " 3D solution transfer" << std::endl; - transfer<3>(logfile); + transfer<3>(deallog.get_file_stream()); } diff --git a/tests/hp/solution_transfer_12.cc b/tests/hp/solution_transfer_12.cc index a6487ed58e..4c0bd7c67c 100644 --- a/tests/hp/solution_transfer_12.cc +++ b/tests/hp/solution_transfer_12.cc @@ -235,15 +235,14 @@ transfer(std::ostream &out) int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); deallog << " 1D solution transfer" << std::endl; - transfer<1>(logfile); + transfer<1>(deallog.get_file_stream()); deallog << " 2D solution transfer" << std::endl; - transfer<2>(logfile); + transfer<2>(deallog.get_file_stream()); deallog << " 3D solution transfer" << std::endl; - transfer<3>(logfile); + transfer<3>(deallog.get_file_stream()); } diff --git a/tests/hp/step-10.cc b/tests/hp/step-10.cc index 9723517b86..4304caa778 100644 --- a/tests/hp/step-10.cc +++ b/tests/hp/step-10.cc @@ -18,10 +18,6 @@ // a hp-ified version of step-10 -#include "../tests.h" -std::ofstream logfile("output"); - - #include #include @@ -42,6 +38,8 @@ std::ofstream logfile("output"); #include +#include "../tests.h" + const long double pi = 3.141592653589793238462643; @@ -227,9 +225,8 @@ compute_pi_by_perimeter() int main() { - logfile.precision(6); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(6); gnuplot_output<2>(); diff --git a/tests/hp/step-11.cc b/tests/hp/step-11.cc index 3a36c118b3..d10ce90b6e 100644 --- a/tests/hp/step-11.cc +++ b/tests/hp/step-11.cc @@ -18,10 +18,6 @@ // a hp-ified version of step-11 -#include "../tests.h" - -std::ofstream logfile("output"); - #include #include #include @@ -54,6 +50,8 @@ std::ofstream logfile("output"); #include #include +#include "../tests.h" + template class LaplaceProblem @@ -231,11 +229,9 @@ main() { try { - logfile.precision(2); + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); - for (unsigned int mapping_degree = 1; mapping_degree <= 3; ++mapping_degree) LaplaceProblem<2>(mapping_degree).run(); diff --git a/tests/hp/step-12.cc b/tests/hp/step-12.cc index 67e875841a..5637bb9e6c 100644 --- a/tests/hp/step-12.cc +++ b/tests/hp/step-12.cc @@ -18,9 +18,6 @@ // a hp-ified version of step-12 -#include "../tests.h" -std::ofstream logfile("output"); - #include #include #include @@ -51,6 +48,8 @@ std::ofstream logfile("output"); #include +#include "../tests.h" + template class RHS : public Function @@ -964,9 +963,8 @@ main() { try { - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); DGMethod<2> dgmethod; dgmethod.run(); diff --git a/tests/hp/step-13.cc b/tests/hp/step-13.cc index fa982b6e79..1528c835ec 100644 --- a/tests/hp/step-13.cc +++ b/tests/hp/step-13.cc @@ -18,10 +18,6 @@ // a hp-ified version of step-13 -#include "../tests.h" -std::ofstream logfile("output"); - - #include #include #include @@ -57,6 +53,8 @@ std::ofstream logfile("output"); #include #include +#include "../tests.h" + namespace Evaluation @@ -810,11 +808,10 @@ main() { try { - logfile.precision(2); + initlog(); + deallog.get_file_stream().precision(2); deallog << std::setprecision(2); - deallog.attach(logfile); - solve_problem<2>("global"); solve_problem<2>("kelly"); } diff --git a/tests/hp/step-2.cc b/tests/hp/step-2.cc index a92f939c39..0b0886ca62 100644 --- a/tests/hp/step-2.cc +++ b/tests/hp/step-2.cc @@ -37,9 +37,6 @@ -std::ofstream logfile("output"); - - void make_grid(Triangulation<2> &triangulation) { const Point<2> center(1, 0); @@ -110,9 +107,8 @@ void renumber_dofs(hp::DoFHandler<2> &dof_handler) int main() { - logfile.precision(2); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(2); Triangulation<2> triangulation; make_grid(triangulation); diff --git a/tests/hp/step-3.cc b/tests/hp/step-3.cc index 8ecfacccc3..fd5f20f66f 100644 --- a/tests/hp/step-3.cc +++ b/tests/hp/step-3.cc @@ -48,10 +48,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - - class LaplaceProblem { public: @@ -220,11 +216,10 @@ LaplaceProblem::run() int main() { - logfile.precision(2); + initlog(); + deallog.get_file_stream().precision(2); deallog << std::setprecision(2); - deallog.attach(logfile); - LaplaceProblem laplace_problem; laplace_problem.run(); diff --git a/tests/hp/step-3a.cc b/tests/hp/step-3a.cc index b1c44b8198..6f38acc78c 100644 --- a/tests/hp/step-3a.cc +++ b/tests/hp/step-3a.cc @@ -51,9 +51,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - class LaplaceProblem { @@ -272,9 +269,8 @@ LaplaceProblem::run() int main() { - logfile.precision(6); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(6); LaplaceProblem laplace_problem; laplace_problem.run(); diff --git a/tests/hp/step-3a_mapping_collection.cc b/tests/hp/step-3a_mapping_collection.cc index 25cebac443..7a059f10cc 100644 --- a/tests/hp/step-3a_mapping_collection.cc +++ b/tests/hp/step-3a_mapping_collection.cc @@ -51,10 +51,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - - class LaplaceProblem { public: @@ -282,9 +278,8 @@ LaplaceProblem::run() int main() { - logfile.precision(6); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(6); LaplaceProblem laplace_problem; laplace_problem.run(); diff --git a/tests/hp/step-3b.cc b/tests/hp/step-3b.cc index 697747bea6..20be7690f7 100644 --- a/tests/hp/step-3b.cc +++ b/tests/hp/step-3b.cc @@ -51,9 +51,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - class LaplaceProblem { @@ -272,9 +269,8 @@ LaplaceProblem::run() int main() { - logfile.precision(6); - - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(6); LaplaceProblem laplace_problem; laplace_problem.run(); diff --git a/tests/hp/step-4.cc b/tests/hp/step-4.cc index 7d62497224..2f147e99d2 100644 --- a/tests/hp/step-4.cc +++ b/tests/hp/step-4.cc @@ -18,10 +18,6 @@ // a hp-ified version of step-4 -#include "../tests.h" -std::ofstream logfile("output"); - - #include #include @@ -50,6 +46,8 @@ std::ofstream logfile("output"); #include +#include "../tests.h" + template @@ -293,11 +291,10 @@ LaplaceProblem::run() int main() { - logfile.precision(2); + initlog(); + deallog.get_file_stream().precision(2); deallog << std::setprecision(2); - deallog.attach(logfile); - { LaplaceProblem<2> laplace_problem_2d; laplace_problem_2d.run(); diff --git a/tests/hp/step-7.cc b/tests/hp/step-7.cc index 62113abdb8..6095825157 100644 --- a/tests/hp/step-7.cc +++ b/tests/hp/step-7.cc @@ -18,10 +18,6 @@ // a hp-ified version of step-7 -#include "../tests.h" -std::ofstream logfile("output"); - - #include #include #include @@ -58,6 +54,8 @@ std::ofstream logfile("output"); #include #include +#include "../tests.h" + template @@ -667,11 +665,9 @@ HelmholtzProblem::run() int main() { - logfile.precision(2); + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); - const unsigned int dim = 2; try diff --git a/tests/hp/step-8.cc b/tests/hp/step-8.cc index 80a6e340bf..0672f0bfd1 100644 --- a/tests/hp/step-8.cc +++ b/tests/hp/step-8.cc @@ -18,10 +18,6 @@ // a hp-ified version of step-8 -#include "../tests.h" -std::ofstream logfile("output"); - - #include #include @@ -55,6 +51,8 @@ std::ofstream logfile("output"); #include +#include "../tests.h" + template @@ -428,10 +426,9 @@ ElasticProblem::run() int main() { - logfile.precision(2); + initlog(); deallog << std::setprecision(2); - - deallog.attach(logfile); + deallog.get_file_stream().precision(2); try { diff --git a/tests/hp/vectors_boundary_rhs_01.cc b/tests/hp/vectors_boundary_rhs_01.cc index 8a76cc581d..90aefa5b6f 100644 --- a/tests/hp/vectors_boundary_rhs_01.cc +++ b/tests/hp/vectors_boundary_rhs_01.cc @@ -126,10 +126,8 @@ check() int main() { - std::ofstream logfile("output"); - logfile.precision(4); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().setf(std::ios::fixed); deallog.push("2d"); check<2>(); diff --git a/tests/hp/vectors_boundary_rhs_02.cc b/tests/hp/vectors_boundary_rhs_02.cc index 3486c925a6..a08e208b61 100644 --- a/tests/hp/vectors_boundary_rhs_02.cc +++ b/tests/hp/vectors_boundary_rhs_02.cc @@ -127,10 +127,9 @@ check() int main() { - std::ofstream logfile("output"); - logfile.precision(4); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(4); + deallog.get_file_stream().setf(std::ios::fixed); deallog.push("2d"); check<2>(); diff --git a/tests/hp/vectors_boundary_rhs_03.cc b/tests/hp/vectors_boundary_rhs_03.cc index 7b11129311..f0a203591b 100644 --- a/tests/hp/vectors_boundary_rhs_03.cc +++ b/tests/hp/vectors_boundary_rhs_03.cc @@ -126,10 +126,9 @@ check() int main() { - std::ofstream logfile("output"); - logfile.precision(4); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(4); + deallog.get_file_stream().setf(std::ios::fixed); deallog.push("2d"); check<2>(); diff --git a/tests/hp/vectors_boundary_rhs_hp_01.cc b/tests/hp/vectors_boundary_rhs_hp_01.cc index 4bfa553f77..44a6f72b57 100644 --- a/tests/hp/vectors_boundary_rhs_hp_01.cc +++ b/tests/hp/vectors_boundary_rhs_hp_01.cc @@ -133,10 +133,9 @@ check() int main() { - std::ofstream logfile("output"); - logfile.precision(4); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(4); + deallog.get_file_stream().setf(std::ios::fixed); deallog.push("2d"); check<2>(); diff --git a/tests/hp/vectors_boundary_rhs_hp_03.cc b/tests/hp/vectors_boundary_rhs_hp_03.cc index bd946eff3f..c5517676f2 100644 --- a/tests/hp/vectors_boundary_rhs_hp_03.cc +++ b/tests/hp/vectors_boundary_rhs_hp_03.cc @@ -129,10 +129,9 @@ check() int main() { - std::ofstream logfile("output"); - logfile.precision(4); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(4); + deallog.get_file_stream().setf(std::ios::fixed); deallog.push("2d"); check<2>(); diff --git a/tests/hp/vectors_point_source_01.cc b/tests/hp/vectors_point_source_01.cc index 2d5250f1cf..b669fd81a4 100644 --- a/tests/hp/vectors_point_source_01.cc +++ b/tests/hp/vectors_point_source_01.cc @@ -99,11 +99,8 @@ check() int main() { - std::ofstream logfile("output"); - logfile.precision(4); - logfile.setf(std::ios::fixed); + initlog(); deallog << std::setprecision(4) << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/vectors_point_source_hp_01.cc b/tests/hp/vectors_point_source_hp_01.cc index 92dcd2d73b..363edac15c 100644 --- a/tests/hp/vectors_point_source_hp_01.cc +++ b/tests/hp/vectors_point_source_hp_01.cc @@ -102,11 +102,8 @@ check() int main() { - std::ofstream logfile("output"); - logfile.precision(4); - logfile.setf(std::ios::fixed); + initlog(); deallog << std::setprecision(4) << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/vectors_rhs_01.cc b/tests/hp/vectors_rhs_01.cc index d60a4c1d7a..3d60d71157 100644 --- a/tests/hp/vectors_rhs_01.cc +++ b/tests/hp/vectors_rhs_01.cc @@ -126,9 +126,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(8) << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/vectors_rhs_02.cc b/tests/hp/vectors_rhs_02.cc index 77d2b87b93..5888e169e8 100644 --- a/tests/hp/vectors_rhs_02.cc +++ b/tests/hp/vectors_rhs_02.cc @@ -126,9 +126,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(8) << std::fixed; - deallog.attach(logfile); deallog.push("2d"); check<2>(); diff --git a/tests/hp/vectors_rhs_03.cc b/tests/hp/vectors_rhs_03.cc index beaa723585..f59afb0ddf 100644 --- a/tests/hp/vectors_rhs_03.cc +++ b/tests/hp/vectors_rhs_03.cc @@ -125,9 +125,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(8) << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/vectors_rhs_hp_01.cc b/tests/hp/vectors_rhs_hp_01.cc index 49ab682e86..8e1b6e009c 100644 --- a/tests/hp/vectors_rhs_hp_01.cc +++ b/tests/hp/vectors_rhs_hp_01.cc @@ -133,9 +133,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(8) << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/hp/vectors_rhs_hp_03.cc b/tests/hp/vectors_rhs_hp_03.cc index 43f4472109..83785923e7 100644 --- a/tests/hp/vectors_rhs_hp_03.cc +++ b/tests/hp/vectors_rhs_hp_03.cc @@ -128,9 +128,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(8) << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/lapack/full_matrix_00.cc b/tests/lapack/full_matrix_00.cc index 2015c3c72e..56669f83a3 100644 --- a/tests/lapack/full_matrix_00.cc +++ b/tests/lapack/full_matrix_00.cc @@ -90,11 +90,8 @@ test(const unsigned int size, const bool reinit_square) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); // Test square matrix initialization test(4, true); diff --git a/tests/lapack/full_matrix_01.cc b/tests/lapack/full_matrix_01.cc index 57d95cf4e0..a0a13c3432 100644 --- a/tests/lapack/full_matrix_01.cc +++ b/tests/lapack/full_matrix_01.cc @@ -92,10 +92,8 @@ test_rect(unsigned int m, unsigned int n, const double *values) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); test_rect(3, 4, &rect[0][0]); test_rect(4, 3, &rect[0][0]); diff --git a/tests/lapack/full_matrix_02.cc b/tests/lapack/full_matrix_02.cc index 23b3bd9751..5c06b9595d 100644 --- a/tests/lapack/full_matrix_02.cc +++ b/tests/lapack/full_matrix_02.cc @@ -74,10 +74,8 @@ test(const unsigned int size, const bool nonsymmetric) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); test(4, false); test(4, true); diff --git a/tests/lapack/full_matrix_03.cc b/tests/lapack/full_matrix_03.cc index 1862cdc032..3c602c0f93 100644 --- a/tests/lapack/full_matrix_03.cc +++ b/tests/lapack/full_matrix_03.cc @@ -108,10 +108,8 @@ test_rect(unsigned int m, unsigned int n, const double *values) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); test_rect(4, 4, &symm[0][0]); test_rect(4, 3, &rect[0][0]); diff --git a/tests/lapack/full_matrix_04.cc b/tests/lapack/full_matrix_04.cc index a6153ded93..f4c5fa93cb 100644 --- a/tests/lapack/full_matrix_04.cc +++ b/tests/lapack/full_matrix_04.cc @@ -110,10 +110,8 @@ test_rect(unsigned int m, unsigned int n, const double *values) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); test_rect(4, 4, &symm[0][0]); test_rect(4, 3, &rect[0][0]); diff --git a/tests/lapack/full_matrix_05.cc b/tests/lapack/full_matrix_05.cc index 9b762e7ae3..8cb10f89df 100644 --- a/tests/lapack/full_matrix_05.cc +++ b/tests/lapack/full_matrix_05.cc @@ -40,10 +40,8 @@ const double right[4][4] = {{4., -1., -1., -1.}, int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(1); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(1); FullMatrix A(4, 4, &left[0][0]), B(4, 4, &right[0][0]); LAPACKFullMatrix LA(4, 4), LB(4, 4); diff --git a/tests/lapack/full_matrix_06.cc b/tests/lapack/full_matrix_06.cc index fb08674b73..39dfc89910 100644 --- a/tests/lapack/full_matrix_06.cc +++ b/tests/lapack/full_matrix_06.cc @@ -42,10 +42,8 @@ const double right[4][4] = {{4., -1., -1., -1.}, int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(1); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(1); FullMatrix A(4, 4, &left[0][0]), B(4, 4, &right[0][0]); LAPACKFullMatrix LA(4, 4), LB(4, 4); diff --git a/tests/lapack/full_matrix_07.cc b/tests/lapack/full_matrix_07.cc index d1bba25ada..ee0750ad75 100644 --- a/tests/lapack/full_matrix_07.cc +++ b/tests/lapack/full_matrix_07.cc @@ -37,10 +37,8 @@ const double left[4][4] = {{1.75, -0.433012701892219, 0.0, 0.0}, int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(1); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(1); FullMatrix A(4, 4, &left[0][0]); LAPACKFullMatrix LA(4, 4); diff --git a/tests/lapack/full_matrix_08.cc b/tests/lapack/full_matrix_08.cc index 681b72bd39..31dc0a8abc 100644 --- a/tests/lapack/full_matrix_08.cc +++ b/tests/lapack/full_matrix_08.cc @@ -57,10 +57,8 @@ test() int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); test(); } diff --git a/tests/lapack/full_matrix_09.cc b/tests/lapack/full_matrix_09.cc index 49a92f7111..dde3dbf2d7 100644 --- a/tests/lapack/full_matrix_09.cc +++ b/tests/lapack/full_matrix_09.cc @@ -57,10 +57,8 @@ test() int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); test(); } diff --git a/tests/lapack/full_matrix_10.cc b/tests/lapack/full_matrix_10.cc index 173c514239..f2c0de9c40 100644 --- a/tests/lapack/full_matrix_10.cc +++ b/tests/lapack/full_matrix_10.cc @@ -57,10 +57,8 @@ test() int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); test(); } diff --git a/tests/lapack/full_matrix_11.cc b/tests/lapack/full_matrix_11.cc index 32e7363a15..65c1e91388 100644 --- a/tests/lapack/full_matrix_11.cc +++ b/tests/lapack/full_matrix_11.cc @@ -57,10 +57,8 @@ test() int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); test(); } diff --git a/tests/lapack/full_matrix_12.cc b/tests/lapack/full_matrix_12.cc index 4691fe28dd..88d26a2265 100644 --- a/tests/lapack/full_matrix_12.cc +++ b/tests/lapack/full_matrix_12.cc @@ -60,10 +60,8 @@ test() int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); test(); } diff --git a/tests/lapack/full_matrix_13.cc b/tests/lapack/full_matrix_13.cc index 6bc8b4ab7b..7a0ada20f6 100644 --- a/tests/lapack/full_matrix_13.cc +++ b/tests/lapack/full_matrix_13.cc @@ -62,10 +62,8 @@ test() int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); test(); } diff --git a/tests/lapack/full_matrix_14.cc b/tests/lapack/full_matrix_14.cc index 78e5fe5694..ab0f34c2b8 100644 --- a/tests/lapack/full_matrix_14.cc +++ b/tests/lapack/full_matrix_14.cc @@ -64,10 +64,8 @@ test(const bool is_singular) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); test(false); test(true); diff --git a/tests/lapack/full_matrix_15.cc b/tests/lapack/full_matrix_15.cc index d843218d15..142122e233 100644 --- a/tests/lapack/full_matrix_15.cc +++ b/tests/lapack/full_matrix_15.cc @@ -67,10 +67,8 @@ test(const unsigned int size) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); const std::vector sizes = {{1, 3, 11, 17, 32, 64, 200, 391}}; for (const auto &s : sizes) diff --git a/tests/lapack/full_matrix_16.cc b/tests/lapack/full_matrix_16.cc index a747ae547a..5b24ee88f5 100644 --- a/tests/lapack/full_matrix_16.cc +++ b/tests/lapack/full_matrix_16.cc @@ -49,10 +49,8 @@ test(const unsigned int size) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); const std::vector sizes = {{1, 3, 11, 17, 32, 64, 200, 391}}; for (const auto &s : sizes) diff --git a/tests/lapack/full_matrix_17.cc b/tests/lapack/full_matrix_17.cc index 78cbb3aefe..d7242adee0 100644 --- a/tests/lapack/full_matrix_17.cc +++ b/tests/lapack/full_matrix_17.cc @@ -53,10 +53,8 @@ test(const unsigned int size) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); const std::vector sizes = {{1, 3, 11, 17, 32, 64, 200, 391}}; for (const auto &s : sizes) diff --git a/tests/lapack/full_matrix_18.cc b/tests/lapack/full_matrix_18.cc index f9fae28bcd..3186695607 100644 --- a/tests/lapack/full_matrix_18.cc +++ b/tests/lapack/full_matrix_18.cc @@ -63,10 +63,8 @@ test(const unsigned int size) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); const std::vector sizes = {{1, 3, 11, 17, 32, 64, 200, 391}}; for (const auto &s : sizes) diff --git a/tests/lapack/full_matrix_19.cc b/tests/lapack/full_matrix_19.cc index 3f3540b275..7d1f3089e6 100644 --- a/tests/lapack/full_matrix_19.cc +++ b/tests/lapack/full_matrix_19.cc @@ -48,10 +48,8 @@ test(const unsigned int size) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); const std::vector sizes = {{1, 3, 11, 17, 32, 64, 200, 391}}; for (const auto &s : sizes) diff --git a/tests/lapack/full_matrix_20.cc b/tests/lapack/full_matrix_20.cc index 3f6c544627..4878fa2808 100644 --- a/tests/lapack/full_matrix_20.cc +++ b/tests/lapack/full_matrix_20.cc @@ -45,10 +45,8 @@ test(const unsigned int size) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); const std::vector sizes = {{17, 391}}; for (const auto &s : sizes) diff --git a/tests/lapack/full_matrix_21.cc b/tests/lapack/full_matrix_21.cc index 79d4d92f13..ddd796aee1 100644 --- a/tests/lapack/full_matrix_21.cc +++ b/tests/lapack/full_matrix_21.cc @@ -57,10 +57,8 @@ test(const unsigned int size) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); const std::vector sizes = {{17, 391}}; for (const auto &s : sizes) diff --git a/tests/lapack/full_matrix_22.cc b/tests/lapack/full_matrix_22.cc index 424260e8cb..2e83b3cd0c 100644 --- a/tests/lapack/full_matrix_22.cc +++ b/tests/lapack/full_matrix_22.cc @@ -60,10 +60,8 @@ test(const unsigned int size) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); const std::vector sizes = {{1, 3, 11}}; for (const auto &s : sizes) diff --git a/tests/lapack/full_matrix_23.cc b/tests/lapack/full_matrix_23.cc index 6adcbc8c54..ecc9defc06 100644 --- a/tests/lapack/full_matrix_23.cc +++ b/tests/lapack/full_matrix_23.cc @@ -80,10 +80,8 @@ test() int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); test(); } diff --git a/tests/lapack/full_matrix_24.cc b/tests/lapack/full_matrix_24.cc index 94d946a54c..f7c374a410 100644 --- a/tests/lapack/full_matrix_24.cc +++ b/tests/lapack/full_matrix_24.cc @@ -82,10 +82,8 @@ test() int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); test(); } diff --git a/tests/lapack/full_matrix_25.cc b/tests/lapack/full_matrix_25.cc index e93af3b83a..0d3071885f 100644 --- a/tests/lapack/full_matrix_25.cc +++ b/tests/lapack/full_matrix_25.cc @@ -71,10 +71,8 @@ test() int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); test(); } diff --git a/tests/lapack/full_matrix_26.cc b/tests/lapack/full_matrix_26.cc index 71f5d79fb9..e6d45f2eba 100644 --- a/tests/lapack/full_matrix_26.cc +++ b/tests/lapack/full_matrix_26.cc @@ -66,11 +66,8 @@ test(const unsigned int size) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); test(4); test(7); diff --git a/tests/lapack/full_matrix_27.cc b/tests/lapack/full_matrix_27.cc index e4417129cb..c4f9a886eb 100644 --- a/tests/lapack/full_matrix_27.cc +++ b/tests/lapack/full_matrix_27.cc @@ -68,10 +68,8 @@ test(const unsigned int size) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); const std::vector sizes = {{17, 35, 391}}; for (const auto &s : sizes) diff --git a/tests/lapack/full_matrix_28.cc b/tests/lapack/full_matrix_28.cc index 6e0d607aad..c77e438150 100644 --- a/tests/lapack/full_matrix_28.cc +++ b/tests/lapack/full_matrix_28.cc @@ -104,10 +104,8 @@ test() int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(5); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(5); test(); } diff --git a/tests/lapack/full_matrix_29.cc b/tests/lapack/full_matrix_29.cc index 7bfbf770a2..8d58e5864f 100644 --- a/tests/lapack/full_matrix_29.cc +++ b/tests/lapack/full_matrix_29.cc @@ -122,10 +122,8 @@ test() int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(5); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(5); test(); } diff --git a/tests/lapack/full_matrix_30.cc b/tests/lapack/full_matrix_30.cc index 2643f0fed6..2586de3bbd 100644 --- a/tests/lapack/full_matrix_30.cc +++ b/tests/lapack/full_matrix_30.cc @@ -43,10 +43,8 @@ test() int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(5); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(5); test(); } diff --git a/tests/lapack/full_matrix_31.cc b/tests/lapack/full_matrix_31.cc index a8acf765c2..fd418772c1 100644 --- a/tests/lapack/full_matrix_31.cc +++ b/tests/lapack/full_matrix_31.cc @@ -108,10 +108,8 @@ test(const unsigned int m, int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); const std::vector> sizes = {{3, 3, 3}, {7, 7, 7}, diff --git a/tests/lapack/full_matrix_32.cc b/tests/lapack/full_matrix_32.cc index d74598a5ae..d93ceb6b8b 100644 --- a/tests/lapack/full_matrix_32.cc +++ b/tests/lapack/full_matrix_32.cc @@ -69,10 +69,8 @@ test(const unsigned int n, const unsigned int k, const NumberType eps) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); const std::vector> sizes = { {3, 3}, {7, 7}, {51, 51}, {320, 320}, {3, 9}, {9, 7}, {5, 17}, {320, 121}}; diff --git a/tests/lapack/full_matrix_33.cc b/tests/lapack/full_matrix_33.cc index c7f6bb9926..61e920ca29 100644 --- a/tests/lapack/full_matrix_33.cc +++ b/tests/lapack/full_matrix_33.cc @@ -70,10 +70,8 @@ test(const unsigned int n, const unsigned int k, const NumberType eps) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); const std::vector> sizes = { {3, 3}, {7, 7}, {51, 51}, {320, 320}, {3, 9}, {9, 7}, {10, 5}, {320, 120}}; diff --git a/tests/lapack/full_matrix_34.cc b/tests/lapack/full_matrix_34.cc index 34a614a34a..8ea725b36c 100644 --- a/tests/lapack/full_matrix_34.cc +++ b/tests/lapack/full_matrix_34.cc @@ -70,10 +70,8 @@ test(const unsigned int n, const unsigned int k, const NumberType eps) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - logfile.precision(3); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(3); const std::vector> sizes = { {3, 3}, {7, 7}, {51, 51}, {320, 320}, {3, 9}, {9, 7}, {10, 5}, {320, 120}}; diff --git a/tests/lapack/solver_cg.cc b/tests/lapack/solver_cg.cc index 2256a81ab4..b99cc84401 100644 --- a/tests/lapack/solver_cg.cc +++ b/tests/lapack/solver_cg.cc @@ -98,10 +98,8 @@ check_Tsolve(SolverType & solver, int main() { - std::ofstream logfile("output"); - // logfile.setf(std::ios::fixed); + initlog(); deallog << std::setprecision(4); - deallog.attach(logfile); GrowingVectorMemory<> mem; SolverControl control(100, 1.e-3); diff --git a/tests/lapack/tridiagonal_ev1.cc b/tests/lapack/tridiagonal_ev1.cc index 4b8ea80621..07fcc499ba 100644 --- a/tests/lapack/tridiagonal_ev1.cc +++ b/tests/lapack/tridiagonal_ev1.cc @@ -47,9 +47,7 @@ test_laplacian(unsigned int n) int main() { - const std::string logname = "output"; - std::ofstream logfile(logname.c_str()); - deallog.attach(logfile); + initlog(); test_laplacian(10); test_laplacian(20); diff --git a/tests/numerics/assemble_matrix_parallel_01.cc b/tests/numerics/assemble_matrix_parallel_01.cc index 5cc8557e5e..e7d878cfd6 100644 --- a/tests/numerics/assemble_matrix_parallel_01.cc +++ b/tests/numerics/assemble_matrix_parallel_01.cc @@ -54,8 +54,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - using namespace dealii; @@ -463,9 +461,8 @@ LaplaceProblem::run() int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); { deallog.push("2d"); diff --git a/tests/numerics/assemble_matrix_parallel_02.cc b/tests/numerics/assemble_matrix_parallel_02.cc index c0d2a1f730..cc1bb30704 100644 --- a/tests/numerics/assemble_matrix_parallel_02.cc +++ b/tests/numerics/assemble_matrix_parallel_02.cc @@ -56,8 +56,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - using namespace dealii; @@ -533,9 +531,8 @@ LaplaceProblem::run() int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); { deallog.push("2d"); diff --git a/tests/numerics/assemble_matrix_parallel_03.cc b/tests/numerics/assemble_matrix_parallel_03.cc index 2668ec70e5..c70b499566 100644 --- a/tests/numerics/assemble_matrix_parallel_03.cc +++ b/tests/numerics/assemble_matrix_parallel_03.cc @@ -54,8 +54,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - using namespace dealii; @@ -471,9 +469,8 @@ LaplaceProblem::run() int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); { deallog.push("2d"); diff --git a/tests/numerics/assemble_matrix_parallel_04.cc b/tests/numerics/assemble_matrix_parallel_04.cc index d222498fa7..83abc234fd 100644 --- a/tests/numerics/assemble_matrix_parallel_04.cc +++ b/tests/numerics/assemble_matrix_parallel_04.cc @@ -55,8 +55,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - using namespace dealii; @@ -570,9 +568,8 @@ LaplaceProblem::run() int main() { + initlog(); deallog << std::setprecision(2); - logfile << std::setprecision(2); - deallog.attach(logfile); { deallog.push("2d"); diff --git a/tests/numerics/create_laplace_matrix_01.cc b/tests/numerics/create_laplace_matrix_01.cc index a1c3a0b8d7..6339cec2f2 100644 --- a/tests/numerics/create_laplace_matrix_01.cc +++ b/tests/numerics/create_laplace_matrix_01.cc @@ -128,10 +128,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_laplace_matrix_01b.cc b/tests/numerics/create_laplace_matrix_01b.cc index f67bb154b4..117aa17f80 100644 --- a/tests/numerics/create_laplace_matrix_01b.cc +++ b/tests/numerics/create_laplace_matrix_01b.cc @@ -120,10 +120,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_laplace_matrix_02.cc b/tests/numerics/create_laplace_matrix_02.cc index 6232122df7..a539710f9f 100644 --- a/tests/numerics/create_laplace_matrix_02.cc +++ b/tests/numerics/create_laplace_matrix_02.cc @@ -131,10 +131,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_laplace_matrix_02b.cc b/tests/numerics/create_laplace_matrix_02b.cc index 054896aff4..54812a0ed5 100644 --- a/tests/numerics/create_laplace_matrix_02b.cc +++ b/tests/numerics/create_laplace_matrix_02b.cc @@ -123,10 +123,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_laplace_matrix_03.cc b/tests/numerics/create_laplace_matrix_03.cc index eb8a3930ad..d2a2660729 100644 --- a/tests/numerics/create_laplace_matrix_03.cc +++ b/tests/numerics/create_laplace_matrix_03.cc @@ -128,10 +128,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_laplace_matrix_03b.cc b/tests/numerics/create_laplace_matrix_03b.cc index 57e304e031..6970d048c3 100644 --- a/tests/numerics/create_laplace_matrix_03b.cc +++ b/tests/numerics/create_laplace_matrix_03b.cc @@ -123,10 +123,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_laplace_matrix_04.cc b/tests/numerics/create_laplace_matrix_04.cc index 3c4c0d906b..0577761130 100644 --- a/tests/numerics/create_laplace_matrix_04.cc +++ b/tests/numerics/create_laplace_matrix_04.cc @@ -131,10 +131,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_laplace_matrix_04b.cc b/tests/numerics/create_laplace_matrix_04b.cc index abea1c74d0..7e614aec77 100644 --- a/tests/numerics/create_laplace_matrix_04b.cc +++ b/tests/numerics/create_laplace_matrix_04b.cc @@ -126,10 +126,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_laplace_matrix_constraints_01.cc b/tests/numerics/create_laplace_matrix_constraints_01.cc index df338fbaff..bca448802a 100644 --- a/tests/numerics/create_laplace_matrix_constraints_01.cc +++ b/tests/numerics/create_laplace_matrix_constraints_01.cc @@ -124,9 +124,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_laplace_matrix_constraints_02.cc b/tests/numerics/create_laplace_matrix_constraints_02.cc index d777025fbc..3d93ce795f 100644 --- a/tests/numerics/create_laplace_matrix_constraints_02.cc +++ b/tests/numerics/create_laplace_matrix_constraints_02.cc @@ -127,9 +127,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_laplace_matrix_constraints_02b.cc b/tests/numerics/create_laplace_matrix_constraints_02b.cc index 72e7ce590a..b70449d8c4 100644 --- a/tests/numerics/create_laplace_matrix_constraints_02b.cc +++ b/tests/numerics/create_laplace_matrix_constraints_02b.cc @@ -122,9 +122,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_laplace_matrix_constraints_03.cc b/tests/numerics/create_laplace_matrix_constraints_03.cc index 0238325ee7..cb84b3f2e1 100644 --- a/tests/numerics/create_laplace_matrix_constraints_03.cc +++ b/tests/numerics/create_laplace_matrix_constraints_03.cc @@ -129,9 +129,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_laplace_matrix_constraints_04.cc b/tests/numerics/create_laplace_matrix_constraints_04.cc index 6099d8ac10..cd976efbb6 100644 --- a/tests/numerics/create_laplace_matrix_constraints_04.cc +++ b/tests/numerics/create_laplace_matrix_constraints_04.cc @@ -132,9 +132,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_mass_matrix_01.cc b/tests/numerics/create_mass_matrix_01.cc index 519bc47abc..111b866de0 100644 --- a/tests/numerics/create_mass_matrix_01.cc +++ b/tests/numerics/create_mass_matrix_01.cc @@ -128,10 +128,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_mass_matrix_01b.cc b/tests/numerics/create_mass_matrix_01b.cc index ebc328449f..6b3cddf422 100644 --- a/tests/numerics/create_mass_matrix_01b.cc +++ b/tests/numerics/create_mass_matrix_01b.cc @@ -120,10 +120,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_mass_matrix_02.cc b/tests/numerics/create_mass_matrix_02.cc index 1d73512381..2187b2e31e 100644 --- a/tests/numerics/create_mass_matrix_02.cc +++ b/tests/numerics/create_mass_matrix_02.cc @@ -131,10 +131,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_mass_matrix_02b.cc b/tests/numerics/create_mass_matrix_02b.cc index f88273291f..25f069fd0e 100644 --- a/tests/numerics/create_mass_matrix_02b.cc +++ b/tests/numerics/create_mass_matrix_02b.cc @@ -123,10 +123,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_mass_matrix_03.cc b/tests/numerics/create_mass_matrix_03.cc index 738aeddd4f..db6c9e2fe5 100644 --- a/tests/numerics/create_mass_matrix_03.cc +++ b/tests/numerics/create_mass_matrix_03.cc @@ -128,10 +128,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_mass_matrix_03b.cc b/tests/numerics/create_mass_matrix_03b.cc index b95743d6e6..737da8fe48 100644 --- a/tests/numerics/create_mass_matrix_03b.cc +++ b/tests/numerics/create_mass_matrix_03b.cc @@ -123,10 +123,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_mass_matrix_04.cc b/tests/numerics/create_mass_matrix_04.cc index ebed5492b1..02b9f0b623 100644 --- a/tests/numerics/create_mass_matrix_04.cc +++ b/tests/numerics/create_mass_matrix_04.cc @@ -131,10 +131,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_mass_matrix_04b.cc b/tests/numerics/create_mass_matrix_04b.cc index 8801d14b61..756b40d45b 100644 --- a/tests/numerics/create_mass_matrix_04b.cc +++ b/tests/numerics/create_mass_matrix_04b.cc @@ -126,10 +126,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_mass_matrix_05.cc b/tests/numerics/create_mass_matrix_05.cc index 4a79056372..3b84789ceb 100644 --- a/tests/numerics/create_mass_matrix_05.cc +++ b/tests/numerics/create_mass_matrix_05.cc @@ -122,10 +122,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); // there used to be a bug in the cell similarity detection for the above // test pattern of an FE_RaviartThomas inside and FESystem, but cell diff --git a/tests/numerics/create_mass_matrix_constraints_01.cc b/tests/numerics/create_mass_matrix_constraints_01.cc index 2f489e1ed6..0c8e0c70fd 100644 --- a/tests/numerics/create_mass_matrix_constraints_01.cc +++ b/tests/numerics/create_mass_matrix_constraints_01.cc @@ -124,9 +124,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_mass_matrix_constraints_02.cc b/tests/numerics/create_mass_matrix_constraints_02.cc index 81e2508636..1554a9cf90 100644 --- a/tests/numerics/create_mass_matrix_constraints_02.cc +++ b/tests/numerics/create_mass_matrix_constraints_02.cc @@ -127,9 +127,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_mass_matrix_constraints_02b.cc b/tests/numerics/create_mass_matrix_constraints_02b.cc index 2f11606e0b..5c97d5e0f3 100644 --- a/tests/numerics/create_mass_matrix_constraints_02b.cc +++ b/tests/numerics/create_mass_matrix_constraints_02b.cc @@ -125,9 +125,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_mass_matrix_constraints_03.cc b/tests/numerics/create_mass_matrix_constraints_03.cc index d5e0311513..8d47b4e0e5 100644 --- a/tests/numerics/create_mass_matrix_constraints_03.cc +++ b/tests/numerics/create_mass_matrix_constraints_03.cc @@ -129,9 +129,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_mass_matrix_constraints_04.cc b/tests/numerics/create_mass_matrix_constraints_04.cc index ab4f662f4c..48c71f80a9 100644 --- a/tests/numerics/create_mass_matrix_constraints_04.cc +++ b/tests/numerics/create_mass_matrix_constraints_04.cc @@ -132,9 +132,8 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_point_source.cc b/tests/numerics/create_point_source.cc index 0387e16220..6826f151df 100644 --- a/tests/numerics/create_point_source.cc +++ b/tests/numerics/create_point_source.cc @@ -61,10 +61,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/create_point_source_hp.cc b/tests/numerics/create_point_source_hp.cc index 6f0ffb86bf..1a43770828 100644 --- a/tests/numerics/create_point_source_hp.cc +++ b/tests/numerics/create_point_source_hp.cc @@ -66,11 +66,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); - deallog.push("1d"); check<1>(); deallog.pop(); diff --git a/tests/numerics/derivative_approximation_01.cc b/tests/numerics/derivative_approximation_01.cc index d352195995..c9f1536203 100644 --- a/tests/numerics/derivative_approximation_01.cc +++ b/tests/numerics/derivative_approximation_01.cc @@ -84,10 +84,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/derivatives.cc b/tests/numerics/derivatives.cc index 015024ffaf..6a6aeeeb7f 100644 --- a/tests/numerics/derivatives.cc +++ b/tests/numerics/derivatives.cc @@ -228,10 +228,9 @@ loop() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); loop<1>(); diff --git a/tests/numerics/error_estimator.cc b/tests/numerics/error_estimator.cc index f9bd5e4147..074d902cf7 100644 --- a/tests/numerics/error_estimator.cc +++ b/tests/numerics/error_estimator.cc @@ -121,10 +121,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/error_estimator_01.cc b/tests/numerics/error_estimator_01.cc index d5bb089e88..e75e34f23a 100644 --- a/tests/numerics/error_estimator_01.cc +++ b/tests/numerics/error_estimator_01.cc @@ -82,11 +82,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); - deallog.push("2d_2"); check<2, 2>(); diff --git a/tests/numerics/error_estimator_02.cc b/tests/numerics/error_estimator_02.cc index 20ebcef9dc..04313d1252 100644 --- a/tests/numerics/error_estimator_02.cc +++ b/tests/numerics/error_estimator_02.cc @@ -741,8 +741,7 @@ test(const MySecondFunction &func) int main() { - std::ofstream logfile("output"); - dealii::deallog.attach(logfile); + initlog(); { NeumanBC<2> func(1.25); diff --git a/tests/numerics/error_estimator_02_complex.cc b/tests/numerics/error_estimator_02_complex.cc index bc5096b7b3..9ef7f4009e 100644 --- a/tests/numerics/error_estimator_02_complex.cc +++ b/tests/numerics/error_estimator_02_complex.cc @@ -688,8 +688,7 @@ test(const MySecondFunction &func) int main() { - std::ofstream logfile("output"); - dealii::deallog.attach(logfile); + initlog(); { NeumanBC<2> func(1.25); diff --git a/tests/numerics/history.cc b/tests/numerics/history.cc index d97019f3d5..5faf394b52 100644 --- a/tests/numerics/history.cc +++ b/tests/numerics/history.cc @@ -85,9 +85,7 @@ test() int main(int argc, char **argv) { - std::ofstream logfile("output"); - dealii::deallog.attach(logfile, /*do not print job id*/ false); - dealii::deallog.depth_console(0); + initlog(); test(); } diff --git a/tests/numerics/history.output b/tests/numerics/history.output index 6ec4e28ab2..b8f6bcdf3d 100644 --- a/tests/numerics/history.output +++ b/tests/numerics/history.output @@ -1,3 +1,4 @@ + DEAL::size: 0 DEAL::max_size: 3 DEAL::initial: diff --git a/tests/numerics/kelly_crash_02.cc b/tests/numerics/kelly_crash_02.cc index ed5ce909ec..3561f8ff64 100644 --- a/tests/numerics/kelly_crash_02.cc +++ b/tests/numerics/kelly_crash_02.cc @@ -231,10 +231,9 @@ test() int main() { - std::ofstream logfile("output"); - logfile.precision(3); + initlog(); + deallog.get_file_stream().precision(3); - deallog.attach(logfile); test(); return 0; } diff --git a/tests/numerics/no_flux_01.cc b/tests/numerics/no_flux_01.cc index 4d9b459c0a..917e8931e2 100644 --- a/tests/numerics/no_flux_01.cc +++ b/tests/numerics/no_flux_01.cc @@ -85,10 +85,9 @@ test_hyper_cube() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); test_hyper_cube<2>(); test_hyper_cube<3>(); diff --git a/tests/numerics/no_flux_02.cc b/tests/numerics/no_flux_02.cc index db71bc4a6f..d2dce1db5b 100644 --- a/tests/numerics/no_flux_02.cc +++ b/tests/numerics/no_flux_02.cc @@ -91,10 +91,9 @@ test_hyper_cube() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); test_hyper_cube<2>(); test_hyper_cube<3>(); diff --git a/tests/numerics/no_flux_03.cc b/tests/numerics/no_flux_03.cc index a54bdaa238..c97c264c8a 100644 --- a/tests/numerics/no_flux_03.cc +++ b/tests/numerics/no_flux_03.cc @@ -85,11 +85,9 @@ test_hyper_sphere() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); - test_hyper_sphere<2>(); test_hyper_sphere<3>(); } diff --git a/tests/numerics/no_flux_04.cc b/tests/numerics/no_flux_04.cc index b6e220a20a..e589b0d12d 100644 --- a/tests/numerics/no_flux_04.cc +++ b/tests/numerics/no_flux_04.cc @@ -147,10 +147,9 @@ test_hyper_sphere() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); test_hyper_sphere<2>(); test_hyper_sphere<3>(); diff --git a/tests/numerics/no_flux_05.cc b/tests/numerics/no_flux_05.cc index 610635d31d..f7c933c24e 100644 --- a/tests/numerics/no_flux_05.cc +++ b/tests/numerics/no_flux_05.cc @@ -99,10 +99,9 @@ test_hyper_cube() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); test_hyper_cube<2>(); test_hyper_cube<3>(); diff --git a/tests/numerics/no_flux_06.cc b/tests/numerics/no_flux_06.cc index 06cccd7a2f..35e6e26536 100644 --- a/tests/numerics/no_flux_06.cc +++ b/tests/numerics/no_flux_06.cc @@ -71,10 +71,9 @@ test_hyper_cube() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); test_hyper_cube<3>(); } diff --git a/tests/numerics/no_flux_07.cc b/tests/numerics/no_flux_07.cc index f20d40cd45..02e7ed14dc 100644 --- a/tests/numerics/no_flux_07.cc +++ b/tests/numerics/no_flux_07.cc @@ -88,10 +88,9 @@ test_hyper_cube() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); test_hyper_cube<3>(); } diff --git a/tests/numerics/no_flux_08.cc b/tests/numerics/no_flux_08.cc index b025d6e2b3..304354f458 100644 --- a/tests/numerics/no_flux_08.cc +++ b/tests/numerics/no_flux_08.cc @@ -79,10 +79,9 @@ check() int main() { - std::ofstream logfile("output"); - logfile.precision(4); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(4); + deallog.get_file_stream().setf(std::ios::fixed); deallog.push("2d"); check<2>(); diff --git a/tests/numerics/no_flux_09.cc b/tests/numerics/no_flux_09.cc index b1f0214939..03ed30b42b 100644 --- a/tests/numerics/no_flux_09.cc +++ b/tests/numerics/no_flux_09.cc @@ -80,10 +80,9 @@ check() int main() { - std::ofstream logfile("output"); - logfile.precision(4); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(4); + deallog.get_file_stream().setf(std::ios::fixed); check<3>(); } diff --git a/tests/numerics/no_flux_10.cc b/tests/numerics/no_flux_10.cc index 75e0c53f6c..47f3f265e1 100644 --- a/tests/numerics/no_flux_10.cc +++ b/tests/numerics/no_flux_10.cc @@ -246,10 +246,9 @@ run() int main() { - std::ofstream logfile("output"); - logfile.precision(4); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(4); + deallog.get_file_stream().setf(std::ios::fixed); run<3>(); } diff --git a/tests/numerics/no_flux_11.cc b/tests/numerics/no_flux_11.cc index f6820eb3e7..560edbd888 100644 --- a/tests/numerics/no_flux_11.cc +++ b/tests/numerics/no_flux_11.cc @@ -160,10 +160,9 @@ run() int main() { - std::ofstream logfile("output"); - logfile.precision(4); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(4); + deallog.get_file_stream().setf(std::ios::fixed); run<2>(); } diff --git a/tests/numerics/no_flux_12.cc b/tests/numerics/no_flux_12.cc index 21eb7e4236..484323b7c5 100644 --- a/tests/numerics/no_flux_12.cc +++ b/tests/numerics/no_flux_12.cc @@ -117,10 +117,9 @@ run() int main() { - std::ofstream logfile("output"); - logfile.precision(7); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(7); + deallog.get_file_stream().setf(std::ios::fixed); run<3>(); } diff --git a/tests/numerics/no_flux_14.cc b/tests/numerics/no_flux_14.cc index 471135b760..1bc0d2da82 100644 --- a/tests/numerics/no_flux_14.cc +++ b/tests/numerics/no_flux_14.cc @@ -69,10 +69,9 @@ check() int main() { - std::ofstream logfile("output"); - logfile.precision(4); - logfile.setf(std::ios::fixed); - deallog.attach(logfile); + initlog(); + deallog.get_file_stream().precision(4); + deallog.get_file_stream().setf(std::ios::fixed); check<3>(); } diff --git a/tests/numerics/no_flux_hp_01.cc b/tests/numerics/no_flux_hp_01.cc index 968a5ef3da..46ef5a4b77 100644 --- a/tests/numerics/no_flux_hp_01.cc +++ b/tests/numerics/no_flux_hp_01.cc @@ -81,10 +81,9 @@ test_hyper_cube() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); test_hyper_cube<2>(); test_hyper_cube<3>(); diff --git a/tests/numerics/no_flux_hp_02.cc b/tests/numerics/no_flux_hp_02.cc index 9629c9c665..9a4cbfaf70 100644 --- a/tests/numerics/no_flux_hp_02.cc +++ b/tests/numerics/no_flux_hp_02.cc @@ -87,10 +87,9 @@ test_hyper_cube() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); test_hyper_cube<2>(); test_hyper_cube<3>(); diff --git a/tests/numerics/no_flux_hp_03.cc b/tests/numerics/no_flux_hp_03.cc index 55ff250f14..a01dbfad27 100644 --- a/tests/numerics/no_flux_hp_03.cc +++ b/tests/numerics/no_flux_hp_03.cc @@ -80,11 +80,9 @@ test_hyper_sphere() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); - test_hyper_sphere<2>(); test_hyper_sphere<3>(); } diff --git a/tests/numerics/no_flux_hp_04.cc b/tests/numerics/no_flux_hp_04.cc index af05e24c0c..66a8ddbf2b 100644 --- a/tests/numerics/no_flux_hp_04.cc +++ b/tests/numerics/no_flux_hp_04.cc @@ -141,10 +141,9 @@ test_hyper_sphere() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); test_hyper_sphere<2>(); test_hyper_sphere<3>(); diff --git a/tests/numerics/no_flux_hp_05.cc b/tests/numerics/no_flux_hp_05.cc index 50228d3a8d..24f49578c4 100644 --- a/tests/numerics/no_flux_hp_05.cc +++ b/tests/numerics/no_flux_hp_05.cc @@ -92,10 +92,9 @@ test_hyper_cube() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); test_hyper_cube<2>(); test_hyper_cube<3>(); diff --git a/tests/numerics/normal_flux_01.cc b/tests/numerics/normal_flux_01.cc index 7de6e3bb08..a2a95a93b7 100644 --- a/tests/numerics/normal_flux_01.cc +++ b/tests/numerics/normal_flux_01.cc @@ -85,10 +85,9 @@ test_hyper_cube() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); test_hyper_cube<2>(); test_hyper_cube<3>(); diff --git a/tests/numerics/normal_flux_02.cc b/tests/numerics/normal_flux_02.cc index c3052ebfb6..9928fd5720 100644 --- a/tests/numerics/normal_flux_02.cc +++ b/tests/numerics/normal_flux_02.cc @@ -91,10 +91,9 @@ test_hyper_cube() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); test_hyper_cube<2>(); test_hyper_cube<3>(); diff --git a/tests/numerics/normal_flux_03.cc b/tests/numerics/normal_flux_03.cc index 63052c6f0b..81d4e2b1eb 100644 --- a/tests/numerics/normal_flux_03.cc +++ b/tests/numerics/normal_flux_03.cc @@ -80,11 +80,9 @@ test_hyper_sphere() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); - test_hyper_sphere<2>(); test_hyper_sphere<3>(); } diff --git a/tests/numerics/normal_flux_hp_01.cc b/tests/numerics/normal_flux_hp_01.cc index 1b1b8e2efa..8b5fdf7f3d 100644 --- a/tests/numerics/normal_flux_hp_01.cc +++ b/tests/numerics/normal_flux_hp_01.cc @@ -88,10 +88,9 @@ test_hyper_cube() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); test_hyper_cube<2>(); test_hyper_cube<3>(); diff --git a/tests/numerics/normal_flux_inhom_01.cc b/tests/numerics/normal_flux_inhom_01.cc index c212a55206..9275ac6613 100644 --- a/tests/numerics/normal_flux_inhom_01.cc +++ b/tests/numerics/normal_flux_inhom_01.cc @@ -120,10 +120,9 @@ test_hyper_cube() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); test_hyper_cube<2>(); test_hyper_cube<3>(); diff --git a/tests/numerics/point_value_history_01.cc b/tests/numerics/point_value_history_01.cc index a73cd94153..3e4076e8c3 100644 --- a/tests/numerics/point_value_history_01.cc +++ b/tests/numerics/point_value_history_01.cc @@ -273,10 +273,8 @@ TestPointValueHistory::run() int main() { - std::ofstream logfile("output"); - logfile << std::setprecision(2); + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); TestPointValueHistory<2> test; test.run(); diff --git a/tests/numerics/point_value_history_02.cc b/tests/numerics/point_value_history_02.cc index da36b44024..bfd7d2bd52 100644 --- a/tests/numerics/point_value_history_02.cc +++ b/tests/numerics/point_value_history_02.cc @@ -441,10 +441,8 @@ TestPointValueHistory::output_results(unsigned int step, int main() { - std::ofstream logfile("output"); - logfile << std::setprecision(2); + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); TestPointValueHistory<2> test; test.run(); diff --git a/tests/numerics/point_value_history_03.cc b/tests/numerics/point_value_history_03.cc index 05c52ff59b..87dea8b9a0 100644 --- a/tests/numerics/point_value_history_03.cc +++ b/tests/numerics/point_value_history_03.cc @@ -389,10 +389,8 @@ TestPointValueHistory::output_results(unsigned int step, int main() { - std::ofstream logfile("output"); - logfile << std::setprecision(2); + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); TestPointValueHistory<2> test; test.run(); diff --git a/tests/numerics/project_01.cc b/tests/numerics/project_01.cc index ec3510d761..5df3da102c 100644 --- a/tests/numerics/project_01.cc +++ b/tests/numerics/project_01.cc @@ -100,8 +100,7 @@ test() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test<1>(); test<2>(); diff --git a/tests/numerics/project_01_curved_boundary.cc b/tests/numerics/project_01_curved_boundary.cc index 6707a71642..ec8f54efaa 100644 --- a/tests/numerics/project_01_curved_boundary.cc +++ b/tests/numerics/project_01_curved_boundary.cc @@ -182,8 +182,7 @@ test() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test<2>(); test<3>(); diff --git a/tests/numerics/project_02.cc b/tests/numerics/project_02.cc index 8441db9af8..f5fb904825 100644 --- a/tests/numerics/project_02.cc +++ b/tests/numerics/project_02.cc @@ -103,8 +103,7 @@ test() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test<1>(); test<2>(); diff --git a/tests/numerics/project_03.cc b/tests/numerics/project_03.cc index 3645729394..a45bdcf79b 100644 --- a/tests/numerics/project_03.cc +++ b/tests/numerics/project_03.cc @@ -112,8 +112,7 @@ test() int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); test<1>(); test<2>(); diff --git a/tests/numerics/project_boundary_rt_01.cc b/tests/numerics/project_boundary_rt_01.cc index 39ea198d21..879402047d 100644 --- a/tests/numerics/project_boundary_rt_01.cc +++ b/tests/numerics/project_boundary_rt_01.cc @@ -191,10 +191,9 @@ test_hyper_cube(const FiniteElement &fe) int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); FE_RaviartThomasNodal<2> rt21(1); test_hyper_cube(rt21); diff --git a/tests/numerics/project_bv_curl_conf.cc b/tests/numerics/project_bv_curl_conf.cc index d39856290d..28c628315e 100644 --- a/tests/numerics/project_bv_curl_conf.cc +++ b/tests/numerics/project_bv_curl_conf.cc @@ -28,8 +28,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - template class BoundaryFunction : public Function { @@ -72,14 +70,13 @@ test_boundary_values(const FiniteElement &fe) VectorTools::project_boundary_values_curl_conforming_l2( dof_handler, 0, boundary_function, 0, constraints); constraints.close(); - constraints.print(logfile); + constraints.print(deallog.get_file_stream()); } int main() { - deallog << std::setprecision(2); - deallog.attach(logfile); + initlog(); FE_Nedelec<2> fe_2(1); diff --git a/tests/numerics/project_bv_curl_conf_02.cc b/tests/numerics/project_bv_curl_conf_02.cc index 8d68fe0f73..fb5a27d8e7 100644 --- a/tests/numerics/project_bv_curl_conf_02.cc +++ b/tests/numerics/project_bv_curl_conf_02.cc @@ -34,8 +34,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - template class BoundaryFunction : public Function { @@ -131,8 +129,8 @@ test(unsigned order) int main() { + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); test<2>(0); test<2>(1); diff --git a/tests/numerics/project_bv_div_conf.cc b/tests/numerics/project_bv_div_conf.cc index 2414ddd178..064a135a93 100644 --- a/tests/numerics/project_bv_div_conf.cc +++ b/tests/numerics/project_bv_div_conf.cc @@ -28,8 +28,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - template class BoundaryFunction : public Function { @@ -72,14 +70,14 @@ test_boundary_values(const FiniteElement &fe) VectorTools::project_boundary_values_div_conforming( dof_handler, 0, boundary_function, 0, constraints); constraints.close(); - constraints.print(logfile); + constraints.print(deallog.get_file_stream()); } int main() { + initlog(); deallog << std::setprecision(2); - deallog.attach(logfile); FE_RaviartThomas<2> fe_2(1); diff --git a/tests/numerics/project_common.h b/tests/numerics/project_common.h index 2d8fc0cbc2..dee826d719 100644 --- a/tests/numerics/project_common.h +++ b/tests/numerics/project_common.h @@ -347,12 +347,9 @@ test_with_2d_deformed_refined_mesh(const FiniteElement &fe, int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); - deallog.depth_console(0); - test<1>(); test<2>(); test<3>(); diff --git a/tests/numerics/project_to_surface_01.cc b/tests/numerics/project_to_surface_01.cc index e8037bc80a..c9f2cff47f 100644 --- a/tests/numerics/project_to_surface_01.cc +++ b/tests/numerics/project_to_surface_01.cc @@ -128,10 +128,9 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); deallog << std::fixed; - deallog.attach(logfile); test<1>(); test<2>(); diff --git a/tests/numerics/project_to_surface_02.cc b/tests/numerics/project_to_surface_02.cc index cfdb688d05..1708175e0e 100644 --- a/tests/numerics/project_to_surface_02.cc +++ b/tests/numerics/project_to_surface_02.cc @@ -159,10 +159,9 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); deallog << std::fixed; - deallog.attach(logfile); test<2>(); test<3>(); diff --git a/tests/numerics/project_to_surface_03.cc b/tests/numerics/project_to_surface_03.cc index 9ff2d3b2fe..007878535b 100644 --- a/tests/numerics/project_to_surface_03.cc +++ b/tests/numerics/project_to_surface_03.cc @@ -125,10 +125,9 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); deallog << std::fixed; - deallog.attach(logfile); test<3>(); } diff --git a/tests/numerics/tangential_flux_inhom_01.cc b/tests/numerics/tangential_flux_inhom_01.cc index ac93fe48b4..1d69a5f78a 100644 --- a/tests/numerics/tangential_flux_inhom_01.cc +++ b/tests/numerics/tangential_flux_inhom_01.cc @@ -121,10 +121,9 @@ test_hyper_cube() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(2); deallog << std::fixed; - deallog.attach(logfile); test_hyper_cube<2>(); test_hyper_cube<3>(); diff --git a/tests/numerics/time_dependent_01.cc b/tests/numerics/time_dependent_01.cc index cda24b876e..2c2903e6a4 100644 --- a/tests/numerics/time_dependent_01.cc +++ b/tests/numerics/time_dependent_01.cc @@ -25,9 +25,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - std::vector end_sweep_flags; @@ -82,8 +79,8 @@ test() int main() { + initlog(); deallog << std::setprecision(4); - deallog.attach(logfile); test(); diff --git a/tests/numerics/vectors_boundary_rhs_01.cc b/tests/numerics/vectors_boundary_rhs_01.cc index de792c18c7..eb4b340d7b 100644 --- a/tests/numerics/vectors_boundary_rhs_01.cc +++ b/tests/numerics/vectors_boundary_rhs_01.cc @@ -116,10 +116,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(4); deallog << std::fixed; - deallog.attach(logfile); deallog.push("2d"); check<2>(); diff --git a/tests/numerics/vectors_boundary_rhs_02.cc b/tests/numerics/vectors_boundary_rhs_02.cc index ff73cda7a7..06d6f1cc5d 100644 --- a/tests/numerics/vectors_boundary_rhs_02.cc +++ b/tests/numerics/vectors_boundary_rhs_02.cc @@ -118,10 +118,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(4); deallog << std::fixed; - deallog.attach(logfile); deallog.push("2d"); check<2>(); diff --git a/tests/numerics/vectors_boundary_rhs_03.cc b/tests/numerics/vectors_boundary_rhs_03.cc index d165d22a43..ea69a6cb8c 100644 --- a/tests/numerics/vectors_boundary_rhs_03.cc +++ b/tests/numerics/vectors_boundary_rhs_03.cc @@ -117,10 +117,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(4); deallog << std::fixed; - deallog.attach(logfile); deallog.push("2d"); check<2>(); diff --git a/tests/numerics/vectors_point_source_01.cc b/tests/numerics/vectors_point_source_01.cc index 7a793e46f5..dd9413009e 100644 --- a/tests/numerics/vectors_point_source_01.cc +++ b/tests/numerics/vectors_point_source_01.cc @@ -112,10 +112,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(4); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/vectors_rhs_01.cc b/tests/numerics/vectors_rhs_01.cc index 15eaf21ca1..08d8b427af 100644 --- a/tests/numerics/vectors_rhs_01.cc +++ b/tests/numerics/vectors_rhs_01.cc @@ -117,10 +117,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(8); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/numerics/vectors_rhs_03.cc b/tests/numerics/vectors_rhs_03.cc index 2a27138693..5b72d76c0b 100644 --- a/tests/numerics/vectors_rhs_03.cc +++ b/tests/numerics/vectors_rhs_03.cc @@ -117,10 +117,9 @@ check() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(8); deallog << std::fixed; - deallog.attach(logfile); deallog.push("1d"); check<1>(); diff --git a/tests/parameter_handler/parameter_handler_3.cc b/tests/parameter_handler/parameter_handler_3.cc index 19fe7a2112..8832f869c0 100644 --- a/tests/parameter_handler/parameter_handler_3.cc +++ b/tests/parameter_handler/parameter_handler_3.cc @@ -27,8 +27,7 @@ main() { try { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.enter_subsection("Testing"); @@ -42,7 +41,7 @@ main() // read and then write parameters prm.parse_input(SOURCE_DIR "/prm/parameter_handler_3.prm"); - prm.print_parameters(logfile, ParameterHandler::Text); + prm.print_parameters(deallog.get_file_stream(), ParameterHandler::Text); } catch (std::exception &exc) { diff --git a/tests/parameter_handler/parameter_handler_3_with_alias_01.cc b/tests/parameter_handler/parameter_handler_3_with_alias_01.cc index 3dc2edcad7..d1e1db0233 100644 --- a/tests/parameter_handler/parameter_handler_3_with_alias_01.cc +++ b/tests/parameter_handler/parameter_handler_3_with_alias_01.cc @@ -30,8 +30,7 @@ main() { try { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.enter_subsection("Testing"); @@ -46,7 +45,7 @@ main() // read and then write parameters prm.parse_input(SOURCE_DIR "/prm/parameter_handler_3.prm"); - prm.print_parameters(logfile, ParameterHandler::Text); + prm.print_parameters(deallog.get_file_stream(), ParameterHandler::Text); } catch (std::exception &exc) { diff --git a/tests/parameter_handler/parameter_handler_3_with_alias_02.cc b/tests/parameter_handler/parameter_handler_3_with_alias_02.cc index a2c22f3993..19dee09aad 100644 --- a/tests/parameter_handler/parameter_handler_3_with_alias_02.cc +++ b/tests/parameter_handler/parameter_handler_3_with_alias_02.cc @@ -30,8 +30,7 @@ main() { try { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.enter_subsection("Testing"); @@ -46,7 +45,7 @@ main() // read and then write parameters prm.parse_input(SOURCE_DIR "/prm/parameter_handler_3.prm"); - prm.print_parameters(logfile, ParameterHandler::Text); + prm.print_parameters(deallog.get_file_stream(), ParameterHandler::Text); } catch (std::exception &exc) { diff --git a/tests/parameter_handler/parameter_handler_3_with_alias_03.cc b/tests/parameter_handler/parameter_handler_3_with_alias_03.cc index aa7b2d4850..f506be54a0 100644 --- a/tests/parameter_handler/parameter_handler_3_with_alias_03.cc +++ b/tests/parameter_handler/parameter_handler_3_with_alias_03.cc @@ -28,8 +28,7 @@ main() { try { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.enter_subsection("Testing"); @@ -44,7 +43,7 @@ main() // read and then write parameters prm.parse_input(SOURCE_DIR "/prm/parameter_handler_3_with_alias_03.prm"); - prm.print_parameters(logfile, ParameterHandler::Text); + prm.print_parameters(deallog.get_file_stream(), ParameterHandler::Text); } catch (std::exception &exc) { diff --git a/tests/parameter_handler/parameter_handler_3_with_alias_04.cc b/tests/parameter_handler/parameter_handler_3_with_alias_04.cc index f6f1b65bac..54671c962f 100644 --- a/tests/parameter_handler/parameter_handler_3_with_alias_04.cc +++ b/tests/parameter_handler/parameter_handler_3_with_alias_04.cc @@ -28,8 +28,7 @@ main() { try { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.enter_subsection("Testing"); @@ -44,7 +43,7 @@ main() // read and then write parameters prm.parse_input(SOURCE_DIR "/prm/parameter_handler_3_with_alias_04.prm"); - prm.print_parameters(logfile, ParameterHandler::Text); + prm.print_parameters(deallog.get_file_stream(), ParameterHandler::Text); } catch (std::exception &exc) { diff --git a/tests/parameter_handler/parameter_handler_3_with_space.cc b/tests/parameter_handler/parameter_handler_3_with_space.cc index 301e55687b..ba56d40b46 100644 --- a/tests/parameter_handler/parameter_handler_3_with_space.cc +++ b/tests/parameter_handler/parameter_handler_3_with_space.cc @@ -28,8 +28,7 @@ main() { try { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.enter_subsection("Testing"); @@ -47,7 +46,7 @@ main() // read and then write parameters prm.parse_input(SOURCE_DIR "/prm/parameter_handler_3_with_space.prm"); - prm.print_parameters(logfile, ParameterHandler::Text); + prm.print_parameters(deallog.get_file_stream(), ParameterHandler::Text); } catch (std::exception &exc) { diff --git a/tests/parameter_handler/parameter_handler_4.cc b/tests/parameter_handler/parameter_handler_4.cc index 3a1fc8d4bf..01f102699f 100644 --- a/tests/parameter_handler/parameter_handler_4.cc +++ b/tests/parameter_handler/parameter_handler_4.cc @@ -27,8 +27,7 @@ main() { try { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.enter_subsection("Testing"); @@ -45,7 +44,7 @@ main() // as for parameter_handler_3, but // use different output format prm.parse_input(SOURCE_DIR "/prm/parameter_handler_3.prm"); - prm.print_parameters(logfile, ParameterHandler::LaTeX); + prm.print_parameters(deallog.get_file_stream(), ParameterHandler::LaTeX); } catch (std::exception &exc) { diff --git a/tests/parameter_handler/parameter_handler_4a.cc b/tests/parameter_handler/parameter_handler_4a.cc index 980c4a4d74..45c8bad151 100644 --- a/tests/parameter_handler/parameter_handler_4a.cc +++ b/tests/parameter_handler/parameter_handler_4a.cc @@ -29,8 +29,7 @@ main() { try { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.enter_subsection("Testing"); @@ -65,7 +64,7 @@ main() // as for parameter_handler_3, but // use different output format prm.parse_input(SOURCE_DIR "/prm/parameter_handler_3.prm"); - prm.print_parameters(logfile, ParameterHandler::LaTeX); + prm.print_parameters(deallog.get_file_stream(), ParameterHandler::LaTeX); } catch (std::exception &exc) { diff --git a/tests/parameter_handler/parameter_handler_4a_with_alias.cc b/tests/parameter_handler/parameter_handler_4a_with_alias.cc index 7187bb3bd1..db404cb393 100644 --- a/tests/parameter_handler/parameter_handler_4a_with_alias.cc +++ b/tests/parameter_handler/parameter_handler_4a_with_alias.cc @@ -29,8 +29,7 @@ main() { try { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.enter_subsection("Testing"); @@ -67,7 +66,7 @@ main() // as for parameter_handler_3, but // use different output format prm.parse_input(SOURCE_DIR "/prm/parameter_handler_3.prm"); - prm.print_parameters(logfile, ParameterHandler::LaTeX); + prm.print_parameters(deallog.get_file_stream(), ParameterHandler::LaTeX); } catch (std::exception &exc) { diff --git a/tests/parameter_handler/parameter_handler_4a_with_alias_deprecated.cc b/tests/parameter_handler/parameter_handler_4a_with_alias_deprecated.cc index caa4909e16..82297a3464 100644 --- a/tests/parameter_handler/parameter_handler_4a_with_alias_deprecated.cc +++ b/tests/parameter_handler/parameter_handler_4a_with_alias_deprecated.cc @@ -29,8 +29,7 @@ main() { try { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.enter_subsection("Testing"); @@ -67,7 +66,7 @@ main() // as for parameter_handler_3, but // use different output format prm.parse_input(SOURCE_DIR "/prm/parameter_handler_3.prm"); - prm.print_parameters(logfile, ParameterHandler::LaTeX); + prm.print_parameters(deallog.get_file_stream(), ParameterHandler::LaTeX); } catch (std::exception &exc) { diff --git a/tests/parameter_handler/parameter_handler_4b.cc b/tests/parameter_handler/parameter_handler_4b.cc index b7e5407922..ead3942ba5 100644 --- a/tests/parameter_handler/parameter_handler_4b.cc +++ b/tests/parameter_handler/parameter_handler_4b.cc @@ -30,13 +30,12 @@ main() { try { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.enter_subsection("Testing"); prm.leave_subsection(); - prm.print_parameters(logfile, ParameterHandler::LaTeX); + prm.print_parameters(deallog.get_file_stream(), ParameterHandler::LaTeX); } catch (std::exception &exc) { diff --git a/tests/parameter_handler/parameter_handler_5.cc b/tests/parameter_handler/parameter_handler_5.cc index ff440d834a..b34d8f21ff 100644 --- a/tests/parameter_handler/parameter_handler_5.cc +++ b/tests/parameter_handler/parameter_handler_5.cc @@ -28,14 +28,13 @@ main() { try { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.declare_entry("int", "1", Patterns::Integer()); prm.declare_entry("int", "2", Patterns::Integer()); - prm.print_parameters(logfile, ParameterHandler::Text); + prm.print_parameters(deallog.get_file_stream(), ParameterHandler::Text); } catch (std::exception &exc) { diff --git a/tests/parameter_handler/parameter_handler_6.cc b/tests/parameter_handler/parameter_handler_6.cc index 93ac611f3c..5406ac0030 100644 --- a/tests/parameter_handler/parameter_handler_6.cc +++ b/tests/parameter_handler/parameter_handler_6.cc @@ -27,8 +27,7 @@ main() { try { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); // same as parameter_handler_3 ParameterHandler prm; @@ -52,7 +51,7 @@ main() prm.leave_subsection(); // then write - prm.print_parameters(logfile, ParameterHandler::Text); + prm.print_parameters(deallog.get_file_stream(), ParameterHandler::Text); } catch (std::exception &exc) { diff --git a/tests/parameter_handler/parameter_handler_6_bool.cc b/tests/parameter_handler/parameter_handler_6_bool.cc index 3c7587fab5..6a86712fe5 100644 --- a/tests/parameter_handler/parameter_handler_6_bool.cc +++ b/tests/parameter_handler/parameter_handler_6_bool.cc @@ -27,8 +27,7 @@ main() { try { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); // same as parameter_handler_3 ParameterHandler prm; @@ -45,7 +44,7 @@ main() prm.leave_subsection(); // then write - prm.print_parameters(logfile, ParameterHandler::Text); + prm.print_parameters(deallog.get_file_stream(), ParameterHandler::Text); // and do it again with the opposite // value @@ -54,7 +53,7 @@ main() prm.leave_subsection(); // then write - prm.print_parameters(logfile, ParameterHandler::Text); + prm.print_parameters(deallog.get_file_stream(), ParameterHandler::Text); } catch (std::exception &exc) { diff --git a/tests/parameter_handler/parameter_handler_7.cc b/tests/parameter_handler/parameter_handler_7.cc index 04e2ec3016..95530828b9 100644 --- a/tests/parameter_handler/parameter_handler_7.cc +++ b/tests/parameter_handler/parameter_handler_7.cc @@ -27,8 +27,7 @@ main() { try { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.enter_subsection("Testing"); @@ -45,7 +44,8 @@ main() // as for parameter_handler_3, but // use different output format prm.parse_input(SOURCE_DIR "/prm/parameter_handler_3.prm"); - prm.print_parameters(logfile, ParameterHandler::Description); + prm.print_parameters(deallog.get_file_stream(), + ParameterHandler::Description); } catch (std::exception &exc) { diff --git a/tests/parameter_handler/parameter_handler_8.cc b/tests/parameter_handler/parameter_handler_8.cc index 7c71edb1b8..28b613ee31 100644 --- a/tests/parameter_handler/parameter_handler_8.cc +++ b/tests/parameter_handler/parameter_handler_8.cc @@ -29,8 +29,7 @@ main() { try { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.enter_subsection("Testing testing"); @@ -68,7 +67,7 @@ main() // as for parameter_handler_3, but // use different output format prm.parse_input(SOURCE_DIR "/prm/parameter_handler_8.prm"); - prm.print_parameters(logfile, ParameterHandler::Text); + prm.print_parameters(deallog.get_file_stream(), ParameterHandler::Text); } catch (std::exception &exc) { diff --git a/tests/parameter_handler/parameter_handler_read_json.cc b/tests/parameter_handler/parameter_handler_read_json.cc index edacf84085..b6d68e5825 100644 --- a/tests/parameter_handler/parameter_handler_read_json.cc +++ b/tests/parameter_handler/parameter_handler_read_json.cc @@ -25,8 +25,7 @@ int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.declare_entry("int1", "1", Patterns::Integer(), "doc 1"); @@ -64,7 +63,7 @@ main() // write it out again prm.print_parameters(deallog.get_file_stream(), ParameterHandler::JSON); - logfile << std::endl; + deallog.get_file_stream() << std::endl; return 0; } diff --git a/tests/parameter_handler/parameter_handler_read_xml.cc b/tests/parameter_handler/parameter_handler_read_xml.cc index 1af84a29f4..f882eb47ad 100644 --- a/tests/parameter_handler/parameter_handler_read_xml.cc +++ b/tests/parameter_handler/parameter_handler_read_xml.cc @@ -25,8 +25,7 @@ int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.declare_entry("int1", "1", Patterns::Integer(), "doc 1"); @@ -64,7 +63,7 @@ main() // write it out again prm.print_parameters(deallog.get_file_stream(), ParameterHandler::XML); - logfile << std::endl; + deallog.get_file_stream() << std::endl; return 0; } diff --git a/tests/parameter_handler/parameter_handler_write_json.cc b/tests/parameter_handler/parameter_handler_write_json.cc index 92a157a2aa..c35d52ab03 100644 --- a/tests/parameter_handler/parameter_handler_write_json.cc +++ b/tests/parameter_handler/parameter_handler_write_json.cc @@ -26,8 +26,7 @@ int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.declare_entry("int1", "1", Patterns::Integer(), "doc 1"); @@ -60,8 +59,8 @@ main() prm.leave_subsection(); - prm.print_parameters(logfile, ParameterHandler::JSON); - logfile << std::endl; + prm.print_parameters(deallog.get_file_stream(), ParameterHandler::JSON); + deallog.get_file_stream() << std::endl; return 0; } diff --git a/tests/parameter_handler/parameter_handler_write_section_1.cc b/tests/parameter_handler/parameter_handler_write_section_1.cc index 8abb887c34..23447e63e7 100644 --- a/tests/parameter_handler/parameter_handler_write_section_1.cc +++ b/tests/parameter_handler/parameter_handler_write_section_1.cc @@ -26,8 +26,7 @@ int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.declare_entry("int1", "1", Patterns::Integer(), "doc 1"); @@ -55,11 +54,13 @@ main() prm.enter_subsection("ss1"); prm.enter_subsection("Testing%testing"); - prm.print_parameters_section(logfile, ParameterHandler::Text, 0); + prm.print_parameters_section(deallog.get_file_stream(), + ParameterHandler::Text, + 0); prm.leave_subsection(); prm.leave_subsection(); - logfile << std::endl; + deallog.get_file_stream() << std::endl; return 0; } diff --git a/tests/parameter_handler/parameter_handler_write_section_2.cc b/tests/parameter_handler/parameter_handler_write_section_2.cc index 6da4593695..359ade81e8 100644 --- a/tests/parameter_handler/parameter_handler_write_section_2.cc +++ b/tests/parameter_handler/parameter_handler_write_section_2.cc @@ -26,8 +26,7 @@ int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.declare_entry("int1", "1", Patterns::Integer(), "doc 1"); @@ -55,11 +54,14 @@ main() prm.enter_subsection("ss1"); prm.enter_subsection("Testing%testing"); - prm.print_parameters_section(logfile, ParameterHandler::Text, 0, true); + prm.print_parameters_section(deallog.get_file_stream(), + ParameterHandler::Text, + 0, + true); prm.leave_subsection(); prm.leave_subsection(); - logfile << std::endl; + deallog.get_file_stream() << std::endl; return 0; } diff --git a/tests/parameter_handler/parameter_handler_write_section_xml.cc b/tests/parameter_handler/parameter_handler_write_section_xml.cc index c1858c780d..33aa5ee4be 100644 --- a/tests/parameter_handler/parameter_handler_write_section_xml.cc +++ b/tests/parameter_handler/parameter_handler_write_section_xml.cc @@ -26,8 +26,7 @@ int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.declare_entry("int1", "1", Patterns::Integer(), "doc 1"); @@ -55,11 +54,14 @@ main() prm.enter_subsection("ss1"); prm.enter_subsection("Testing%testing"); - prm.print_parameters_section(logfile, ParameterHandler::XML, 0, true); + prm.print_parameters_section(deallog.get_file_stream(), + ParameterHandler::XML, + 0, + true); prm.leave_subsection(); prm.leave_subsection(); - logfile << std::endl; + deallog.get_file_stream() << std::endl; return 0; } diff --git a/tests/parameter_handler/parameter_handler_write_xml.cc b/tests/parameter_handler/parameter_handler_write_xml.cc index 3f9a08b74f..3365725cf3 100644 --- a/tests/parameter_handler/parameter_handler_write_xml.cc +++ b/tests/parameter_handler/parameter_handler_write_xml.cc @@ -26,8 +26,7 @@ int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.declare_entry("int1", "1", Patterns::Integer(), "doc 1"); @@ -60,8 +59,8 @@ main() prm.leave_subsection(); - prm.print_parameters(logfile, ParameterHandler::XML); - logfile << std::endl; + prm.print_parameters(deallog.get_file_stream(), ParameterHandler::XML); + deallog.get_file_stream() << std::endl; return 0; } diff --git a/tests/parameter_handler/save_flags.cc b/tests/parameter_handler/save_flags.cc index d0394f2f50..3d36f42c5c 100644 --- a/tests/parameter_handler/save_flags.cc +++ b/tests/parameter_handler/save_flags.cc @@ -26,8 +26,7 @@ int main() { - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); ParameterHandler prm; prm.declare_entry("int1", "1", Patterns::Integer(), "doc 1"); @@ -60,17 +59,18 @@ main() prm.leave_subsection(); // set a special fill char and verify that it is being used - logfile.fill('x'); - logfile.width(15); - logfile << std::left << 42 << std::endl; + deallog.get_file_stream().fill('x'); + deallog.get_file_stream().width(15); + deallog.get_file_stream() << std::left << 42 << std::endl; // now let ParameterHandler output its state - prm.print_parameters(logfile, ParameterHandler::Description); + prm.print_parameters(deallog.get_file_stream(), + ParameterHandler::Description); // verify that the special fill char is still available (i.e., that // print_parameters() has saved and restored the stream flags) - logfile.width(15); - logfile << std::left << 42 << std::endl; + deallog.get_file_stream().width(15); + deallog.get_file_stream() << std::left << 42 << std::endl; return 0; } diff --git a/tests/petsc_complex/00.cc b/tests/petsc_complex/00.cc index 6e16386140..5594707d12 100644 --- a/tests/petsc_complex/00.cc +++ b/tests/petsc_complex/00.cc @@ -151,8 +151,7 @@ init_petsc_complex() int main(int argc, char **argv) { - std::ofstream logfile("output"); - dealii::deallog.attach(logfile); + initlog(); try { diff --git a/tests/petsc_complex/element_access_00.cc b/tests/petsc_complex/element_access_00.cc index f143011875..8d4b05b474 100644 --- a/tests/petsc_complex/element_access_00.cc +++ b/tests/petsc_complex/element_access_00.cc @@ -60,9 +60,7 @@ test_vector(PETScWrappers::MPI::Vector &v) int main(int argc, char **argv) { - std::ofstream logfile("output"); - dealii::deallog.attach(logfile); - dealii::deallog.depth_console(0); + initlog(); try { @@ -72,7 +70,7 @@ main(int argc, char **argv) test_vector(v); deallog << "vector:" << std::endl; - v.print(logfile); + v.print(deallog.get_file_stream()); } } @@ -104,7 +102,7 @@ main(int argc, char **argv) return 1; } - logfile << std::endl; + deallog.get_file_stream() << std::endl; return 0; } diff --git a/tests/petsc_complex/element_access_01.cc b/tests/petsc_complex/element_access_01.cc index a6825fcf29..23a47907fe 100644 --- a/tests/petsc_complex/element_access_01.cc +++ b/tests/petsc_complex/element_access_01.cc @@ -58,11 +58,9 @@ test_matrix(PETScWrappers::SparseMatrix &m) int main(int argc, char **argv) { - std::ofstream logfile("output"); - dealii::deallog.attach(logfile); - dealii::deallog.depth_console(0); + intilog() - try + try { Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); { @@ -70,7 +68,7 @@ main(int argc, char **argv) test_matrix(m); deallog << "matrix:" << std::endl; - m.print(logfile); + m.print(deallog.get_file_stream()); } } @@ -102,7 +100,7 @@ main(int argc, char **argv) return 1; } - logfile << std::endl; + deallog.get_file_stream() << std::endl; return 0; } diff --git a/tests/petsc_complex/element_access_02.cc b/tests/petsc_complex/element_access_02.cc index 49723d4fb5..2fc9c348e0 100644 --- a/tests/petsc_complex/element_access_02.cc +++ b/tests/petsc_complex/element_access_02.cc @@ -47,9 +47,7 @@ test(PETScWrappers::SparseMatrix &m) int main(int argc, char **argv) { - std::ofstream logfile("output"); - dealii::deallog.attach(logfile); - dealii::deallog.depth_console(0); + initlog(); try { @@ -59,7 +57,7 @@ main(int argc, char **argv) test(m); deallog << "matrix:" << std::endl; - m.print(logfile); + m.print(deallog.get_file_stream()); } } @@ -90,7 +88,7 @@ main(int argc, char **argv) return 1; } - logfile << std::endl; + deallog.get_file_stream() << std::endl; return 0; } diff --git a/tests/petsc_complex/element_access_03.cc b/tests/petsc_complex/element_access_03.cc index ff052c85f6..59d404985e 100644 --- a/tests/petsc_complex/element_access_03.cc +++ b/tests/petsc_complex/element_access_03.cc @@ -68,9 +68,7 @@ test_matrix(PETScWrappers::SparseMatrix &m) int main(int argc, char **argv) { - std::ofstream logfile("output"); - dealii::deallog.attach(logfile); - dealii::deallog.depth_console(0); + initlog(); try { @@ -80,7 +78,7 @@ main(int argc, char **argv) test_matrix(m); deallog << "matrix:" << std::endl; - m.print(logfile); + m.print(deallog.get_file_stream()); } } @@ -111,7 +109,7 @@ main(int argc, char **argv) return 1; } - logfile << std::endl; + deallog.get_file_stream() << std::endl; return 0; } diff --git a/tests/petsc_complex/vector_assign_02.cc b/tests/petsc_complex/vector_assign_02.cc index e3fc46dd4a..0303b5e091 100644 --- a/tests/petsc_complex/vector_assign_02.cc +++ b/tests/petsc_complex/vector_assign_02.cc @@ -47,9 +47,7 @@ test(PETScWrappers::MPI::Vector &v, PETScWrappers::MPI::Vector &w) int main(int argc, char **argv) { - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.depth_console(0); + initlog(); try { @@ -62,9 +60,9 @@ main(int argc, char **argv) // Some output deallog << "Complex vectors: " << std::endl; deallog << "v: " << std::flush; - v.print(logfile, 0, false, true); + v.print(deallog.get_file_stream(), 0, false, true); deallog << "w: " << std::flush; - w.print(logfile, 0, false, true); + w.print(deallog.get_file_stream(), 0, false, true); deallog << "OK" << std::endl; } } diff --git a/tests/petsc_complex/vector_equality_1.cc b/tests/petsc_complex/vector_equality_1.cc index 174c391522..c855ab3e4b 100644 --- a/tests/petsc_complex/vector_equality_1.cc +++ b/tests/petsc_complex/vector_equality_1.cc @@ -47,9 +47,7 @@ test(PETScWrappers::MPI::Vector &v, PETScWrappers::MPI::Vector &w) int main(int argc, char **argv) { - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.depth_console(0); + initlog(); try { @@ -61,8 +59,8 @@ main(int argc, char **argv) // SOme output deallog << "Complex vectors: " << std::endl; - v.print(logfile, 0, false, true); - w.print(logfile, 0, false, true); + v.print(deallog.get_file_stream(), 0, false, true); + w.print(deallog.get_file_stream(), 0, false, true); deallog << "OK" << std::endl; } } diff --git a/tests/petsc_complex/vector_equality_2.cc b/tests/petsc_complex/vector_equality_2.cc index db6bc45f2f..757eb781e8 100644 --- a/tests/petsc_complex/vector_equality_2.cc +++ b/tests/petsc_complex/vector_equality_2.cc @@ -51,9 +51,7 @@ test(PETScWrappers::MPI::Vector &v, PETScWrappers::MPI::Vector &w) int main(int argc, char **argv) { - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.depth_console(0); + initlog(); try { @@ -65,8 +63,8 @@ main(int argc, char **argv) // Output deallog << "Complex vectors: " << std::endl; - v.print(logfile, 0, false, true); - w.print(logfile, 0, false, true); + v.print(deallog.get_file_stream(), 0, false, true); + w.print(deallog.get_file_stream(), 0, false, true); deallog << "OK" << std::endl; } } diff --git a/tests/petsc_complex/vector_print.cc b/tests/petsc_complex/vector_print.cc index 1e87b63a83..f4b0028adc 100644 --- a/tests/petsc_complex/vector_print.cc +++ b/tests/petsc_complex/vector_print.cc @@ -29,9 +29,7 @@ int main(int argc, char **argv) { - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.depth_console(0); + initlog(); try { @@ -44,10 +42,10 @@ main(int argc, char **argv) // print with prescribed precision deallog << "unreadable=true,across=false" << std::endl; - v.print(logfile, 10, true, false); + v.print(deallog.get_file_stream(), 10, true, false); deallog << "unreadable=false,across=true" << std::endl; - v.print(logfile, 3, false, true); + v.print(deallog.get_file_stream(), 3, false, true); } } catch (std::exception &exc) diff --git a/tests/serialization/dof_handler_01.cc b/tests/serialization/dof_handler_01.cc index a844df3b27..91ca5a4e80 100644 --- a/tests/serialization/dof_handler_01.cc +++ b/tests/serialization/dof_handler_01.cc @@ -187,9 +187,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test<1, 1>(); test<1, 2>(); diff --git a/tests/serialization/parameter_handler.cc b/tests/serialization/parameter_handler.cc index 9656c43a4a..d011703572 100644 --- a/tests/serialization/parameter_handler.cc +++ b/tests/serialization/parameter_handler.cc @@ -95,9 +95,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/point.cc b/tests/serialization/point.cc index 7f1194b3bf..2793dd8f9f 100644 --- a/tests/serialization/point.cc +++ b/tests/serialization/point.cc @@ -37,9 +37,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/pointer_01.cc b/tests/serialization/pointer_01.cc index 6284757179..6ed24bf51f 100644 --- a/tests/serialization/pointer_01.cc +++ b/tests/serialization/pointer_01.cc @@ -80,9 +80,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/pointer_02.cc b/tests/serialization/pointer_02.cc index 8af36c0ae2..1277bfd7e6 100644 --- a/tests/serialization/pointer_02.cc +++ b/tests/serialization/pointer_02.cc @@ -102,9 +102,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/pointer_03.cc b/tests/serialization/pointer_03.cc index 2b80e5a047..b074653904 100644 --- a/tests/serialization/pointer_03.cc +++ b/tests/serialization/pointer_03.cc @@ -104,9 +104,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/pointer_04.cc b/tests/serialization/pointer_04.cc index 553ca5d2ee..3c2f994083 100644 --- a/tests/serialization/pointer_04.cc +++ b/tests/serialization/pointer_04.cc @@ -109,9 +109,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/pointer_05.cc b/tests/serialization/pointer_05.cc index 569218c8cd..7ffb47f0dd 100644 --- a/tests/serialization/pointer_05.cc +++ b/tests/serialization/pointer_05.cc @@ -127,9 +127,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/polynomial.cc b/tests/serialization/polynomial.cc index ad71778c6b..7f92609e25 100644 --- a/tests/serialization/polynomial.cc +++ b/tests/serialization/polynomial.cc @@ -47,9 +47,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/polynomial_hierarchical.cc b/tests/serialization/polynomial_hierarchical.cc index 8199df1f41..a8a895fd7d 100644 --- a/tests/serialization/polynomial_hierarchical.cc +++ b/tests/serialization/polynomial_hierarchical.cc @@ -38,9 +38,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/polynomial_lagrange_equidistant.cc b/tests/serialization/polynomial_lagrange_equidistant.cc index 9ed94b95da..cab884e610 100644 --- a/tests/serialization/polynomial_lagrange_equidistant.cc +++ b/tests/serialization/polynomial_lagrange_equidistant.cc @@ -42,9 +42,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/polynomial_lagrange_gl.cc b/tests/serialization/polynomial_lagrange_gl.cc index 04e27747f2..5b7822179e 100644 --- a/tests/serialization/polynomial_lagrange_gl.cc +++ b/tests/serialization/polynomial_lagrange_gl.cc @@ -48,9 +48,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/polynomial_legendre.cc b/tests/serialization/polynomial_legendre.cc index ead2b44dca..bed8a1d5f2 100644 --- a/tests/serialization/polynomial_legendre.cc +++ b/tests/serialization/polynomial_legendre.cc @@ -39,9 +39,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/polynomial_lobatto.cc b/tests/serialization/polynomial_lobatto.cc index 0657b4f3b0..35dd5fe395 100644 --- a/tests/serialization/polynomial_lobatto.cc +++ b/tests/serialization/polynomial_lobatto.cc @@ -39,9 +39,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/polynomial_monomial.cc b/tests/serialization/polynomial_monomial.cc index 33dc287c3d..7123c02067 100644 --- a/tests/serialization/polynomial_monomial.cc +++ b/tests/serialization/polynomial_monomial.cc @@ -43,9 +43,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/quadrature.cc b/tests/serialization/quadrature.cc index ab8e7205a1..73b6512c6e 100644 --- a/tests/serialization/quadrature.cc +++ b/tests/serialization/quadrature.cc @@ -60,9 +60,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/quadrature_qanisotropic.cc b/tests/serialization/quadrature_qanisotropic.cc index 5abcb940cf..fbc37ca3df 100644 --- a/tests/serialization/quadrature_qanisotropic.cc +++ b/tests/serialization/quadrature_qanisotropic.cc @@ -53,9 +53,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/quadrature_qiterated.cc b/tests/serialization/quadrature_qiterated.cc index 85892acc74..7051dbc339 100644 --- a/tests/serialization/quadrature_qiterated.cc +++ b/tests/serialization/quadrature_qiterated.cc @@ -54,9 +54,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/sparsity_pattern.cc b/tests/serialization/sparsity_pattern.cc index bf07545beb..c0a024dc6a 100644 --- a/tests/serialization/sparsity_pattern.cc +++ b/tests/serialization/sparsity_pattern.cc @@ -46,9 +46,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/table_1.cc b/tests/serialization/table_1.cc index f44c91fc80..92153cb255 100644 --- a/tests/serialization/table_1.cc +++ b/tests/serialization/table_1.cc @@ -47,9 +47,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/table_2.cc b/tests/serialization/table_2.cc index f78b2e4ffe..c95245712c 100644 --- a/tests/serialization/table_2.cc +++ b/tests/serialization/table_2.cc @@ -55,9 +55,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/table_3.cc b/tests/serialization/table_3.cc index 74e33bb1b0..c05b92fbd7 100644 --- a/tests/serialization/table_3.cc +++ b/tests/serialization/table_3.cc @@ -60,9 +60,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/table_4.cc b/tests/serialization/table_4.cc index bf212b376c..11aa8596b1 100644 --- a/tests/serialization/table_4.cc +++ b/tests/serialization/table_4.cc @@ -64,9 +64,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/table_5.cc b/tests/serialization/table_5.cc index 56eaf7c20b..8f5836ded1 100644 --- a/tests/serialization/table_5.cc +++ b/tests/serialization/table_5.cc @@ -67,9 +67,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/table_6.cc b/tests/serialization/table_6.cc index 9202b1cd46..bc1d775bca 100644 --- a/tests/serialization/table_6.cc +++ b/tests/serialization/table_6.cc @@ -74,9 +74,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/table_7.cc b/tests/serialization/table_7.cc index b7f8aca95c..d2945589a6 100644 --- a/tests/serialization/table_7.cc +++ b/tests/serialization/table_7.cc @@ -79,9 +79,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/table_handler.cc b/tests/serialization/table_handler.cc index d4dc563f20..26db830a40 100644 --- a/tests/serialization/table_handler.cc +++ b/tests/serialization/table_handler.cc @@ -61,9 +61,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/tensor.cc b/tests/serialization/tensor.cc index 0692f8b25c..718d33e3cc 100644 --- a/tests/serialization/tensor.cc +++ b/tests/serialization/tensor.cc @@ -47,9 +47,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/tensor_base.cc b/tests/serialization/tensor_base.cc index 78e6786dfc..aae843475f 100644 --- a/tests/serialization/tensor_base.cc +++ b/tests/serialization/tensor_base.cc @@ -39,9 +39,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/tensor_base_scalar.cc b/tests/serialization/tensor_base_scalar.cc index 37c630c2f4..afaaaea3a5 100644 --- a/tests/serialization/tensor_base_scalar.cc +++ b/tests/serialization/tensor_base_scalar.cc @@ -38,9 +38,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/test_01.cc b/tests/serialization/test_01.cc index fe95b64b9d..042dd729f6 100644 --- a/tests/serialization/test_01.cc +++ b/tests/serialization/test_01.cc @@ -69,9 +69,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test(); diff --git a/tests/serialization/triangulation_01.cc b/tests/serialization/triangulation_01.cc index 93dddf854c..9e111ccfc0 100644 --- a/tests/serialization/triangulation_01.cc +++ b/tests/serialization/triangulation_01.cc @@ -164,9 +164,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test<1, 1>(); test<1, 2>(); diff --git a/tests/serialization/triangulation_02.cc b/tests/serialization/triangulation_02.cc index 02d5856f07..a5e8ff4623 100644 --- a/tests/serialization/triangulation_02.cc +++ b/tests/serialization/triangulation_02.cc @@ -175,9 +175,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test<1, 1>(); test<1, 2>(); diff --git a/tests/serialization/vector.cc b/tests/serialization/vector.cc index d1cfb184c1..c39abb0eaf 100644 --- a/tests/serialization/vector.cc +++ b/tests/serialization/vector.cc @@ -48,9 +48,8 @@ test() int main() { - std::ofstream logfile("output"); + initlog(); deallog << std::setprecision(3); - deallog.attach(logfile); test();