]> https://gitweb.dealii.org/ - dealii.git/commitdiff
address some left-over comments 3116/head
authorTimo Heister <timo.heister@gmail.com>
Tue, 17 Jan 2017 16:04:55 +0000 (11:04 -0500)
committerTimo Heister <timo.heister@gmail.com>
Tue, 17 Jan 2017 17:51:13 +0000 (12:51 -0500)
examples/step-57/doc/intro.dox
examples/step-57/doc/results.dox
examples/step-57/step-57.cc

index be97c6f08d32895cc48aeacf2d73505dabf34065..396f4eac5ac1b8386876f3c90299acd6d2cde13c 100644 (file)
@@ -125,9 +125,11 @@ Now, Newton's iteration can be used to solve for the update terms:
   <li> Initialization: Initial guess $u_0$ and $p_0$, tolerance $\tau$;
   <li> Linear solve to compute update term $\delta\textbf{u}^{k}$ and $\delta p^k$;
   <li> Update the approximation: $\textbf{u}^{k+1} = \textbf{u}^{k} + \delta\textbf{u}^{k}$ and $p^{k+1} = p^{k} + \delta p^{k}$;
-  <li> Check residual norm: $E^{k+1} = \|F(\mathbf{u}^{k+1}, p^{k+1})\|$. 
-       If $E^{k+1} \leq \tau$, STOP. 
-       If $E^{k+1} > \tau$, back to step 2. 
+  <li> Check residual norm: $E^{k+1} = \|F(\mathbf{u}^{k+1}, p^{k+1})\|$:
+       <ul>
+       <li>If $E^{k+1} \leq \tau$, STOP. 
+       <li>If $E^{k+1} > \tau$, back to step 2. 
+       </ul>
 </ol>
 
 <h3> Finding an Initial Guess </h3>
@@ -236,7 +238,7 @@ Instead of solving the above system, we can solve the equivalent system
     \right)
 @f}
 with a parameter $\gamma$ and an invertible matrix W. Here 
-$\gamma B^TW^{-1}B & B^{T}$ is the Augmented Lagrangian term and
+$\gamma B^TW^{-1}B$ is the Augmented Lagrangian term and
  see [1] for details.
 
 Denoting the system matrix of the new system by $G$ and the right-hand
index f1475d646d633fd5336e8a007c1b8257e9e2b50f..86d9c8c7a408a4a5539b44e16c6a0d5fdc5a014f 100644 (file)
@@ -20,7 +20,7 @@ every mesh is shown. The data in the table shows that Newton's iteration converg
     <th colspan="2">Mesh4</th>
   </tr>
   <tr>
-    <th>Newton's iter </th>
+    <th>Newton iter   </th>
     <th>Residual      </th>
     <th>FGMRES        </th>
     <th>Residual      </th>
@@ -33,112 +33,112 @@ every mesh is shown. The data in the table shows that Newton's iteration converg
     <th>FGMRES        </th>
   </tr>
   <tr>
-    <th>1         </th>
-    <th>7.40396e-3</th>
-    <th>3         </th>
-    <th>1.05562e-3  </th>
-    <th>3         </th>
-    <th>4.94796e-4  </th>
-    <th>3         </th>
-    <th>2.5624e-4 </th>
-    <th>2         </th>
-    <th>1.26733e-4  </th>
-    <th>2         </th>
+    <td>1         </td>
+    <td>7.40396e-3</td>
+    <td>3         </td>
+    <td>1.05562e-3  </td>
+    <td>3         </td>
+    <td>4.94796e-4  </td>
+    <td>3         </td>
+    <td>2.5624e-4 </td>
+    <td>2         </td>
+    <td>1.26733e-4  </td>
+    <td>2         </td>
   </tr>
   <tr>
-    <th>2         </th>
-    <th>3.86766e-3  </th>
-    <th>4         </th>
-    <th>1.3549e-5  </th>
-    <th>3         </th>
-    <th>1.41981e-6  </th>
-    <th>3        </th>
-    <th>1.29108e-6  </th>
-    <th>4         </th>
-    <th>6.14794e-7  </th>
-    <th>4         </th>
+    <td>2         </td>
+    <td>3.86766e-3  </td>
+    <td>4         </td>
+    <td>1.3549e-5  </td>
+    <td>3         </td>
+    <td>1.41981e-6  </td>
+    <td>3        </td>
+    <td>1.29108e-6  </td>
+    <td>4         </td>
+    <td>6.14794e-7  </td>
+    <td>4         </td>
   </tr>
   <tr>
