dr

compas.numerical.dr(vertices, edges, fixed, loads, qpre, fpre=None, lpre=None, linit=None, E=None, radius=None, kmax=100, dt=1.0, tol1=0.001, tol2=1e-06, c=0.1, callback=None, callback_args=None)[source]

Implementation of dynamic relaxation with RK integration scheme in pure Python.

Parameters
  • vertices (list) – XYZ coordinates of the vertices.

  • edges (list) – Connectivity of the vertices.

  • fixed (list) – Indices of the fixed vertices.

  • loads (list) – XYZ components of the loads on the vertices.

  • qpre (list) – Prescribed force densities in the edges.

  • fpre (list, optional) – Prescribed forces in the edges.

  • lpre (list, optional) – Prescribed lengths of the edges.

  • linit (list, optoional) – Initial length of the edges.

  • E (list, optional) – Stiffness of the edges.

  • radius (list, optional) – Radius of the edges.

  • kmax (int, optional) – Maximum number of iterations.

  • dt (float, optional) – The time step.

  • tol1 (float, optional) – Convergence criterion for the residual forces.

  • tol2 (float, optional) – Convergence criterion for the displacements in between interations.

  • c (float, optional) – Damping factor for viscous damping.

  • callback (callable, optional) – A user-defined callback that is called after every iteration. The callback will be called with k the current iteration, X the coordinates at iteration k, crit1, crit2 the values of the stoppage criteria at iteration k, and callback_args the optional additional arguments.

  • callback_args (tuple, optional) – Additional arguments to be passed to the callback.

Returns

  • xyz (array) – XYZ coordinates of the equilibrium geometry.

  • q (array) – Force densities in the edges.

  • f (array) – Forces in the edges.

  • l (array) – Lengths of the edges

  • r (array) – Residual forces.

Examples

>>>