Skip to content

ActionManager

ActionManager

ActionManager(mesh_maker: 'Model')

Create solver commands through model.actions.

Factories return action objects; they do not execute OpenSees or modify its current state. Add an action to model.process to place its command in the exported script. The process retains action objects strongly.

Example
from femora import Model

model = Model()
model.process.add_step(model.actions.load_const(), "Hold gravity")
model.process.add_step(model.actions.set_time(0.0), "Reset clock")
print(model.process.to_tcl())
See Also

ProcessManager orders commands. Concrete action classes are documented under Components.

Methods:

Name Description
wipe

Return an action emitting wipe to destroy the solver domain.

wipe_analysis

Return an action emitting wipeAnalysis.

reset

Return an action emitting the OpenSees reset command.

load_const

Return an action emitting loadConst without a time argument.

exit

Return an action emitting exit to terminate the solver script.

remove_recorders

Return an action emitting remove recorders.

set_time

Create a command setting the solver domain clock.

tcl

Wrap custom Tcl for insertion into the process.

set_material_parameter

Create a deferred material-parameter update.

update_material_stage_to_elastic

Create a model-aware action selecting elastic material stage zero.

update_material_stage_to_plastic

Create a model-aware action selecting plastic material stage one.

remove_load_patterns

Create an action removing the model's load patterns in the solver.

Methods:

wipe

wipe() -> WipeAction

Return an action emitting wipe to destroy the solver domain.

This does not clear the Python Model. Use model.clear_model() for that operation; use this action only at an appropriate script position.

wipe_analysis

wipe_analysis() -> WipeAnalysisAction

Return an action emitting wipeAnalysis.

The solver analysis configuration is discarded, not the model domain. This factory itself performs no solver operation.

reset

reset() -> ResetAction

Return an action emitting the OpenSees reset command.

This is a solver-domain operation, not a workflow checkpoint or a Python Model reset. The command runs only when the Tcl is executed.

load_const

load_const() -> LoadConstAction

Return an action emitting loadConst without a time argument.

Freeze existing solver load patterns at their current factors. This action does not reset time; append set_time(0.0) when needed.

exit

exit() -> ExitAction

Return an action emitting exit to terminate the solver script.

Commands placed after it will not execute. Creating the action does not terminate Python or launch a solver.

remove_recorders

remove_recorders() -> RemoveRecordersAction

Return an action emitting remove recorders.

When executed, this closes active solver recorders. It does not delete output files or remove recorder definitions from the Python manager.

set_time

set_time(pseudo_time: float) -> SetTimeAction

Create a command setting the solver domain clock.

Parameters:

Name Type Description Default
pseudo_time float

New domain time, in the model's time units.

required

Returns:

Name Type Description
SetTimeAction SetTimeAction

Deferred setTime command. No analysis is advanced.

tcl

tcl(command: str) -> TclAction

Wrap custom Tcl for insertion into the process.

Parameters:

Name Type Description Default
command str

Tcl text, including any required arguments or lines.

required

Returns:

Name Type Description
TclAction TclAction

Deferred command. Femora does not validate its Tcl syntax

TclAction

or ensure that it is safe or compatible with all MPI ranks.

set_material_parameter

set_material_parameter(material: Union[int, str, Material], parameter_name: str, parameter_value: Union[float, int, str, None] = None, element_tags: Union[list[int], None] = None) -> SetMaterialParameterAction

Create a deferred material-parameter update.

Parameters:

Name Type Description Default
material int | str | Material

Registered material tag, name, or object.

required
parameter_name str

Parameter supported by the target material.

required
parameter_value float | int | str | None

Optional parameter value.

None
element_tags list[int] | None

Explicit target element tags; when omitted, the action resolves affected elements from the model.

None

Returns:

Name Type Description
SetMaterialParameterAction SetMaterialParameterAction

Model-aware command object. Parameter

SetMaterialParameterAction

support is ultimately determined by the solver material/element.

update_material_stage_to_elastic

update_material_stage_to_elastic() -> UpdateMaterialStageToElasticAction

Create a model-aware action selecting elastic material stage zero.

Intended for stage-capable soil materials during initialization, not as a conversion of arbitrary materials into elastic material models.

update_material_stage_to_plastic

update_material_stage_to_plastic() -> UpdateMaterialStageToPlasticAction

Create a model-aware action selecting plastic material stage one.

Place after elastic initialization and before re-equilibration when required by the constitutive model. This does not equilibrate gravity.

remove_load_patterns

remove_load_patterns() -> RemoveLoadPatternsAction

Create an action removing the model's load patterns in the solver.

The action uses the owning Model to produce commands. It does not clear the Python pattern manager when this factory is called.