-    <th>3         </th>
-    <th>1.60421e-3</th>
-    <th>4         </th>
-    <th>1.24836e-9  </th>
-    <th>3         </th>
-    <th>9.11557e-11  </th>
-    <th>3         </th>
-    <th>3.35933e-11 </th>
-    <th>3         </th>
-    <th>5.86734e-11 </th>
-    <th>2         </th>
+    <td>3         </td>
+    <td>1.60421e-3</td>
+    <td>4         </td>
+    <td>1.24836e-9  </td>
+    <td>3         </td>
+    <td>9.11557e-11  </td>
+    <td>3         </td>
+    <td>3.35933e-11 </td>
+    <td>3         </td>
+    <td>5.86734e-11 </td>
+    <td>2         </td>
   </tr>
   <tr>
-    <th>4         </th>
-    <th>9.26748e-4  </th>
-    <th>4         </th>
-    <th>2.75537e-14  </th>
-    <th>4         </th>
-    <th>1.39986e-14 </th>
-    <th>5         </th>
-    <th>2.18864e-14 </th>
-    <th>5         </th>
-    <th>3.38787e-14 </th>
-    <th>5         </th>
+    <td>4         </td>
+    <td>9.26748e-4  </td>
+    <td>4         </td>
+    <td>2.75537e-14  </td>
+    <td>4         </td>
+    <td>1.39986e-14 </td>
+    <td>5         </td>
+    <td>2.18864e-14 </td>
+    <td>5         </td>
+    <td>3.38787e-14 </td>
+    <td>5         </td>
   </tr>
   <tr>
-    <th>5          </th>
-    <th>1.34601e-5</th>
-    <th>4          </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
+    <td>5          </td>
+    <td>1.34601e-5</td>
+    <td>4          </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
   </tr>
   <tr>
-    <th>6         </th>
-    <th>2.5235e-8    </th>
-    <th>5    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
+    <td>6         </td>
+    <td>2.5235e-8    </td>
+    <td>5    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
   </tr>
   <tr>
-    <th>7         </th>
-    <th>1.38899e-12    </th>
-    <th>4    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
+    <td>7         </td>
+    <td>1.38899e-12    </td>
+    <td>4    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
   </tr>
   <tr>
-    <th>8           </th>
-    <th>4.68224e-15 </th>
-    <th>4           </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;      </th>
-    <th>&nbsp;      </th>
-    <th>&nbsp;      </th>
-    <th>&nbsp;      </th>
-    <th>&nbsp;      </th>
-    <th>&nbsp;      </th>
+    <td>8           </td>
+    <td>4.68224e-15 </td>
+    <td>4           </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;      </td>
+    <td>&nbsp;      </td>
+    <td>&nbsp;      </td>
+    <td>&nbsp;      </td>
+    <td>&nbsp;      </td>
+    <td>&nbsp;      </td>
   </tr>
 </table>
 
-The following figures show the sequence of the generated grids. For the case
+The following figures show the sequence of generated grids. For the case
 of Re=400, the initial guess is obtained by solving Stokes on an $8 \times 8$
 mesh, and the mesh is refined adaptively. Between meshes, the solution from
 the coarse mesh is interpolated to the fine mesh to be used as an initial guess.
@@ -193,11 +193,10 @@ iterations are executed for solving this test case.
 
 <img src="https://www.dealii.org/images/steps/developer/step-57.Re7500_get_convergence.svg" style="width:50%" alt="">
 
-Also we show the residual from each step of Newton's iteration on every
-mesh. The quadratic convergence is shown clearly in the table.
+We also show the residual from each step of Newton's iteration on every
+mesh. The quadratic convergence is clearly visible in the table.
 
 <table align="center" border="1">
-  
   <tr>
     <th>&nbsp;</th>
     <th colspan="2">Mesh0</th>
