Variable container (fluidsim.base.setofvariables)


class fluidsim.base.setofvariables.SetOfVariables(input_array=None, keys=None, shape_variable=None, like=None, value=None, info=None, dtype=None, **kargs)[source]

Bases: numpy.ndarray

np.ndarray containing the variables.

input_arraynumpy.ndarray, optional

Input array, default to None.

keysIterable, optional

Keys corresponding to the variables, default to None.

shape_variableIterable, optional

Shape of an array containing one variable, default to None.

likeSetOfVariables, optional

Model for creating the new SetOfVariables, default to None.

valueNumber, optional

For initialization of the new SetOfVariables, default to None.

infostr, optional

Description, default to None.

dtypenumpy.dtype, optional

see numpy.ndarray help.

set_var(self, arg, value)[source]

Set a variable.

get_var(self, arg)[source]

Get a variable as a np.array.

initialize(self, value=0)[source]

Initialize as a constant array.