Class FieldAbstractPropagator<T extends org.hipparchus.RealFieldElement<T>>
- java.lang.Object
-
- org.orekit.propagation.FieldAbstractPropagator<T>
-
- All Implemented Interfaces:
FieldPropagator<T>
,FieldPVCoordinatesProvider<T>
- Direct Known Subclasses:
FieldAbstractAnalyticalPropagator
,FieldAbstractIntegratedPropagator
public abstract class FieldAbstractPropagator<T extends org.hipparchus.RealFieldElement<T>> extends Object implements FieldPropagator<T>
Common handling ofPropagator
methods for analytical propagators.This abstract class allows to provide easily the full set of
Propagator
methods, including all propagation modes support and discrete events support for any simple propagation method.- Author:
- Luc Maisonobe
-
-
Field Summary
-
Fields inherited from interface org.orekit.propagation.FieldPropagator
DEFAULT_LAW, DEFAULT_MASS, EPHEMERIS_GENERATION_MODE, MASTER_MODE, SLAVE_MODE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FieldAbstractPropagator(org.hipparchus.Field<T> field)
Build a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addAdditionalStateProvider(FieldAdditionalStateProvider<T> additionalStateProvider)
Add a set of user-specified state parameters to be computed along with the orbit propagation.abstract <D extends FieldEventDetector<T>>
voidaddEventDetector(D detector)
Add an event detector.abstract void
clearEventsDetectors()
Remove all events detectors.List<FieldAdditionalStateProvider<T>>
getAdditionalStateProviders()
Get an unmodifiable list of providers for additional state.AttitudeProvider
getAttitudeProvider()
Get attitude provider.abstract Collection<FieldEventDetector<T>>
getEventsDetectors()
Get all the events detectors that have been added.org.hipparchus.Field<T>
getField()
Field getter.protected T
getFixedStepSize()
Get the fixed step size.Frame
getFrame()
Get the frame in which the orbit is propagated.abstract FieldBoundedPropagator<T>
getGeneratedEphemeris()
Get the ephemeris generated during propagation.FieldSpacecraftState<T>
getInitialState()
Get the propagator initial state.String[]
getManagedAdditionalStates()
Get all the names of all managed states.int
getMode()
Get the current operating mode of the propagator.TimeStampedFieldPVCoordinates<T>
getPVCoordinates(FieldAbsoluteDate<T> date, Frame frame)
Get theFieldPVCoordinates
of the body in the selected frame.protected FieldAbsoluteDate<T>
getStartDate()
Get the start date.protected FieldOrekitStepHandler<T>
getStepHandler()
Get the step handler.boolean
isAdditionalStateManaged(String name)
Check if an additional state is managed.FieldSpacecraftState<T>
propagate(FieldAbsoluteDate<T> target)
Propagate towards a target date.void
resetInitialState(FieldSpacecraftState<T> state)
Reset the propagator initial state.void
setAttitudeProvider(AttitudeProvider attitudeProvider)
Set attitude provider.void
setEphemerisMode()
Set the propagator to ephemeris generation mode.void
setMasterMode(FieldOrekitStepHandler<T> handler)
Set the propagator to master mode with variable steps.void
setMasterMode(T h, FieldOrekitFixedStepHandler<T> handler)
Set the propagator to master mode with fixed steps.void
setSlaveMode()
Set the propagator to slave mode.protected void
setStartDate(FieldAbsoluteDate<T> startDate)
Set a start date.protected FieldSpacecraftState<T>
updateAdditionalStates(FieldSpacecraftState<T> original)
Update state by adding all additional states.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.orekit.propagation.FieldPropagator
propagate
-
-
-
-
Constructor Detail
-
FieldAbstractPropagator
protected FieldAbstractPropagator(org.hipparchus.Field<T> field)
Build a new instance.- Parameters:
field
- setting the field
-
-
Method Detail
-
setStartDate
protected void setStartDate(FieldAbsoluteDate<T> startDate)
Set a start date.- Parameters:
startDate
- start date
-
getStartDate
protected FieldAbsoluteDate<T> getStartDate()
Get the start date.- Returns:
- start date
-
getAttitudeProvider
public AttitudeProvider getAttitudeProvider()
Get attitude provider.- Specified by:
getAttitudeProvider
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Returns:
- attitude provider
-
setAttitudeProvider
public void setAttitudeProvider(AttitudeProvider attitudeProvider)
Set attitude provider.- Specified by:
setAttitudeProvider
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Parameters:
attitudeProvider
- attitude provider
-
getField
public org.hipparchus.Field<T> getField()
Field getter.- Returns:
- field used
-
getInitialState
public FieldSpacecraftState<T> getInitialState()
Get the propagator initial state.- Specified by:
getInitialState
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Returns:
- initial state
-
getMode
public int getMode()
Get the current operating mode of the propagator.- Specified by:
getMode
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Returns:
- one of
FieldPropagator.SLAVE_MODE
,FieldPropagator.MASTER_MODE
,FieldPropagator.EPHEMERIS_GENERATION_MODE
- See Also:
FieldPropagator.setSlaveMode()
,FieldPropagator.setMasterMode(RealFieldElement, FieldOrekitFixedStepHandler)
,FieldPropagator.setMasterMode(FieldOrekitStepHandler)
,FieldPropagator.setEphemerisMode()
-
getFrame
public Frame getFrame()
Get the frame in which the orbit is propagated.The propagation frame is the definition frame of the initial state, so this method should be called after this state has been set, otherwise it may return null.
- Specified by:
getFrame
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Returns:
- frame in which the orbit is propagated
- See Also:
FieldPropagator.resetInitialState(FieldSpacecraftState)
-
resetInitialState
public void resetInitialState(FieldSpacecraftState<T> state)
Reset the propagator initial state.- Specified by:
resetInitialState
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Parameters:
state
- new initial state to consider
-
setSlaveMode
public void setSlaveMode()
Set the propagator to slave mode.This mode is used when the user needs only the final orbit at the target time. The (slave) propagator computes this result and return it to the calling (master) application, without any intermediate feedback.
This is the default mode.
- Specified by:
setSlaveMode
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- See Also:
FieldPropagator.setMasterMode(RealFieldElement, FieldOrekitFixedStepHandler)
,FieldPropagator.setMasterMode(FieldOrekitStepHandler)
,FieldPropagator.setEphemerisMode()
,FieldPropagator.getMode()
,FieldPropagator.SLAVE_MODE
-
setMasterMode
public void setMasterMode(T h, FieldOrekitFixedStepHandler<T> handler)
Set the propagator to master mode with fixed steps.This mode is used when the user needs to have some custom function called at the end of each finalized step during integration. The (master) propagator integration loop calls the (slave) application callback methods at each finalized step.
- Specified by:
setMasterMode
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Parameters:
h
- fixed stepsize (s)handler
- handler called at the end of each finalized step- See Also:
FieldPropagator.setSlaveMode()
,FieldPropagator.setMasterMode(FieldOrekitStepHandler)
,FieldPropagator.setEphemerisMode()
,FieldPropagator.getMode()
,FieldPropagator.MASTER_MODE
-
setMasterMode
public void setMasterMode(FieldOrekitStepHandler<T> handler)
Set the propagator to master mode with variable steps.This mode is used when the user needs to have some custom function called at the end of each finalized step during integration. The (master) propagator integration loop calls the (slave) application callback methods at each finalized step.
- Specified by:
setMasterMode
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Parameters:
handler
- handler called at the end of each finalized step- See Also:
FieldPropagator.setSlaveMode()
,FieldPropagator.setMasterMode(RealFieldElement, FieldOrekitFixedStepHandler)
,FieldPropagator.setEphemerisMode()
,FieldPropagator.getMode()
,FieldPropagator.MASTER_MODE
-
setEphemerisMode
public void setEphemerisMode()
Set the propagator to ephemeris generation mode.This mode is used when the user needs random access to the orbit state at any time between the initial and target times, and in no sequential order. A typical example is the implementation of search and iterative algorithms that may navigate forward and backward inside the propagation range before finding their result.
Beware that since this mode stores all intermediate results, it may be memory intensive for long integration ranges and high precision/short time steps.
- Specified by:
setEphemerisMode
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- See Also:
FieldPropagator.getGeneratedEphemeris()
,FieldPropagator.setSlaveMode()
,FieldPropagator.setMasterMode(RealFieldElement, FieldOrekitFixedStepHandler)
,FieldPropagator.setMasterMode(FieldOrekitStepHandler)
,FieldPropagator.getMode()
,FieldPropagator.EPHEMERIS_GENERATION_MODE
-
addAdditionalStateProvider
public void addAdditionalStateProvider(FieldAdditionalStateProvider<T> additionalStateProvider)
Add a set of user-specified state parameters to be computed along with the orbit propagation.- Specified by:
addAdditionalStateProvider
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Parameters:
additionalStateProvider
- provider for additional state
-
getAdditionalStateProviders
public List<FieldAdditionalStateProvider<T>> getAdditionalStateProviders()
Get an unmodifiable list of providers for additional state.- Specified by:
getAdditionalStateProviders
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Returns:
- providers for the additional states
-
updateAdditionalStates
protected FieldSpacecraftState<T> updateAdditionalStates(FieldSpacecraftState<T> original)
Update state by adding all additional states.- Parameters:
original
- original state- Returns:
- updated state, with all additional states included
- See Also:
addAdditionalStateProvider(FieldAdditionalStateProvider)
-
isAdditionalStateManaged
public boolean isAdditionalStateManaged(String name)
Check if an additional state is managed.Managed states are states for which the propagators know how to compute its evolution. They correspond to additional states for which an
additional state provider
has been registered by calling theaddAdditionalStateProvider
method. If the propagator is anintegrator-based propagator
, the states for which a set ofadditional equations
has been registered by calling theaddAdditionalEquations
method are also counted as managed additional states.Additional states that are present in the
initial state
but have no evolution method registered are not considered as managed states. These unmanaged additional states are not lost during propagation, though. Their value will simply be copied unchanged throughout propagation.- Specified by:
isAdditionalStateManaged
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Parameters:
name
- name of the additional state- Returns:
- true if the additional state is managed
-
getManagedAdditionalStates
public String[] getManagedAdditionalStates()
Get all the names of all managed states.- Specified by:
getManagedAdditionalStates
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Returns:
- names of all managed states
-
getFixedStepSize
protected T getFixedStepSize()
Get the fixed step size.- Returns:
- fixed step size (or NaN if there are no fixed step size).
-
getStepHandler
protected FieldOrekitStepHandler<T> getStepHandler()
Get the step handler.- Returns:
- step handler
-
getGeneratedEphemeris
public abstract FieldBoundedPropagator<T> getGeneratedEphemeris()
Get the ephemeris generated during propagation.- Specified by:
getGeneratedEphemeris
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Returns:
- generated ephemeris
- See Also:
FieldPropagator.setEphemerisMode()
-
addEventDetector
public abstract <D extends FieldEventDetector<T>> void addEventDetector(D detector)
Add an event detector.- Specified by:
addEventDetector
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Type Parameters:
D
- class type for the generic version- Parameters:
detector
- event detector to add- See Also:
FieldPropagator.clearEventsDetectors()
,FieldPropagator.getEventsDetectors()
-
getEventsDetectors
public abstract Collection<FieldEventDetector<T>> getEventsDetectors()
Get all the events detectors that have been added.- Specified by:
getEventsDetectors
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Returns:
- an unmodifiable collection of the added detectors
- See Also:
FieldPropagator.addEventDetector(FieldEventDetector)
,FieldPropagator.clearEventsDetectors()
-
clearEventsDetectors
public abstract void clearEventsDetectors()
Remove all events detectors.- Specified by:
clearEventsDetectors
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- See Also:
FieldPropagator.addEventDetector(FieldEventDetector)
,FieldPropagator.getEventsDetectors()
-
propagate
public FieldSpacecraftState<T> propagate(FieldAbsoluteDate<T> target)
Propagate towards a target date.Simple propagators use only the target date as the specification for computing the propagated state. More feature rich propagators can consider other information and provide different operating modes or G-stop facilities to stop at pinpointed events occurrences. In these cases, the target date is only a hint, not a mandatory objective.
- Specified by:
propagate
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Parameters:
target
- target date towards which orbit state should be propagated- Returns:
- propagated state
-
getPVCoordinates
public TimeStampedFieldPVCoordinates<T> getPVCoordinates(FieldAbsoluteDate<T> date, Frame frame)
Get theFieldPVCoordinates
of the body in the selected frame.- Specified by:
getPVCoordinates
in interfaceFieldPVCoordinatesProvider<T extends org.hipparchus.RealFieldElement<T>>
- Parameters:
date
- current dateframe
- the frame where to define the position- Returns:
- time-stamped position/velocity of the body (m and m/s)
-
-