Skip to content

Commit 1781b2a

Browse files
committed
rebase: rebased onto master
1 parent 22de07b commit 1781b2a

3 files changed

Lines changed: 7 additions & 12 deletions

File tree

py_ballisticcalc.exts/py_ballisticcalc_exts/rk45_engine.pxd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# pxd for rk4_engine to expose CythonizedRK4IntegrationEngine
22
from py_ballisticcalc_exts.base_types cimport BCLIBC_TerminationReason
33
from py_ballisticcalc_exts.base_engine cimport (
4-
BCLIBC_Engine,
4+
BCLIBC_BaseEngine,
55
CythonizedBaseIntegrationEngine,
66
BCLIBC_BaseTrajDataHandlerInterface,
77
)
@@ -10,7 +10,7 @@ from py_ballisticcalc_exts.base_engine cimport (
1010
cdef extern from "include/bclibc/rk45.hpp" namespace "bclibc" nogil:
1111

1212
void BCLIBC_integrateRK45(
13-
BCLIBC_Engine &eng,
13+
BCLIBC_BaseEngine &eng,
1414
BCLIBC_BaseTrajDataHandlerInterface &handler,
1515
BCLIBC_TerminationReason &reason,
1616
) except +

py_ballisticcalc.exts/py_ballisticcalc_exts/rk45_engine.pyx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ Because storing each step in a BCLIBC_BaseTrajSeq is practically costless,
66
we always run with "dense_output=True".
77
"""
88
from cython cimport final
9-
from py_ballisticcalc_exts.base_engine cimport CythonizedBaseIntegrationEngine
10-
9+
from py_ballisticcalc_exts.base_engine cimport CythonizedBaseIntegrationEngine, BCLIBC_IntegrateCallable
1110

1211
__all__ = [
1312
'CythonizedRK45IntegrationEngine',
@@ -17,11 +16,7 @@ __all__ = [
1716
@final
1817
cdef class CythonizedRK45IntegrationEngine(CythonizedBaseIntegrationEngine):
1918
"""Cythonized RK45 (Runge-Kutta 5th order) integration engine for ballistic calculations."""
20-
DEFAULT_TIME_STEP = 0.0025
21-
19+
2220
def __cinit__(self, object _config):
23-
self._this.integrate_func_ptr = BCLIBC_integrateRK45
24-
25-
cdef double get_calc_step(CythonizedRK45IntegrationEngine self):
26-
"""Calculate the step size for integration."""
27-
return self.DEFAULT_TIME_STEP * CythonizedBaseIntegrationEngine.get_calc_step(self)
21+
self._DEFAULT_TIME_STEP = 0.0025
22+
self._this.integrate_func = BCLIBC_IntegrateCallable(BCLIBC_integrateRK45)

py_ballisticcalc.exts/py_ballisticcalc_exts/src/rk45.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ namespace bclibc
4444
}
4545

4646
void BCLIBC_integrateRK45(
47-
BCLIBC_Engine &eng,
47+
BCLIBC_BaseEngine &eng,
4848
BCLIBC_BaseTrajDataHandlerInterface &handler,
4949
BCLIBC_TerminationReason &reason)
5050
{

0 commit comments

Comments
 (0)