Skip to content

Commit 2e3f0f6

Browse files
committed
add a test for dop853
1 parent 22c5997 commit 2e3f0f6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/unit/test_advanced_integrators.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <integrators/ode/rk4.hpp>
1010
#include <integrators/ode/rk23.hpp>
1111
#include <integrators/ode/rk45.hpp>
12+
#include <integrators/ode/dop853.hpp>
1213
#include <integrators/ode/bdf.hpp>
1314
#include <integrators/ode/lsoda.hpp>
1415

@@ -112,6 +113,18 @@ TEST_F(IntegratorTest, RK45IntegratorAdaptive) {
112113
EXPECT_NEAR(y[0], exact, 1e-6);
113114
}
114115

116+
TEST_F(IntegratorTest, DOP853IntegratorAdaptive) {
117+
diffeq::integrators::ode::DOP853Integrator<std::vector<double>> integrator(exponential_decay, 1e-6, 1e-9);
118+
119+
auto y = y0_vector_;
120+
integrator.set_time(t_start_);
121+
integrator.integrate(y, dt_, t_end_);
122+
123+
double exact = analytical_solution(t_end_);
124+
EXPECT_NEAR(y[0], exact, 1e-6);
125+
}
126+
127+
115128
TEST_F(IntegratorTest, BDFIntegratorStiff) {
116129
// Test with a mildly stiff system
117130
VanderPolOscillator vdp(5.0); // Moderately stiff

0 commit comments

Comments
 (0)