Package org.hipparchus.ode.events
Interface FieldEventState<T extends CalculusFieldElement<T>>
-
- Type Parameters:
T
- the type of the field elements
- All Known Implementing Classes:
FieldDetectorBasedEventState
,FieldStepEndEventState
public interface FieldEventState<T extends CalculusFieldElement<T>>
This interface handles the state for either oneevent handler
or onestep end handler
during integration steps.- Since:
- 3.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FieldEventOccurrence<T>
doEvent(FieldODEStateAndDerivative<T> state)
Notify the user's listener of the event.boolean
evaluateStep(FieldODEStateInterpolator<T> interpolator)
Evaluate the impact of the proposed step on the event handler.T
getEventTime()
Get the occurrence time of the event triggered in the current step.void
init(FieldODEStateAndDerivative<T> s0, T t)
Initialize handler at the start of an integration.
-
-
-
Method Detail
-
init
void init(FieldODEStateAndDerivative<T> s0, T t)
Initialize handler at the start of an integration.This method is called once at the start of the integration. It may be used by the event handler to initialize some internal data if needed.
- Parameters:
s0
- initial statet
- target time for the integration
-
getEventTime
T getEventTime()
Get the occurrence time of the event triggered in the current step.- Returns:
- occurrence time of the event triggered in the current step or infinity if no events are triggered
-
evaluateStep
boolean evaluateStep(FieldODEStateInterpolator<T> interpolator) throws MathIllegalArgumentException, MathIllegalStateException
Evaluate the impact of the proposed step on the event handler.- Parameters:
interpolator
- step interpolator for the proposed step- Returns:
- true if the event handler triggers an event before the end of the proposed step
- Throws:
MathIllegalStateException
- if the interpolator throws one because the number of functions evaluations is exceededMathIllegalArgumentException
- if the event cannot be bracketed
-
doEvent
FieldEventOccurrence<T> doEvent(FieldODEStateAndDerivative<T> state)
Notify the user's listener of the event. The event occurs wholly within this method call including a call toFieldODEEventHandler.resetState(FieldODEEventDetector, FieldODEStateAndDerivative)
if necessary.- Parameters:
state
- the state at the time of the event. This must be at the same time as the current value ofgetEventTime()
.- Returns:
- the user's requested action and the new state if the action is
Action.RESET_STATE
. Otherwise the new state isstate
. The stop time indicates what time propagation should stop if the action isAction.STOP
. This guarantees the integration will stop on or after the root, so that integration may be restarted safely.
-
-