Class DustStateTime

3d-array-like object representing the state of a dust model at multiple points in time (vs a matrix-like object DustState. This object exists to simplify thinking about accessing different parts of the data, as primitives for doing this don't really exist in JavaScript. It also leaves us free to swap out the underlying storage later (currently using ndarray)

Hierarchy

  • DustStateTime

Constructors

  • new DustStateTime(data: NdArray<number[] | TypedArray | GenericArray<number>>, nState: number, nParticles: number, nTime: number): DustStateTime
  • Construct a new object - generally prefer dustStateTime which also allocates the data correctly

    Parameters

    • data: NdArray<number[] | TypedArray | GenericArray<number>>

      The underlying data

    • nState: number

      The number of state elements per particle

    • nParticles: number

      The number of particles

    • nTime: number

      The number of time steps

    Returns DustStateTime

Properties

nParticles: number

The number of particles

nState: number

The number of state elements per particle

nTime: number

The number of time steps

state: NdArray<number[] | TypedArray | GenericArray<number>>

The underlying state

Methods

  • getParticle(iParticle: number, iTime: number): number[]
  • Copy the state for a single vector at a single point in time into a plain JavaScript numeric array. This will then be decoupled from the underlying object

    Parameters

    • iParticle: number

      The index of the particle to fetch

    • iTime: number

      The index of the time to fetch

    Returns number[]

  • getState(iState: number, iTime: number): number[]
  • Copy a single state variable across all particles at a single point in time into a plain JavaScript numeric array. This will then be decoupled from the underlying object

    Parameters

    • iState: number

      The index of the state to fetch

    • iTime: number

      The index of the time to fetch

    Returns number[]

  • getTrace(iState: number, iParticle: number): number[]
  • Copy the state for a single trace of a variable for a single particle over all time points into a plain JavaScript numeric array. This will then be decoupled from the underlying object

    Parameters

    • iState: number

      The index of the state to fetch

    • iParticle: number

      The index of the particle to fetch

    Returns number[]

  • viewParticle(iParticle: number, iTime: number): VectorView
  • Construct a VectorView for a single particle at a single point in time. This can then be easily read from or written to.

    Parameters

    • iParticle: number

      The index of the particle to fetch

    • iTime: number

      The index of the time to fetch

    Returns VectorView

  • viewState(iState: number, iTime: number): VectorView
  • Construct a VectorView for a single state, across all particles at a single point in time. This can then be easily read from or written to.

    Parameters

    • iState: number

      The index of the state to fetch

    • iTime: number

      The index of the time to fetch

    Returns VectorView

  • Construct a view of a single time point - a DustState object - which can then be used to view or modify the state at this time point.

    Parameters

    • iTime: number

      The index in time

    Returns DustState

  • viewTrace(iState: number, iParticle: number): VectorView
  • Construct a VectorView for a single trace (or variable) for a single particle over all points in time. This can then be easily read from or written to.

    Parameters

    • iState: number

      The index of the state to fetch

    • iParticle: number

      The index of the particle to fetch

    Returns VectorView

Generated using TypeDoc