From: Wolfgang Bangerth Date: Tue, 2 May 2023 23:50:27 +0000 (-0600) Subject: Convert step-77. X-Git-Tag: v9.5.0-rc1~247^2~4 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9147d845bcca91bfba7dd9feeab56306a26d07f5;p=dealii.git Convert step-77. --- diff --git a/examples/step-77/step-77.cc b/examples/step-77/step-77.cc index e04c7f9123..b58f350b20 100644 --- a/examples/step-77/step-77.cc +++ b/examples/step-77/step-77.cc @@ -572,10 +572,8 @@ namespace Step77 // the SUNDIALS::KINSOL class that are of type `std::function`, i.e., // they are objects to which we can assign a pointer to a function or, // as we do here, a "lambda function" that takes the appropriate - // arguments and returns the appropriate information. By convention, - // KINSOL wants that functions doing something nontrivial return an - // integer where zero indicates success. It turns out that we can do - // all of this in just 25 lines of code. + // arguments and returns the appropriate information. It turns out + // that we can do all of this in just over 20 lines of code. // // (If you're not familiar what "lambda functions" are, take // a look at step-12 or at the @@ -603,24 +601,18 @@ namespace Step77 [&](const Vector &evaluation_point, Vector & residual) { compute_residual(evaluation_point, residual); - - return 0; }; nonlinear_solver.setup_jacobian = [&](const Vector ¤t_u, const Vector & /*current_f*/) { compute_and_factorize_jacobian(current_u); - - return 0; }; nonlinear_solver.solve_with_jacobian = [&](const Vector &rhs, Vector & dst, const double tolerance) { this->solve(rhs, dst, tolerance); - - return 0; }; nonlinear_solver.solve(current_solution);