From: bangerth Date: Mon, 15 Nov 2010 13:15:38 +0000 (+0000) Subject: Finish documenting. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=453c7c3bc6f871ec2bc9949099720270ca575392;p=dealii-svn.git Finish documenting. git-svn-id: https://svn.dealii.org/trunk@22743 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-40/step-40.cc b/deal.II/examples/step-40/step-40.cc index 88999769fe..8272fbe953 100644 --- a/deal.II/examples/step-40/step-40.cc +++ b/deal.II/examples/step-40/step-40.cc @@ -382,7 +382,8 @@ void LaplaceProblem::setup_system () // 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 + // (the @ref distributed_paper + // "distributed computing paper" has a long // discussion why one really needs the // locally relevant, and not the small set // of locally active degrees of freedom in @@ -422,6 +423,42 @@ void LaplaceProblem::setup_system () + // @sect4{LaplaceProblem::assemble_system} + + // The function that then assembles the + // linear system is comparatively boring, + // being almost exactly what we've seen + // before. The points to watch out for are: + // - Assembly must only loop over locally + // owned cells. We test this by comparing + // a cell's subdomain_id against + // information from the triangulation + // but an equally valid condition would + // have been to skip all cells for which + // the condition cell->is_ghost() + // || cell->is_artificial() is + // true. + // - Copying local contributions into the + // global matrix must include distributing + // constraints and boundary values. In + // other words, we can now (as we did in + // step-6) first copy every local + // contribution into the global matrix and + // only in a later step take care of + // hanging node constraints and boundary + // values. The reason is, as discussed in + // step-17, that PETSc does not provide + // access to arbitrary elements of the + // matrix once they have been assembled + // into it -- in parts because they may + // simple no longer reside on the current + // processor but have instead been shipped + // to a different machine. + // - The way we compute the right hand side + // (given the formula stated in the + // introduction) may not be the most + // elegant but will do for a program whose + // focus lies somewhere entirely different. template void LaplaceProblem::assemble_system () { @@ -457,7 +494,8 @@ void LaplaceProblem::assemble_system () rhs_value = (fe_values.quadrature_point(q_point)[1] > - 0.5+0.25*sin(4.0*numbers::PI*fe_values.quadrature_point(q_point)[0]) + 0.5+0.25*std::sin(4.0 * numbers::PI * + fe_values.quadrature_point(q_point)[0]) ? 1 : -1); for (unsigned int i=0; i