From bf6495129d143a31f00b14c74705a3b9ba589530 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 2 Jun 2024 20:55:29 -0600 Subject: [PATCH] Update a testcase for IDA. --- tests/sundials/ida_01.cc | 14 +++++++++++--- tests/sundials/ida_01.output | 2 ++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/sundials/ida_01.cc b/tests/sundials/ida_01.cc index 1df9c52d70..779be869d1 100644 --- a/tests/sundials/ida_01.cc +++ b/tests/sundials/ida_01.cc @@ -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> time_stepper; private: diff --git a/tests/sundials/ida_01.output b/tests/sundials/ida_01.output index bb8726d8d1..d376f9c05c 100644 --- a/tests/sundials/ida_01.output +++ b/tests/sundials/ida_01.output @@ -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 -- 2.39.5