@@ -206,9 +205,8 @@ mesh. The quadratic convergence is shown clearly in the table.
     <th colspan="2">Mesh3</th>
     <th colspan="2">Mesh4</th>
   </tr>
-
   <tr>
-    <th>Newton's iter </th>
+    <th>Newton iter   </th>
     <th>Residual      </th>
     <th>FGMRES        </th>
     <th>Residual      </th>
@@ -220,103 +218,96 @@ mesh. The quadratic convergence is shown clearly in the table.
     <th>Residual      </th>
     <th>FGMRES        </th>
   </tr>
-
   <tr>
-    <th>1          </th>
-    <th>1.89223e-6  </th>
-    <th>6          </th>
-    <th>4.2506e-3  </th>
-    <th>3          </th>
-    <th>1.42993e-3  </th>
-    <th>3          </th>
-    <th>4.87932e-4  </th>
-    <th>2          </th>
-    <th>1.89981e-04  </th>
-    <th>2         </th>
+    <td>1          </td>
+    <td>1.89223e-6  </td>
+    <td>6          </td>
+    <td>4.2506e-3  </td>
+    <td>3          </td>
+    <td>1.42993e-3  </td>
+    <td>3          </td>
+    <td>4.87932e-4  </td>
+    <td>2          </td>
+    <td>1.89981e-04  </td>
+    <td>2         </td>
   </tr>
-
   <tr>
-    <th>2         </th>
-    <th>3.16439e-9</th>
-    <th>8         </th>
-    <th>1.3732e-3 </th>
-    <th>7         </th>
-    <th>4.15062e-4 </th>
-    <th>7         </th>
-    <th>9.11191e-5 </th>
-    <th>8         </th>
-    <th>1.35553e-5</th>
-    <th>8         </th>
+    <td>2         </td>
+    <td>3.16439e-9</td>
+    <td>8         </td>
+    <td>1.3732e-3 </td>
+    <td>7         </td>
+    <td>4.15062e-4 </td>
+    <td>7         </td>
+    <td>9.11191e-5 </td>
+    <td>8         </td>
+    <td>1.35553e-5</td>
+    <td>8         </td>
   </tr>
-
   <tr>
-    <th>3         </th>
-    <th>1.7628e-14</th>
-    <th>9         </th>
-    <th>2.19455e-4 </th>
-    <th>6         </th>
-    <th>1.78805e-5 </th>
-    <th>6         </th>
-    <th>5.26782e-7 </th>
-    <th>7         </th>
-    <th>9.37391e-9 </th>
-    <th>7         </th>
+    <td>3         </td>
+    <td>1.7628e-14</td>
+    <td>9         </td>
+    <td>2.19455e-4 </td>
+    <td>6         </td>
+    <td>1.78805e-5 </td>
+    <td>6         </td>
+    <td>5.26782e-7 </td>
+    <td>7         </td>
+    <td>9.37391e-9 </td>
+    <td>7         </td>
   </tr>
-
   <tr>
-    <th>4         </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>8.82693e-6 </th>
-    <th>6         </th>
-    <th>6.82096e-9 </th>
-    <th>7         </th>
-    <th>2.27696e-11 </th>
-    <th>8         </th>
-    <th>1.25899e-13</th>
-    <th>9        </th>
+    <td>4         </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>8.82693e-6 </td>
+    <td>6         </td>
+    <td>6.82096e-9 </td>
+    <td>7         </td>
+    <td>2.27696e-11 </td>
+    <td>8         </td>
+    <td>1.25899e-13</td>
+    <td>9        </td>
   </tr>
-
   <tr>
-    <th>5         </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>1.29739e-7</th>
-    <th>7         </th>
-    <th>1.25167e-13 </th>
-    <th>9        </th>
-    <th>1.76128e-14 </th>
-    <th>10         </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
+    <td>5         </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>1.29739e-7</td>
+    <td>7         </td>
+    <td>1.25167e-13 </td>
+    <td>9        </td>
+    <td>1.76128e-14 </td>
+    <td>10         </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
   </tr>
-
   <tr>
