]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Finish documenting.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 13 Feb 2010 15:54:38 +0000 (15:54 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 13 Feb 2010 15:54:38 +0000 (15:54 +0000)
git-svn-id: https://svn.dealii.org/trunk@20594 0785d39b-7218-0410-832d-ea1e28bc413d

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

index f64cad0031aabbab5c096ae4c011f747aac756af..1f0ecb6b039891d5780619dab9a23e6c84c89462 100644 (file)
@@ -814,16 +814,23 @@ void LaplaceProblem<dim>::solve ()
   mg_smoother.set_steps(2);
   mg_smoother.set_symmetric(true);
 
-                                  // We must wrap our matrices in an
-                                  // object having the required
-                                  // multiplication functions.
-  MGMatrix<SparseMatrix<double>, Vector<double> >
-    mg_matrix(&mg_matrices);
-                                  //do the same for the interface matrices
-  MGMatrix<SparseMatrix<double>, Vector<double> >
-    mg_interface_up(&mg_interface_matrices);
-  MGMatrix<SparseMatrix<double>, Vector<double> >
-    mg_interface_down(&mg_interface_matrices);
+                                  // The next preparatory step is that we
+                                  // must wrap our level and interface
+                                  // matrices in an object having the
+                                  // required multiplication functions. We
+                                  // will create two objects for the
+                                  // interface objects going from coarse to
+                                  // fine and the other way around; the
+                                  // multigrid algorithm will later use the
+                                  // transpose operator for the latter
+                                  // operation, allowing us to initialize
+                                  // both up and down versions of the
+                                  // operator with the matrices we already
+                                  // built:
+  MGMatrix<> mg_matrix(&mg_matrices);
+  MGMatrix<> mg_interface_up(&mg_interface_matrices);
+  MGMatrix<> mg_interface_down(&mg_interface_matrices);
+
                                   // Now, we are ready to set up the
                                   // V-cycle operator and the
                                   // multilevel preconditioner.
@@ -835,13 +842,13 @@ void LaplaceProblem<dim>::solve ()
                                mg_smoother);
   mg.set_edge_matrices(mg_interface_down, mg_interface_up);
 
-  PreconditionMG<dim, Vector<double>,
-    MGTransferPrebuilt<Vector<double> > >
+  PreconditionMG<dim, Vector<double>, MGTransferPrebuilt<Vector<double> > >
   preconditioner(mg_dof_handler, mg, mg_transfer);
 
-                                  // Finally, create the solver
-                                  // object and solve the system
-  ReductionControl solver_control (100, 1.e-20, 1.e-10, true, true);
+                                  // With all this together, we can finally
+                                  // get about solving the linear system in
+                                  // the usual way:
+  SolverControl solver_control (1000, 1e-12);
   SolverCG<>    cg (solver_control);
 
   solution = 0;

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.