From 9147d845bcca91bfba7dd9feeab56306a26d07f5 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 2 May 2023 17:50:27 -0600 Subject: [PATCH] Convert step-77. --- examples/step-77/step-77.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) 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); -- 2.39.5