cantera/interfaces/cython/cantera/interrupts.py
Ray Speth b3a1e1e47c [Cython/1D] 1D solver can be interrupted by ctrl-c
By calling a pure Python function each time OneDim::eval is called, we can
catch KeyboardInterrupt exceptions and abort the 1D solver loop, returning
control to Python.

Partially addresses Issue 93.
2013-03-04 17:31:41 +00:00

7 lines
231 B
Python

def no_op(t):
"""
This function does nothing. It is used as an interrupt in the 1D solver
C++ loop where a pure Python function is needed in order for
KeyboardInterrupt events to be captured.
"""
return 0.0