From: Martin Kronbichler Date: Wed, 11 Mar 2020 13:39:13 +0000 (+0100) Subject: Avoid global logfile variable for matrix-free tests X-Git-Tag: v9.2.0-rc1~431^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d792b051c93239827a026f27bffd6d78e2ac74c;p=dealii.git Avoid global logfile variable for matrix-free tests --- diff --git a/tests/matrix_free/additional_data_copy.cc b/tests/matrix_free/additional_data_copy.cc index 85f573fa83..3484836f2b 100644 --- a/tests/matrix_free/additional_data_copy.cc +++ b/tests/matrix_free/additional_data_copy.cc @@ -21,7 +21,6 @@ #include "../tests.h" -std::ofstream logfile("output"); template bool diff --git a/tests/matrix_free/advect_1d.cc b/tests/matrix_free/advect_1d.cc index 1fb04f7dcc..9933de9a5d 100644 --- a/tests/matrix_free/advect_1d.cc +++ b/tests/matrix_free/advect_1d.cc @@ -37,7 +37,6 @@ #include "../tests.h" -std::ofstream logfile("output"); template void @@ -158,7 +155,7 @@ test() int main() { - deallog.attach(logfile); + initlog(); deallog << std::setprecision(3); diff --git a/tests/matrix_free/assemble_matrix_02.cc b/tests/matrix_free/assemble_matrix_02.cc index 70ab7a365d..b58fb5a84d 100644 --- a/tests/matrix_free/assemble_matrix_02.cc +++ b/tests/matrix_free/assemble_matrix_02.cc @@ -36,8 +36,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - const unsigned int degree_p = 1; @@ -215,7 +213,7 @@ test() int main() { - deallog.attach(logfile); + initlog(); deallog << std::setprecision(3); diff --git a/tests/matrix_free/assemble_matrix_03.cc b/tests/matrix_free/assemble_matrix_03.cc index 0cb764fdbe..a4c8c38adc 100644 --- a/tests/matrix_free/assemble_matrix_03.cc +++ b/tests/matrix_free/assemble_matrix_03.cc @@ -39,8 +39,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - namespace Assembly { @@ -198,7 +196,7 @@ test() int main() { - deallog.attach(logfile); + initlog(); deallog << std::setprecision(3); diff --git a/tests/matrix_free/cell_categorization.cc b/tests/matrix_free/cell_categorization.cc index 4be5c69e83..10fecce5f9 100644 --- a/tests/matrix_free/cell_categorization.cc +++ b/tests/matrix_free/cell_categorization.cc @@ -32,7 +32,6 @@ #include "create_mesh.h" -std::ofstream logfile("output"); template void diff --git a/tests/matrix_free/cell_categorization_02.cc b/tests/matrix_free/cell_categorization_02.cc index f0b1eba5e0..c368c3b289 100644 --- a/tests/matrix_free/cell_categorization_02.cc +++ b/tests/matrix_free/cell_categorization_02.cc @@ -39,7 +39,6 @@ #include "create_mesh.h" -std::ofstream logfile("output"); template void diff --git a/tests/matrix_free/compress_constraints.cc b/tests/matrix_free/compress_constraints.cc index c3448356f7..87d2f63c65 100644 --- a/tests/matrix_free/compress_constraints.cc +++ b/tests/matrix_free/compress_constraints.cc @@ -38,8 +38,6 @@ #include "create_mesh.h" -std::ofstream logfile("output"); - template @@ -97,7 +95,7 @@ test() int main() { - deallog.attach(logfile); + initlog(); deallog << std::setprecision(3); diff --git a/tests/matrix_free/compress_mapping.cc b/tests/matrix_free/compress_mapping.cc index cd77d3421d..8493156b99 100644 --- a/tests/matrix_free/compress_mapping.cc +++ b/tests/matrix_free/compress_mapping.cc @@ -37,8 +37,6 @@ #include "create_mesh.h" -std::ofstream logfile("output"); - template @@ -182,7 +180,7 @@ test_parallelogram() int main() { - deallog.attach(logfile); + initlog(); deallog << std::setprecision(3); diff --git a/tests/matrix_free/copy.cc b/tests/matrix_free/copy.cc index a46876edd6..624c6c36bf 100644 --- a/tests/matrix_free/copy.cc +++ b/tests/matrix_free/copy.cc @@ -23,8 +23,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_common.h" diff --git a/tests/matrix_free/copy_feevaluation.cc b/tests/matrix_free/copy_feevaluation.cc index c4b526815a..5eae41ab64 100644 --- a/tests/matrix_free/copy_feevaluation.cc +++ b/tests/matrix_free/copy_feevaluation.cc @@ -19,10 +19,6 @@ // the heap (using AlignedVector) instead of allocating it on the stack. Tests // also copy constructors of FEEvaluation. -#include "../tests.h" - -std::ofstream logfile("output"); - #include #include @@ -52,6 +48,8 @@ std::ofstream logfile("output"); #include #include +#include "../tests.h" + template @@ -336,7 +334,7 @@ test() int main() { - deallog.attach(logfile); + initlog(); deallog << std::setprecision(3); diff --git a/tests/matrix_free/dg_pbc_01.cc b/tests/matrix_free/dg_pbc_01.cc index fb06c63df1..f6ea0ed100 100644 --- a/tests/matrix_free/dg_pbc_01.cc +++ b/tests/matrix_free/dg_pbc_01.cc @@ -32,7 +32,6 @@ #include "../tests.h" -std::ofstream logfile("output"); // We want to use the matrix-vector product provided by this function (which diff --git a/tests/matrix_free/dg_pbc_02.cc b/tests/matrix_free/dg_pbc_02.cc index 7fcd4dbe39..4a04f8f50d 100644 --- a/tests/matrix_free/dg_pbc_02.cc +++ b/tests/matrix_free/dg_pbc_02.cc @@ -35,8 +35,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - template diff --git a/tests/matrix_free/estimate_condition_number_mass.cc b/tests/matrix_free/estimate_condition_number_mass.cc index 11f2baa510..bbc3312f0f 100644 --- a/tests/matrix_free/estimate_condition_number_mass.cc +++ b/tests/matrix_free/estimate_condition_number_mass.cc @@ -19,10 +19,6 @@ // different polynomial degrees. The mesh uses a hypercube mesh with no // hanging nodes and no other constraints -#include "../tests.h" - -std::ofstream logfile("output"); - #include #include @@ -40,6 +36,8 @@ std::ofstream logfile("output"); #include +#include "../tests.h" + void output_double_number(double input, const std::string &text) @@ -156,7 +154,7 @@ test(const FiniteElement &fe, const unsigned int n_iterations) int main() { - deallog.attach(logfile); + initlog(); deallog << std::setprecision(2); diff --git a/tests/matrix_free/faces_value_optimization.cc b/tests/matrix_free/faces_value_optimization.cc index 40cbab8677..e57f50518b 100644 --- a/tests/matrix_free/faces_value_optimization.cc +++ b/tests/matrix_free/faces_value_optimization.cc @@ -30,7 +30,6 @@ #include "../tests.h" -std::ofstream logfile("output"); template class MatrixFreeTest diff --git a/tests/matrix_free/faces_value_optimization_02.cc b/tests/matrix_free/faces_value_optimization_02.cc index 2f8a6a3a03..617f3bc268 100644 --- a/tests/matrix_free/faces_value_optimization_02.cc +++ b/tests/matrix_free/faces_value_optimization_02.cc @@ -31,7 +31,6 @@ #include "../tests.h" -std::ofstream logfile("output"); template class MatrixFreeTest diff --git a/tests/matrix_free/get_functions_cartesian.cc b/tests/matrix_free/get_functions_cartesian.cc index 74c04c5a08..d2f3cf98ab 100644 --- a/tests/matrix_free/get_functions_cartesian.cc +++ b/tests/matrix_free/get_functions_cartesian.cc @@ -23,9 +23,6 @@ #include "../tests.h" - -std::ofstream logfile("output"); - #include "get_functions_common.h" diff --git a/tests/matrix_free/get_functions_circle.cc b/tests/matrix_free/get_functions_circle.cc index ee576e315d..9fb44a490c 100644 --- a/tests/matrix_free/get_functions_circle.cc +++ b/tests/matrix_free/get_functions_circle.cc @@ -23,8 +23,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "get_functions_common.h" diff --git a/tests/matrix_free/get_functions_common.h b/tests/matrix_free/get_functions_common.h index c12568185e..394dc3cd1a 100644 --- a/tests/matrix_free/get_functions_common.h +++ b/tests/matrix_free/get_functions_common.h @@ -274,8 +274,7 @@ do_test(const DoFHandler & dof, int main() { - deallog.attach(logfile); - deallog.depth_console(0); + initlog(); deallog << std::setprecision(3); { diff --git a/tests/matrix_free/get_functions_constraints.cc b/tests/matrix_free/get_functions_constraints.cc index 11503a4168..174a9a7492 100644 --- a/tests/matrix_free/get_functions_constraints.cc +++ b/tests/matrix_free/get_functions_constraints.cc @@ -21,8 +21,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "get_functions_common.h" diff --git a/tests/matrix_free/get_functions_faces.cc b/tests/matrix_free/get_functions_faces.cc index a6fa31f63f..989ed0f573 100644 --- a/tests/matrix_free/get_functions_faces.cc +++ b/tests/matrix_free/get_functions_faces.cc @@ -33,8 +33,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - template diff --git a/tests/matrix_free/get_functions_float.cc b/tests/matrix_free/get_functions_float.cc index 5f3187e77f..3ecf8af209 100644 --- a/tests/matrix_free/get_functions_float.cc +++ b/tests/matrix_free/get_functions_float.cc @@ -25,9 +25,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "get_functions_common.h" diff --git a/tests/matrix_free/get_functions_gl.cc b/tests/matrix_free/get_functions_gl.cc index a0789be80c..8fb9bf94f3 100644 --- a/tests/matrix_free/get_functions_gl.cc +++ b/tests/matrix_free/get_functions_gl.cc @@ -23,9 +23,6 @@ #include "../tests.h" - -std::ofstream logfile("output"); - #include "get_functions_common.h" diff --git a/tests/matrix_free/get_functions_mappingq.cc b/tests/matrix_free/get_functions_mappingq.cc index d5b1f58d13..70d9aa284e 100644 --- a/tests/matrix_free/get_functions_mappingq.cc +++ b/tests/matrix_free/get_functions_mappingq.cc @@ -23,8 +23,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "get_functions_common.h" diff --git a/tests/matrix_free/get_functions_multife.cc b/tests/matrix_free/get_functions_multife.cc index 85c8bb2be7..9aa9e51fad 100644 --- a/tests/matrix_free/get_functions_multife.cc +++ b/tests/matrix_free/get_functions_multife.cc @@ -44,8 +44,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - template @@ -197,7 +196,7 @@ test() int main() { - deallog.attach(logfile); + initlog(); deallog << std::setprecision(3); diff --git a/tests/matrix_free/get_functions_variants_gl.cc b/tests/matrix_free/get_functions_variants_gl.cc index d5114ac630..db387ee071 100644 --- a/tests/matrix_free/get_functions_variants_gl.cc +++ b/tests/matrix_free/get_functions_variants_gl.cc @@ -38,7 +38,6 @@ #include "../tests.h" -std::ofstream logfile("output"); template @@ -193,7 +192,7 @@ test() int main() { - deallog.attach(logfile); + initlog(); deallog << std::setprecision(3); diff --git a/tests/matrix_free/get_values_plain.cc b/tests/matrix_free/get_values_plain.cc index ca7eb3c579..58550ef4e8 100644 --- a/tests/matrix_free/get_values_plain.cc +++ b/tests/matrix_free/get_values_plain.cc @@ -44,7 +44,6 @@ #include "../tests.h" -std::ofstream logfile("output"); template @@ -230,7 +229,7 @@ test() int main() { - deallog.attach(logfile); + initlog(); deallog << std::setprecision(3); { diff --git a/tests/matrix_free/integrate_functions_multife.cc b/tests/matrix_free/integrate_functions_multife.cc index 9e8c8bcfad..cfab893c86 100644 --- a/tests/matrix_free/integrate_functions_multife.cc +++ b/tests/matrix_free/integrate_functions_multife.cc @@ -44,7 +44,6 @@ #include "../tests.h" -std::ofstream logfile("output"); template @@ -355,7 +354,7 @@ test() int main() { - deallog.attach(logfile); + initlog(); deallog << std::setprecision(3); { diff --git a/tests/matrix_free/integrate_functions_multife2.cc b/tests/matrix_free/integrate_functions_multife2.cc index 7b7fa5850e..ed0e10c0b2 100644 --- a/tests/matrix_free/integrate_functions_multife2.cc +++ b/tests/matrix_free/integrate_functions_multife2.cc @@ -47,7 +47,6 @@ #include "create_mesh.h" -std::ofstream logfile("output"); template @@ -345,7 +344,7 @@ test() int main() { - deallog.attach(logfile); + initlog(); deallog << std::setprecision(3); { diff --git a/tests/matrix_free/jxw_values.cc b/tests/matrix_free/jxw_values.cc index d11f5b6a2d..798bed121c 100644 --- a/tests/matrix_free/jxw_values.cc +++ b/tests/matrix_free/jxw_values.cc @@ -34,7 +34,6 @@ #include "create_mesh.h" -std::ofstream logfile("output"); template @@ -102,7 +101,7 @@ test() int main() { - deallog.attach(logfile); + initlog(); deallog << std::setprecision(3); test<2>(); diff --git a/tests/matrix_free/matrix_vector_01.cc b/tests/matrix_free/matrix_vector_01.cc index 6cdc926c43..9f836f8197 100644 --- a/tests/matrix_free/matrix_vector_01.cc +++ b/tests/matrix_free/matrix_vector_01.cc @@ -22,8 +22,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_common.h" diff --git a/tests/matrix_free/matrix_vector_02.cc b/tests/matrix_free/matrix_vector_02.cc index f8306a9d52..114b6e7ed1 100644 --- a/tests/matrix_free/matrix_vector_02.cc +++ b/tests/matrix_free/matrix_vector_02.cc @@ -24,8 +24,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_common.h" diff --git a/tests/matrix_free/matrix_vector_03.cc b/tests/matrix_free/matrix_vector_03.cc index 08058c6766..94f381f856 100644 --- a/tests/matrix_free/matrix_vector_03.cc +++ b/tests/matrix_free/matrix_vector_03.cc @@ -24,8 +24,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_common.h" template diff --git a/tests/matrix_free/matrix_vector_04.cc b/tests/matrix_free/matrix_vector_04.cc index 00d06943bb..449e40b776 100644 --- a/tests/matrix_free/matrix_vector_04.cc +++ b/tests/matrix_free/matrix_vector_04.cc @@ -22,8 +22,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_common.h" diff --git a/tests/matrix_free/matrix_vector_04b.cc b/tests/matrix_free/matrix_vector_04b.cc index b219f519bc..d74e7567bc 100644 --- a/tests/matrix_free/matrix_vector_04b.cc +++ b/tests/matrix_free/matrix_vector_04b.cc @@ -20,8 +20,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_common.h" diff --git a/tests/matrix_free/matrix_vector_05.cc b/tests/matrix_free/matrix_vector_05.cc index c78548f77e..dcc2cff6a9 100644 --- a/tests/matrix_free/matrix_vector_05.cc +++ b/tests/matrix_free/matrix_vector_05.cc @@ -22,8 +22,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_common.h" diff --git a/tests/matrix_free/matrix_vector_06.cc b/tests/matrix_free/matrix_vector_06.cc index d381316b79..025be763ab 100644 --- a/tests/matrix_free/matrix_vector_06.cc +++ b/tests/matrix_free/matrix_vector_06.cc @@ -26,9 +26,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_common.h" template diff --git a/tests/matrix_free/matrix_vector_06_notempl.cc b/tests/matrix_free/matrix_vector_06_notempl.cc index 6ab5467e52..be92986aa8 100644 --- a/tests/matrix_free/matrix_vector_06_notempl.cc +++ b/tests/matrix_free/matrix_vector_06_notempl.cc @@ -24,9 +24,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_common.h" template diff --git a/tests/matrix_free/matrix_vector_07.cc b/tests/matrix_free/matrix_vector_07.cc index 6d7eb2bb87..c8ad6ab325 100644 --- a/tests/matrix_free/matrix_vector_07.cc +++ b/tests/matrix_free/matrix_vector_07.cc @@ -29,8 +29,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_common.h" diff --git a/tests/matrix_free/matrix_vector_08.cc b/tests/matrix_free/matrix_vector_08.cc index 7c273cf72c..4224727cdd 100644 --- a/tests/matrix_free/matrix_vector_08.cc +++ b/tests/matrix_free/matrix_vector_08.cc @@ -24,9 +24,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_common.h" template diff --git a/tests/matrix_free/matrix_vector_09.cc b/tests/matrix_free/matrix_vector_09.cc index dcbcc89e12..97723ab344 100644 --- a/tests/matrix_free/matrix_vector_09.cc +++ b/tests/matrix_free/matrix_vector_09.cc @@ -24,9 +24,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_common.h" template diff --git a/tests/matrix_free/matrix_vector_14.cc b/tests/matrix_free/matrix_vector_14.cc index 56cf15c978..9e8be93d2c 100644 --- a/tests/matrix_free/matrix_vector_14.cc +++ b/tests/matrix_free/matrix_vector_14.cc @@ -25,9 +25,6 @@ #include "../tests.h" - -std::ofstream logfile("output"); - #include "matrix_vector_common.h" diff --git a/tests/matrix_free/matrix_vector_14_notempl.cc b/tests/matrix_free/matrix_vector_14_notempl.cc index 2eed9aebaf..04b2442608 100644 --- a/tests/matrix_free/matrix_vector_14_notempl.cc +++ b/tests/matrix_free/matrix_vector_14_notempl.cc @@ -22,9 +22,6 @@ #include "../tests.h" - -std::ofstream logfile("output"); - #include "matrix_vector_common.h" diff --git a/tests/matrix_free/matrix_vector_14b.cc b/tests/matrix_free/matrix_vector_14b.cc index 3ff403c920..a60749f071 100644 --- a/tests/matrix_free/matrix_vector_14b.cc +++ b/tests/matrix_free/matrix_vector_14b.cc @@ -22,8 +22,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_common.h" diff --git a/tests/matrix_free/matrix_vector_15.cc b/tests/matrix_free/matrix_vector_15.cc index 213e048691..a667d6a97c 100644 --- a/tests/matrix_free/matrix_vector_15.cc +++ b/tests/matrix_free/matrix_vector_15.cc @@ -43,9 +43,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - - template & dof, int main() { - deallog.attach(logfile); - deallog.depth_console(0); - - deallog << std::setprecision(3); + initlog(); { deallog.push("2d"); diff --git a/tests/matrix_free/matrix_vector_curl.cc b/tests/matrix_free/matrix_vector_curl.cc index 72e2f9d2ff..39d1a17e8c 100644 --- a/tests/matrix_free/matrix_vector_curl.cc +++ b/tests/matrix_free/matrix_vector_curl.cc @@ -21,10 +21,6 @@ // vector-valued problem (curl-curl operator which does not really make a lot // of sense from a problem point of view, though). -#include "../tests.h" - -std::ofstream logfile("output"); - #include #include @@ -52,6 +48,8 @@ std::ofstream logfile("output"); #include #include +#include "../tests.h" + const double global_coefficient = 0.1; @@ -283,8 +281,7 @@ test() int main() { - deallog.attach(logfile); - + initlog(); deallog << std::setprecision(3); { diff --git a/tests/matrix_free/matrix_vector_div.cc b/tests/matrix_free/matrix_vector_div.cc index d1f9c00332..e9f95940c5 100644 --- a/tests/matrix_free/matrix_vector_div.cc +++ b/tests/matrix_free/matrix_vector_div.cc @@ -21,10 +21,6 @@ // vector-valued problem (div-div operator which does not really make a lot // of sense from a problem point of view, though). -#include "../tests.h" - -std::ofstream logfile("output"); - #include #include @@ -52,6 +48,8 @@ std::ofstream logfile("output"); #include #include +#include "../tests.h" + #include "create_mesh.h" const double global_coefficient = 0.1; @@ -286,7 +284,7 @@ test() int main() { - deallog.attach(logfile); + initlog(); deallog << std::setprecision(3); diff --git a/tests/matrix_free/matrix_vector_faces_01.cc b/tests/matrix_free/matrix_vector_faces_01.cc index 62ce23abc0..57459a44bc 100644 --- a/tests/matrix_free/matrix_vector_faces_01.cc +++ b/tests/matrix_free/matrix_vector_faces_01.cc @@ -25,8 +25,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" template diff --git a/tests/matrix_free/matrix_vector_faces_02.cc b/tests/matrix_free/matrix_vector_faces_02.cc index afa440fa88..3259184f59 100644 --- a/tests/matrix_free/matrix_vector_faces_02.cc +++ b/tests/matrix_free/matrix_vector_faces_02.cc @@ -25,8 +25,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" template diff --git a/tests/matrix_free/matrix_vector_faces_03.cc b/tests/matrix_free/matrix_vector_faces_03.cc index 2cb5f25c97..e4c17e0696 100644 --- a/tests/matrix_free/matrix_vector_faces_03.cc +++ b/tests/matrix_free/matrix_vector_faces_03.cc @@ -28,9 +28,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_faces_04.cc b/tests/matrix_free/matrix_vector_faces_04.cc index a383b6f443..9309d6c4ca 100644 --- a/tests/matrix_free/matrix_vector_faces_04.cc +++ b/tests/matrix_free/matrix_vector_faces_04.cc @@ -25,8 +25,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" template diff --git a/tests/matrix_free/matrix_vector_faces_05.cc b/tests/matrix_free/matrix_vector_faces_05.cc index 3b1bfc0afc..163f5a6aa8 100644 --- a/tests/matrix_free/matrix_vector_faces_05.cc +++ b/tests/matrix_free/matrix_vector_faces_05.cc @@ -27,8 +27,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" template diff --git a/tests/matrix_free/matrix_vector_faces_06.cc b/tests/matrix_free/matrix_vector_faces_06.cc index 34caad2788..22386d7cd4 100644 --- a/tests/matrix_free/matrix_vector_faces_06.cc +++ b/tests/matrix_free/matrix_vector_faces_06.cc @@ -27,9 +27,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" template diff --git a/tests/matrix_free/matrix_vector_faces_07.cc b/tests/matrix_free/matrix_vector_faces_07.cc index 61f3192409..9954c305a8 100644 --- a/tests/matrix_free/matrix_vector_faces_07.cc +++ b/tests/matrix_free/matrix_vector_faces_07.cc @@ -29,9 +29,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_faces_08.cc b/tests/matrix_free/matrix_vector_faces_08.cc index 5c8e6e342a..857575f521 100644 --- a/tests/matrix_free/matrix_vector_faces_08.cc +++ b/tests/matrix_free/matrix_vector_faces_08.cc @@ -29,9 +29,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_faces_09.cc b/tests/matrix_free/matrix_vector_faces_09.cc index 4a0e94e790..32011a4615 100644 --- a/tests/matrix_free/matrix_vector_faces_09.cc +++ b/tests/matrix_free/matrix_vector_faces_09.cc @@ -28,9 +28,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_faces_10.cc b/tests/matrix_free/matrix_vector_faces_10.cc index c552852e3e..7fa725d6d0 100644 --- a/tests/matrix_free/matrix_vector_faces_10.cc +++ b/tests/matrix_free/matrix_vector_faces_10.cc @@ -32,9 +32,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_faces_11.cc b/tests/matrix_free/matrix_vector_faces_11.cc index e013de3790..c65a0a637a 100644 --- a/tests/matrix_free/matrix_vector_faces_11.cc +++ b/tests/matrix_free/matrix_vector_faces_11.cc @@ -33,9 +33,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_faces_12.cc b/tests/matrix_free/matrix_vector_faces_12.cc index da16228eae..1f20bc99b7 100644 --- a/tests/matrix_free/matrix_vector_faces_12.cc +++ b/tests/matrix_free/matrix_vector_faces_12.cc @@ -28,9 +28,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_faces_13.cc b/tests/matrix_free/matrix_vector_faces_13.cc index 7d04f9fda9..c46c7827c1 100644 --- a/tests/matrix_free/matrix_vector_faces_13.cc +++ b/tests/matrix_free/matrix_vector_faces_13.cc @@ -32,9 +32,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_faces_14.cc b/tests/matrix_free/matrix_vector_faces_14.cc index 0f4fd5838b..85d68c99cc 100644 --- a/tests/matrix_free/matrix_vector_faces_14.cc +++ b/tests/matrix_free/matrix_vector_faces_14.cc @@ -32,8 +32,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_faces_15.cc b/tests/matrix_free/matrix_vector_faces_15.cc index 1e73d8ac0c..fd2f766bb2 100644 --- a/tests/matrix_free/matrix_vector_faces_15.cc +++ b/tests/matrix_free/matrix_vector_faces_15.cc @@ -32,9 +32,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_faces_16.cc b/tests/matrix_free/matrix_vector_faces_16.cc index 870cf8458c..2959b135eb 100644 --- a/tests/matrix_free/matrix_vector_faces_16.cc +++ b/tests/matrix_free/matrix_vector_faces_16.cc @@ -32,9 +32,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_faces_17.cc b/tests/matrix_free/matrix_vector_faces_17.cc index 3fead3db46..4e88917679 100644 --- a/tests/matrix_free/matrix_vector_faces_17.cc +++ b/tests/matrix_free/matrix_vector_faces_17.cc @@ -32,9 +32,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_faces_18.cc b/tests/matrix_free/matrix_vector_faces_18.cc index 6594d5bba7..aab380f9f5 100644 --- a/tests/matrix_free/matrix_vector_faces_18.cc +++ b/tests/matrix_free/matrix_vector_faces_18.cc @@ -30,8 +30,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_faces_19.cc b/tests/matrix_free/matrix_vector_faces_19.cc index 8fa6661328..4f36f23791 100644 --- a/tests/matrix_free/matrix_vector_faces_19.cc +++ b/tests/matrix_free/matrix_vector_faces_19.cc @@ -32,9 +32,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_faces_20.cc b/tests/matrix_free/matrix_vector_faces_20.cc index 3f08f63458..82806b6c16 100644 --- a/tests/matrix_free/matrix_vector_faces_20.cc +++ b/tests/matrix_free/matrix_vector_faces_20.cc @@ -34,8 +34,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_faces_21.cc b/tests/matrix_free/matrix_vector_faces_21.cc index 5784918a54..7d1ed6a849 100644 --- a/tests/matrix_free/matrix_vector_faces_21.cc +++ b/tests/matrix_free/matrix_vector_faces_21.cc @@ -35,8 +35,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_faces_22.cc b/tests/matrix_free/matrix_vector_faces_22.cc index a9766e1282..37d4206abe 100644 --- a/tests/matrix_free/matrix_vector_faces_22.cc +++ b/tests/matrix_free/matrix_vector_faces_22.cc @@ -33,8 +33,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_faces_23.cc b/tests/matrix_free/matrix_vector_faces_23.cc index 0c82043594..e7e50f8db7 100644 --- a/tests/matrix_free/matrix_vector_faces_23.cc +++ b/tests/matrix_free/matrix_vector_faces_23.cc @@ -35,8 +35,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_faces_24.cc b/tests/matrix_free/matrix_vector_faces_24.cc index be853f6239..2f66177d07 100644 --- a/tests/matrix_free/matrix_vector_faces_24.cc +++ b/tests/matrix_free/matrix_vector_faces_24.cc @@ -33,9 +33,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_faces_25.cc b/tests/matrix_free/matrix_vector_faces_25.cc index e0007396e1..0869d61557 100644 --- a/tests/matrix_free/matrix_vector_faces_25.cc +++ b/tests/matrix_free/matrix_vector_faces_25.cc @@ -27,8 +27,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_faces_26.cc b/tests/matrix_free/matrix_vector_faces_26.cc index 64a2ceaa9a..0fdfb20557 100644 --- a/tests/matrix_free/matrix_vector_faces_26.cc +++ b/tests/matrix_free/matrix_vector_faces_26.cc @@ -25,8 +25,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" template diff --git a/tests/matrix_free/matrix_vector_faces_27.cc b/tests/matrix_free/matrix_vector_faces_27.cc index 360eea7b74..f0e5fe7756 100644 --- a/tests/matrix_free/matrix_vector_faces_27.cc +++ b/tests/matrix_free/matrix_vector_faces_27.cc @@ -27,8 +27,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" template diff --git a/tests/matrix_free/matrix_vector_faces_28.cc b/tests/matrix_free/matrix_vector_faces_28.cc index 8cfe4fb36d..365e779164 100644 --- a/tests/matrix_free/matrix_vector_faces_28.cc +++ b/tests/matrix_free/matrix_vector_faces_28.cc @@ -32,9 +32,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/matrix_vector_float.cc b/tests/matrix_free/matrix_vector_float.cc index 493236d482..19c06c2139 100644 --- a/tests/matrix_free/matrix_vector_float.cc +++ b/tests/matrix_free/matrix_vector_float.cc @@ -22,8 +22,6 @@ #include "../tests.h" -std::ofstream logfile("output"); - #include "create_mesh.h" #include "matrix_vector_common.h" diff --git a/tests/matrix_free/matrix_vector_hp.cc b/tests/matrix_free/matrix_vector_hp.cc index bf53ef42bc..113b364ee9 100644 --- a/tests/matrix_free/matrix_vector_hp.cc +++ b/tests/matrix_free/matrix_vector_hp.cc @@ -20,15 +20,13 @@ // matrix for hp DoFHandler on a hyperball mesh with hanging nodes and finite // elements orders distributed randomly. -#include "../tests.h" - -std::ofstream logfile("output"); - #include #include #include +#include "../tests.h" + #include "matrix_vector_common.h" diff --git a/tests/matrix_free/matrix_vector_large_degree_01.cc b/tests/matrix_free/matrix_vector_large_degree_01.cc index 9a89539ac7..fccad8f2eb 100644 --- a/tests/matrix_free/matrix_vector_large_degree_01.cc +++ b/tests/matrix_free/matrix_vector_large_degree_01.cc @@ -22,10 +22,6 @@ // matrix-based results in this case, this test simply checks that the // matrix-vector product runs without error -#include "../tests.h" - -std::ofstream logfile("output"); - #include #include @@ -38,6 +34,8 @@ std::ofstream logfile("output"); #include #include +#include "../tests.h" + #include "matrix_vector_mf.h" diff --git a/tests/matrix_free/matrix_vector_large_degree_03.cc b/tests/matrix_free/matrix_vector_large_degree_03.cc index 7cd78ee84e..7353d31619 100644 --- a/tests/matrix_free/matrix_vector_large_degree_03.cc +++ b/tests/matrix_free/matrix_vector_large_degree_03.cc @@ -20,10 +20,6 @@ // have a constant-coefficient Laplacian, we can verify the implementation by // comparing to the result with 21 quadrature points. -#include "../tests.h" - -std::ofstream logfile("output"); - #include #include @@ -36,6 +32,8 @@ std::ofstream logfile("output"); #include #include +#include "../tests.h" + #include "matrix_vector_mf.h" diff --git a/tests/matrix_free/matrix_vector_mg.cc b/tests/matrix_free/matrix_vector_mg.cc index f55fbd9ab7..dc6c832f76 100644 --- a/tests/matrix_free/matrix_vector_mg.cc +++ b/tests/matrix_free/matrix_vector_mg.cc @@ -20,15 +20,13 @@ // matrix for MG DoFHandler on a hyperball mesh with no hanging nodes but // homogeneous Dirichlet conditions -#include "../tests.h" - -std::ofstream logfile("output"); - #include #include #include +#include "../tests.h" + #include "matrix_vector_common.h" diff --git a/tests/matrix_free/matrix_vector_stokes.cc b/tests/matrix_free/matrix_vector_stokes.cc index a450fae2d4..f11f8a78f0 100644 --- a/tests/matrix_free/matrix_vector_stokes.cc +++ b/tests/matrix_free/matrix_vector_stokes.cc @@ -20,10 +20,6 @@ // matrix. No hanging nodes and no other // constraints for a vector-valued problem (stokes equations). -#include "../tests.h" - -std::ofstream logfile("output"); - #include #include @@ -51,6 +47,8 @@ std::ofstream logfile("output"); #include #include +#include "../tests.h" + #include "create_mesh.h" @@ -317,8 +315,7 @@ test() int main() { - deallog.attach(logfile); - + initlog(); deallog << std::setprecision(3); { diff --git a/tests/matrix_free/matrix_vector_stokes_flux.cc b/tests/matrix_free/matrix_vector_stokes_flux.cc index 2c7cfe2ec6..05f492e1db 100644 --- a/tests/matrix_free/matrix_vector_stokes_flux.cc +++ b/tests/matrix_free/matrix_vector_stokes_flux.cc @@ -22,10 +22,6 @@ // the Stokes equations. Like matrix_vector_stokes_onedof except for // different constraints -#include "../tests.h" - -std::ofstream logfile("output"); - #include #include @@ -56,6 +52,8 @@ std::ofstream logfile("output"); #include #include +#include "../tests.h" + template diff --git a/tests/matrix_free/matrix_vector_stokes_noflux.cc b/tests/matrix_free/matrix_vector_stokes_noflux.cc index 42fb68d9f3..530f9e62de 100644 --- a/tests/matrix_free/matrix_vector_stokes_noflux.cc +++ b/tests/matrix_free/matrix_vector_stokes_noflux.cc @@ -21,10 +21,6 @@ // between the vector components in the form of no-normal flux constraints on // the Stokes equations. -#include "../tests.h" - -std::ofstream logfile("output"); - #include #include @@ -53,6 +49,8 @@ std::ofstream logfile("output"); #include #include +#include "../tests.h" + template @@ -331,8 +329,7 @@ test() int main() { - deallog.attach(logfile); - + initlog(); deallog << std::setprecision(3); { diff --git a/tests/matrix_free/matrix_vector_stokes_notempl.cc b/tests/matrix_free/matrix_vector_stokes_notempl.cc index 6b1280a699..64eab7565c 100644 --- a/tests/matrix_free/matrix_vector_stokes_notempl.cc +++ b/tests/matrix_free/matrix_vector_stokes_notempl.cc @@ -18,10 +18,6 @@ // same as matrix_vector_stokes_noflux but no template parameter on the // polynomial degree -#include "../tests.h" - -std::ofstream logfile("output"); - #include #include @@ -50,6 +46,8 @@ std::ofstream logfile("output"); #include #include +#include "../tests.h" + template @@ -327,8 +325,7 @@ test(const unsigned int fe_degree) int main() { - deallog.attach(logfile); - + initlog(); deallog << std::setprecision(3); { diff --git a/tests/matrix_free/matrix_vector_stokes_onedof.cc b/tests/matrix_free/matrix_vector_stokes_onedof.cc index 9dc414bd5a..789096ebe9 100644 --- a/tests/matrix_free/matrix_vector_stokes_onedof.cc +++ b/tests/matrix_free/matrix_vector_stokes_onedof.cc @@ -20,10 +20,6 @@ // putting all degrees of freedom into a single DoFHandler, where the // selection is done through FEEvaluation -#include "../tests.h" - -std::ofstream logfile("output"); - #include #include @@ -54,6 +50,8 @@ std::ofstream logfile("output"); #include #include +#include "../tests.h" + template diff --git a/tests/matrix_free/matrix_vector_stokes_qdg0.cc b/tests/matrix_free/matrix_vector_stokes_qdg0.cc index 125491ab6d..54ba17b296 100644 --- a/tests/matrix_free/matrix_vector_stokes_qdg0.cc +++ b/tests/matrix_free/matrix_vector_stokes_qdg0.cc @@ -20,10 +20,6 @@ // matrix. No hanging nodes and no other // constraints for a vector-valued problem (stokes equations). -#include "../tests.h" - -std::ofstream logfile("output"); - #include #include @@ -52,6 +48,8 @@ std::ofstream logfile("output"); #include #include +#include "../tests.h" + #include "create_mesh.h" @@ -319,8 +317,7 @@ test() int main() { - deallog.attach(logfile); - + initlog(); deallog << std::setprecision(3); { diff --git a/tests/matrix_free/matrix_vector_stokes_qdg0b.cc b/tests/matrix_free/matrix_vector_stokes_qdg0b.cc index 1da5e8026c..17e48842d0 100644 --- a/tests/matrix_free/matrix_vector_stokes_qdg0b.cc +++ b/tests/matrix_free/matrix_vector_stokes_qdg0b.cc @@ -21,10 +21,6 @@ // problem (stokes equations). Same as matrix_vector_stokes_qdg0 but now // without the template on the degree of the element. -#include "../tests.h" - -std::ofstream logfile("output"); - #include #include @@ -53,6 +49,8 @@ std::ofstream logfile("output"); #include #include +#include "../tests.h" + #include "create_mesh.h" @@ -316,8 +314,7 @@ test(const unsigned int fe_degree) int main() { - deallog.attach(logfile); - + initlog(); deallog << std::setprecision(3); { diff --git a/tests/matrix_free/multigrid_dg_periodic.cc b/tests/matrix_free/multigrid_dg_periodic.cc index a7c846b086..65000afebc 100644 --- a/tests/matrix_free/multigrid_dg_periodic.cc +++ b/tests/matrix_free/multigrid_dg_periodic.cc @@ -53,7 +53,6 @@ #include "../tests.h" -std::ofstream logfile("output"); template #include @@ -45,6 +40,8 @@ std::ofstream logfile("output"); #include +#include "../tests.h" + // forward declare this function template @@ -173,7 +170,7 @@ int main() { deal_II_exceptions::disable_abort_on_exception(); - deallog.attach(logfile); + initlog(); deallog << std::setprecision(3); test<2, 1>(); diff --git a/tests/matrix_free/parallel_multigrid.cc b/tests/matrix_free/parallel_multigrid.cc index 186f91bca6..a151604ac6 100644 --- a/tests/matrix_free/parallel_multigrid.cc +++ b/tests/matrix_free/parallel_multigrid.cc @@ -49,7 +49,6 @@ #include "../tests.h" -std::ofstream logfile("output"); template @@ -276,12 +274,8 @@ int main(int argc, char **argv) { Utilities::MPI::MPI_InitFinalize mpi_init(argc, argv, 1); - - if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) - { - deallog.attach(logfile); - deallog << std::setprecision(4); - } + mpi_initlog(); + deallog << std::setprecision(4); { deallog.push("2d"); diff --git a/tests/matrix_free/parallel_multigrid_adaptive_01.cc b/tests/matrix_free/parallel_multigrid_adaptive_01.cc index 554b5ab6c0..ece9bf6a08 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_01.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_01.cc @@ -49,7 +49,6 @@ #include "../tests.h" -std::ofstream logfile("output"); template @@ -116,7 +115,7 @@ test() int main() { - deallog.attach(logfile); + initlog(); deallog << std::setprecision(3); { diff --git a/tests/matrix_free/shape_info.cc b/tests/matrix_free/shape_info.cc index 3a2fffcfec..d312245861 100644 --- a/tests/matrix_free/shape_info.cc +++ b/tests/matrix_free/shape_info.cc @@ -31,7 +31,6 @@ #include "../tests.h" -std::ofstream logfile("output"); template diff --git a/tests/matrix_free/shape_info_inverse.cc b/tests/matrix_free/shape_info_inverse.cc index be98ff8a3a..0a2c2096a5 100644 --- a/tests/matrix_free/shape_info_inverse.cc +++ b/tests/matrix_free/shape_info_inverse.cc @@ -29,7 +29,6 @@ #include "../tests.h" -std::ofstream logfile("output"); template diff --git a/tests/matrix_free/thread_correctness.cc b/tests/matrix_free/thread_correctness.cc index dd0adce30b..4d9f6681d6 100644 --- a/tests/matrix_free/thread_correctness.cc +++ b/tests/matrix_free/thread_correctness.cc @@ -23,9 +23,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_common.h" diff --git a/tests/matrix_free/thread_correctness_dg.cc b/tests/matrix_free/thread_correctness_dg.cc index 5ac0b94f24..10380858e4 100644 --- a/tests/matrix_free/thread_correctness_dg.cc +++ b/tests/matrix_free/thread_correctness_dg.cc @@ -25,9 +25,6 @@ #include "../tests.h" #include "create_mesh.h" - -std::ofstream logfile("output"); - #include "matrix_vector_faces_common.h" diff --git a/tests/matrix_free/thread_correctness_hp.cc b/tests/matrix_free/thread_correctness_hp.cc index 90ded7ed5a..c569864450 100644 --- a/tests/matrix_free/thread_correctness_hp.cc +++ b/tests/matrix_free/thread_correctness_hp.cc @@ -19,16 +19,14 @@ // matrix free matrix-vector products for hp elements by comparing to the // serial version -#include "../tests.h" - -std::ofstream logfile("output"); - #include #include #include #include +#include "../tests.h" + #include "create_mesh.h" #include "matrix_vector_common.h" diff --git a/tests/matrix_free/update_mapping_only.cc b/tests/matrix_free/update_mapping_only.cc index 364064a4e1..874bdcb341 100644 --- a/tests/matrix_free/update_mapping_only.cc +++ b/tests/matrix_free/update_mapping_only.cc @@ -23,9 +23,6 @@ #include "../tests.h" - -std::ofstream logfile("output"); - #include "get_functions_common.h"