fd_numpy

compas_fd.solvers.fd_numpy(*, vertices, fixed, edges, forcedensities, loads=None)

Compute the equilibrium coordinates of a system of vertices connected by edges.

Parameters:
verticesFloatNx3

The XYZ coordinates of the vertices.

fixedlist[int]

The fixed vertices.

edgeslist[tuple[int, int]]

The edges between the vertices.

forcedensitieslist[float]

The force densities of the edges.

loadsFloatNx3, optional

The loads on the vertices.

Returns:
Result

Examples

>>> from compas.datastructures import Mesh
>>> from compas_fd.solvers import fd_numpy
>>> mesh = Mesh.from_meshgrid(dx=10, nx=10)
>>> vertices = mesh.vertices_attributes("xyz")
>>> fixed = list(mesh.vertices_where(vertex_degree=2))
>>> edges = list(mesh.edges())
>>> loads = [[0, 0, 0] for _ in range(len(vertices))]
>>> q = [1.0] * len(edges)
>>> result = fd_numpy(vertices=vertices, fixed=fixed, edges=edges, forcedensities=q, loads=loads)
>>> all(result.residuals < 1e-6)
True
>>> all(result.forces > 0)
True