]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Convert step-77.
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 2 May 2023 23:50:27 +0000 (17:50 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 4 May 2023 23:43:06 +0000 (17:43 -0600)
examples/step-77/step-77.cc

index e04c7f91231a349da92cc09e8aa1c800079dba75..b58f350b20f4c3cfd961423d13168d582ba65deb 100644 (file)
@@ -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<double> &evaluation_point,
                 Vector<double> &      residual) {
               compute_residual(evaluation_point, residual);
-
-              return 0;
             };
 
           nonlinear_solver.setup_jacobian =
             [&](const Vector<double> &current_u,
                 const Vector<double> & /*current_f*/) {
               compute_and_factorize_jacobian(current_u);
-
-              return 0;
             };
 
           nonlinear_solver.solve_with_jacobian = [&](const Vector<double> &rhs,
                                                      Vector<double> &      dst,
                                                      const double tolerance) {
             this->solve(rhs, dst, tolerance);
-
-            return 0;
           };
 
           nonlinear_solver.solve(current_solution);

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.