vivyd.models.Collection#

class Collection(models)[source]#

Bases: VIVModel, Generic[T]

A collection of uncoupled VIV models. The state of the collection is the concatenation of the states of the individual models, and the right-hand side of the collection is the concatenation of the RHS of the individual models.

Important

As for now, a Collection must be instantiated inside a Taichi context in order to benefit from Taichi acceleration.

Parameters:

models (Sequence[VIVModel]) – A sequence of VIV models to be included in the collection. All models must be of the same type.

Methods#

Collection.rhs(t, state, handle=<function Collection.<lambda>>)[source]#

Compute the right-hand side of all the models in the collection.

Parameters:
  • t (float) – Time.

  • state (arrf64) – Concatenated state array indexed of shape (n_nodes, state_size).

  • handle (Callable) – A callable function for handling the model evaluation.

Returns:

Concatenated right-hand side array indexed of shape (n_nodes, state_size).

Return type:

arrf64

Collection.validate_state(state)[source]#

Validate the shape of the state vector.

Parameters:

state (arrf64) – State vector.

Returns:

Validated state vector.

Return type:

arrf64

Raises:

ValueError – If the state vector has an invalid shape.