Skip to content

SetMaterialParameterAction

SetMaterialParameterAction

SetMaterialParameterAction(mesh_maker: 'Model', material: Union[int, str, Material], parameter_name: str, parameter_value: Union[float, int, str, None] = None, element_tags: Union[list[int], None] = None)

Bases: Action

Set material parameter action to dynamically update material state.

SetMaterialParameterAction generates a sequence of OpenSees parameter updates to change properties of structural materials inside elements during an analysis sequence. This can be used to update plastic shear modulus, cohesion, or other custom material variables.

Tcl form

parameter <tag> element <ele_tag> <parameter_name> and updateParameter <tag> <value>

Example
from femora.core.model import Model

model = Model()
# Assumes a material named 'soil' has been added
action = model.actions.set_material_parameter(
    material='soil',
    parameter_name='refShearModulus',
    parameter_value=40000.0,
)

Create a SetMaterialParameterAction.

Parameters:

Name Type Description Default
mesh_maker 'Model'

The parent Model instance.

required
material Union[int, str, Material]

The target material by tag, name, or instance.

required
parameter_name str

The name of the parameter inside the material.

required
parameter_value Union[float, int, str, None]

The new value to set.

None
element_tags Union[list[int], None]

Explicit list of element IDs to apply the parameter update. If None, updates all elements assigned the target material in the model.

None

Raises:

Type Description
ValueError

If the target material cannot be found or if mesh is not assembled when element_tags is None.

TypeError

If the material argument is an invalid type.