Skip to content

Commit

Permalink
Avoid global logfile variable for matrix-free tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kronbichler committed Mar 11, 2020
1 parent 6fa3d5e commit 5d792b0
Show file tree
Hide file tree
Showing 118 changed files with 81 additions and 361 deletions.
1 change: 0 additions & 1 deletion tests/matrix_free/additional_data_copy.cc
Expand Up @@ -21,7 +21,6 @@

#include "../tests.h"

std::ofstream logfile("output");

template <typename T>
bool
Expand Down
1 change: 0 additions & 1 deletion tests/matrix_free/advect_1d.cc
Expand Up @@ -37,7 +37,6 @@

#include "../tests.h"

std::ofstream logfile("output");


template <int dim,
Expand Down
1 change: 0 additions & 1 deletion tests/matrix_free/advect_1d_system.cc
Expand Up @@ -37,7 +37,6 @@

#include "../tests.h"

std::ofstream logfile("output");


template <int dim,
Expand Down
1 change: 0 additions & 1 deletion tests/matrix_free/advect_1d_vectorization_mask.cc
Expand Up @@ -36,7 +36,6 @@

#include "../tests.h"

std::ofstream logfile("output");


template <int dim,
Expand Down
5 changes: 1 addition & 4 deletions tests/matrix_free/assemble_matrix_01.cc
Expand Up @@ -36,9 +36,6 @@
#include "../tests.h"


std::ofstream logfile("output");



