|
3 | 3 | #include <array> |
4 | 4 | #include <cmath> |
5 | 5 | #include <memory> |
6 | | -#include <diffeq.hpp> |
| 6 | +#include <core/concepts.hpp> |
| 7 | +#include <core/abstract_integrator.hpp> |
| 8 | +#include <core/state_creator.hpp> |
| 9 | +#include <integrators/ode/rk4.hpp> |
7 | 10 |
|
8 | 11 | #ifndef M_PI |
9 | 12 | #define M_PI 3.14159265358979323846 |
@@ -116,27 +119,6 @@ bool test_rk4_harmonic_oscillator() { |
116 | 119 | return true; |
117 | 120 | } |
118 | 121 |
|
119 | | -bool test_inheritance() { |
120 | | - std::cout << "\n=== Testing inheritance and polymorphism ===" << std::endl; |
121 | | - |
122 | | - // Test that RK4Integrator can be used polymorphically |
123 | | - auto rk4 = std::make_unique<diffeq::RK4Integrator<std::vector<double>>>(exponential_decay); |
124 | | - AbstractIntegrator<std::vector<double>, double>* base_ptr = rk4.get(); |
125 | | - |
126 | | - std::vector<double> state = {1.0}; |
127 | | - double initial_time = base_ptr->current_time(); |
128 | | - |
129 | | - TEST_ASSERT(initial_time == 0.0, "Initial time should be 0.0"); |
130 | | - |
131 | | - base_ptr->step(state, 0.1); |
132 | | - double final_time = base_ptr->current_time(); |
133 | | - |
134 | | - TEST_ASSERT(final_time == 0.1, "Time should advance after step"); |
135 | | - TEST_ASSERT(state[0] < 1.0, "State should decrease for exponential decay"); |
136 | | - |
137 | | - return true; |
138 | | -} |
139 | | - |
140 | 122 | bool test_array_state() { |
141 | 123 | std::cout << "\n=== Testing RK4 with std::array state ===" << std::endl; |
142 | 124 |
|
@@ -177,7 +159,6 @@ int main() { |
177 | 159 | all_passed &= test_rk4_double(); |
178 | 160 | all_passed &= test_rk4_float(); |
179 | 161 | all_passed &= test_rk4_harmonic_oscillator(); |
180 | | - all_passed &= test_inheritance(); |
181 | 162 | all_passed &= test_array_state(); |
182 | 163 |
|
183 | 164 | std::cout << "\n=== Test Results ===" << std::endl; |
|
0 commit comments