Interface System

Interface defining the basic functionality of a dust system, composed of a number of particles

interface System {
    state: Readonly<SystemState>;
    time: number;
    runToTime(time: number): void;
    setState(
        newState: SystemSubState,
        groupIndices: number[],
        particleIndices: number[],
        stateElementIndices: number[],
    ): void;
    setStateInitial(): void;
    simulate(
        times: number[],
        stateElementIndices: number[],
    ): SystemSimulateResult;
}

Hierarchy (View Summary)

Implemented by

Properties

state: Readonly<SystemState>

The current state of each particle in the system

time: number

The current time in the system

Methods

  • Runs the system from its current time to the given time, causing its state to be updated

    Parameters

    • time: number

      The time to run to

    Returns void

  • Sets new values in the system state

    Parameters

    • newState: SystemSubState

      The new state values for all or part of the state. If partial state, the shape must match the values provided in the indices parameters

    • groupIndices: number[]

      The group indices, in order, which the first dimension of newState are setting values for. If empty, this means newState provides values for all groups.

    • particleIndices: number[]

      The particle indices, in order, which the second dimension of newState are setting values for. If empty, this means newState provides values for all particles.

    • stateElementIndices: number[]

      The state element indices, in order, which the second dimension of newState are setting values for. If empty, this means newState provides values for all state elements.

    Returns void

  • Runs the system from its current time to a series of times given by the parameter times and returns state values for all particles at each of these times.

    Parameters

    • times: number[]

      The times to run to and return state for. Must be in increasing order, with no value less than the current time.

    • stateElementIndices: number[]

      Indices of the state elements to return in the result. If an empty array is provided, all values are returned.

    Returns SystemSimulateResult