From 100471149e4b87a769049fabe34a2b4b5d01298e Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 13 Feb 2010 15:54:38 +0000 Subject: [PATCH] Finish documenting. git-svn-id: https://svn.dealii.org/trunk@20594 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-16/step-16.cc | 37 +++++++++++++++++------------ 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/deal.II/examples/step-16/step-16.cc b/deal.II/examples/step-16/step-16.cc index f64cad0031..1f0ecb6b03 100644 --- a/deal.II/examples/step-16/step-16.cc +++ b/deal.II/examples/step-16/step-16.cc @@ -814,16 +814,23 @@ void LaplaceProblem::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, Vector > - mg_matrix(&mg_matrices); - //do the same for the interface matrices - MGMatrix, Vector > - mg_interface_up(&mg_interface_matrices); - MGMatrix, Vector > - 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::solve () mg_smoother); mg.set_edge_matrices(mg_interface_down, mg_interface_up); - PreconditionMG, - MGTransferPrebuilt > > + PreconditionMG, MGTransferPrebuilt > > 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; -- 2.39.5