pyHarm.Elements.NodeToNodeElements.PenaltyUnilateralGap ======================================================= .. py:module:: pyHarm.Elements.NodeToNodeElements.PenaltyUnilateralGap Classes ------- .. autoapisummary:: pyHarm.Elements.NodeToNodeElements.PenaltyUnilateralGap.PenaltyUnilateralGap Functions --------- .. autoapisummary:: pyHarm.Elements.NodeToNodeElements.PenaltyUnilateralGap.PenalGapResidual_jax pyHarm.Elements.NodeToNodeElements.PenaltyUnilateralGap.PenalGapResidual pyHarm.Elements.NodeToNodeElements.PenaltyUnilateralGap.PenalGapJacobian Module Contents --------------- .. py:function:: PenalGapResidual_jax(x, om, Pdir, Pslave, Pmaster, g, k, DFT, DTF, N0=0.0) .. py:function:: PenalGapResidual(x, om, Pdir, Pslave, Pmaster, g, k, DFT, DTF, N0=0.0) .. py:function:: PenalGapJacobian(x, om, Pdir, Pslave, Pmaster, g, k, DFT, DTF, N0=0.0) .. py:class:: PenaltyUnilateralGap(nh: int | list[int], nti: int, name: str, data: dict, CS: pyHarm.CoordinateSystem.CoordinateSystem, dynop: Optional[dict[str, numpy.ndarray]] = None) Bases: :py:obj:`pyHarm.Elements.NodeToNodeElements.NodeToNodeElement.NodeToNodeElement` This element is an approximation of unilateral contact by adding a rigidity when contact is made. .. attribute:: g gap value. :type: float .. attribute:: k linear spring value. :type: foat .. attribute:: jac if "analytical" uses analytical expression of jacobian, if "jax" uses automatic differentiation, if "DF" uses finite difference. :type: str .. py:attribute:: factory_keyword :type: str :value: 'PenaltyUnilateralGap' keyword that is used to call the creation of this class in the system factory. :type: str .. py:method:: __post_init__() .. py:method:: __flag_update__() .. py:method:: _evalJaco_DF(xg, om, step) Computes the jacobian using finite difference method. :param xg: full displacement vector. :type xg: np.ndarray :param om: angular frequency value. :type om: float :param step: step size for the finite difference method. :type step: float :returns: jacobian with respect to displacement vector. dJdom (np.ndarray): jacobian with respect to angular frequency. :rtype: dJdx (np.ndarray) .. py:method:: _evalJaco_ana(xg, om) .. py:method:: adim(lc, wc) Modifies the element properties according to the characteristic length and angular frequency. .. attribute:: k modified linear coefficient to apply according to the characteristic parameters. :type: float .. attribute:: g modified gap value according to the characteristic parameters. :type: float .. attribute:: flag_adim True if equations are to be adimensionalized. :type: bool .. py:method:: evalResidual(xg, om) Computes the residual. :param xg: full displacement vector. :type xg: np.ndarray :param om: angular frequency value. :type om: float :returns: residual vector. :rtype: np.ndarray .. py:method:: evalJacobian(xg, om) Compute the jacobians. :param xg: full displacement vector. :type xg: np.ndarray :param om: angular frequency value. :type om: float :returns: Jacobian with respect to displacement. np.ndarray: Jacobian with respect to angular frequency. :rtype: np.ndarray