// that things still work for very high order
-#include "../tests.h"
-std::ofstream logfile("output");
-
-
#include <deal.II/base/convergence_table.h>
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/hp/fe_values.h>
+#include "../tests.h"
+
const long double pi = 3.141592653589793238462643;
int
main()
{
+ initlog();
deallog << std::setprecision(16);
- logfile << std::setprecision(16);
+ deallog.get_file_stream() << std::setprecision(16);
- deallog.attach(logfile);
compute_pi_by_area<2>();
compute_pi_by_perimeter<2>();
// a un-hp-ified version of hp/step-10
-#include "../tests.h"
-std::ofstream logfile("output");
-
-
#include <deal.II/base/convergence_table.h>
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/hp/fe_values.h>
+#include "../tests.h"
+
const long double pi = 3.141592653589793238462643;
int
main()
{
+ initlog();
deallog << std::setprecision(6);
- logfile << std::setprecision(6);
+ deallog.get_file_stream() << std::setprecision(6);
- deallog.attach(logfile);
gnuplot_output<2>();
// a un-hp-ified version of hp/step-12
-#include "../tests.h"
-std::ofstream logfile("output");
-
#include <deal.II/base/function.h>
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/base/timer.h>
#include <deal.II/numerics/data_out.h>
#include <deal.II/numerics/derivative_approximation.h>
+#include "../tests.h"
+
template <int dim>
int
main()
{
+ initlog();
try
{
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
+ deallog.get_file_stream() << std::setprecision(2);
- deallog.attach(logfile);
DGMethod<2> dgmethod;
dgmethod.run();
-std::ofstream logfile("output");
-
-
void
make_grid(Triangulation<2> &triangulation)
{
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- deallog.attach(logfile);
Triangulation<2> triangulation;
make_grid(triangulation);
#include "../tests.h"
-std::ofstream logfile("output");
-
-
-
class LaplaceProblem
{
public:
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
+ deallog.get_file_stream() << std::setprecision(2);
- deallog.attach(logfile);
LaplaceProblem laplace_problem;
laplace_problem.run();
#include "../tests.h"
-std::ofstream logfile("output");
-
-
template <int dim>
void
test()
int
main()
{
+ initlog();
deallog << std::setprecision(4);
- deallog.attach(logfile);
test<1>();
test<2>();
#include "../tests.h"
-std::ofstream logfile("output");
-
-
template <int dim>
void
test()
int
main()
{
+ initlog();
deallog << std::setprecision(4);
- deallog.attach(logfile);
test<1>();
test<2>();
#include "../tests.h"
-std::ofstream logfile("output");
-
-
template <int dim>
void
test()
int
main()
{
+ initlog();
deallog << std::setprecision(4);
- deallog.attach(logfile);
test<1>();
test<2>();
#include "../tests.h"
-std::ofstream logfile("output");
-
-
template <int dim>
void
test()
int
main()
{
+ initlog();
deallog << std::setprecision(4);
- deallog.attach(logfile);
test<1>();
test<2>();
#include "../tests.h"
-std::ofstream logfile("output");
-
-
template <int dim>
void
test()
int
main()
{
+ initlog();
deallog << std::setprecision(4);
- deallog.attach(logfile);
test<1>();
test<2>();
#include "../tests.h"
-std::ofstream logfile("output");
-
-
template <int dim>
void
test()
int
main()
{
+ initlog();
deallog << std::setprecision(4);
- deallog.attach(logfile);
test<1>();
test<2>();
#include "../tests.h"
-std::ofstream logfile("output");
-
-
template <int dim>
void
test()
int
main()
{
+ initlog();
deallog << std::setprecision(4);
- deallog.attach(logfile);
test<1>();
test<2>();
// 2: refinement of the circle at the boundary
// 2: refinement of a wiggled area at the boundary
-std::ofstream logfile("output");
-
-
template <int dim>
class Ball : public FlatManifold<dim>
{
int unconstrained_bandwidth = sparsity.bandwidth();
deallog << " Writing sparsity pattern..." << std::endl;
- sparsity.print_gnuplot(logfile);
+ sparsity.print_gnuplot(deallog.get_file_stream());
// computing constraints
constraints.condense(sparsity);
deallog << " Writing condensed sparsity pattern..." << std::endl;
- sparsity.print_gnuplot(logfile);
+ sparsity.print_gnuplot(deallog.get_file_stream());
deallog << std::endl
int
main()
{
- deallog.attach(logfile);
+ initlog();
for (unsigned int test_case = 1; test_case <= 2; ++test_case)
{
#include "../tests.h"
-std::ofstream logfile("output");
-
-
//
// Test
// DoFTools::
int
main()
{
+ initlog();
deallog << std::setprecision(4);
- logfile << std::setprecision(4);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(4);
deallog << "Test for 2D, Q1:" << std::endl << std::endl;
#include "../tests.h"
-std::ofstream logfile("output");
-
-
-
/*
* Generate a grid consisting of two disjoint cells, colorize the two
* outermost faces. They will be matched via collect_periodic_faces
int
main()
{
+ initlog();
deallog << std::setprecision(4);
- logfile << std::setprecision(4);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(4);
{
// Generate a triangulation and match:
#include "../tests.h"
-std::ofstream logfile("output");
-
-
-
/*
* Generate a grid consisting of two disjoint cells, colorize the two
* outermost faces. They will be matched via collect_periodic_faces
int
main()
{
+ initlog();
deallog << std::setprecision(4);
- logfile << std::setprecision(4);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(4);
{
// Generate a triangulation and match:
#include "../tests.h"
-std::ofstream logfile("output");
-
-
-
/*
* Generate a grid consisting of two disjoint cells, colorize the two
* outermost faces. They will be matched via collect_periodic_faces
int
main()
{
+ initlog();
deallog << std::setprecision(4);
- logfile << std::setprecision(4);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(4);
{
// Generate a triangulation and match:
#include "../tests.h"
-std::ofstream logfile("output");
-
-
//
// Test
// DoFTools::
int
main()
{
+ initlog();
deallog << std::setprecision(4);
- logfile << std::setprecision(4);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(4);
deallog << "Test for 2D, Q1:" << std::endl << std::endl;
#define PRECISION 2
-std::ofstream logfile("output");
-
char buf[1000];
int
main()
{
- 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);
Triangulation<2> tria_test;
DoFHandler<2> * dof_handler, *dof_handler_def;
#define PRECISION 2
-std::ofstream logfile("output");
-
-
#include <deal.II/base/function.h>
#include <deal.II/base/numbers.h>
#include <deal.II/base/quadrature_lib.h>
int
main(int /*argc*/, char ** /*argv*/)
{
- 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);
Triangulation<2> tria_test;
DoFHandler<2> * dof_handler, *dof_handler_def;
#define PRECISION 2
-std::ofstream logfile("output");
-
char buf[1000];
int
main()
{
- 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);
Triangulation<2> tria_test;
Point<2> p1(0, 0), p2(1, 1);
#define PRECISION 2
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
for (unsigned int i = 1; i < 4; ++i)
test<2>(i);
#define PRECISION 2
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
for (unsigned int i = 1; i < 4; ++i)
test<2>(i);
#define PRECISION 2
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
for (unsigned int i = 1; i < 4; ++i)
test<2>(i);
#define PRECISION 2
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
for (unsigned int i = 1; i < 4; ++i)
test<2>(i);
#define PRECISION 2
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
for (unsigned int i = 1; i < 4; ++i)
test<2>(i);
#define PRECISION 2
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
for (unsigned int i = 1; i < 4; ++i)
test<2>(i);
#include "../tests.h"
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
#define PRECISION 5
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
(fe.shape_value_component(i, q_point, d) *
fe.shape_value_component(j, q_point, d) * fe.JxW(q_point));
- mass_matrix.print_formatted(logfile, 3, false, 0, "0", 1);
+ mass_matrix.print_formatted(deallog.get_file_stream(), 3, false, 0, "0", 1);
SolverControl solver_control(2 * dofs_per_cell, 1e-8);
PrimitiveVectorMemory<> vector_memory;
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
for (unsigned int i = 1; i < 4; ++i)
{
#define PRECISION 2
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
MatrixTools::create_mass_matrix(dof, q, mass_matrix);
- mass_matrix.print_formatted(logfile, 3, false, 0, "0", 1);
+ mass_matrix.print_formatted(deallog.get_file_stream(), 3, false, 0, "0", 1);
SolverControl solver_control(3 * dofs_per_cell, 1e-8);
PrimitiveVectorMemory<> vector_memory;
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
for (unsigned int i = 1; i < 4; ++i)
{
#define PRECISION 8
-std::ofstream logfile("output");
-
-
#include <deal.II/base/function.h>
#include <deal.II/base/quadrature_lib.h>
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- logfile << std::setprecision(PRECISION);
- logfile << std::fixed;
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(PRECISION);
+ deallog.get_file_stream() << std::fixed;
Triangulation<2> tria_test;
DoFHandler<2> * dof_handler, *dof_handler_def;
#include "../tests.h"
-std::ofstream logfile("output");
-
-
template <int dim>
void
check(const FE_Q<dim> &fe)
{
Assert(l2h[hierarchic_to_lexicographic_numbering[i]] == i,
ExcInternalError());
- logfile << dim << "d, degree=" << degree << ": " << l2h[i] << ' '
- << hierarchic_to_lexicographic_numbering[i] << std::endl;
+ deallog.get_file_stream()
+ << dim << "d, degree=" << degree << ": " << l2h[i] << ' '
+ << hierarchic_to_lexicographic_numbering[i] << std::endl;
};
// finally, we also have the
int
main()
{
+ initlog();
deallog << std::setprecision(2);
deallog << std::fixed;
- deallog.attach(logfile);
check_dim<1>();
check_dim<2>();
#define PRECISION 8
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
for (unsigned int i = 0; i < 4; ++i)
test<2>(i);
#define PRECISION 8
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
for (unsigned int i = 0; i < 4; ++i)
test<2>(i);
#define PRECISION 8
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
for (unsigned int i = 0; i < 4; ++i)
test<2>(i);
#define PRECISION 8
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
for (unsigned int i = 0; i < 4; ++i)
test<2>(i);
#define PRECISION 8
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
for (unsigned int i = 0; i < 4; ++i)
test<2>(i);
#define PRECISION 8
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
for (unsigned int i = 0; i < 4; ++i)
test<2>(i);
#define PRECISION 8
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
for (unsigned int j = 0; j < dofs_per_cell; ++j)
if (std::fabs(mass_matrix(i, j)) < 1e-14)
mass_matrix(i, j) = 0;
- mass_matrix.print_formatted(logfile, 3, false, 0, " ", 1);
+ mass_matrix.print_formatted(deallog.get_file_stream(), 3, false, 0, " ", 1);
SolverControl solver_control(dofs_per_cell, 1e-8);
PrimitiveVectorMemory<> vector_memory;
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
for (unsigned int i = 0; i < 4; ++i)
test<2>(i);
#define PRECISION 8
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
MatrixTools::create_mass_matrix(dof, q, mass_matrix);
- mass_matrix.print_formatted(logfile, 3, false, 0, " ", 1);
+ mass_matrix.print_formatted(deallog.get_file_stream(), 3, false, 0, " ", 1);
SolverControl solver_control(dofs_per_cell, 1e-8);
PrimitiveVectorMemory<> vector_memory;
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
for (unsigned int i = 0; i < 4; ++i)
test<2>(i);
#define PRECISION 8
-std::ofstream logfile("output");
-
-
#include <deal.II/base/function.h>
#include <deal.II/base/quadrature_lib.h>
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- logfile << std::setprecision(PRECISION);
- logfile << std::fixed;
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(PRECISION);
+ deallog.get_file_stream() << std::fixed;
Triangulation<2> tria_test;
DoFHandler<2> * dof_handler, *dof_handler_def;
#define PRECISION 5
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
for (unsigned int i = 1; i < 4; ++i)
{
#define PRECISION 5
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
for (unsigned int i = 1; i < 4; ++i)
{
#include "../tests.h"
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
#define PRECISION 5
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
(fe.shape_value_component(i, q_point, d) *
fe.shape_value_component(j, q_point, d) * fe.JxW(q_point));
- mass_matrix.print_formatted(logfile, 3, false, 0, "0", 1);
+ mass_matrix.print_formatted(deallog.get_file_stream(), 3, false, 0, "0", 1);
SolverControl solver_control(2 * dofs_per_cell, 1e-8);
PrimitiveVectorMemory<> vector_memory;
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
for (unsigned int i = 1; i < 4; ++i)
{
#define PRECISION 5
-std::ofstream logfile("output");
-
template <int dim>
void
test(const unsigned int degree)
MatrixTools::create_mass_matrix(dof, q, mass_matrix);
- mass_matrix.print_formatted(logfile, 3, false, 0, "0", 1);
+ mass_matrix.print_formatted(deallog.get_file_stream(), 3, false, 0, "0", 1);
SolverControl solver_control(3 * dofs_per_cell, 1e-8);
PrimitiveVectorMemory<> vector_memory;
int
main()
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
for (unsigned int i = 1; i < 4; ++i)
{
#include <deal.II/numerics/data_out.h>
#include <deal.II/numerics/vector_tools.h>
-std::ofstream logfile("output");
-
-
/*
* Check if the normal component is continuous over element edges.
*/
int
main(int /*argc*/, char ** /*argv*/)
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
Triangulation<2> tria_test;
DoFHandler<2> * dof_handler;
// STL
#include <map>
-std::ofstream logfile("output");
-
using namespace dealii;
template <int dim>
int
main(int /*argc*/, char ** /*argv*/)
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
/*
* 2D test only
// STL
#include <map>
-std::ofstream logfile("output");
-
-
using namespace dealii;
template <int dim>
int
main(int /*argc*/, char ** /*argv*/)
{
+ initlog();
deallog << std::setprecision(PRECISION);
deallog << std::fixed;
- deallog.attach(logfile);
/*
* 3D test only
-std::ofstream logfile("output");
-
-
void
make_tria(Triangulation<3> &tria, int step)
{
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(2);
FiniteElement<3> *fe = nullptr;
Triangulation<3> tria;
make_tria(tria, step);
- GridOut().write_gnuplot(tria, logfile);
+ GridOut().write_gnuplot(tria, deallog.get_file_stream());
DoFHandler<3> dof(tria);
dof.distribute_dofs(*fe);
DoFTools::make_hanging_node_constraints(dof, constraints);
constraints.close();
- constraints.print(logfile);
+ constraints.print(deallog.get_file_stream());
// release FE
dof.clear();
-std::ofstream logfile("output");
-
-
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(2);
// setting up some constants
const unsigned int dim = 2;
#include "../tests.h"
-std::ofstream logfile("output");
-
-
template <int dim>
void
test()
int
main()
{
- deallog.attach(logfile);
+ initlog();
deallog << std::setprecision(2);
{
#include "../tests.h"
-std::ofstream logfile("output");
-
template <int dim>
void
test()
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(2);
test<2>();
}
#include "../tests.h"
-std::ofstream logfile("output");
-
template <int dim>
void
test(unsigned int chunk_size)
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(2);
test<2>(1);
test<2>(2);
-std::ofstream logfile("output");
-
-
void
merge_check()
{
// now merge the two and print the
// results
c1.merge(c2);
- c1.print(logfile);
+ c1.print(deallog.get_file_stream());
};
}
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(2);
merge_check();
}
-std::ofstream logfile("output");
-
-
void
merge_check()
{
// now merge the two and print the
// results
c1.merge(c2);
- c1.print(logfile);
+ c1.print(deallog.get_file_stream());
};
}
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(2);
merge_check();
}
-std::ofstream logfile("output");
-
-
void
merge_check()
{
deallog << "OK" << std::endl;
}
- c1.print(logfile);
+ c1.print(deallog.get_file_stream());
}
}
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(2);
merge_check();
}
-std::ofstream logfile("output");
-
-
void
merge_check()
{
Assert(false, ExcInternalError());
}
- c1.print(logfile);
+ c1.print(deallog.get_file_stream());
}
}
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(2);
merge_check();
}
-std::ofstream logfile("output");
-
-
void
merge_check()
{
Assert(false, ExcInternalError());
}
- c1.print(logfile);
+ c1.print(deallog.get_file_stream());
}
}
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(2);
merge_check();
}
-std::ofstream logfile("output");
-
-
void
merge_check()
{
Assert(false, ExcInternalError());
}
- c1.print(logfile);
+ c1.print(deallog.get_file_stream());
}
}
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(2);
merge_check();
}
-std::ofstream logfile("output");
-
-
void
merge_check()
{
Assert(false, ExcInternalError());
}
- c1.print(logfile);
+ c1.print(deallog.get_file_stream());
}
}
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(2);
merge_check();
}
-std::ofstream logfile("output");
-
-
void
merge_check()
{
// now merge the two and print the
// results
c1.merge(c2);
- c1.print(logfile);
+ c1.print(deallog.get_file_stream());
};
}
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(2);
merge_check();
}
-std::ofstream logfile("output");
-
-
void
merge_check()
{
Assert(false, ExcInternalError());
}
- c1.print(logfile);
+ c1.print(deallog.get_file_stream());
}
}
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(2);
merge_check();
}
#include "../tests.h"
-std::ofstream logfile("output");
-
-
template <int dim>
class LaplaceProblem
{
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(2);
{
deallog.push("2d");
#include "../tests.h"
-std::ofstream logfile("output");
-
-
void
test(bool use_inhomogeneity_for_rhs)
{
cm.add_entry(4, 2, 2.0);
cm.close();
- cm.print(logfile);
+ cm.print(deallog.get_file_stream());
DynamicSparsityPattern csp(5, 5);
cm.distribute_local_to_global(
local_mat, local_vec, local_dofs, mat, rhs, use_inhomogeneity_for_rhs);
- mat.print(logfile);
- rhs.print(logfile);
+ mat.print(deallog.get_file_stream());
+ rhs.print(deallog.get_file_stream());
}
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(2);
// Use the constraints for the right-hand-side
{
#include "../tests.h"
-std::ofstream logfile("output");
-
-
void
test(bool use_inhomogeneity_for_rhs)
{
cm.set_inhomogeneity(4, 1.0);
cm.close();
- cm.print(logfile);
+ cm.print(deallog.get_file_stream());
DynamicSparsityPattern csp(8, 8);
local_mat, local_vec, local_dofs2, mat, rhs, use_inhomogeneity_for_rhs);
- mat.print(logfile);
- rhs.print(logfile);
+ mat.print(deallog.get_file_stream());
+ rhs.print(deallog.get_file_stream());
Vector<double> solution(8);
for (unsigned int i = 0; i < 8; ++i)
solution(i) = rhs(i) / mat(i, i);
}
- solution.print(logfile);
+ solution.print(deallog.get_file_stream());
cm.distribute(solution);
- solution.print(logfile);
+ solution.print(deallog.get_file_stream());
}
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(2);
// Use the constraints for the right-hand-side
{
#include "../tests.h"
-std::ofstream logfile("output");
-
-
void
test(bool use_constraint_matrix)
{
cm.set_inhomogeneity(4, 0.0);
cm.close();
- cm.print(logfile);
+ cm.print(deallog.get_file_stream());
cm.distribute_local_to_global(
local_mat, local_vec, local_dofs1, mat, rhs, true);
MatrixTools::apply_boundary_values(boundary_values, mat, solution, rhs);
}
- mat.print(logfile);
- rhs.print(logfile);
+ mat.print(deallog.get_file_stream());
+ rhs.print(deallog.get_file_stream());
for (unsigned int i = 0; i < 8; ++i)
{
solution(i) = rhs(i) / mat(i, i);
}
- solution.print(logfile);
+ solution.print(deallog.get_file_stream());
}
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(2);
// Use the constraints for the right-hand-side
{
#include "../tests.h"
-std::ofstream logfile("output");
-
-
template <int dim>
class AdvectionProblem
{
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(2);
{
AdvectionProblem<2> advection_problem;
#include "../tests.h"
-std::ofstream logfile("output");
-
-
template <int dim>
class AdvectionProblem
{
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(2);
{
AdvectionProblem<2> advection_problem;
#include "../tests.h"
-std::ofstream logfile("output");
-
-
template <int dim>
class LaplaceProblem
{
int
main()
{
+ initlog();
deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
+ deallog.get_file_stream() << std::setprecision(2);
LaplaceProblem<2> laplace_problem_2d;
laplace_problem_2d.run();
#include "../tests.h"
-std::ofstream logfile("output");
-
int
main(int argc, char **argv)
{
- deallog.attach(logfile);
+ initlog();
try
{
- logfile << "Initializing SLEPc (PETSc): " << std::flush;
+ deallog.get_file_stream() << "Initializing SLEPc (PETSc): " << std::flush;
SlepcInitialize(&argc, &argv, nullptr, nullptr);
{
- logfile << "ok" << std::endl;
+ deallog.get_file_stream() << "ok" << std::endl;
// Do something simple with PETSc
- logfile << "Using PetscScalar:" << std::endl;
+ deallog.get_file_stream() << "Using PetscScalar:" << std::endl;
const PetscScalar pi = numbers::PI;
const PetscScalar two = 2.;
- logfile << " pi: " << pi << std::endl
- << " two: " << two << std::endl
- << " two times pi: " << two * pi << std::endl;
+ deallog.get_file_stream()
+ << " pi: " << pi << std::endl
+ << " two: " << two << std::endl
+ << " two times pi: " << two * pi << std::endl;
- logfile << "Finalizing SLEPc (PETSc): " << std::flush;
+ deallog.get_file_stream() << "Finalizing SLEPc (PETSc): " << std::flush;
}
SlepcFinalize();
- logfile << "ok" << std::endl << std::endl;
+ deallog.get_file_stream() << "ok" << std::endl << std::endl;
}
catch (std::exception &exc)
#include "../tests.h"
-std::ofstream logfile("output");
-
int
main(int argc, char **argv)
{
- deallog.attach(logfile);
+ initlog();
deallog.depth_console(1);
try
{
- logfile << "Initializing SLEPc (PETSc): " << std::flush;
+ deallog.get_file_stream() << "Initializing SLEPc (PETSc): " << std::flush;
SlepcInitialize(&argc, &argv, nullptr, nullptr);
{
- logfile << "ok" << std::endl;
+ deallog.get_file_stream() << "ok" << std::endl;
// Do something simple with PETSc
- logfile << "Using PetscScalar:" << std::endl;
+ deallog.get_file_stream() << "Using PetscScalar:" << std::endl;
const PetscScalar pi_1i = numbers::PI + 1. * PETSC_i;
const PetscScalar two = 2.;
- logfile << " pi+1i: " << pi_1i << std::endl
- << " two: " << two << std::endl
- << " two times pi+1i: " << two * pi_1i << std::endl;
+ deallog.get_file_stream()
+ << " pi+1i: " << pi_1i << std::endl
+ << " two: " << two << std::endl
+ << " two times pi+1i: " << two * pi_1i << std::endl;
- logfile << "Finalizing SLEPc (PETSc): " << std::flush;
+ deallog.get_file_stream() << "Finalizing SLEPc (PETSc): " << std::flush;
}
SlepcFinalize();
- logfile << "ok" << std::endl << std::endl;
+ deallog.get_file_stream() << "ok" << std::endl << std::endl;
}
catch (std::exception &exc)
#include "../tests.h"
-std::ofstream logfile("output");
-
void
test()
{
csp.add(i, (i + (i + 1) * (j * j + i)) % N);
csp.symmetrize();
- csp.print_gnuplot(logfile);
+ csp.print_gnuplot(deallog.get_file_stream());
deallog << "OK" << std::endl;
}
int
main()
{
- deallog.attach(logfile);
+ initlog();
test();
return 0;
#include "../tests.h"
-std::ofstream logfile("output");
-
-
-
namespace Assembly
{
namespace Scratch
int
main(int argc, char **argv)
{
- deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
-
Utilities::MPI::MPI_InitFinalize mpi_initialization(
argc, argv, testing_max_num_threads());
+ mpi_initlog();
+ deallog << std::setprecision(2);
+
{
deallog.push("2d");
LaplaceProblem<2> laplace_problem;
#include "../tests.h"
-std::ofstream logfile("output");
-
-
-
namespace Assembly
{
namespace Scratch
int
main(int argc, char **argv)
{
- deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
-
Utilities::MPI::MPI_InitFinalize mpi_initialization(
argc, argv, testing_max_num_threads());
+ mpi_initlog();
+
+ deallog << std::setprecision(2);
{
deallog.push("2d");
#include "../tests.h"
-std::ofstream logfile("output");
-
-
-
namespace Assembly
{
namespace Scratch
int
main(int argc, char **argv)
{
- deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
-
Utilities::MPI::MPI_InitFinalize mpi_initialization(
argc, argv, testing_max_num_threads());
+ mpi_initlog();
+ deallog << std::setprecision(2);
{
deallog.push("2d");
#include "../tests.h"
-std::ofstream logfile("output");
-
-
-
namespace Assembly
{
namespace Scratch
int
main(int argc, char **argv)
{
- deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
-
Utilities::MPI::MPI_InitFinalize mpi_initialization(
argc, argv, testing_max_num_threads());
+ mpi_initlog();
+ deallog << std::setprecision(2);
{
deallog.push("2d");
#include "../tests.h"
-std::ofstream logfile("output");
-
-
-
namespace Assembly
{
namespace Scratch
int
main(int argc, char **argv)
{
- deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
-
Utilities::MPI::MPI_InitFinalize mpi_initialization(
argc, argv, testing_max_num_threads());
+ mpi_initlog();
+ deallog << std::setprecision(2);
{
deallog.push("2d");
#include "../tests.h"
-std::ofstream logfile("output");
-
-
-
namespace Assembly
{
namespace Scratch
int
main(int argc, char **argv)
{
- deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
-
Utilities::MPI::MPI_InitFinalize mpi_initialization(
argc, argv, testing_max_num_threads());
+ mpi_initlog();
+ deallog << std::setprecision(2);
{
deallog.push("2d");
#include "../tests.h"
-std::ofstream logfile("output");
-
-
-
namespace Assembly
{
namespace Scratch
int
main(int argc, char **argv)
{
- deallog << std::setprecision(2);
- logfile << std::setprecision(2);
- deallog.attach(logfile);
-
Utilities::MPI::MPI_InitFinalize mpi_initialization(
argc, argv, testing_max_num_threads());
+ mpi_initlog();
+ deallog << std::setprecision(2);
{
deallog.push("2d");