tmdsimpy.utils.continuation.continuation_save¶
- tmdsimpy.utils.continuation.continuation_save(XlamP, dirP_prev, fname)¶
Saves continuation data to a file.
Saves continuation variables. Saved output will 2D arrays with the same names as inputs here. Each row of output will correspond to a single solution point.
- Parameters:
- XlamP(N+1,) numpy.ndarray
Solution at the current step in physical coordinates (including continuation parameter).
- dirP_prev(N+1,) numpy.ndarray
Direction for prediction from previous step to this step. Can be used to get slope of solution at previous point w.r.t. lam by dividing dirP / dirP[-1]
- fnamestr
Filename to save variables to. Should have file extension of .npz
- Returns:
- None.
See also
tmdsimpy.ContinuationClass for continuation where this function is intended to be used as a callback function.
combine_callback_funsFunction for combining multiple callback functions for Continuation.
Examples
Define a callback function handle to pass to tmdsimpy.Continuation as
>>> callback_fun = lambda XlamP, dirP_prev : continuation_save(XlamP, ... dirP_prev, 'saved_data.npz')