]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Update a testcase for IDA. 17096/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 3 Jun 2024 02:55:29 +0000 (20:55 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 11 Jun 2024 03:38:56 +0000 (21:38 -0600)
tests/sundials/ida_01.cc
tests/sundials/ida_01.output

index 1df9c52d708a84f5f696da2f90f99ef714ffa502..779be869d1973bdf9607a414535848dcb255a996 100644 (file)
@@ -53,6 +53,9 @@
  *
  * J = alpha I + A
  */
+
+unsigned int n_rhs_evaluations = 0;
+
 class HarmonicOscillator
 {
 public:
@@ -78,6 +81,7 @@ public:
                                 VectorType       &res) {
       res = y_dot;
       A.vmult_add(res, y);
+      ++n_rhs_evaluations;
     };
 
     time_stepper.setup_jacobian = [&](const double,
@@ -112,10 +116,14 @@ public:
   void
   run()
   {
-    y[1]     = kappa;
-    y_dot[0] = kappa;
-    time_stepper.solve_dae(y, y_dot);
+    y[1]                           = kappa;
+    y_dot[0]                       = kappa;
+    const unsigned int n_timesteps = time_stepper.solve_dae(y, y_dot);
+
+    deallog << "n_rhs_evaluations=" << n_rhs_evaluations << std::endl;
+    deallog << "n_timesteps=" << n_timesteps << std::endl;
   }
+
   SUNDIALS::IDA<Vector<double>> time_stepper;
 
 private:
index bb8726d8d138c0f96f235ada0f30f94e44d09373..d376f9c05cf69361748a6f0d01c2197ed3e6f12a 100644 (file)
@@ -32,3 +32,5 @@ DEAL::5.800000000 -0.4646021729 0.8855195059 0.8855195072 0.4646021708
 DEAL::6.000000000 -0.2794154939 0.9601702741 0.9601702747 0.2794154923
 DEAL::6.200000000 -0.08308940102 0.9965420835 0.9965420838 0.08308939852
 DEAL::6.300000000 0.01681390092 0.9998586225 0.9998586225 -0.01681390017
+DEAL::n_rhs_evaluations=325
+DEAL::n_timesteps=305

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.