]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Accelerate the solver by a factor of 6 by preconditioning the Schur complement with...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 22 Oct 2007 18:45:20 +0000 (18:45 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 22 Oct 2007 18:45:20 +0000 (18:45 +0000)
git-svn-id: https://svn.dealii.org/trunk@15363 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-22/step-22.cc

index 316e02f194deb2bac88719833beb9d75755288ec..2508f19d103be118c48a8cd2cd7cf2fa8a0d7bd9 100644 (file)
@@ -567,6 +567,7 @@ void BoussinesqFlowProblem<dim>::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<dim>::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 (...)
       {

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.