]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Added justification for redundancy in step-44 4980/head
authorLucas Campos <rmk236@gmail.com>
Tue, 29 Aug 2017 07:50:35 +0000 (09:50 +0200)
committerLucas Campos <rmk236@gmail.com>
Tue, 29 Aug 2017 07:50:35 +0000 (09:50 +0200)
examples/step-44/step-44.cc

index ab2e576c6364fa9023b4116baca5f5b72dfa1027..3ca1c3bd8c332c66b5449b5ddf1216d5b43ad219 100644 (file)
@@ -2470,6 +2470,17 @@ namespace Step44
     constraints.clear();
     const bool apply_dirichlet_bc = (it_nr == 0);
 
+    // In this particular example, the boundary values will be calculated for
+    // the two first iterations of Newton's algorithm. In general, one would
+    // build non-homogeneous constraints in the zeroth iteration (that is, when
+    // `apply_dirichlet_bc == true`) and build only the corresponding
+    // homogeneous constraints in the following step. While the current
+    // example has only homogenous constraints, previous experiences have
+    // shown that a common error is forgetting to add the extra condition when
+    // refactoring the code to specific uses. This could lead errors that are
+    // hard to debug. In this spirit, we choose to make the code more verbose
+    // in terms of what operations are performed at each Newton step.
+    //
     // The boundary conditions for the indentation problem are as follows: On
     // the -x, -y and -z faces (IDs 0,2,4) we set up a symmetry condition to
     // allow only planar movement while the +x and +z faces (IDs 1,5) are

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.