From cd5fc0e778fde96056c9bcdf4b21a48f6276e1fc Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 28 Mar 2021 19:17:11 +0200 Subject: [PATCH] Rename a variable. While there, also replace a '1/' by '1./'. --- examples/step-15/step-15.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/step-15/step-15.cc b/examples/step-15/step-15.cc index a7a6749949..e01dd1f314 100644 --- a/examples/step-15/step-15.cc +++ b/examples/step-15/step-15.cc @@ -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(); -- 2.39.5