residual_force
ResidualForce
Bases: MessagePassing
Computes the per-node residual force from axial member forces and applied loads.
Source code in src/torch_structure/message_passing/residual_force.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
forward(x, force, edge_index, load)
Sum each node's incident axial member forces and add the applied load.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor[N, D]
|
node coordinates. |
required |
force
|
Tensor[E]
|
axial force magnitude of each member. |
required |
edge_index
|
Tensor[2, E]
|
edge connectivity (undirected). |
required |
load
|
Tensor[N, D]
|
externally applied nodal loads. |
required |
Returns:
| Type | Description |
|---|---|
|
torch.Tensor [N, D]: the residual force at each node. |
Source code in src/torch_structure/message_passing/residual_force.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
message(x_i, x_j, force)
Compute the force vector a member exerts on its target (center) node, along its direction.
Source code in src/torch_structure/message_passing/residual_force.py
28 29 30 31 32 | |