-    <th>6         </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>4.43518e-11</th>
-    <th>7         </th>
-    <th>&nbsp; </th>
-    <th>&nbsp;        </th>
-    <th>&nbsp; </th>
-    <th>&nbsp;        </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
+    <td>6         </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>4.43518e-11</td>
+    <td>7         </td>
+    <td>&nbsp; </td>
+    <td>&nbsp;        </td>
+    <td>&nbsp; </td>
+    <td>&nbsp;        </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
   </tr>
-
   <tr>
-    <th>7         </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
-    <th>6.42323e-15 </th>
-    <th>9         </th>
-    <th>&nbsp;</th>
-    <th>&nbsp;         </th>
-    <th>&nbsp; </th>
-    <th>&nbsp;         </th>
-    <th>&nbsp;    </th>
-    <th>&nbsp;    </th>
+    <td>7         </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
+    <td>6.42323e-15 </td>
+    <td>9         </td>
+    <td>&nbsp;</td>
+    <td>&nbsp;         </td>
+    <td>&nbsp; </td>
+    <td>&nbsp;         </td>
+    <td>&nbsp;    </td>
+    <td>&nbsp;    </td>
   </tr>
 </table>
 The sequence of generated grids looks like this:
@@ -377,40 +368,35 @@ consumes less memory. This will be even more pronounced in 3d.
 
 <table align="center" border="1">
 <tr>
-  <td>Ref</td>
-  <td>DoFs</td>
-  <td>Iterative: Total/s (Setup/s)</td>
-  <td>Direct: Total/s (Setup/s)</td>
+  <th>Ref</th>
+  <th>DoFs</th>
+  <th>Iterative: Total/s (Setup/s)</th>
+  <th>Direct: Total/s (Setup/s)</th>
 </tr>
-
 <tr>
   <td>5</td>
   <td>9539</td>
   <td>0.10 (0.06)</td>
   <td>0.13 (0.12)</td>
 </tr>
-
 <tr>
   <td>6</td>
   <td>37507</td>
   <td>0.58 (0.37)</td>
   <td>1.03 (0.97)</td>
 </tr>
-
 <tr>
   <td>7</td>
   <td>148739</td>
   <td>3.59 (2.73)</td>
   <td>7.78 (7.53)</td>
 </tr>
-
 <tr>
   <td>8</td>
   <td>592387</td>
   <td>29.17 (24.94)</td>
   <td>(>4GB RAM)</td>
 </tr>
-
 </table>
 
 
index 468df2e0f2e3928c900ee5a4e17cb32d9379a67b..0760f493cf62fa8d1966f66e567e689553b33195 100644 (file)
@@ -189,7 +189,7 @@ namespace Step57
   // Schur complement preconditioner is defined in this part. As discussed in
   // the introduction, the preconditioner in Krylov iterative methods is
   // implemented as a matrix-vector product operator. In practice, the Schur
-  // complement preconditioner is decomposed as a product of three matrices(as
+  // complement preconditioner is decomposed as a product of three matrices (as
   // presented in the first section).  The $\tilde{A}^{-1}$ in the first factor
   // involves a solve for the linear system $\tilde{A}x=b$. Here we solve
   // this system via a direct solver for simplicity. The computation involved
@@ -516,6 +516,13 @@ namespace Step57
       {
         pressure_mass_matrix.reinit(sparsity_pattern.block(1,1));
         pressure_mass_matrix.copy_from(system_matrix.block(1,1));
+
+        // Note that settings this pressure block to zero is not identical to
+        // not assembling anything in this block, because this operation here
+        // will (incorrectly) delete diagonal entries that come in from
+        // hanging node constraints for pressure DoFs. This means that our
+        // whole system matrix will have rows that are completely
+        // zero. Luckily, FGMRES handles these rows without any problem.
         system_matrix.block(1,1) = 0;
       }
   }
@@ -545,7 +552,7 @@ namespace Step57
   {
     const ConstraintMatrix &constraints_used = initial_step ? nonzero_constraints : zero_constraints;
 
-    SolverControl solver_control (system_matrix.m(),1e-4*system_rhs.l2_norm(), true);
+    SolverControl solver_control (system_matrix.m(), 1e-4*system_rhs.l2_norm(), true);
     SolverFGMRES<BlockVector<double> > gmres(solver_control);
 
     SparseILU<double> pmass_preconditioner;

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.