fr.cnes.sirius.patrius.propagation.sampling.multi
Class MultiAdaptedStepHandler

java.lang.Object
  extended by fr.cnes.sirius.patrius.propagation.sampling.multi.MultiAdaptedStepHandler
All Implemented Interfaces:
MultiModeHandler, MultiOrekitStepInterpolator, StepHandler

public class MultiAdaptedStepHandler
extends Object
implements MultiOrekitStepInterpolator, StepHandler, MultiModeHandler

This class is copied from AdaptedStepHandler and adapted to multi propagation.

Adapt an MultiOrekitStepHandler to commons-math StepHandler interface.

Since:
3.0
Version:
$Id: MultiAdaptedStepHandler.java 14139 2015-10-07 12:05:35Z bignon $
Author:
maggioranic
Concurrency :
not thread-safe

Constructor Summary
MultiAdaptedStepHandler(MultiOrekitStepHandler multiHandler)
          Build an instance.
 
Method Summary
 MultiAdaptedStepHandler copy()
          Copy this.
 AbsoluteDate getCurrentDate()
          Get the current grid date.
 AbsoluteDate getInterpolatedDate()
          Get the interpolated date.
 Map<String,SpacecraftState> getInterpolatedStates()
          Get all the interpolated states.
 AbsoluteDate getPreviousDate()
          Get the previous grid date.
 void handleStep(StepInterpolator interpolator, boolean isLast)
          Handle the last accepted step
 void init(double t0, double[] y0, double t)
          Initialize step handler at the start of an ODE integration.
 void initialize(OrbitType orbit, PositionAngle angle, Map<String,AttitudeProvider> attProvidersForces, Map<String,AttitudeProvider> attProvidersEvents, MultiStateVectorInfo stateVectorInfo, boolean activateHandlers, AbsoluteDate reference, Map<String,Frame> frameMap, Map<String,Double> muMap)
          Initialize the mode handler.
 boolean isForward()
          Check is integration direction is forward in date.
 void setInterpolatedDate(AbsoluteDate date)
          Set the interpolated date.
 void setReference(AbsoluteDate newReference)
          Define new reference date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiAdaptedStepHandler

public MultiAdaptedStepHandler(MultiOrekitStepHandler multiHandler)
Build an instance.

Parameters:
multiHandler - underlying handler to wrap
Method Detail

initialize

public void initialize(OrbitType orbit,
                       PositionAngle angle,
                       Map<String,AttitudeProvider> attProvidersForces,
                       Map<String,AttitudeProvider> attProvidersEvents,
                       MultiStateVectorInfo stateVectorInfo,
                       boolean activateHandlers,
                       AbsoluteDate reference,
                       Map<String,Frame> frameMap,
                       Map<String,Double> muMap)
Initialize the mode handler.

Specified by:
initialize in interface MultiModeHandler
Parameters:
orbit - orbit type
angle - position angle type
attProvidersForces - attitude providers for forces computation for each state
attProvidersEvents - attitude providers for events computation for each state
stateVectorInfo - the state vector informations
activateHandlers - if handlers shall be active
reference - reference date
frameMap - the map of reference frame for each state
muMap - the map of central body attraction coefficient for each state

init

public void init(double t0,
                 double[] y0,
                 double t)
Initialize step handler at the start of an ODE integration.

This method is called once at the start of the integration. It may be used by the step handler to initialize some internal data if needed.

Specified by:
init in interface StepHandler
Parameters:
t0 - start value of the independent time variable
y0 - array containing the start value of the state vector
t - target time for the integration

handleStep

public void handleStep(StepInterpolator interpolator,
                       boolean isLast)
Handle the last accepted step

Specified by:
handleStep in interface StepHandler
Parameters:
interpolator - interpolator for the last accepted step. For efficiency purposes, the various integrators reuse the same object on each call, so if the instance wants to keep it across all calls (for example to provide at the end of the integration a continuous model valid throughout the integration range, as the ContinuousOutputModel class does), it should build a local copy using the clone method of the interpolator and store this copy. Keeping only a reference to the interpolator and reusing it will result in unpredictable behavior (potentially crashing the application).
isLast - true if the step is the last one

getCurrentDate

public AbsoluteDate getCurrentDate()
Get the current grid date.

Specified by:
getCurrentDate in interface MultiOrekitStepInterpolator
Returns:
current grid date

getPreviousDate

public AbsoluteDate getPreviousDate()
Get the previous grid date.

Specified by:
getPreviousDate in interface MultiOrekitStepInterpolator
Returns:
previous grid date

getInterpolatedDate

public AbsoluteDate getInterpolatedDate()
Get the interpolated date.

If setInterpolatedDate has not been called, the date returned is the same as getCurrentDate.

Specified by:
getInterpolatedDate in interface MultiOrekitStepInterpolator
Returns:
interpolated date
See Also:
MultiOrekitStepInterpolator.setInterpolatedDate(AbsoluteDate), MultiOrekitStepInterpolator.getInterpolatedStates()

setInterpolatedDate

public void setInterpolatedDate(AbsoluteDate date)
                         throws PropagationException
Set the interpolated date.

It is possible to set the interpolation date outside of the current step range, but accuracy will decrease as date is farther.

Specified by:
setInterpolatedDate in interface MultiOrekitStepInterpolator
Parameters:
date - interpolated date to set
Throws:
PropagationException - if underlying interpolator cannot handle the date
See Also:
MultiOrekitStepInterpolator.getInterpolatedDate(), MultiOrekitStepInterpolator.getInterpolatedStates()

getInterpolatedStates

public Map<String,SpacecraftState> getInterpolatedStates()
                                                  throws OrekitException
Get all the interpolated states.

Specified by:
getInterpolatedStates in interface MultiOrekitStepInterpolator
Returns:
interpolated states at the current interpolation date
Throws:
OrekitException - if a state cannot be interpolated or converted
See Also:
MultiOrekitStepInterpolator.getInterpolatedDate(), MultiOrekitStepInterpolator.setInterpolatedDate(AbsoluteDate)

isForward

public boolean isForward()
Check is integration direction is forward in date.

Specified by:
isForward in interface MultiOrekitStepInterpolator
Returns:
true if integration is forward in date

copy

public MultiAdaptedStepHandler copy()

Copy this.

Following attributes are deeply copied:

Following attributes reference is passed (no deep copy):

Returns:
copy of this

setReference

public void setReference(AbsoluteDate newReference)
Define new reference date.

To be called by NumericalPropagator only.

Specified by:
setReference in interface MultiModeHandler
Parameters:
newReference - new reference date


Copyright © 2016 CNES. All Rights Reserved.