mymesh.improvement.SegmentSpringSmoothing#

mymesh.improvement.SegmentSpringSmoothing(M, StiffnessFactor=1, Forces=None, Displacements=None, L0Override='min', CellCentered=True, FaceCentered=True, return_KF=False, options={})[source]#

SegmentSpringSmoothing - Blom, F.J., 2000. Considerations on the spring analogy. International journal for numerical methods in fluids, 32(6), pp.647-668.

Parameters:
  • NodeCoords (list) – List of nodal coordinates.

  • NodeConn (list) – Nodal connectivity list.

  • NodeNeighbors (list, optional) – List of node neighboring nodes for each node in the mesh. If provided with ElemConn, will avoid the need to recalculate, by default None. If only one is provided, both will be recalculated.

  • ElemConn (list, optional) – List of elements connected to each node. If provided with NodeNeighbors, will avoid the need to recalculate, by default None. If only one is provided, both will be recalculated.

  • StiffnessFactor (float, optional) – Specifies a scaling factor for the stiffness of the springs. The default is 1.

  • FixedNotes (list or set, optional) – Set of nodes to be held fixed. The default is set().

  • Forces (list, optional) – Set of applied forces. If specified, forces must be specified for every node, with a force of [0,0,0] applied to unloaded nodes. The default is None.

  • L0Override (str or float, optional) – Override value for assigning the length of springs whose initial length is 0. ‘min’ : 0-length springs will be assigned to be equal to the shortest non-0-length spring in the mesh. ‘max’ : 0-length springs will be assigned to be equal to the longest spring in the mesh. float : 0-length springs will be assigned to be equal to the specified float. The default is ‘min’.

  • CellCentered (bool, optional) – If true, will add cell (element)-centered springs, adding springs between each node in an element to the element centrod, by default True.

  • FaceCentered (bool, optional) – If true, will add face-centered springs, adding springs between each node in an element face to the face centrod, by default True.

  • return_KF (bool, optional) – If true, will return a tuple (K,F) containing the matrices (in scipy sparse formats) K and F of the linear spring equation KU=F which is solved to find the the nodal displacements, by default False.

Returns:

  • Xnew (list) – Updated list of nodal coordinates.

  • dXnew (list) – List of nodal displacements to go from NodeCoords -> Xnew

  • KF (tuple of sparse matrices, optional) – If return_KF is true, the tuple of sparse matrice KF=(K,F) is returned.