]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Adjust tests.
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 24 May 2023 16:18:30 +0000 (10:18 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 24 May 2023 17:05:48 +0000 (11:05 -0600)
tests/quick_tests/sundials-ida.cc
tests/sundials/ida_01.cc
tests/sundials/ida_02.cc

index 6cd984410e692ad938634a3122ece8e3be5aae66..e72692341733414765901c2a18c8cc1d44c344f0 100644 (file)
@@ -76,16 +76,15 @@ public:
     time_stepper.residual = [&](const double /*t*/,
                                 const VectorType &y,
                                 const VectorType &y_dot,
-                                VectorType &      res) -> int {
+                                VectorType &      res) {
       res = y_dot;
       A.vmult_add(res, y);
-      return 0;
     };
 
     time_stepper.setup_jacobian = [&](const double,
                                       const VectorType &,
                                       const VectorType &,
-                                      const double alpha) -> int {
+                                      const double alpha) {
       A(0, 1) = -1.0;
       A(1, 0) = kappa * kappa;
 
@@ -95,21 +94,18 @@ public:
       J(1, 1) = alpha;
 
       Jinv.invert(J);
-      return 0;
     };
 
     time_stepper.solve_with_jacobian =
-      [&](const VectorType &rhs, VectorType &dst, const double /*tol*/) -> int {
-      Jinv.vmult(dst, rhs);
-      return 0;
-    };
+      [&](const VectorType &rhs, VectorType &dst, const double /*tol*/) {
+        Jinv.vmult(dst, rhs);
+      };
 
     time_stepper.output_step = [&](const double /*t*/,
                                    const VectorType & /*sol*/,
                                    const VectorType & /*sol_dot*/,
-                                   const unsigned int /*step_number*/) -> int {
+                                   const unsigned int /*step_number*/) {
       // In this test, don't output anything.
-      return 0;
     };
 
     time_stepper.solver_should_restart =
index d83ae344e93f2ef4bc622e67c7dfcf02766d2cf9..6d071ab0de4bcd39d59f8b99cfb03400baf646c3 100644 (file)
@@ -76,16 +76,15 @@ public:
     time_stepper.residual = [&](const double      t,
                                 const VectorType &y,
                                 const VectorType &y_dot,
-                                VectorType &      res) -> int {
+                                VectorType &      res) {
       res = y_dot;
       A.vmult_add(res, y);
-      return 0;
     };
 
     time_stepper.setup_jacobian = [&](const double,
                                       const VectorType &,
                                       const VectorType &,
-                                      const double alpha) -> int {
+                                      const double alpha) {
       A(0, 1) = -1.0;
       A(1, 0) = kappa * kappa;
 
@@ -95,30 +94,24 @@ public:
       J(1, 1) = alpha;
 
       Jinv.invert(J);
-      return 0;
     };
 
     // Used only in ver < 4.0.0
-    time_stepper.solve_jacobian_system = [&](const VectorType &src,
-                                             VectorType &      dst) -> int {
-      Jinv.vmult(dst, src);
-      return 0;
-    };
+    time_stepper.solve_jacobian_system =
+      [&](const VectorType &src, VectorType &dst) { Jinv.vmult(dst, src); };
 
     // Used in ver >= 4.0.0
     time_stepper.solve_with_jacobian =
-      [&](const VectorType &src, VectorType &dst, const double) -> int {
-      Jinv.vmult(dst, src);
-      return 0;
-    };
+      [&](const VectorType &src, VectorType &dst, const double) {
+        Jinv.vmult(dst, src);
+      };
 
     time_stepper.output_step = [&](const double       t,
                                    const VectorType & sol,
                                    const VectorType & sol_dot,
-                                   const unsigned int step_number) -> int {
+                                   const unsigned int step_number) {
       deallog << t << ' ' << sol[0] << ' ' << sol[1] << ' ' << sol_dot[0] << ' '
               << sol_dot[1] << std::endl;
-      return 0;
     };
   }
 
@@ -161,5 +154,4 @@ main()
 
   HarmonicOscillator ode(1.0, data);
   ode.run();
-  return 0;
 }
index e6c835967010df78fffde7aee76e716326547a26..8277677886dd3e00099ab219d947b51e15d81001 100644 (file)
@@ -79,16 +79,15 @@ public:
     time_stepper.residual = [&](const double      t,
                                 const VectorType &y,
                                 const VectorType &y_dot,
-                                VectorType &      res) -> int {
+                                VectorType &      res) {
       res = y_dot;
       A.vmult_add(res, y);
-      return 0;
     };
 
     time_stepper.setup_jacobian = [&](const double,
                                       const VectorType &,
                                       const VectorType &,
-                                      const double alpha) -> int {
+                                      const double alpha) {
       A(0, 1) = -1.0;
       A(1, 0) = kappa * kappa;
 
@@ -96,26 +95,21 @@ public:
 
       J(0, 0) = alpha;
       J(1, 1) = alpha;
-
-      return 0;
     };
 
-    time_stepper.solve_with_jacobian = [&](const VectorType &src,
-                                           VectorType &      dst,
-                                           const double      tolerance) -> int {
-      SolverControl               solver_control(1000, tolerance, false, false);
-      SolverGMRES<Vector<double>> solver(solver_control);
-      solver.solve(J, dst, src, PreconditionIdentity());
-      return 0;
-    };
+    time_stepper.solve_with_jacobian =
+      [&](const VectorType &src, VectorType &dst, const double tolerance) {
+        SolverControl solver_control(1000, tolerance, false, false);
+        SolverGMRES<Vector<double>> solver(solver_control);
+        solver.solve(J, dst, src, PreconditionIdentity());
+      };
 
     time_stepper.output_step = [&](const double       t,
                                    const VectorType & sol,
                                    const VectorType & sol_dot,
-                                   const unsigned int step_number) -> int {
+                                   const unsigned int step_number) {
       deallog << t << ' ' << sol[0] << ' ' << sol[1] << ' ' << sol_dot[0] << ' '
               << sol_dot[1] << std::endl;
-      return 0;
     };
   }
 
@@ -158,5 +152,4 @@ main()
 
   HarmonicOscillator ode(1.0, data);
   ode.run();
-  return 0;
 }

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.