Package cnuphys.swim
Class DefaultSwimStopper
java.lang.Object
cnuphys.swim.DefaultSwimStopper
- All Implemented Interfaces:
- IStopper
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultSwimStopper(double maxR) A default swim stopper that will stop if either a max pathlength is exceeded or if a radial coordinate is exceeded
- 
Method SummaryModifier and TypeMethodDescriptiondoubleGet the final path length in metersvoidsetFinalT(double finalPathLength) Set the final path length in metersbooleanstopIntegration(double t, double[] y) Given the current state of the integration, should we stop?Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface cnuphys.rk4.IStopperterminateIntegration
- 
Field Details- 
_finalPathLengthprotected double _finalPathLength
 
- 
- 
Constructor Details- 
DefaultSwimStopperpublic DefaultSwimStopper(double maxR) A default swim stopper that will stop if either a max pathlength is exceeded or if a radial coordinate is exceeded- Parameters:
- maxR- the max radial coordinate in meters. Give a negative
 
 
- 
- 
Method Details- 
stopIntegrationpublic boolean stopIntegration(double t, double[] y) Description copied from interface:IStopperGiven the current state of the integration, should we stop? This allows the integration to stop, for example, if some distance from the origin has been exceeded or if the independent variable passes some threshold. It won't be precise, because the check may not happen on every step, but it should be close.- Specified by:
- stopIntegrationin interface- IStopper
- Parameters:
- t- the current value of the independent variable (typically pathlength)
- y- the current state vector (typically [x, y, z, vx, vy, vz])
- Returns:
- trueif we should stop now.
 
- 
getFinalTpublic double getFinalT()Get the final path length in meters
- 
setFinalTpublic void setFinalT(double finalPathLength) Set the final path length in meters
 
-