Class DefaultListener

java.lang.Object
cnuphys.swim.DefaultListener
All Implemented Interfaces:
IRkListener

public class DefaultListener extends Object implements IRkListener
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    Create a default listener that simply tracks the total number of steps taken and stores the last step.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    int
    Get the number of steps taken
    double
    Get the independent variable (e.g., path length) for the last step.
    double[]
    Get the last state vector entries (e.g., [x,y,z, px.p, py/p, pz/p])
    void
    nextStep(double newS, double[] newY, double h)
    The integration has advanced one step
    void
    Call reset if you are going to use the same object again.

    Methods inherited from class java.lang.Object Link icon

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details Link icon

    • DefaultListener Link icon

      public DefaultListener()
      Create a default listener that simply tracks the total number of steps taken and stores the last step.
  • Method Details Link icon

    • nextStep Link icon

      public void nextStep(double newS, double[] newY, double h)
      The integration has advanced one step
      Specified by:
      nextStep in interface IRkListener
      Parameters:
      newS - the new value of the independent variable (e.g., path length)
      newY - the new value of the dependent variable, e.g. often a vector with six elements (e.g., x, y, z, px/p, py/p, pz/p)
      h - the stepsize used for this advance
    • reset Link icon

      public void reset()
      Call reset if you are going to use the same object again.
    • getIndependentVariable Link icon

      public double getIndependentVariable()
      Get the independent variable (e.g., path length) for the last step.
      Returns:
      the independent variable (e.g., path length) at the last step
    • getLastStateVector Link icon

      public double[] getLastStateVector()
      Get the last state vector entries (e.g., [x,y,z, px.p, py/p, pz/p])
      Returns:
      the last state vector
    • getCount Link icon

      public int getCount()
      Get the number of steps taken
      Returns:
      the count, i.e., the number of steps taken