def constitutive_Mooney_Rivlin(F, c, c1, c2):
    # First derivate of W:Neo-Hookean free energy w.r.t F
    detF = det2(F)
    if np.any(detF < 0):  # That means the calculation will return wrong values
        return -1, -1
        # pass
    invF = inv2(F)
    Cauchy = dot22(trans2(F), F)
    J = detF
    trC = trace2(Cauchy)
    invC = inv2(Cauchy)
    S = (2 * c1 + 2 * c2 * trC) * I - 2 * c2 * trans2(Cauchy) + (
        2 * c * (J - 1) * J) * trans2(invC)
    P = dot22(F, S)
    C4 = zeros([dim, dim, dim, dim, Nx, Ny])
    for i, j, k, l in itertools.product(range(dim), repeat=4):
        C4[i, j, k, l, :, :] = 2 * (2*c2*delta(i,j)*delta(k,l) - 2*c2*delta(j,k)*delta(i,l) + c*(2*J - 1) * J * invC[j,i,:,:] * invC[l,k,:,:] \
         - (2 * c * (J - 1) * J) * invC[j, k, :, :] * invC[l, i, :, :])
    K4 = zeros([dim, dim, dim, dim, Nx, Ny])
    for i, j, k, l in itertools.product(range(dim), repeat=4):
        temp = zeros([dim, dim, dim, dim, Nx, Ny])
        for m, q in itertools.product(range(dim), repeat=2):
            temp += F[i, m, :, :] * 0.5 * (
                C4[m, j, l, q, :, :] + C4[m, j, q, l, :, :]) * F[k, q, :, :]
        K4[i, j, k,
           l, :, :] = delta(i, k) * S[l, j, :, :] + temp[i, j, k, l, :, :]
    return P, K4
Пример #2
0
def get_Green_Operator(xi):
    Ghat4 = zeros([dim, dim, dim, dim, Nx, Ny])  # zero initialize
    normXi = np.sqrt(xi[0] * xi[0] + xi[1] * xi[1])
    normXi[0][0] = 1.0  # Assign 1 to avoid the singularity
    for i, j, l, m in itertools.product(range(dim), repeat=4):
        # centerPoint = where(freq - 0.0 < 1e-10)
        Ghat4[i, j, l, m, :, :] = -(xi[i] * xi[j] * xi[l] * xi[m]) / np.power(normXi, 4) + \
                (delta(j, l) * xi[i] * xi[m] + delta(j, m) * xi[i] * xi[l] + \
                 delta(i, l) * xi[j] * xi[m] + delta(i, m) * xi[j] * xi[l]) / (2. * np.power(normXi, 2))
        Ghat4[i, j, l, m, 0, 0] = 0  # Like boundary condition
    return Ghat4
def constitutive_Neo_Hookean(F, mu, beta):
    # First derivate of W:Neo-Hookean free energy w.r.t F
    detF = det2(F)
    invF = inv2(F)
    P = np.zeros([dim, dim, Nx, Ny])
    for i, j in itertools.product(range(dim), repeat=2):
        P[i, j, :, :] = mu * F[i, j, :, :] - mu * power(
            detF, -beta) * invF[j, i, :, :]
    # Second derivate of W:Neo-Hookean free energy w.r.t F
    K4 = np.zeros([dim, dim, dim, dim, Nx, Ny])
    for i, j, k, l in itertools.product(range(dim), repeat=4):
        K4[i, j, k, l, :, :] = mu * delta(i, k) * delta(j, l) + mu * power(detF, -beta) \
                * (beta * invF[j, i, :, :] * invF[l, k, :, :] + invF[l, i, :, :] * invF[j, k, :, :])
    return P, K4
def constitutive_Neo_Hookean2(F, mu, lam):
    # First derivate of W:Neo-Hookean free energy w.r.t F
    detF = det2(F)
    if np.any(detF < 0):  # That means the calculation will return wrong values
        return -1, -1
        # pass
    invF = inv2(F)
    P = np.zeros([dim, dim, Nx, Ny])
    for i, j in itertools.product(range(dim), repeat=2):
        P[i, j, :, :] = (lam * np.log(detF) -
                         mu) * invF[j, i, :, :] + mu * F[i, j, :, :]
    # Second derivate of W:Neo-Hookean free energy w.r.t F
    K4 = np.zeros([dim, dim, dim, dim, Nx, Ny])
    for i, j, k, l in itertools.product(range(dim), repeat=4):
        K4[i, j, k, l, :, :] = lam * invF[j, i, :, :] * invF[l, k, :, :] - (lam * np.log(detF) - mu) *\
                (invF[j, k, :, :] * invF[l, i, :, :]) + mu * delta(i, k) * delta(j, l)
    return P, K4
def get_Green_Operator(xi):
    Ghat4 = np.zeros([dim, dim, dim, dim, Nx, Ny])  # zero initialzation
    # - compute
    normXi = np.sqrt(xi[0] * xi[0] + xi[1] * xi[1])
    normXi[0][0] = 1.0  # Assign 1 to avoid the singularity
    for i, j, k, l in itertools.product(range(dim), repeat=4):
        Ghat4[i, j, k, l] = delta(i, k) * xi[j] * xi[l] / np.power(normXi, 2)
        Ghat4[i, j, k, l, 0, 0] = 0  # Like boundary conditions
    return Ghat4