template <int dim, int fe_degree>
void
Expand Down Expand Up @@ -158,7 +155,7 @@ test()
int
main()
{
deallog.attach(logfile);
initlog();

deallog << std::setprecision(3);

Expand Down
4 changes: 1 addition & 3 deletions tests/matrix_free/assemble_matrix_02.cc
Expand Up @@ -36,8 +36,6 @@
#include "../tests.h"


std::ofstream logfile("output");


const unsigned int degree_p = 1;

Expand Down Expand Up @@ -215,7 +213,7 @@ test()
int
main()
{
deallog.attach(logfile);
initlog();

deallog << std::setprecision(3);

Expand Down
4 changes: 1 addition & 3 deletions tests/matrix_free/assemble_matrix_03.cc
Expand Up @@ -39,8 +39,6 @@
#include "../tests.h"


std::ofstream logfile("output");


namespace Assembly
{
Expand Down Expand Up @@ -198,7 +196,7 @@ test()
int
main()
{
deallog.attach(logfile);
initlog();

deallog << std::setprecision(3);

Expand Down
1 change: 0 additions & 1 deletion tests/matrix_free/cell_categorization.cc
Expand Up @@ -32,7 +32,6 @@

#include "create_mesh.h"

std::ofstream logfile("output");

template <int dim>
void
Expand Down
1 change: 0 additions & 1 deletion tests/matrix_free/cell_categorization_02.cc
Expand Up @@ -39,7 +39,6 @@

#include "create_mesh.h"

std::ofstream logfile("output");

template <int dim>
void
Expand Down
4 changes: 1 addition & 3 deletions tests/matrix_free/compress_constraints.cc
Expand Up @@ -38,8 +38,6 @@

#include "create_mesh.h"

std::ofstream logfile("output");



template <int dim>
Expand Down Expand Up @@ -97,7 +95,7 @@ test()
int
main()
{
deallog.attach(logfile);
initlog();

deallog << std::setprecision(3);

Expand Down
4 changes: 1 addition & 3 deletions tests/matrix_free/compress_mapping.cc
Expand Up @@ -37,8 +37,6 @@

#include "create_mesh.h"

std::ofstream logfile("output");



template <int dim>
Expand Down Expand Up @@ -182,7 +180,7 @@ test_parallelogram()
int
main()
{
deallog.attach(logfile);
initlog();

deallog << std::setprecision(3);

Expand Down
2 changes: 0 additions & 2 deletions tests/matrix_free/copy.cc
Expand Up @@ -23,8 +23,6 @@

#include "../tests.h"

std::ofstream logfile("output");

#include "matrix_vector_common.h"


Expand Down
8 changes: 3 additions & 5 deletions tests/matrix_free/copy_feevaluation.cc
Expand Up @@ -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 <deal.II/base/aligned_vector.h>
#include <deal.II/base/utilities.h>

Expand Down Expand Up @@ -52,6 +48,8 @@ std::ofstream logfile("output");
#include <complex>
#include <iostream>

#include "../tests.h"



template <int dim, int degree_p, typename VectorType>
Expand Down Expand Up @@ -336,7 +334,7 @@ test()
int
main()
{
deallog.attach(logfile);
initlog();

deallog << std::setprecision(3);

Expand Down
1 change: 0 additions & 1 deletion tests/matrix_free/dg_pbc_01.cc
Expand Up @@ -32,7 +32,6 @@

#include "../tests.h"

std::ofstream logfile("output");


// We want to use the matrix-vector product provided by this function (which
Expand Down
2 changes: 0 additions & 2 deletions tests/matrix_free/dg_pbc_02.cc
Expand Up @@ -35,8 +35,6 @@

#include "../tests.h"

std::ofstream logfile("output");



template <int dim>
Expand Down
8 changes: 3 additions & 5 deletions tests/matrix_free/estimate_condition_number_mass.cc
Expand Up @@ -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 <deal.II/base/function_lib.h>

#include <deal.II/fe/fe_dgq.h>
Expand All @@ -40,6 +36,8 @@ std::ofstream logfile("output");

#include <deal.II/numerics/vector_tools.h>

#include "../tests.h"


void
output_double_number(double input, const std::string &text)
Expand Down Expand Up @@ -156,7 +154,7 @@ test(const FiniteElement<dim> &fe, const unsigned int n_iterations)
int
main()
{
deallog.attach(logfile);
initlog();

deallog << std::setprecision(2);

Expand Down
1 change: 0 additions & 1 deletion tests/matrix_free/faces_value_optimization.cc
Expand Up @@ -30,7 +30,6 @@

#include "../tests.h"

std::ofstream logfile("output");

template <int dim, int fe_degree, typename number>
class MatrixFreeTest
Expand Down
1 change: 0 additions & 1 deletion tests/matrix_free/faces_value_optimization_02.cc
Expand Up @@ -31,7 +31,6 @@

#include "../tests.h"

std::ofstream logfile("output");

template <int dim, int fe_degree, typename number>
class MatrixFreeTest
Expand Down
3 changes: 0 additions & 3 deletions tests/matrix_free/get_functions_cartesian.cc
Expand Up @@ -23,9 +23,6 @@

#include "../tests.h"


std::ofstream logfile("output");

#include "get_functions_common.h"


Expand Down
2 changes: 0 additions & 2 deletions tests/matrix_free/get_functions_circle.cc
Expand Up @@ -23,8 +23,6 @@

#include "../tests.h"

std::ofstream logfile("output");

#include "get_functions_common.h"


Expand Down
3 changes: 1 addition & 2 deletions tests/matrix_free/get_functions_common.h
Expand Up @@ -274,8 +274,7 @@ do_test(const DoFHandler<dim> & dof,
int
main()
{
deallog.attach(logfile);
deallog.depth_console(0);
initlog();

deallog << std::setprecision(3);
{
Expand Down
2 changes: 0 additions & 2 deletions tests/matrix_free/get_functions_constraints.cc
Expand Up @@ -21,8 +21,6 @@

#include "../tests.h"

std::ofstream logfile("output");

#include "get_functions_common.h"


Expand Down
2 changes: 0 additions & 2 deletions tests/matrix_free/get_functions_faces.cc
Expand Up @@ -33,8 +33,6 @@

#include "../tests.h"

std::ofstream logfile("output");



template <int dim, int fe_degree, typename number>
Expand Down
3 changes: 0 additions & 3 deletions tests/matrix_free/get_functions_float.cc
Expand Up @@ -25,9 +25,6 @@
#include "../tests.h"

#include "create_mesh.h"

std::ofstream logfile("output");

#include "get_functions_common.h"


Expand Down
3 changes: 0 additions & 3 deletions tests/matrix_free/get_functions_gl.cc
Expand Up @@ -23,9 +23,6 @@

#include "../tests.h"


std::ofstream logfile("output");

#include "get_functions_common.h"


Expand Down
2 changes: 0 additions & 2 deletions tests/matrix_free/get_functions_mappingq.cc
Expand Up @@ -23,8 +23,6 @@

#include "../tests.h"

std::ofstream logfile("output");

#include "get_functions_common.h"


Expand Down
9 changes: 2 additions & 7 deletions tests/matrix_free/get_functions_multife.cc
Expand Up @@ -44,8 +44,6 @@
#include "../tests.h"


std::ofstream logfile("output");


template <int dim,
int fe_degree,
Expand Down Expand Up @@ -291,11 +289,8 @@ test()
int
main()
{
deallog.attach(logfile);
// need to set quite a loose tolerance because
// FEValues approximates Hessians with finite
// differences, which are not so accurate
deallog << std::setprecision(3);
initlog();
deallog << std::setprecision(7);

{
deallog.push("2d");
Expand Down
9 changes: 2 additions & 7 deletions tests/matrix_free/get_functions_multife2.cc
Expand Up @@ -46,8 +46,6 @@
#include "../tests.h"


std::ofstream logfile("output");


template <int dim,
int fe_degree,
Expand Down Expand Up @@ -342,11 +340,8 @@ test()
int
main()
{
deallog.attach(logfile);
// need to set quite a loose tolerance because
// FEValues approximates Hessians with finite
// differences, which are not so accurate
deallog << std::setprecision(3);
initlog();
deallog << std::setprecision(7);

{
deallog.push("2d");
Expand Down
2 changes: 0 additions & 2 deletions tests/matrix_free/get_functions_notempl.cc
Expand Up @@ -24,8 +24,6 @@

#include "../tests.h"

std::ofstream logfile("output");

#include "get_functions_common.h"


Expand Down
2 changes: 0 additions & 2 deletions tests/matrix_free/get_functions_q_hierarchical.cc
Expand Up @@ -30,8 +30,6 @@

#include "../tests.h"

std::ofstream logfile("output");

#include "get_functions_common.h"


Expand Down
2 changes: 0 additions & 2 deletions tests/matrix_free/get_functions_rect.cc
Expand Up @@ -24,8 +24,6 @@

#include "../tests.h"

std::ofstream logfile("output");

#include "get_functions_common.h"


Expand Down

0 comments on commit 5d792b0

Please sign in to comment.