smash.Model.response#

property Model.response[source]#

Model response.

Returns:
responseResponseDT

It returns a Fortran derived type containing the variables relating to the response.

Examples

>>> from smash.factory import load_dataset
>>> setup, mesh = load_dataset("cance")
>>> model = smash.Model(setup, mesh)

Access to Model response

>>> model.response
ResponseDT
    q: array([[-99., -99., -99., ..., -99., -99., -99.],
       [-99., -99., -99., ..., -99., -99., -99.],
       [-99., -99., -99., ..., -99., -99., -99.]], dtype=float32)

Run the direct Model to generate discharge responses

>>> model.forward_run()
</> Forward Run

Access to a specific gauge simulated discharge time serie

>>> model.mesh.code
array(['V3524010', 'V3515010', 'V3517010'], dtype='<U8')
>>> ind = np.argwhere(model.mesh.code == "V3524010").item()
>>> ind
0
>>> model.response.q[ind, :]
array([1.9826430e-03, 1.3466669e-07, 6.7617895e-12, ..., 2.2796249e+01,
       2.2655941e+01, 2.2517307e+01], dtype=float32)

If you are using IPython, tab completion allows you to visualize all the attributes and methods

>>> model.response.<TAB>
model.response.copy()        model.response.q
model.response.from_handle(