, data(matrix_free)
{}
- ~HelmholtzOperator()
+ void
+ print_n_calls_special()
{
if (n_calls_vmult > 0)
deallog << "Number of calls to special vmult: " << n_calls_vmult
VectorType rhs, sol;
mf_data.initialize_dof_vector(rhs);
mf_data.initialize_dof_vector(sol);
- rhs = 1.;
+ rhs = 1. / std::sqrt(rhs.size());
DiagonalMatrix<VectorType> preconditioner;
mf_data.initialize_dof_vector(preconditioner.get_vector());
mf.vmult(preconditioner.get_vector(), rhs);
SolverCG<VectorType> solver(control);
solver.solve(matrix, sol, rhs, preconditioner);
deallog << "Norm of the solution: " << sol.l2_norm() << std::endl;
+ matrix.print_n_calls_special();
}
// Step 3: solve with CG solver for a matrix that does support but a
SolverCG<VectorType> solver(control);
solver.solve(matrix, sol, rhs, simple_diagonal);
deallog << "Norm of the solution: " << sol.l2_norm() << std::endl;
+ matrix.print_n_calls_special();
}
// Step 4: solve with CG solver for a matrix that does support the
SolverCG<VectorType> solver(control);
solver.solve(matrix, sol, rhs, diagonal_subrange);
deallog << "Norm of the solution: " << sol.l2_norm() << std::endl;
+ matrix.print_n_calls_special();
}
}
Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
mpi_initlog();
+ deallog << std::setprecision(8);
test<2, double>(3);
test<3, double>(4);
DEAL::CG solver without interleaving support
-DEAL:cg::Starting value 49.0000
-DEAL:cg::Convergence step 51 value 0.429721
-DEAL::Norm of the solution: 11776.3
+DEAL:cg::Starting value 1.0000000
+DEAL:cg::Convergence step 51 value 0.0087698196
+DEAL::Norm of the solution: 240.33305
DEAL::CG solver with interleaving support
-DEAL:cg::Starting value 49.0000
-DEAL:cg::Convergence step 51 value 0.429721
-DEAL::Norm of the solution: 11776.3
+DEAL:cg::Starting value 1.0000000
+DEAL:cg::Convergence step 51 value 0.0087698196
+DEAL::Norm of the solution: 240.33305
DEAL::Number of calls to special vmult: 51
DEAL::CG solver with matrix with interleaving support but no preconditioner
-DEAL:cg::Starting value 49.0000
-DEAL:cg::Convergence step 51 value 0.429721
-DEAL::Norm of the solution: 11776.3
+DEAL:cg::Starting value 1.0000000
+DEAL:cg::Convergence step 51 value 0.0087698196
+DEAL::Norm of the solution: 240.33305
DEAL::CG solver with interleaving support and preconditioner working on subrange
-DEAL:cg::Starting value 49.0000
-DEAL:cg::Convergence step 51 value 0.429721
-DEAL::Norm of the solution: 11776.3
+DEAL:cg::Starting value 1.0000000
+DEAL:cg::Convergence step 51 value 0.0087698196
+DEAL::Norm of the solution: 240.33305
DEAL::Number of calls to special vmult: 51
DEAL::CG solver without interleaving support
-DEAL:cg::Starting value 189.571
-DEAL:cg::Convergence step 61 value 1.71195
-DEAL::Norm of the solution: 684335.
+DEAL:cg::Starting value 1.0000000
+DEAL:cg::Convergence step 61 value 0.0090310678
+DEAL::Norm of the solution: 3609.9220
DEAL::CG solver with interleaving support
-DEAL:cg::Starting value 189.571
-DEAL:cg::Convergence step 61 value 1.71195
-DEAL::Norm of the solution: 684335.
+DEAL:cg::Starting value 1.0000000
+DEAL:cg::Convergence step 61 value 0.0090310675
+DEAL::Norm of the solution: 3609.9220
DEAL::Number of calls to special vmult: 61
DEAL::CG solver with matrix with interleaving support but no preconditioner
-DEAL:cg::Starting value 189.571
-DEAL:cg::Convergence step 61 value 1.71195
-DEAL::Norm of the solution: 684335.
+DEAL:cg::Starting value 1.0000000
+DEAL:cg::Convergence step 61 value 0.0090310678
+DEAL::Norm of the solution: 3609.9220
DEAL::CG solver with interleaving support and preconditioner working on subrange
-DEAL:cg::Starting value 189.571
-DEAL:cg::Convergence step 61 value 1.71195
-DEAL::Norm of the solution: 684335.
+DEAL:cg::Starting value 1.0000000
+DEAL:cg::Convergence step 61 value 0.0090310574
+DEAL::Norm of the solution: 3609.9220
DEAL::Number of calls to special vmult: 61
DEAL::CG solver without interleaving support
-DEAL:cg::Starting value 125.000
-DEAL:cg::Convergence step 39 value 1.10898
-DEAL::Norm of the solution: 196549.
+DEAL:cg::Starting value 1.0000000
+DEAL:cg::Convergence step 39 value 0.0088718752
+DEAL::Norm of the solution: 1572.3941
DEAL::CG solver with interleaving support
-DEAL:cg::Starting value 125.000
-DEAL:cg::Convergence step 39 value 1.10898
-DEAL::Norm of the solution: 196549.
+DEAL:cg::Starting value 1.0000000
+DEAL:cg::Convergence step 39 value 0.0088718752
+DEAL::Norm of the solution: 1572.3941
DEAL::Number of calls to special vmult: 39
DEAL::CG solver with matrix with interleaving support but no preconditioner
-DEAL:cg::Starting value 125.000
-DEAL:cg::Convergence step 39 value 1.10898
-DEAL::Norm of the solution: 196549.
+DEAL:cg::Starting value 1.0000000
+DEAL:cg::Convergence step 39 value 0.0088718752
+DEAL::Norm of the solution: 1572.3941
DEAL::CG solver with interleaving support and preconditioner working on subrange
-DEAL:cg::Starting value 125.000
-DEAL:cg::Convergence step 39 value 1.10898
-DEAL::Norm of the solution: 196549.
+DEAL:cg::Starting value 1.0000000
+DEAL:cg::Convergence step 39 value 0.0088718752
+DEAL::Norm of the solution: 1572.3941
DEAL::Number of calls to special vmult: 39