]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Updated Documentation. Again, in the Introduction section of the step-20 tutorial... 151/head 155/head
authorUwe Köcher <koecher@hsu-hamburg.de>
Wed, 17 Sep 2014 07:33:13 +0000 (09:33 +0200)
committerUwe Köcher <koecher@hsu-hamburg.de>
Wed, 17 Sep 2014 07:33:13 +0000 (09:33 +0200)
examples/step-20/doc/intro.dox

index 74b1ae35697ea5cde04865256c2b10d0ccc4be40..dbea94c6031c66a5894d3346e94a0dca67302e4c 100644 (file)
@@ -483,7 +483,13 @@ matrix and the mass matrix, respectively:
 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());
 
   {
@@ -600,8 +606,11 @@ the approximate Schur complement, i.e. we need code like this:
     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!
@@ -622,12 +631,15 @@ look like this:
     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);

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.