Skip to content

Commit

Permalink
Update mesh_fd solvers
Browse files Browse the repository at this point in the history
Reference updated solver backend
  • Loading branch information
Sam-Bouten committed Nov 11, 2021
1 parent c601b51 commit dcd6276
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
3 changes: 3 additions & 0 deletions src/compas_fd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
compas_fd.datastructures
compas_fd.fd
compas_fd.loads
compas_fd.numdata
compas_fd.results
compas_fd.solvers
"""

Expand Down
17 changes: 6 additions & 11 deletions src/compas_fd/fd/mesh_fd_iter_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
from numpy import float64

import compas_fd
from .fd_iter_numpy import fd_iter_numpy

from compas_fd.numdata import FDNumericalData
from compas_fd.solvers import FDConstraintSolver


def mesh_fd_iter_numpy(mesh: 'compas_fd.datastructures.CableMesh') -> 'compas_fd.datastructures.CableMesh':
Expand Down Expand Up @@ -30,18 +32,11 @@ def mesh_fd_iter_numpy(mesh: 'compas_fd.datastructures.CableMesh') -> 'compas_fd
loads = array(mesh.vertices_attributes(('px', 'py', 'pz')), dtype=float64)
constraints = list(mesh.vertices_attribute('constraint'))

result = fd_iter_numpy(vertices=vertices,
fixed=fixed,
edges=edges,
forcedensities=forcedensities,
loads=loads,
constraints=constraints,
max_iter=100,
tol_res=1E-3,
tol_xyz=1E-3)
numdata = FDNumericalData.from_params(vertices, fixed, edges, forcedensities, loads)
solver = FDConstraintSolver(numdata, constraints, max_iter=100, tol_res=1E-3, tol_dxyz=1E-3)
result = solver()

_update_mesh(mesh, result)

return mesh


Expand Down

0 comments on commit dcd6276

Please sign in to comment.