CATIA-Systems / FMPy

Simulate Functional Mockup Units (FMUs) in Python
Other
429 stars 118 forks source link

fmi[2/3]CompletedIntegratorStep called regardless of needsCompletedIntegratorStep=false #652

Closed sharanry closed 5 months ago

sharanry commented 7 months ago

fmi[2/3]CompletedIntegratorStep gets called in spite of flags

https://github.com/CATIA-Systems/FMPy/blob/04aa5fd1aa86af25caa37b7f9a710d240890ca4e/fmpy/simulation.py#L1076

Doesn't this violate the FMI spec?

nik5346 commented 6 months ago

FMI 2.0.4 p.95 "If true, function fmi2CompletedIntegratorStep need not be called (this gives a slightly more efficient integration). If it is called, it has no effect. If false (the default), the function must be called after every completed integrator step, see section 3.2.2."

FMI 3.0.1 section 3.4 "If true, the function fmi3CompletedIntegratorStep must be called after every completed integrator step. If false and the function is called anyway, it has no effect."

Therefor it is fine and not a violation.