From 08aacab8a91a55c393cf092a05cb88372a98efab Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 12 Mar 2020 09:18:46 -0400 Subject: [PATCH] Fix up tests --- tests/algorithms/theta_01.cc | 4 +++- tests/bits/christian_1.cc | 10 +++++----- tests/bits/christian_2.cc | 2 +- tests/bits/solution_transfer.cc | 6 +++--- tests/data_out/data_out_curved_cells.cc | 7 +++---- tests/data_out/data_out_multi_dh_03.cc | 2 +- tests/data_out/data_out_multi_dh_05.cc | 2 +- tests/fe/fe_tools.cc | 6 +++--- tests/fe/fe_tools_01.cc | 2 +- tests/lac/constraints_inhomogeneous.cc | 2 +- tests/lac/copy_transposed.cc | 2 +- tests/lac/matrices.cc | 8 ++++---- tests/lac/matrices_ez.cc | 2 +- tests/lac/matrices_ez_add.cc | 2 +- tests/lac/matrices_lapack.cc | 2 +- tests/lac/matrices_lapack_fill.cc | 4 ++-- tests/lac/print_formatted_ez_01.cc | 2 +- tests/lac/solver_control_01.cc | 2 +- tests/lac/solver_control_02.cc | 2 +- tests/lac/solver_control_03.cc | 2 +- tests/lac/solver_control_04.cc | 2 +- tests/lac/sparse_matrices.cc | 2 +- tests/opencascade/circle_normal_projection.cc | 2 +- tests/opencascade/interpolation_curve_boundary.cc | 2 +- tests/physics/elasticity-kinematics_02.cc | 1 - tests/sparsity/block_dynamic_01.cc | 2 +- .../block_dynamic_sparsity_pattern_indexset_01.cc | 2 +- tests/sparsity/block_sparsity_pattern_01.cc | 2 +- tests/tensors/tensor_05.cc | 3 ++- tests/tensors/tensor_08.cc | 3 ++- 30 files changed, 47 insertions(+), 45 deletions(-) diff --git a/tests/algorithms/theta_01.cc b/tests/algorithms/theta_01.cc index d11b5e8664..b879610a1a 100644 --- a/tests/algorithms/theta_01.cc +++ b/tests/algorithms/theta_01.cc @@ -24,6 +24,8 @@ #include +#include "../tests.h" + using namespace dealii; using namespace Algorithms; @@ -67,7 +69,7 @@ main() matrix(1, 0) = -numbers::PI; OutputOperator> out; - out.initialize_stream(logfile); + out.initialize_stream(deallog.get_file_stream()); Explicit op_explicit(matrix); Implicit op_implicit(matrix); diff --git a/tests/bits/christian_1.cc b/tests/bits/christian_1.cc index 8129cea884..2245f10216 100644 --- a/tests/bits/christian_1.cc +++ b/tests/bits/christian_1.cc @@ -181,25 +181,25 @@ main() data_out.attach_dof_handler(dof); data_out.add_data_vector(sol, "base"); data_out.build_patches(); - data_out.write_gnuplot(logfile); + data_out.write_gnuplot(deallog.get_file_stream()); data_out.clear(); data_out.attach_dof_handler(refined_dof); data_out.add_data_vector(refined_sol, "refined"); data_out.build_patches(); - data_out.write_gnuplot(logfile); + data_out.write_gnuplot(deallog.get_file_stream()); data_out.clear(); data_out.attach_dof_handler(coarse_dof); data_out.add_data_vector(coarse_sol, "coarse"); data_out.build_patches(); - data_out.write_gnuplot(logfile); + data_out.write_gnuplot(deallog.get_file_stream()); data_out.clear(); data_out.attach_dof_handler(both_dof); data_out.add_data_vector(both_sol, "both"); data_out.build_patches(); - data_out.write_gnuplot(logfile); + data_out.write_gnuplot(deallog.get_file_stream()); // test output using DataOutStack DataOutStack<2> data_out_stack; @@ -209,5 +209,5 @@ main() data_out_stack.add_data_vector(sol, "dof"); data_out_stack.build_patches(); data_out_stack.finish_parameter_value(); - data_out_stack.write_gnuplot(logfile); + data_out_stack.write_gnuplot(deallog.get_file_stream()); } diff --git a/tests/bits/christian_2.cc b/tests/bits/christian_2.cc index 6464e821de..468b9e0ea8 100644 --- a/tests/bits/christian_2.cc +++ b/tests/bits/christian_2.cc @@ -54,5 +54,5 @@ main() data_out_stack.build_patches(); data_out_stack.finish_parameter_value(); - data_out_stack.write_gnuplot(logfile); + data_out_stack.write_gnuplot(deallog.get_file_stream()); } diff --git a/tests/bits/solution_transfer.cc b/tests/bits/solution_transfer.cc index ecfcf056f9..9d385c0dca 100644 --- a/tests/bits/solution_transfer.cc +++ b/tests/bits/solution_transfer.cc @@ -197,11 +197,11 @@ main() 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/data_out/data_out_curved_cells.cc b/tests/data_out/data_out_curved_cells.cc index 9e44933fcc..88227f3ffc 100644 --- a/tests/data_out/data_out_curved_cells.cc +++ b/tests/data_out/data_out_curved_cells.cc @@ -84,7 +84,7 @@ laplace_solve(const SparseMatrix & S, // create a rinf grid and compute a MappingQEuler to represent the inner // boundary void -curved_grid(std::ofstream &out) +curved_grid(std::ostream &out) { // number of cells in radial and // circumferential direction @@ -256,8 +256,7 @@ int main() { initlog(); - deallog << std::setprecision(4); - logfile << std::setprecision(4); + deallog.get_file_stream() << std::setprecision(4); - curved_grid(logfile); + curved_grid(deallog.get_file_stream()); } diff --git a/tests/data_out/data_out_multi_dh_03.cc b/tests/data_out/data_out_multi_dh_03.cc index 228ce94f8d..b3242b72e8 100644 --- a/tests/data_out/data_out_multi_dh_03.cc +++ b/tests/data_out/data_out_multi_dh_03.cc @@ -77,7 +77,7 @@ main() try { initlog(); - deallog << std::setprecision(2); + deallog.get_file_stream() << std::setprecision(2); test<1>(); test<2>(); diff --git a/tests/data_out/data_out_multi_dh_05.cc b/tests/data_out/data_out_multi_dh_05.cc index e141418d5b..1a46cb6c09 100644 --- a/tests/data_out/data_out_multi_dh_05.cc +++ b/tests/data_out/data_out_multi_dh_05.cc @@ -87,7 +87,7 @@ main() try { initlog(); - deallog << std::setprecision(2); + deallog.get_file_stream() << std::setprecision(2); test<1>(); test<2>(); diff --git a/tests/fe/fe_tools.cc b/tests/fe/fe_tools.cc index 6075479ffb..7ebeadac28 100644 --- a/tests/fe/fe_tools.cc +++ b/tests/fe/fe_tools.cc @@ -202,9 +202,9 @@ main() { initlog(); - test_projection<1>(logfile); - test_projection<2>(logfile); - test_projection<3>(logfile); + test_projection<1>(deallog.get_file_stream()); + test_projection<2>(deallog.get_file_stream()); + test_projection<3>(deallog.get_file_stream()); test_renumbering<1>(); test_renumbering<2>(); diff --git a/tests/fe/fe_tools_01.cc b/tests/fe/fe_tools_01.cc index 636ff52e81..27719c29f0 100644 --- a/tests/fe/fe_tools_01.cc +++ b/tests/fe/fe_tools_01.cc @@ -82,7 +82,7 @@ main() } catch (ExceptionBase &e) { - logfile << e.what(); + deallog << e.what(); } } } diff --git a/tests/lac/constraints_inhomogeneous.cc b/tests/lac/constraints_inhomogeneous.cc index badabb1a69..da65e33ec1 100644 --- a/tests/lac/constraints_inhomogeneous.cc +++ b/tests/lac/constraints_inhomogeneous.cc @@ -59,7 +59,7 @@ int main() { initlog(); - deallog << std::setprecision(2); + deallog.get_file_stream() << std::setprecision(2); test(); diff --git a/tests/lac/copy_transposed.cc b/tests/lac/copy_transposed.cc index bcb04cb683..1b7bb46993 100644 --- a/tests/lac/copy_transposed.cc +++ b/tests/lac/copy_transposed.cc @@ -49,5 +49,5 @@ main() << std::endl; FullMatrix ff; ff.copy_transposed(ez); - ff.print_formatted(logfile, 0, false, 5, "~"); + ff.print_formatted(deallog.get_file_stream(), 0, false, 5, "~"); } diff --git a/tests/lac/matrices.cc b/tests/lac/matrices.cc index 928f23a84e..42d100d884 100644 --- a/tests/lac/matrices.cc +++ b/tests/lac/matrices.cc @@ -49,21 +49,21 @@ main() << std::endl; FullMatrix ff; ff.copy_from(ez); - ff.print_formatted(logfile, 0, false, 5, "~"); + ff.print_formatted(deallog.get_file_stream(), 0, false, 5, "~"); deallog << "LAPACKFullMatrix::copy_from SparseMatrixEZ" << std::endl; LAPACKFullMatrix lfd; lfd.copy_from(ez); - lfd.print_formatted(logfile, 0, false, 5, "~"); + lfd.print_formatted(deallog.get_file_stream(), 0, false, 5, "~"); lfd.reinit(2, 3); deallog << "LAPACKFullMatrix::fill SparseMatrixEZ" << std::endl; lfd.fill(ez, 0, 0, 2, 1); - lfd.print_formatted(logfile, 0, false, 5, "~"); + lfd.print_formatted(deallog.get_file_stream(), 0, false, 5, "~"); deallog << "LAPACKFullMatrix::fill SparseMatrixEZ" << std::endl; lfd.fill(ez, 1, 1, 4, 2); - lfd.print_formatted(logfile, 0, false, 5, "~"); + lfd.print_formatted(deallog.get_file_stream(), 0, false, 5, "~"); } diff --git a/tests/lac/matrices_ez.cc b/tests/lac/matrices_ez.cc index 3c41414cc2..7eb2452db4 100644 --- a/tests/lac/matrices_ez.cc +++ b/tests/lac/matrices_ez.cc @@ -49,5 +49,5 @@ main() << std::endl; SparseMatrixEZ ff; ff.copy_from(ez); - ff.print_formatted(logfile, 0, false, 5, "~"); + ff.print_formatted(deallog.get_file_stream(), 0, false, 5, "~"); } diff --git a/tests/lac/matrices_ez_add.cc b/tests/lac/matrices_ez_add.cc index 2646ccdcba..a6b94f3d7b 100644 --- a/tests/lac/matrices_ez_add.cc +++ b/tests/lac/matrices_ez_add.cc @@ -49,5 +49,5 @@ main() << std::endl; SparseMatrixEZ ff(ez.m(), ez.n()); ff.add(2, ez); - ff.print_formatted(logfile, 0, false, 5, "~"); + ff.print_formatted(deallog.get_file_stream(), 0, false, 5, "~"); } diff --git a/tests/lac/matrices_lapack.cc b/tests/lac/matrices_lapack.cc index 704a7ee727..285ac55538 100644 --- a/tests/lac/matrices_lapack.cc +++ b/tests/lac/matrices_lapack.cc @@ -49,5 +49,5 @@ main() << std::endl; LAPACKFullMatrix ff; ff.copy_from(ez); - ff.print_formatted(logfile, 0, false, 5, "~"); + ff.print_formatted(deallog.get_file_stream(), 0, false, 5, "~"); } diff --git a/tests/lac/matrices_lapack_fill.cc b/tests/lac/matrices_lapack_fill.cc index da4997f9b4..4f8422a5b0 100644 --- a/tests/lac/matrices_lapack_fill.cc +++ b/tests/lac/matrices_lapack_fill.cc @@ -50,7 +50,7 @@ main() << std::endl; LAPACKFullMatrix ff(ez.m(), ez.n()); ff.fill(ez, 0, 0, 0, 0, 2, false); - ff.print_formatted(logfile, 0, false, 5, "~"); + ff.print_formatted(deallog.get_file_stream(), 0, false, 5, "~"); } { @@ -58,6 +58,6 @@ main() << std::endl; LAPACKFullMatrix ff(ez.n(), ez.m()); ff.fill(ez, 0, 0, 0, 0, 2, true); - ff.print_formatted(logfile, 0, false, 5, "~"); + ff.print_formatted(deallog.get_file_stream(), 0, false, 5, "~"); } } diff --git a/tests/lac/print_formatted_ez_01.cc b/tests/lac/print_formatted_ez_01.cc index 42e219e914..319c1f2374 100644 --- a/tests/lac/print_formatted_ez_01.cc +++ b/tests/lac/print_formatted_ez_01.cc @@ -42,5 +42,5 @@ main() ez.set(4, 2, 13.); ez.set(4, 3, 14.); - ez.print_formatted(logfile, 0, false, 5, "~"); + ez.print_formatted(deallog.get_file_stream(), 0, false, 5, "~"); } diff --git a/tests/lac/solver_control_01.cc b/tests/lac/solver_control_01.cc index 06a0ec171b..5608548bf7 100644 --- a/tests/lac/solver_control_01.cc +++ b/tests/lac/solver_control_01.cc @@ -68,7 +68,7 @@ int main(int argc, char **argv) { initlog(); - deallog << std::setprecision(4); + deallog.get_file_stream() << std::setprecision(4); { const unsigned int size = 32; diff --git a/tests/lac/solver_control_02.cc b/tests/lac/solver_control_02.cc index 27b092e7a1..8bf385853c 100644 --- a/tests/lac/solver_control_02.cc +++ b/tests/lac/solver_control_02.cc @@ -68,7 +68,7 @@ int main(int argc, char **argv) { initlog(); - deallog << std::setprecision(4); + deallog.get_file_stream() << std::setprecision(4); { diff --git a/tests/lac/solver_control_03.cc b/tests/lac/solver_control_03.cc index 00194c22d1..5c05b73d30 100644 --- a/tests/lac/solver_control_03.cc +++ b/tests/lac/solver_control_03.cc @@ -68,7 +68,7 @@ int main(int argc, char **argv) { initlog(); - deallog << std::setprecision(4); + deallog.get_file_stream() << std::setprecision(4); { diff --git a/tests/lac/solver_control_04.cc b/tests/lac/solver_control_04.cc index b114635378..8afb248215 100644 --- a/tests/lac/solver_control_04.cc +++ b/tests/lac/solver_control_04.cc @@ -68,7 +68,7 @@ int main(int argc, char **argv) { initlog(); - deallog << std::setprecision(4); + deallog.get_file_stream() << std::setprecision(4); { const unsigned int size = 32; diff --git a/tests/lac/sparse_matrices.cc b/tests/lac/sparse_matrices.cc index 2d937a601e..1be8e0c553 100644 --- a/tests/lac/sparse_matrices.cc +++ b/tests/lac/sparse_matrices.cc @@ -288,7 +288,7 @@ main() const unsigned int row_length = 3; check_ez_iterator(); - check_conjugate(logfile); + check_conjugate(deallog.get_file_stream()); FDMatrix testproblem(size, size); unsigned int dim = (size - 1) * (size - 1); diff --git a/tests/opencascade/circle_normal_projection.cc b/tests/opencascade/circle_normal_projection.cc index d1789dd132..f47018de69 100644 --- a/tests/opencascade/circle_normal_projection.cc +++ b/tests/opencascade/circle_normal_projection.cc @@ -89,7 +89,7 @@ main() // You can open the generated file // with paraview. GridOut gridout; - gridout.write_ucd(tria, logfile); + gridout.write_ucd(tria, deallog.get_file_stream()); return 0; } diff --git a/tests/opencascade/interpolation_curve_boundary.cc b/tests/opencascade/interpolation_curve_boundary.cc index 7c0997f835..e1619f0035 100644 --- a/tests/opencascade/interpolation_curve_boundary.cc +++ b/tests/opencascade/interpolation_curve_boundary.cc @@ -76,7 +76,7 @@ main() // You can open the generated file with gmsh. GridOut gridout; - gridout.write_msh(tria, logfile); + gridout.write_msh(tria, deallog.get_file_stream()); return 0; } diff --git a/tests/physics/elasticity-kinematics_02.cc b/tests/physics/elasticity-kinematics_02.cc index 41f01072d9..10ef530719 100644 --- a/tests/physics/elasticity-kinematics_02.cc +++ b/tests/physics/elasticity-kinematics_02.cc @@ -103,5 +103,4 @@ main() deallog << "Not OK" << std::endl; deallog << "OK" << std::endl; - logfile.close(); } diff --git a/tests/sparsity/block_dynamic_01.cc b/tests/sparsity/block_dynamic_01.cc index 070a08dcdf..2a1bc266a8 100644 --- a/tests/sparsity/block_dynamic_01.cc +++ b/tests/sparsity/block_dynamic_01.cc @@ -47,7 +47,7 @@ main() deallog << "size block(1,0):" << csp.block(1, 0).n_rows() << "x" << csp.block(1, 0).n_cols() << std::endl; - csp.print(logfile); + csp.print(deallog.get_file_stream()); deallog << std::endl; for (unsigned int i = 0; i < 3; ++i) diff --git a/tests/sparsity/block_dynamic_sparsity_pattern_indexset_01.cc b/tests/sparsity/block_dynamic_sparsity_pattern_indexset_01.cc index 4a7bcd61ac..5b8f496182 100644 --- a/tests/sparsity/block_dynamic_sparsity_pattern_indexset_01.cc +++ b/tests/sparsity/block_dynamic_sparsity_pattern_indexset_01.cc @@ -64,7 +64,7 @@ main() } } - csp.print(logfile); + csp.print(deallog.get_file_stream()); return 0; } diff --git a/tests/sparsity/block_sparsity_pattern_01.cc b/tests/sparsity/block_sparsity_pattern_01.cc index e307ecc630..eab0c7cb60 100644 --- a/tests/sparsity/block_sparsity_pattern_01.cc +++ b/tests/sparsity/block_sparsity_pattern_01.cc @@ -69,7 +69,7 @@ main() sparsity.add(ii, cols.local_to_global(jb, j)); } - sparsity.print(logfile); + sparsity.print(deallog.get_file_stream()); return 0; } diff --git a/tests/tensors/tensor_05.cc b/tests/tensors/tensor_05.cc index 5e1e0cebb0..0e48b8c64c 100644 --- a/tests/tensors/tensor_05.cc +++ b/tests/tensors/tensor_05.cc @@ -25,7 +25,8 @@ int main() { - initlog() deallog << std::setprecision(3); + initlog(); + deallog << std::setprecision(3); double a[3][3] = {{1, 2, 3}, {3, 4, 5}, {6, 7, 8}}; diff --git a/tests/tensors/tensor_08.cc b/tests/tensors/tensor_08.cc index ee7f2ac2d6..ae8838fd8a 100644 --- a/tests/tensors/tensor_08.cc +++ b/tests/tensors/tensor_08.cc @@ -47,7 +47,8 @@ test_select(double f1, double f2) int main() { - initlog() deallog << std::setprecision(3); + initlog(); + deallog << std::setprecision(3); test_select<2>(1., 1.); test_select<3>(1., 1.); -- 2.39.5