]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Rename a variable. 11997/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Sun, 28 Mar 2021 17:17:11 +0000 (19:17 +0200)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 31 Mar 2021 15:41:58 +0000 (09:41 -0600)
While there, also replace a '1/' by '1./'.

examples/step-15/step-15.cc

index a7a6749949068a6a37fb8ca0e4af04840b9760bf..e01dd1f314ef4ace9a53898438ca8e7f6256d88e 100644 (file)
@@ -524,7 +524,8 @@ namespace Step15
 
         for (unsigned int q = 0; q < n_q_points; ++q)
           {
-            const double coeff = 1 / std::sqrt(1 + gradients[q] * gradients[q]);
+            const double coeff =
+              1. / std::sqrt(1 + gradients[q] * gradients[q]);
 
             for (unsigned int i = 0; i < dofs_per_cell; ++i)
               cell_residual(i) -= (fe_values.shape_grad(i, q) // \nabla \phi_i
@@ -616,9 +617,9 @@ namespace Step15
     // information about the residual prior to this step and so we continue
     // the Newton iteration until we have reached at least one iteration and
     // until residual is less than $10^{-3}$.
-    double       previous_res     = 0;
-    unsigned int refinement_cycle = 0;
-    while ((refinement_cycle == 0) || (previous_res > 1e-3))
+    double       previous_residual = 0;
+    unsigned int refinement_cycle  = 0;
+    while ((refinement_cycle == 0) || (previous_residual > 1e-3))
       {
         std::cout << "Mesh refinement step " << refinement_cycle << std::endl;
 
@@ -640,7 +641,7 @@ namespace Step15
              ++inner_iteration)
           {
             assemble_system();
-            previous_res = system_rhs.l2_norm();
+            previous_residual = system_rhs.l2_norm();
 
             solve();
 

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.