Utility/SetupThe SET_DISCRETE_INTERFACE subroutine tells the solver to call the user-written subroutine discretely at successful integration steps.


The function can be called by SFOSUB, VFOSUB, VTOSUB, GFOSUB, DIFSUB, or VARSUB.


Fortran Calling Syntax
C/C++ Calling Syntax
Python Calling Syntax


  1. SET_DISCRETE_INTERFACE should only be called during subroutine initialization when IFLAG is set to TRUE.
  2. The default interface with the subroutine is continuous. In other words, the subroutine is called not only at successful integration steps, but also at all corrector iterations in-between the integration steps.
  3. If SET_DISCRETE_INTERFACE is in a user-written subroutine, the interface of only that subroutine will be changed to discrete, and the subroutine will be called only at successful integration steps.
  4. A subroutine with a SET_DISCRETE_INTERFACE call is regarded by MotionSolve as a discrete dynamical system. Therefore, the Jacobian terms (the derivatives of subroutine outputs with respect to MotionSolve states) associated with the subroutine are discarded.
  5. Besides co-simulation, where the data between the solver and the user-written-subroutines are exchanged discretely, you may also call SET_DISCRETE_INTERFACE from the user-written subroutine(s) to potentially improve corrector convergence. This may be useful if the subroutine outputs are extremely discontinuous and you don't want the solver to calculate the Jacobian terms numerically for use with the corrector iterations.