pastas.model.Model.add_stressmodel ================================== .. py:method:: pastas.model.Model.add_stressmodel(stressmodel: pastas.typing.StressModel | list[pastas.typing.StressModel], replace: bool = True) -> None Add a stressmodel to the main model. :param stressmodel: instance of a pastas.stressmodel class. Multiple stress models can be provided (e.g., ml.add_stressmodel([sm1, sm2]) in one call. :type stressmodel: pastas.stressmodel or list of pastas.stressmodel :param replace: force replace the stressmodel if a stressmodel with the same name already exists. Not recommended but useful at times. Default is True. :type replace: bool, optional .. rubric:: Notes To obtain a list of the stressmodel names, type: >>> ml.get_stressmodel_names() .. rubric:: Examples >>> sm = ps.StressModel(stress, rfunc=ps.Gamma(), name="stress") >>> ml.add_stressmodel(sm) To add multiple stress models at once you can do the following: >>> sm1 = ps.StressModel(stress, rfunc=ps.Gamma(), name="stress1") >>> sm2 = ps.StressModel(stress, rfunc=ps.Gamma(), name="stress2") >>> ml.add_stressmodel([sm1, sm2]) .. seealso:: :py:obj:`pastas.stressmodels` .. !! processed by numpydoc !!