PatternManager
PatternManager
Local manager for Pattern lifecycle and tag assignment.
The manager is intentionally not a singleton. Each instance owns an independent pattern tag space for one model context.
Create an empty manager with pattern tags starting at 1.
Attributes
Methods:
add
Add an existing pattern and assign a tag if needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern
|
Pattern
|
Unmanaged or already-managed |
required |
Returns:
| Type | Description |
|---|---|
Pattern
|
The same |
Raises:
| Type | Description |
|---|---|
TypeError
|
If |
ValueError
|
If its preassigned tag conflicts with a different object already managed here. |
get
Return the pattern with tag if it exists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tag
|
int
|
Pattern tag to look up. |
required |
Returns:
| Type | Description |
|---|---|
Optional[Pattern]
|
The matching |
remove
Remove a managed pattern and compact the remaining tags.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tag
|
int
|
Tag of the pattern to remove. Missing tags are ignored. |
required |
set_tag_start
Set the first tag used by this manager and retag existing patterns.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start_tag
|
int
|
Positive integer for the first assigned pattern tag. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
uniform_excitation
uniform_excitation(dof: int, time_series: TimeSeries, vel0: float = 0.0, factor: float = 1.0) -> UniformExcitation
Create and manage a UniformExcitation pattern.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dof
|
int
|
1-based DOF direction for the uniform excitation. |
required |
time_series
|
TimeSeries
|
Managed acceleration |
required |
vel0
|
float
|
Initial velocity. |
0.0
|
factor
|
float
|
Scale factor applied to the time series. |
1.0
|
Returns:
| Type | Description |
|---|---|
UniformExcitation
|
Managed |
h5drm
h5drm(filepath: str, factor: float, crd_scale: float, distance_tolerance: float, do_coordinate_transformation: int, transform_matrix: Optional[Sequence[float]] = None, origin: Optional[Sequence[float]] = None, **kwargs) -> H5DRMPattern
Create and manage an H5DRMPattern.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str
|
Path to the H5DRM dataset file. |
required |
factor
|
float
|
Scale factor for DRM forces and displacements. |
required |
crd_scale
|
float
|
Coordinate scale factor for the DRM dataset. |
required |
distance_tolerance
|
float
|
Node matching tolerance. |
required |
do_coordinate_transformation
|
int
|
|
required |
transform_matrix
|
Optional[Sequence[float]]
|
Optional 9-value transformation matrix. If not
provided, |
None
|
origin
|
Optional[Sequence[float]]
|
Optional 3-value transformed origin. If not provided,
|
None
|
**kwargs
|
Compatibility support for individual matrix/origin values. |
{}
|
Returns:
| Type | Description |
|---|---|
H5DRMPattern
|
Managed |
plain
Create and manage a PlainPattern.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time_series
|
TimeSeries
|
Managed |
required |
factor
|
float
|
Optional scale factor for all loads in the pattern. |
1.0
|
Returns:
| Type | Description |
|---|---|
PlainPattern
|
Managed |
multiple_support
Create and manage a MultipleSupportPattern.
Returns:
| Type | Description |
|---|---|
MultipleSupportPattern
|
Managed empty |
_next_available_tag
Return the next unused pattern tag in this manager's tag space.
_sync_attached_load_tags
Keep loads attached to a plain pattern aligned with its current tag.