Пример #1
0
def disp_def_cst(u, coords=(x, y, z), h_vec=(1, 1, 1)):
    """
    Compute strain measures for C-CST elasticity, as defined
    in [CST]_.

    Parameters
    ----------
    u : Matrix (3, 1), list
        Displacement vector function to apply the micropolar operator.
    coords : Tuple (3), optional
        Coordinates for the new reference system. This is an optional
        parameter it takes (x, y, z) as default.
    h_vec : Tuple (3), optional
        Scale coefficients for the new coordinate system. It takes
        (1, 1, 1), as default.

    Returns
    -------
    strain : Matrix (3, 3)
        Strain tensor.
    curvature : Matrix (3, 3)
        Curvature tensor.
    """
    strain = sym_grad(u, coords, h_vec)
    curvature = S(1) / 4 * curl(curl(u, coords, h_vec), coords, h_vec)
    return strain, dual_tensor(curvature)
Пример #2
0
def disp_def_micropolar(u, phi, coords=(x, y, z), h_vec=(1, 1, 1)):
    """
    Compute strain measures for micropolar elasticity, as defined
    in [NOW]_.

    Parameters
    ----------
    u : Matrix (3, 1), list
        Displacement vector function to apply the micropolar operator.
    phi : Matrix (3, 1), list
        Microrrotation (pseudo)-vector function to apply the
        micropolar operator.
    coords : Tuple (3), optional
        Coordinates for the new reference system. This is an optional
        parameter it takes (x, y, z) as default.
    h_vec : Tuple (3), optional
        Scale coefficients for the new coordinate system. It takes
        (1, 1, 1), as default.

    Returns
    -------
    strain : Matrix (3, 3)
        Strain tensor.
    curvature : Matrix (3, 3)
        Curvature tensor.
    """
    strain = grad_vec(u, coords, h_vec) - dual_tensor(phi)
    curvature = grad_vec(phi, coords, h_vec)
    return strain, curvature
Пример #3
0
def test_dual_vector():
    tensor = Matrix([[0, 3, -2], [-3, 0, 1], [2, -1, 0]])
    vector = Matrix([1, 2, 3])
    assert dual_vector(tensor) == vector
    assert dual_tensor(vector) == tensor