From ede24abd079fa4e605300c2c78ce6803e3d85acc Mon Sep 17 00:00:00 2001 From: bangerth Date: Mon, 22 Oct 2007 18:45:20 +0000 Subject: [PATCH] Accelerate the solver by a factor of 6 by preconditioning the Schur complement with the mass matrix :-) -- thanks, Guido git-svn-id: https://svn.dealii.org/trunk@15363 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-22/step-22.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deal.II/examples/step-22/step-22.cc b/deal.II/examples/step-22/step-22.cc index 316e02f194..2508f19d10 100644 --- a/deal.II/examples/step-22/step-22.cc +++ b/deal.II/examples/step-22/step-22.cc @@ -567,6 +567,7 @@ void BoussinesqFlowProblem::assemble_system () local_matrix(i,j) += (scalar_product(phi_i_grads_u, phi_j_grads_u) - div_phi_i_u * phi_j_p - phi_i_p * div_phi_j_u + + phi_i_p * phi_j_p + phi_i_T * phi_j_T) * fe_values.JxW(q); } @@ -948,10 +949,14 @@ void BoussinesqFlowProblem::solve () 1e-6*schur_rhs.l2_norm()); SolverCG<> cg (solver_control); + PreconditionSSOR<> preconditioner; + preconditioner.initialize (system_matrix.block(1,1), 1.2); + + try { cg.solve (schur_complement, solution.block(1), schur_rhs, - PreconditionIdentity()); + preconditioner); } catch (...) { -- 2.39.5