Package cnuphys.swim
Class NewPlaneStopper
java.lang.Object
cnuphys.swim.NewPlaneStopper
- All Implemented Interfaces:
- IStopper
This stopper is to stop at the boundary of an arbitrary cylinder
- Author:
- heddle
- 
Constructor SummaryConstructorsConstructorDescriptionNewPlaneStopper(double[] u0, double s0, double sMax, Plane targetPlane, double accuracy) Cylinder stopper that looks at boundary (does check max path length)
- 
Method SummaryModifier and TypeMethodDescriptionbooleanDid we cross the boundarydoubleGet the final path length in metersdouble[]Get the final value of the state vectorbooleanDid we pas the max path length?voidsetFinalT(double finalT) Set the final independent variable (typically path length in meters)booleanstopIntegration(double s, double[] unew) Given the current state of the integration, should we stop?booleanterminateIntegration(double t, double[] y) Generally this is the same as stop integration.
- 
Constructor Details- 
NewPlaneStopperCylinder stopper that looks at boundary (does check max path length)- Parameters:
- u0- starting state vector
- s0- starting path length in meters
- sMax- maximal path length in meters
- targetPlane- target Plane
- accuracy- the accuracy in meters
- normalDirection-- if going smaller to larger rho
 
 
- 
- 
Method Details- 
stopIntegrationpublic boolean stopIntegration(double s, double[] unew) 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:
- s- the current value of the independent variable (typically pathlength)
- unew- the current state vector (typically [x, y, z, vx, vy, vz])
- Returns:
- trueif we should stop now.
 
- 
passedSmaxpublic boolean passedSmax()Did we pas the max path length?- Returns:
- true if we crossed the boundary
 
- 
crossedBoundarypublic boolean crossedBoundary()Did we cross the boundary- Returns:
- true if we crossed the boundary
 
- 
getFinalTpublic double getFinalT()Get the final path length in meters
- 
setFinalTpublic void setFinalT(double finalT) Description copied from interface:IStopperSet the final independent variable (typically path length in meters)
- 
getFinalUpublic double[] getFinalU()Get the final value of the state vector- Returns:
 
- 
terminateIntegrationpublic boolean terminateIntegration(double t, double[] y) Generally this is the same as stop integration. So most will just return stopIntegration(). But sometimes stop just means we reset and integrate more. For example, with a fixed rho integrator we "stop" when we cross the rho boundary however we are not done unless we are within tolerance. If we are within tolerance (on either side) we are really done!- Specified by:
- terminateIntegrationin 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.
 
 
-