template <int dim>
void MixedLaplaceProblem<dim>::solve ()
{
- const InverseMatrix m_inverse (system_matrix.block(0,0));
+ PreconditionIdentity identity;
+ IterativeInverse<Vector<double> > m_inverse;
+ m_inverse.initialize(system_matrix.block(0,0), identity);
+ m_inverse.solver.select("cg");
+ static ReductionControl inner_control(1000, 0., 1.e-13);
+ m_inverse.solver.set_control(inner_control);
+
Vector<double> tmp (solution.block(0).size());
{
ApproximateSchurComplement
approximate_schur_complement (system_matrix);
- InverseMatrix<ApproximateSchurComplement>
- preconditioner (approximate_schur_complement)
+ IterativeInverse<Vector<double> >
+ preconditioner;
+ preconditioner.initialize(approximate_schur_complement, identity);
+ preconditioner.solver.select("cg");
+ preconditioner.solver.set_control(inner_control);
@endcode
That's all!
ApproximateSchurComplement
approximate_schur_complement (system_matrix);
- InverseMatrix<ApproximateSchurComplement>
- preconditioner (approximate_schur_complement);
+ IterativeInverse<Vector<double> >
+ preconditioner;
+ preconditioner.initialize(approximate_schur_complement, identity);
+ preconditioner.solver.select("cg");
+ preconditioner.solver.set_control(inner_control);
- SolverControl solver_control (system_matrix.block(0,0).m(),
- 1e-6*schur_rhs.l2_norm());
- SolverCG<> cg (solver_control);
+ SolverControl solver_control (solution.block(1).size(),
+ 1e-12*schur_rhs.l2_norm());
+ SolverCG<> cg (solver_control);
cg.solve (schur_complement, solution.block(1), schur_rhs,
preconditioner);