Package cnuphys.adaptiveSwim
Class AdaptiveSphereStopper
java.lang.Object
cnuphys.adaptiveSwim.AAdaptiveStopper
cnuphys.adaptiveSwim.AdaptiveSphereStopper
- All Implemented Interfaces:
IAdaptiveStopper
-
Field Summary
Fields inherited from class cnuphys.adaptiveSwim.AAdaptiveStopper
_accuracy, _dim, _hLast, _s, _sf, _THEMAXSTEP, _trajectory, _u
-
Constructor Summary
ConstructorsConstructorDescriptionAdaptiveSphereStopper
(double[] u0, double sf, Sphere targetSphere, double accuracy, SwimTrajectory trajectory) Cylinder stopper (does check max path length) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
accept
(double snew, double[] unew) Accept a new integration stepboolean
stopIntegration
(double snew, double[] unew) Given the current state of the integration, should we stop?Methods inherited from class cnuphys.adaptiveSwim.AAdaptiveStopper
copy, getMaxStepSize, getS, getSmax, getU, setMaxStep
-
Constructor Details
-
AdaptiveSphereStopper
public AdaptiveSphereStopper(double[] u0, double sf, Sphere targetSphere, double accuracy, SwimTrajectory trajectory) Cylinder stopper (does check max path length)- Parameters:
u0
- initial state vectorsf
- the maximum value of the path length in meterstargetSphere
- the target sphereaccuracy
- the accuracy in meterstrajectory
- optional swim trajectory (can be null)
-
-
Method Details
-
stopIntegration
public boolean stopIntegration(double snew, double[] unew) Description copied from interface:IAdaptiveStopper
Given 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.- Returns:
true
if we should stop now.
-
accept
protected void accept(double snew, double[] unew) Accept a new integration step- Overrides:
accept
in classAAdaptiveStopper
- Parameters:
snew
- the new value of s in metersunew
- the new state vector
-