RecorderManager
RecorderManager
Define solver output through model.recorder.
Factories register recorder objects. Add a recorder to model.process
before the analyses whose responses it should capture. Creation does not
open response files or launch OpenSees. File naming, response vocabulary,
output-folder integration, and solver-build support depend on the concrete
recorder; VTKHDF and MPCO response names are not interchangeable.
Example
from femora import Model
model = Model()
recorder = model.recorder.vtkhdf(
file_base_name="response.vtkhdf", resp_types=["disp", "vel", "accel"],
delta_t=0.02,
)
model.process.add_step(recorder, "Begin response output")
model.process.add_step(model.actions.remove_recorders(), "Close output")
assert model.recorder.get(recorder.tag) is recorder
Insert the actual analysis between those two process steps in a complete model. Recorder intervals control output sampling, not analysis time steps. Check acceleration basis and force-coordinate conventions before processing results. Rank-specific files are expected for distributed recorders.
Methods:
| Name | Description |
|---|---|
node |
Create a node recorder. |
drift |
Create a drift recorder. |
vtkhdf |
Create a VTK HDF recorder. |
mpco |
Create an MPCO recorder. |
beam_force |
Create a beam force recorder. |
embedded_beam_solid_interface |
Create an embedded beam-solid interface recorder. |
pile_mpco |
Register MPCO output restricted to selected assembled pile parts. |
pile_vtkhdf |
Register VTKHDF output restricted to selected assembled pile parts. |
add |
Register a recorder and assign its model-local registry tag. |
get |
Return a recorder by integer-convertible registry tag, or None. |
get_all |
Return a shallow registry snapshot with shared recorder objects. |
remove |
Detach a definition and compact surviving registry tags. |
clear |
Detach all recorder definitions without deleting response files. |
set_tag_start |
Set the positive recorder registry origin and retag definitions. |
Methods:
node
node(*, dofs: list[int], resp_type: str, file_name: str | None = None, xml_file: str | None = None, binary_file: str | None = None, inet_addr: str | None = None, port: int | None = None, precision: int = 6, time_series: int | None = None, time: bool = False, delta_t: float | None = None, close_on_write: bool = False, nodes: list[int] | None = None, node_range: list[int] | tuple[int, int] | None = None, region: int | str | RegionBase | None = None, cores: int | list[int] | None = None) -> NodeRecorder
Create a node recorder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_name
|
str | None
|
Optional file path for plain text output. |
None
|
xml_file
|
str | None
|
Optional file path for XML output. |
None
|
binary_file
|
str | None
|
Optional file path for binary output. |
None
|
inet_addr
|
str | None
|
Optional IP address for TCP output. |
None
|
port
|
int | None
|
Optional TCP port paired with inet_addr. |
None
|
precision
|
int
|
Number of significant digits (default: 6). |
6
|
time_series
|
int | None
|
Optional TimeSeries tag. |
None
|
time
|
bool
|
If True, includes time in the first column. |
False
|
delta_t
|
float | None
|
Optional time step recording interval. |
None
|
close_on_write
|
bool
|
If True, opens/closes the output file on each write. |
False
|
nodes
|
list[int] | None
|
Optional list of node tags. |
None
|
node_range
|
list[int] | tuple[int, int] | None
|
Optional start and end tag |
None
|
region
|
int | str | RegionBase | None
|
Optional target region tag or name. |
None
|
dofs
|
list[int]
|
List of active degrees of freedom (required). |
required |
resp_type
|
str
|
Response type, e.g. |
required |
cores
|
int | list[int] | None
|
Optional processor core ID(s) for MPI execution. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If output destination, node selection, DOFs, or response type validation fails. |
Returns:
| Name | Type | Description |
|---|---|---|
recorder |
NodeRecorder
|
Registered definition; add it to model.process to activate output. |
drift
drift(*, file_name: str, i_nodes: list[int] | int, j_nodes: list[int] | int, dof: int, perp_dirn: int = 3, time: bool = False, delta_t: float | None = None, precision: int | None = None, cores: int | list[int] | None = None, core: int | None = None) -> DriftRecorder
Create a drift recorder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_name
|
str
|
Output file name (required). |
required |
i_nodes
|
list[int] | int
|
List of bottom node tags (required). |
required |
j_nodes
|
list[int] | int
|
List of top node tags (required). |
required |
dof
|
int
|
Target degree of freedom (1 to 6). |
required |
perp_dirn
|
int
|
Perpendicular direction (1 to 3). |
3
|
time
|
bool
|
If True, records simulation time. |
False
|
delta_t
|
float | None
|
Optional time step recording interval. |
None
|
precision
|
int | None
|
Optional number of significant digits. |
None
|
cores
|
int | list[int] | None
|
Optional processor core ID(s) for MPI execution. |
None
|
core
|
int | None
|
Single-core compatibility alias used when |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If input validation fails. |
TypeError
|
If cores or node lists are invalid types. |
Returns:
| Name | Type | Description |
|---|---|---|
recorder |
DriftRecorder
|
Registered definition; add it to model.process to activate output. |
vtkhdf
vtkhdf(*, file_base_name: str = '', resp_types: list[str] | None = None, delta_t: float | None = None, r_tol_dt: float | None = None, region: int | str | RegionBase | list[int | str | RegionBase] | None = None, regions: int | str | RegionBase | list[int | str | RegionBase] | None = None, group: ElementGroup | str | None = None, element_group: ElementGroup | str | None = None, cores: int | list[int] | None = None) -> VTKHDFRecorder
Create a VTK HDF recorder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_base_name
|
str
|
Base name of the file to which output is sent (required). |
''
|
resp_types
|
list[str] | None
|
Requested fields (required). Nodal fields are
|
None
|
delta_t
|
float | None
|
Optional time interval for recording. |
None
|
r_tol_dt
|
float | None
|
Optional relative tolerance for time step matching. |
None
|
region
|
int | str | RegionBase | list[int | str | RegionBase] | None
|
Optional region tag, name, or RegionBase instance used to restrict VTKHDF output to one region. If not specified, the entire model will be recorded. |
None
|
regions
|
int | str | RegionBase | list[int | str | RegionBase] | None
|
Alias for |
None
|
group
|
ElementGroup | str | None
|
Optional ElementGroup or element group name used to restrict VTKHDF output. |
None
|
element_group
|
ElementGroup | str | None
|
Alias for |
None
|
cores
|
int | list[int] | None
|
Optional processor core ID(s) for MPI execution. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If file_base_name or resp_types are not specified, or if invalid response types are supplied. |
Returns:
| Name | Type | Description |
|---|---|---|
recorder |
VTKHDFRecorder
|
Registered definition; add it to model.process to activate output. |
mpco
mpco(*, file_name: str, node_responses: list[str] | None = None, element_responses: list[str] | None = None, node_sensitivities: list | None = None, regions: int | str | RegionBase | list[int | str | RegionBase] | None = None, groups: list[ElementGroup | str] | None = None, element_groups: list[ElementGroup | str] | None = None, delta_t: float | None = None, num_steps: int | None = None, cores: int | list[int] | None = None) -> MPCORecorder
Create an MPCO recorder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_name
|
str
|
Output database file name (required). |
required |
node_responses
|
list[str] | None
|
Optional list of node response variables to record. |
None
|
element_responses
|
list[str] | None
|
Optional list of element response variables. |
None
|
node_sensitivities
|
list | None
|
Optional list of node sensitivities. |
None
|
regions
|
int | str | RegionBase | list[int | str | RegionBase] | None
|
Optional list of region tags or names to restrict recording to. |
None
|
groups
|
list[ElementGroup | str] | None
|
Optional list of ElementGroups or element group names used to restrict recording. |
None
|
element_groups
|
list[ElementGroup | str] | None
|
Alias for |
None
|
delta_t
|
float | None
|
Optional recording time step interval. |
None
|
num_steps
|
int | None
|
Optional recording step interval. |
None
|
cores
|
int | list[int] | None
|
Optional processor core ID(s) for MPI execution. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If file_name is missing or parameters are conflicting. |
TypeError
|
If input parameter types are incorrect. |
Returns:
| Name | Type | Description |
|---|---|---|
recorder |
MPCORecorder
|
Registered definition; add it to model.process to activate output. |
beam_force
beam_force(*, meshparts: list[str | MeshPart] | None = None, force_type: str = 'globalForce', file_prefix: str = 'Beam', delta_t: float | None = None, include_time: bool = True, output_format: str = 'file', precision: int | None = None, cores: int | list[int] | None = None) -> BeamForceRecorder
Create a beam force recorder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
meshparts
|
list[str | MeshPart] | None
|
Optional list of MeshPart identifiers (user_name strings or MeshPart instances). If omitted, all line mesh parts are used. |
None
|
force_type
|
str
|
Force system, either |
'globalForce'
|
file_prefix
|
str
|
Prefix for output files (default: |
'Beam'
|
delta_t
|
float | None
|
Optional time step recording interval. |
None
|
include_time
|
bool
|
If True, includes time in columns (default: True). |
True
|
output_format
|
str
|
Output format, either |
'file'
|
precision
|
int | None
|
Optional significant digits. |
None
|
cores
|
int | list[int] | None
|
Optional processor core ID(s) for MPI execution. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If force_type or output_format are invalid. |
Returns:
| Name | Type | Description |
|---|---|---|
recorder |
BeamForceRecorder
|
Registered definition; add it to model.process to activate output. |
embedded_beam_solid_interface
embedded_beam_solid_interface(*, interface: str | EmbeddedBeamSolidInterface | list[str | EmbeddedBeamSolidInterface], resp_type: str | list[str] | None = None, dt: float | None = None, cores: int | list[int] | None = None) -> EmbeddedBeamSolidInterfaceRecorder
Create an embedded beam-solid interface recorder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
interface
|
str | EmbeddedBeamSolidInterface | list[str | EmbeddedBeamSolidInterface]
|
The interface(s) to record. Can be an EmbeddedBeamSolidInterface instance, a string name, or a list of both. |
required |
resp_type
|
str | list[str] | None
|
The response type or list of response types to record. |
None
|
dt
|
float | None
|
Optional recording time step interval. |
None
|
cores
|
int | list[int] | None
|
Optional processor core ID(s) for MPI execution. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If interface validation fails. |
TypeError
|
If resp_type is invalid. |
Returns:
| Name | Type | Description |
|---|---|---|
recorder |
EmbeddedBeamSolidInterfaceRecorder
|
Registered definition; add it to model.process to activate output. |
pile_mpco
pile_mpco(meshparts: str | MeshPart | list[str | MeshPart] | tuple[str | MeshPart, ...], file_name: str, *, delta_t: Optional[float] = None, num_steps: Optional[int] = None, node_responses: Optional[List[str]] = None, element_responses: Optional[List[str]] = None, node_sensitivities: Optional[List] = None, line_cells_only: bool = True, region_name: str = 'pile_mpco_region') -> MPCORecorder
Register MPCO output restricted to selected assembled pile parts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
meshparts
|
str | MeshPart | Sequence
|
Part names/objects to select. |
required |
file_name
|
str
|
MPCO output file base. |
required |
delta_t
|
float | None
|
Output interval in model time units. |
None
|
num_steps
|
int | None
|
Step-based output control accepted by MPCORecorder. |
None
|
node_responses
|
list[str] | None
|
Defaults to displacement, velocity, acceleration. |
None
|
element_responses
|
list[str] | None
|
Defaults to force. |
None
|
node_sensitivities
|
list | None
|
Optional sensitivity requests. |
None
|
line_cells_only
|
bool
|
Restrict the group to recognized line cells. |
True
|
region_name
|
str
|
Preferred generated ElementGroup name. |
'pile_mpco_region'
|
Returns:
| Name | Type | Description |
|---|---|---|
recorder |
Recorder
|
Registered MPCORecorder with a generated element group and rank filter derived from selected cells' Core values. |
Raises:
| Type | Description |
|---|---|
ValueError
|
Assembly, Core metadata, parts, or matching cells are missing. |
Rebuild the group/recorder if assembly changes. Creation adds a group but does not schedule output; add the returned recorder to the process.
pile_vtkhdf
pile_vtkhdf(meshparts: str | MeshPart | list[str | MeshPart] | tuple[str | MeshPart, ...], file_base_name: str, *, resp_types: Optional[List[str]] = None, delta_t: Optional[float] = None, r_tol_dt: Optional[float] = None, line_cells_only: bool = True, region_name: str = 'pile_vtkhdf_region') -> VTKHDFRecorder
Register VTKHDF output restricted to selected assembled pile parts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
meshparts
|
str | MeshPart | Sequence
|
Part names/objects to select. |
required |
file_base_name
|
str
|
VTKHDF output base name. |
required |
resp_types
|
list[str] | None
|
Defaults to disp, vel, accel, force3D, and localForce3D. |
None
|
delta_t
|
float | None
|
Output interval in model time units. |
None
|
r_tol_dt
|
float | None
|
Recorder sampling tolerance option. |
None
|
line_cells_only
|
bool
|
Restrict the generated group to line cells. |
True
|
region_name
|
str
|
Preferred generated ElementGroup name. |
'pile_vtkhdf_region'
|
Returns:
| Name | Type | Description |
|---|---|---|
recorder |
Recorder
|
Registered VTKHDFRecorder with cell group and rank filter based on the current assembly. |
Raises:
| Type | Description |
|---|---|
ValueError
|
Assembly, Core metadata, parts, or matching cells are missing. |
This selects beam/line piles, not automatically solid pile volumes when line_cells_only is True. Rebuild after changes in assembled cell order.
add
Register a recorder and assign its model-local registry tag.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recorder
|
Recorder
|
Unmanaged object or one already owned here. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
recorder |
Recorder
|
The same object, retained by this manager. |
Raises:
| Type | Description |
|---|---|
TypeError
|
Input is not a Recorder. |
ValueError
|
Foreign ownership or conflicting registry tag. |
get
Return a recorder by integer-convertible registry tag, or None.
This lookup does not inspect output files or query active solver recorders.
get_all
Return a shallow registry snapshot with shared recorder objects.
remove
Detach a definition and compact surviving registry tags.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tag
|
int
|
Current tag; absent entries are ignored. |
required |
This does not close a running solver recorder, delete files, or remove references from the process. Use a process remove-recorders action for solver-side closure.
clear
Detach all recorder definitions without deleting response files.
Existing process references are not rewritten, and running solver output is not stopped. This is a Python registry operation only.
set_tag_start
Set the positive recorder registry origin and retag definitions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start_tag
|
int
|
Origin validated by the tagging policy. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
Invalid origin. This does not change partition IDs or rename existing output files. |