From 3134cd3866f43a514652dbe1040e158b05844473 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 2 Jun 2024 20:41:37 -0600 Subject: [PATCH] Update a testcase for ARKODE. --- tests/sundials/arkode_01.cc | 9 +- tests/sundials/arkode_01.output | 256 ++++++++++++++++---------------- 2 files changed, 137 insertions(+), 128 deletions(-) diff --git a/tests/sundials/arkode_01.cc b/tests/sundials/arkode_01.cc index 4eb0dfacff..bb186a280e 100644 --- a/tests/sundials/arkode_01.cc +++ b/tests/sundials/arkode_01.cc @@ -74,9 +74,12 @@ main() double kappa = 1.0; + unsigned int n_rhs_evaluations = 0; ode.explicit_function = [&](double, const VectorType &y, VectorType &ydot) { ydot[0] = y[1]; ydot[1] = -kappa * kappa * y[0]; + + ++n_rhs_evaluations; }; ode.output_step = @@ -87,5 +90,9 @@ main() Vector y(2); y[0] = 0; y[1] = kappa; - ode.solve_ode(y); + + const unsigned int n_timesteps = ode.solve_ode(y); + + deallog << "n_rhs_evaluations=" << n_rhs_evaluations << std::endl; + deallog << "n_timesteps=" << n_timesteps << std::endl; } diff --git a/tests/sundials/arkode_01.output b/tests/sundials/arkode_01.output index 40a95d1ef5..36f54e11a5 100644 --- a/tests/sundials/arkode_01.output +++ b/tests/sundials/arkode_01.output @@ -1,128 +1,130 @@ -DEAL::0 0 1 -DEAL::0.05 0.0499792 0.99875 -DEAL::0.1 0.0998334 0.995004 -DEAL::0.15 0.149438 0.988771 -DEAL::0.2 0.198669 0.980067 -DEAL::0.25 0.247404 0.968912 -DEAL::0.3 0.295521 0.955336 -DEAL::0.35 0.3429 0.939372 -DEAL::0.4 0.38942 0.92106 -DEAL::0.45 0.434967 0.900447 -DEAL::0.5 0.479426 0.877583 -DEAL::0.55 0.522687 0.852525 -DEAL::0.6 0.564643 0.825335 -DEAL::0.65 0.605188 0.796083 -DEAL::0.7 0.644219 0.764841 -DEAL::0.75 0.68164 0.731688 -DEAL::0.8 0.717356 0.696707 -DEAL::0.85 0.751281 0.659983 -DEAL::0.9 0.78333 0.621606 -DEAL::0.95 0.813421 0.581675 -DEAL::1 0.841478 0.540292 -DEAL::1.05 0.867431 0.49756 -DEAL::1.1 0.891214 0.453587 -DEAL::1.15 0.912769 0.408482 -DEAL::1.2 0.932042 0.362356 -DEAL::1.25 0.948986 0.315322 -DEAL::1.3 0.96356 0.267498 -DEAL::1.35 0.975725 0.219002 -DEAL::1.4 0.985452 0.169958 -DEAL::1.45 0.992716 0.120492 -DEAL::1.5 0.997498 0.0707265 -DEAL::1.55 0.999787 0.0207865 -DEAL::1.6 0.999576 -0.0292043 -DEAL::1.65 0.996867 -0.0791226 -DEAL::1.7 0.991667 -0.128845 -DEAL::1.75 0.983988 -0.178249 -DEAL::1.8 0.973849 -0.227207 -DEAL::1.85 0.961276 -0.275598 -DEAL::1.9 0.946301 -0.323297 -DEAL::1.95 0.928961 -0.370187 -DEAL::2 0.909299 -0.416151 -DEAL::2.05 0.887365 -0.461075 -DEAL::2.1 0.863211 -0.504848 -DEAL::2.15 0.836899 -0.547361 -DEAL::2.2 0.808496 -0.588507 -DEAL::2.25 0.778072 -0.62818 -DEAL::2.3 0.745704 -0.666282 -DEAL::2.35 0.711473 -0.702718 -DEAL::2.4 0.675464 -0.737397 -DEAL::2.45 0.637766 -0.770234 -DEAL::2.5 0.598473 -0.801147 -DEAL::2.55 0.557682 -0.830058 -DEAL::2.6 0.515498 -0.856895 -DEAL::2.65 0.472027 -0.881588 -DEAL::2.7 0.427377 -0.904078 -DEAL::2.75 0.38166 -0.924307 -DEAL::2.8 0.334989 -0.942226 -DEAL::2.85 0.287478 -0.957791 -DEAL::2.9 0.239247 -0.970962 -DEAL::2.95 0.190418 -0.981707 -DEAL::3 0.141114 -0.989997 -DEAL::3.05 0.0914593 -0.995813 -DEAL::3.1 0.041577 -0.99914 -DEAL::3.15 -0.00840899 -0.999969 -DEAL::3.2 -0.0583749 -0.998299 -DEAL::3.25 -0.108197 -0.994133 -DEAL::3.3 -0.157751 -0.987483 -DEAL::3.35 -0.206909 -0.978364 -DEAL::3.4 -0.255548 -0.966801 -DEAL::3.45 -0.303548 -0.952821 -DEAL::3.5 -0.350788 -0.93646 -DEAL::3.55 -0.397151 -0.917758 -DEAL::3.6 -0.442523 -0.896762 -DEAL::3.65 -0.486791 -0.873523 -DEAL::3.7 -0.529842 -0.848102 -DEAL::3.75 -0.571568 -0.82056 -DEAL::3.8 -0.611864 -0.790969 -DEAL::3.85 -0.65063 -0.759401 -DEAL::3.9 -0.68777 -0.725935 -DEAL::3.95 -0.723192 -0.690654 -DEAL::4 -0.756808 -0.653645 -DEAL::4.05 -0.788532 -0.615002 -DEAL::4.1 -0.818284 -0.574823 -DEAL::4.15 -0.84599 -0.533208 -DEAL::4.2 -0.871582 -0.490261 -DEAL::4.25 -0.894994 -0.446089 -DEAL::4.3 -0.916171 -0.4008 -DEAL::4.35 -0.935058 -0.354508 -DEAL::4.4 -0.951608 -0.30733 -DEAL::4.45 -0.965779 -0.259385 -DEAL::4.5 -0.977536 -0.210793 -DEAL::4.55 -0.98685 -0.161675 -DEAL::4.6 -0.993697 -0.112152 -DEAL::4.65 -0.99806 -0.062348 -DEAL::4.7 -0.999929 -0.0123862 -DEAL::4.75 -0.999298 0.0376067 -DEAL::4.8 -0.99617 0.0875044 -DEAL::4.85 -0.990552 0.137182 -DEAL::4.9 -0.982458 0.186516 -DEAL::4.95 -0.971908 0.235384 -DEAL::5 -0.958929 0.283665 -DEAL::5.05 -0.943553 0.331238 -DEAL::5.1 -0.925818 0.377984 -DEAL::5.15 -0.90577 0.423783 -DEAL::5.2 -0.883458 0.468523 -DEAL::5.25 -0.858939 0.512091 -DEAL::5.3 -0.832272 0.554378 -DEAL::5.35 -0.803524 0.595282 -DEAL::5.4 -0.772767 0.634699 -DEAL::5.45 -0.740079 0.672529 -DEAL::5.5 -0.705541 0.708677 -DEAL::5.55 -0.669241 0.743054 -DEAL::5.6 -0.631269 0.775572 -DEAL::5.65 -0.591718 0.806152 -DEAL::5.7 -0.550688 0.834719 -DEAL::5.75 -0.50828 0.861199 -DEAL::5.8 -0.464601 0.885527 -DEAL::5.85 -0.419763 0.907641 -DEAL::5.9 -0.373876 0.927486 -DEAL::5.95 -0.327055 0.945012 -DEAL::6 -0.279416 0.960177 -DEAL::6.05 -0.231078 0.972942 -DEAL::6.1 -0.182162 0.983275 -DEAL::6.15 -0.132791 0.991151 -DEAL::6.2 -0.0830885 0.996549 -DEAL::6.25 -0.0331785 0.999456 -DEAL::6.28 -0.0031845 1 \ No newline at end of file +DEAL::0.00000 0.00000 1.00000 +DEAL::0.0500000 0.0499792 0.998750 +DEAL::0.100000 0.0998334 0.995004 +DEAL::0.150000 0.149438 0.988771 +DEAL::0.200000 0.198669 0.980067 +DEAL::0.250000 0.247404 0.968912 +DEAL::0.300000 0.295521 0.955336 +DEAL::0.350000 0.342900 0.939372 +DEAL::0.400000 0.389420 0.921060 +DEAL::0.450000 0.434967 0.900447 +DEAL::0.500000 0.479426 0.877583 +DEAL::0.550000 0.522687 0.852525 +DEAL::0.600000 0.564643 0.825335 +DEAL::0.650000 0.605188 0.796083 +DEAL::0.700000 0.644219 0.764841 +DEAL::0.750000 0.681640 0.731688 +DEAL::0.800000 0.717356 0.696707 +DEAL::0.850000 0.751281 0.659983 +DEAL::0.900000 0.783330 0.621606 +DEAL::0.950000 0.813421 0.581675 +DEAL::1.00000 0.841478 0.540292 +DEAL::1.05000 0.867431 0.497560 +DEAL::1.10000 0.891214 0.453587 +DEAL::1.15000 0.912769 0.408482 +DEAL::1.20000 0.932042 0.362356 +DEAL::1.25000 0.948986 0.315322 +DEAL::1.30000 0.963560 0.267498 +DEAL::1.35000 0.975725 0.219002 +DEAL::1.40000 0.985452 0.169958 +DEAL::1.45000 0.992716 0.120492 +DEAL::1.50000 0.997498 0.0707265 +DEAL::1.55000 0.999787 0.0207865 +DEAL::1.60000 0.999576 -0.0292043 +DEAL::1.65000 0.996867 -0.0791226 +DEAL::1.70000 0.991667 -0.128845 +DEAL::1.75000 0.983988 -0.178249 +DEAL::1.80000 0.973849 -0.227207 +DEAL::1.85000 0.961276 -0.275598 +DEAL::1.90000 0.946301 -0.323297 +DEAL::1.95000 0.928961 -0.370187 +DEAL::2.00000 0.909299 -0.416151 +DEAL::2.05000 0.887365 -0.461075 +DEAL::2.10000 0.863211 -0.504848 +DEAL::2.15000 0.836899 -0.547361 +DEAL::2.20000 0.808496 -0.588507 +DEAL::2.25000 0.778072 -0.628180 +DEAL::2.30000 0.745704 -0.666282 +DEAL::2.35000 0.711473 -0.702718 +DEAL::2.40000 0.675464 -0.737397 +DEAL::2.45000 0.637766 -0.770234 +DEAL::2.50000 0.598473 -0.801147 +DEAL::2.55000 0.557682 -0.830058 +DEAL::2.60000 0.515498 -0.856895 +DEAL::2.65000 0.472027 -0.881588 +DEAL::2.70000 0.427377 -0.904078 +DEAL::2.75000 0.381660 -0.924307 +DEAL::2.80000 0.334989 -0.942226 +DEAL::2.85000 0.287478 -0.957791 +DEAL::2.90000 0.239247 -0.970962 +DEAL::2.95000 0.190418 -0.981707 +DEAL::3.00000 0.141114 -0.989997 +DEAL::3.05000 0.0914593 -0.995813 +DEAL::3.10000 0.0415770 -0.999140 +DEAL::3.15000 -0.00840899 -0.999969 +DEAL::3.20000 -0.0583749 -0.998299 +DEAL::3.25000 -0.108197 -0.994133 +DEAL::3.30000 -0.157751 -0.987483 +DEAL::3.35000 -0.206909 -0.978364 +DEAL::3.40000 -0.255548 -0.966801 +DEAL::3.45000 -0.303548 -0.952821 +DEAL::3.50000 -0.350788 -0.936460 +DEAL::3.55000 -0.397151 -0.917758 +DEAL::3.60000 -0.442523 -0.896762 +DEAL::3.65000 -0.486791 -0.873523 +DEAL::3.70000 -0.529842 -0.848102 +DEAL::3.75000 -0.571568 -0.820560 +DEAL::3.80000 -0.611864 -0.790969 +DEAL::3.85000 -0.650630 -0.759401 +DEAL::3.90000 -0.687770 -0.725935 +DEAL::3.95000 -0.723192 -0.690654 +DEAL::4.00000 -0.756808 -0.653645 +DEAL::4.05000 -0.788532 -0.615002 +DEAL::4.10000 -0.818284 -0.574823 +DEAL::4.15000 -0.845990 -0.533208 +DEAL::4.20000 -0.871582 -0.490261 +DEAL::4.25000 -0.894994 -0.446089 +DEAL::4.30000 -0.916171 -0.400800 +DEAL::4.35000 -0.935058 -0.354508 +DEAL::4.40000 -0.951608 -0.307330 +DEAL::4.45000 -0.965779 -0.259385 +DEAL::4.50000 -0.977536 -0.210793 +DEAL::4.55000 -0.986850 -0.161675 +DEAL::4.60000 -0.993697 -0.112152 +DEAL::4.65000 -0.998060 -0.0623480 +DEAL::4.70000 -0.999929 -0.0123862 +DEAL::4.75000 -0.999298 0.0376067 +DEAL::4.80000 -0.996170 0.0875044 +DEAL::4.85000 -0.990552 0.137182 +DEAL::4.90000 -0.982458 0.186516 +DEAL::4.95000 -0.971908 0.235384 +DEAL::5.00000 -0.958929 0.283665 +DEAL::5.05000 -0.943553 0.331238 +DEAL::5.10000 -0.925818 0.377984 +DEAL::5.15000 -0.905770 0.423783 +DEAL::5.20000 -0.883458 0.468523 +DEAL::5.25000 -0.858939 0.512091 +DEAL::5.30000 -0.832272 0.554378 +DEAL::5.35000 -0.803524 0.595282 +DEAL::5.40000 -0.772767 0.634699 +DEAL::5.45000 -0.740079 0.672529 +DEAL::5.50000 -0.705541 0.708677 +DEAL::5.55000 -0.669241 0.743054 +DEAL::5.60000 -0.631269 0.775572 +DEAL::5.65000 -0.591718 0.806152 +DEAL::5.70000 -0.550688 0.834719 +DEAL::5.75000 -0.508280 0.861199 +DEAL::5.80000 -0.464601 0.885527 +DEAL::5.85000 -0.419763 0.907641 +DEAL::5.90000 -0.373876 0.927486 +DEAL::5.95000 -0.327055 0.945012 +DEAL::6.00000 -0.279416 0.960177 +DEAL::6.05000 -0.231078 0.972942 +DEAL::6.10000 -0.182162 0.983275 +DEAL::6.15000 -0.132791 0.991151 +DEAL::6.20000 -0.0830885 0.996549 +DEAL::6.25000 -0.0331785 0.999456 +DEAL::6.28000 -0.00318450 1.00000 +DEAL::n_rhs_evaluations=273 +DEAL::n_timesteps=20 -- 2.39.5