]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Finish documentation of setup_system.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 15 Nov 2010 12:55:11 +0000 (12:55 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 15 Nov 2010 12:55:11 +0000 (12:55 +0000)
git-svn-id: https://svn.dealii.org/trunk@22741 0785d39b-7218-0410-832d-ea1e28bc413d

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

index a7f10a6620f692aeb3ade9982564d96999d661dc..88999769fe8fde294d940dca7d7bbd000410393a 100644 (file)
@@ -366,7 +366,43 @@ void LaplaceProblem<dim>::setup_system ()
                                            constraints);
   constraints.close ();
 
-                                  // xxx
+                                  // The last part of this function deals
+                                  // with initializing the matrix with
+                                  // accompanying sparsity pattern. As in
+                                  // previous tutorial programs, we use the
+                                  // CompressedSimpleSparsityPattern as an
+                                  // intermediate with which we then
+                                  // initialize the PETSc matrix. To do so we
+                                  // have to tell the sparsity pattern its
+                                  // size but as above there is no way the
+                                  // resulting object will be able to store
+                                  // even a single pointer for each global
+                                  // degree of freedom; the best we can hope
+                                  // for is that it stores information about
+                                  // each locally relevant degree of freedom,
+                                  // i.e. all those that we may ever touch in
+                                  // the process of assembling the matrix
+                                  // (the @ref distributed_paper has a long
+                                  // discussion why one really needs the
+                                  // locally relevant, and not the small set
+                                  // of locally active degrees of freedom in
+                                  // this context).
+                                  //
+                                  // So we tell the sparsity pattern its size
+                                  // and what DoFs to store anything for and
+                                  // then ask DoFTools::make_sparsity_pattern
+                                  // to fill it (this function ignores all
+                                  // cells that are not locally owned,
+                                  // mimicking what we will do below in the
+                                  // assembly process). After this, we call a
+                                  // function that exchanges entries in these
+                                  // sparsity pattern between processors so
+                                  // that in the end each processor really
+                                  // knows about all the entries that will
+                                  // exist in that part of the finite element
+                                  // matrix that it will own. The final step
+                                  // is to initialize the matrix with the
+                                  // sparsity pattern.
   CompressedSimpleSparsityPattern csp (dof_handler.n_dofs(),
                                       dof_handler.n_dofs(),
                                       locally_relevant_dofs);

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.