smash.Model.get_serr_mu_parameters#
- Model.get_serr_mu_parameters(key)[source]#
Get the values of a Model structural error mu parameter.
- Parameters:
- keystr
The name of the structural error mu parameter.
- Returns:
- value
numpy.ndarray
An array of shape (ng,) representing the values of the structural error mu parameter.
- value
See also
Model.serr_mu_parameters
Model structural error mu parameters.
Examples
>>> from smash.factory import load_dataset >>> setup, mesh = load_dataset("cance")
Set the structural error mu mapping to
'Linear'
(seeModel
). Default value in theCance
dataset is'Zero'
(equivalent to no mu mapping)>>> setup["serr_mu_mapping"] = "Linear" >>> model = smash.Model(setup, mesh)
Access to a specific structural error mu parameter vector
>>> model.get_serr_mu_parameters("mg0") array([0., 0., 0.], dtype=float32)
Note
This method is equivalent to directly slicing the
serr_mu_parameters.values
array (as shown below) but is simpler to use.Access the structural error mu parameter keys
>>> model.serr_mu_parameters.keys array(['mg0', 'mg1'], dtype='<U3')
Get the index of the structural error mu parameter
'mg0'
>>> ind = np.argwhere(model.serr_mu_parameters.keys == "mg0").item() >>> ind 0
Slice the
serr_mu_parameters.values
array on the last axis>>> model.serr_mu_parameters.values[..., ind] array([0., 0., 0.], dtype=float32)