Exemple #1
0
def _calculate_K_r(x1, x2, x3, y1, y2, y3, eps):
    """
    _calculate_K_r
    """
    K_r = np.zeros(shape=(3, 3))
    #gradients do not depend on x,y in this case
    #therefore K_r = J^-T*grad_i*J^-T*grad_j * abs(det_J) * int ( eps(...) )

    detJ = x2 * y3 - x2 * y1 - x1 * y3 - x3 * y2 + x3 * y1 + x1 * y2

    K_r[0, 0] = (y3 * y3 - 2 * y2 * y3 + y2 * y2 + x2 * x2 - 2 * x2 * x3 +
                 x3 * x3)
    K_r[0, 1] = -(y3 * y3 - y3 * y1 - y2 * y3 + y2 * y1 - x2 * x3 + x2 * x1 +
                  x3 * x3 - x3 * x1)
    K_r[0, 2] = (y2 * y3 - y2 * y2 - y3 * y1 + y2 * y1 + x2 * x3 - x2 * x2 -
                 x3 * x1 + x2 * x1)
    K_r[1, 0] = -(y3 * y3 - y3 * y1 - y2 * y3 + y2 * y1 - x2 * x3 + x2 * x1 +
                  x3 * x3 - x3 * x1)
    K_r[1, 1] = (y3 * y3 - 2 * y3 * y1 + y1 * y1 + x3 * x3 - 2 * x3 * x1 +
                 x1 * x1)
    K_r[1, 2] = -(y2 * y3 - y2 * y1 - y3 * y1 + y1 * y1 + x2 * x3 - x2 * x1 -
                  x3 * x1 + x1 * x1)
    K_r[2, 0] = (y2 * y3 - y2 * y2 - y3 * y1 + y2 * y1 + x2 * x3 - x2 * x2 -
                 x3 * x1 + x2 * x1)
    K_r[2, 1] = -(y2 * y3 - y2 * y1 - y3 * y1 + y1 * y1 + x2 * x3 - x2 * x1 -
                  x3 * x1 + x1 * x1)
    K_r[2, 2] = (y2 * y2 - 2 * y2 * y1 + y1 * y1 + x2 * x2 - 2 * x2 * x1 +
                 x1 * x1)

    epsIntegral = numeric.gauss_triangle_6(
        lambda x, y: eps(_ref_to_global(x1, x2, x3, y1, y2, y3, (x, y))))

    K_r = K_r / detJ**2 * abs(detJ) * epsIntegral

    return K_r
Exemple #2
0
def _calculate_K_r(x1, x2, x3, y1, y2, y3, eps):
    """
    _calculate_K_r
    """
    K_r = np.zeros(shape=(3,3))
    #gradients do not depend on x,y in this case
    #therefore K_r = J^-T*grad_i*J^-T*grad_j * abs(det_J) * int ( eps(...) )

    detJ = x2 * y3 - x2 * y1 - x1 * y3 - x3 * y2 + x3 * y1 + x1 * y2;

    K_r[0,0] = (y3 * y3 - 2 * y2 * y3 + y2 * y2 + x2 * x2 - 2 * x2 * x3 + x3 * x3)
    K_r[0,1] = -(y3 * y3 - y3 * y1 - y2 * y3 + y2 * y1 - x2 * x3 + x2 * x1 + x3 * x3 - x3 * x1)
    K_r[0,2] = (y2 * y3 - y2 * y2 - y3 * y1 + y2 * y1 + x2 * x3 - x2 * x2 - x3 * x1 + x2 * x1)
    K_r[1,0] = -(y3 * y3 - y3 * y1 - y2 * y3 + y2 * y1 - x2 * x3 + x2 * x1 + x3 * x3 - x3 * x1)
    K_r[1,1] = (y3 * y3 - 2 * y3 * y1 + y1 * y1 + x3 * x3 - 2 * x3 * x1 + x1 * x1)
    K_r[1,2] = -(y2 * y3 - y2 * y1 - y3 * y1 + y1 * y1 + x2 * x3 - x2 * x1 - x3 * x1 + x1 * x1)
    K_r[2,0] = (y2 * y3 - y2 * y2 - y3 * y1 + y2 * y1 + x2 * x3 - x2 * x2 - x3 * x1 + x2 * x1)
    K_r[2,1] = -(y2 * y3 - y2 * y1 - y3 * y1 + y1 * y1 + x2 * x3 - x2 * x1 - x3 * x1 + x1 * x1)
    K_r[2,2] = (y2 * y2 - 2 * y2 * y1 + y1 * y1 + x2 * x2 - 2 * x2 * x1 + x1 * x1)

    epsIntegral = numeric.gauss_triangle_6(lambda x,y: eps(_ref_to_global(x1, x2, x3, y1, y2, y3, (x,y))))
    
    K_r = K_r / detJ**2 * abs(detJ) * epsIntegral

    return K_r
Exemple #3
0
def _calculate_f_r(x1, x2, x3, y1, y2, y3, rho):
    """
    _calculate_f_r elementwise "lastvektoren"
    """
    f_r = np.zeros(shape=(3,1))
    phi = phi_lin_tri
    adetJ = abs(x2 * y3 - x2 * y1 - x1 * y3 - x3 * y2 + x3 * y1 + x1 * y2)

    for i in range(0,3):
        integrand = lambda xi1, xi2: rho(_ref_to_global(x1, x2, x3, y1, y2, y3, (xi1,xi2))) * phi[i](xi1,xi2) * adetJ

        f_r[i,0] = numeric.gauss_triangle_6(integrand)

    return f_r
Exemple #4
0
def _calculate_f_r(x1, x2, x3, y1, y2, y3, rho):
    """
    _calculate_f_r elementwise "lastvektoren"
    """
    f_r = np.zeros(shape=(3, 1))
    phi = phi_lin_tri
    adetJ = abs(x2 * y3 - x2 * y1 - x1 * y3 - x3 * y2 + x3 * y1 + x1 * y2)

    for i in range(0, 3):
        integrand = lambda xi1, xi2: rho(
            _ref_to_global(x1, x2, x3, y1, y2, y3,
                           (xi1, xi2))) * phi[i](xi1, xi2) * adetJ

        f_r[i, 0] = numeric.gauss_triangle_6(integrand)

    return f_r