node_load
node_load
Attributes
Classes
Load
Bases: ABC
Base class for OpenSees load commands emitted inside a pattern Plain block.
Load instances do not self-register. A :class:LoadManager owns tag assignment
and lifecycle for a single model context.
NodeLoad
NodeLoad(*, values: List[float], node_tag: Optional[int] = None, node_mask: Optional[object] = None, pids: Optional[List[int]] = None)
Bases: Load
Nodal load component for applying forces or moments to nodes.
NodeLoad represents a node-based load applied directly to a node's degrees of freedom. It is typically registered under a Plain pattern to represent external static or dynamic excitations.
Tcl form
load <nodeTag> <value1> <value2> ...
Note
- The number of specified load values should match the number of degrees of freedom (NDF) at the target node.
- If a
node_maskis provided, the load will be automatically expanded and applied to all selected nodes. - In parallel computing contexts, partition IDs (
pids) specify which processor core(s) should execute the command.
Example
Create a nodal load component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values
|
List[float]
|
Nodal force or moment values corresponding to the active degrees of freedom (DOFs) at the node. |
required |
node_tag
|
Optional[int]
|
Optional explicit tag of the target node. |
None
|
node_mask
|
Optional[object]
|
Optional NodeMask object to apply the load to multiple nodes. |
None
|
pids
|
Optional[List[int]]
|
Optional processor partition IDs for parallel executions. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither |
Functions:
_coerce_positive_int
Coerce a value to a positive integer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Any
|
The value to be converted. |
required |
field
|
str
|
The name of the field being validated (for error messages). |
required |
Returns:
| Type | Description |
|---|---|
int
|
The validated positive integer. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the value cannot be converted to a positive integer or is less than 1. |
_coerce_load_values
Coerce input load values to a list of floats.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values
|
Any
|
The load values (list or tuple) to be validated. |
required |
Returns:
| Type | Description |
|---|---|
List[float]
|
A list of validated float values. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the input is not a non-empty list or tuple of numeric values. |
_coerce_pids
Coerce partition IDs to a sorted list of unique integers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pids
|
Any
|
The partition IDs (list or tuple) to be validated. |
required |
Returns:
| Type | Description |
|---|---|
List[int]
|
A sorted list of unique validated integers. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the input is not a list or tuple of integer values. |