FLINT 0.9.9
Fortran Library for numerical INTegration of differential equations
Loading...
Searching...
No Matches
flint_base::eventfunc Interface Reference

Interface for a user-supplied procedure for computing events values during the integration. It is also called after an event is detected in order for the user to specify the event actions to be taken by the event handler. Note that if multiple events are triggered at the same location then only the event with the lowest index will be reported. More...

+ Collaboration diagram for flint_base::eventfunc:

Public Member Functions

subroutine eventfunc (me, x, y, evalevents, value, direction, locevent, loceventaction)
 

Detailed Description

Interface for a user-supplied procedure for computing events values during the integration. It is also called after an event is detected in order for the user to specify the event actions to be taken by the event handler. Note that if multiple events are triggered at the same location then only the event with the lowest index will be reported.

Definition at line 257 of file FLINT_base.f90.

Constructor & Destructor Documentation

◆ eventfunc()

subroutine flint_base::eventfunc::eventfunc ( class(diffeqsys), intent(inout) me,
real(wp), intent(in) x,
real(wp), dimension(:), intent(inout) y,
integer, dimension(:), intent(in) evalevents,
real(wp), dimension(:), intent(out) value,
integer, dimension(:), intent(out) direction,
integer, intent(in), optional locevent,
integer(kind(flint_eventaction_continue)), intent(out), optional loceventaction )
virtual
Parameters
[in,out]meObject of class type DiffEqSys
[in]xThe current independent variable value. When an event is detected, it contains the location of that event.
[in,out]yCurrent solution value. User can modify this value from inside the event function, however it will only take effect if an event is located and the LocEvent contains the index of the located event. In that case, user user also must set the appropriate action in EventAction.
[in]evaleventsSize is m. User should evaluate only those event functions for which the corresponding index entry is 1 in EvalEvents.
[out]valueSize is m. If Value(i) changes sign, then the event "i" may trigger based on Direction(i). If Value(i) changes from/to NaN, then the sign change is ignored.
[out]directionSize must be same as Value.
  • Direction=1: only sign changes from -ve to +ve are detected
  • Direction=-1: only sign changes from +ve to -ve are detected
  • Direction=0: all sign changes are detected
[in]loceventFLINT will only call EventFunc with this parameter after an event is located. In that case, it will contain the index between 1 and m of the located event. User must check whether this parameter is "present" before using it.
[out]loceventactionThis parameter will be only present if an event has been located and LocEvent contains a valid index of the located event. In that case, user can specify a one of following actions that the event handler will take:
  • FLINT_EVENTACTION_CONTINUE: Continue the integration (default)
  • FLINT_EVENTACTION_TERMINATE: Terminate the integration at the current value of X
  • FLINT_EVENTACTION_CHANGESOLY: Change the solution value Y for the given X and use this value as the initial condition for computing the next step. The new value must be returned in "Y" by the user. EventStates will still contain the old value of Y that triggered the event.
  • FLINT_EVENTACTION_RESTARTINT: Restart the integration from the current value of X

Definition at line 257 of file FLINT_base.f90.

References flint_base::flint_eventaction_continue.


The documentation for this interface was generated from the following file: