コード例 #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 navier_cauchy(u, parameters, coords=(x, y, z), h_vec=(1, 1, 1)):
    """
    Navier-Cauchy operator of a vector function u.

    Parameters
    ----------
    u : Matrix (3, 1), list
        Vector function to apply the Navier-Cauchy operator.
    parameters : tuple
        Material parameters in the following order:

        lamda : float
            Lamé's first parameter.
        mu : float, > 0
            Lamé's second parameter.
    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
    -------
    navier_op : Matrix (3, 1)
        Components of the Navier-Cauchy operator applied to the
        displacement vector.
    """
    lamda, mu = parameters
    u = Matrix(u)
    term1 = (lamda + 2 * mu) * grad(div(u, coords, h_vec), coords, h_vec)
    term2 = mu * curl(curl(u, coords, h_vec), coords, h_vec)

    return simplify(term1 - term2)
コード例 #3
0
def c_cst(u, parameters, coords=(x, y, z), h_vec=(1, 1, 1)):
    """
    Corrected-Couple-Stress-Theory (C-CST) elasticity operator of a
    vector function u, as presented in [CST]_.

    Parameters
    ----------
    u : Matrix (3, 1), list
        Vector function to apply the Navier-Cauchy operator.
    parameters : tuple
        Material parameters in the following order:

        lamda : float
            Lamé's first parameter.
        mu : float, > 0
            Lamé's second parameter.
        eta : float, > 0
            Couple stress modulus in C-CST.
    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
    -------
    c_cst : Matrix (3, 1)
        Components of the C-CST operator applied to the
        displacement vector

    References
    ----------

    .. [CST] Ali R. Hadhesfandiari, Gary F. Dargush.
        Couple stress theory for solids. International Journal
        for Solids and Structures, 2011, 48, 2496-2510.
    """
    lamda, mu, eta = parameters
    u = Matrix(u)
    term1 = (lamda + 2 * mu) * grad(div(u, coords, h_vec), coords, h_vec)
    term2 = mu * curl(curl(u, coords, h_vec), coords, h_vec)
    term3 = eta * lap_vec(curl(curl(u, coords, h_vec), coords, h_vec), coords,
                          h_vec)
    return simplify(term1 - term2 + term3)
コード例 #4
0
def micropolar(u, phi, parameters, coords=(x, y, z), h_vec=(1, 1, 1)):
    """
    Micropolar operator of a vector function u, 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.
    parameters : tuple
        Material parameters in the following order:

        lamda : float
            Lamé's first parameter.
        mu : float, > 0
            Lamé's second parameter.
        alpha : float, > 0
            Micropolar parameter.
        beta : float
            Micropolar parameter.
        gamma : float, > 0
            Micropolar parameter.
        epsilon : float, > 0
            Micropolar parameter.
    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
    -------
    disp_op : Matrix (3, 1)
        Displacement components.
    rot_op : Matrix (3, 1)
        Microrrotational components.

    References
    ----------
    .. [NOW] Witold Nowacki. Theory of micropolar elasticity.
        International centre for mechanical sciences,
        Courses and lectures, No. 25. Berlin: Springer, 1972.
    """
    lamda, mu, alpha, beta, gamma, epsilon = parameters
    u = Matrix(u)
    phi = Matrix(phi)
    u_op = (lamda + 2*mu) * grad(div(u, coords, h_vec), coords, h_vec) \
         - (mu + alpha) * curl(curl(u, coords, h_vec), coords, h_vec) \
         + 2*alpha*curl(phi, coords, h_vec)
    phi_op = (beta + 2*gamma) * grad(div(phi, coords, h_vec), coords, h_vec)\
           - (gamma + epsilon) * curl(curl(phi, coords, h_vec), coords, h_vec)\
           + 2*alpha*curl(u, coords, h_vec) - 4*alpha*phi
    return simplify(u_op), simplify(phi_op)
コード例 #5
0
def test_curl():
    rot = curl([0, -x**2, 0])
    expected_rot = Matrix([[0], [0], [-2 * x]])
    assert rot == expected_rot