fdm
fdm(coords, load, support, edge_index, force_density, batch=None, use_batching=True, directed=False, solve_only_z=False, C=None)
Performs the Force Density Method (FDM) to find the equilibrium state of a structure given its coordinates, loads, supports, edge connections, and force densities.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coords
|
Tensor
|
A tensor of shape (num_nodes, 3) containing the initial 3D coordinates of each node. Only coordinates of supported nodes have an effect on the output. |
required |
load
|
Tensor
|
A tensor of shape (num_nodes, 3) containing the external load vector for each node. |
required |
support
|
Tensor
|
A boolean tensor of shape (num_nodes, 1) indicating which nodes are fixed (True) or free (False). |
required |
edge_index
|
Tensor
|
A tensor of shape (2, num_edges) containing the indices of the nodes that form each edge. |
required |
force_density
|
Tensor
|
A tensor of shape (num_edges, 1) containing the force density for each edge. |
required |
batch
|
Tensor
|
A tensor of shape (num_nodes, 1) indicating the batch assignment for each node. If not supplied a single linear system containing all nodes and edges of the entire batch is solved. Default is None. |
None
|
use_batching
|
bool
|
If True, batching is used for solving the linear system. Default is True. |
True
|
directed
|
bool
|
If True, edges are assumed to be directed. If False, the force densities are halved to account for undirected edges. Default is False. |
False
|
solve_only_z
|
bool
|
If True, only the z-coordinate of the free nodes is solved. Default is False. |
False
|
C
|
Tensor
|
A precomputed branch-node matrix. If None, it is created using the edge_index. Default is None. |
None
|
Returns:
| Type | Description |
|---|---|
|
A tuple containing: - coords (torch.Tensor): A tensor of shape (num_nodes, 3) containing form-found coordinates of each node. - force (torch.Tensor): A tensor of shape (num_edges, 1) containing the axial force of each edge. |
Source code in src/torch_structure/formfinding/fdm.py
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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |