Package cnuphys.swim

Class NumStepStopper

java.lang.Object
cnuphys.swim.NumStepStopper
All Implemented Interfaces:
IStopper

public class NumStepStopper extends Object implements IStopper
  • Field Details

    • _finalPathLength

      protected double _finalPathLength
  • Constructor Details

    • NumStepStopper

      public NumStepStopper(int numStep)
  • Method Details

    • stopIntegration

      public boolean stopIntegration(double t, double[] y)
      Description copied from interface: IStopper
      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.
      Specified by:
      stopIntegration in 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:
      true if we should stop now.
    • getFinalT

      public double getFinalT()
      Description copied from interface: IStopper
      Get the final independent variable (typically path length in meters)
      Specified by:
      getFinalT in interface IStopper
      Returns:
      the final independent variable (typically path length in meters)
    • setFinalT

      public void setFinalT(double finalPathLength)
      Description copied from interface: IStopper
      Set the final independent variable (typically path length in meters)
      Specified by:
      setFinalT in interface IStopper
      Parameters:
      finalPathLength - the final independent variable (typically path length in meters)