예제 #1
0
파일: innerprods.py 프로젝트: s769/op_on_sg
def inner0_j3k3(j, k):
    '''
    Calculates the L2 inner product <P_j3, P_k3>

    Args:
        j, k: indices for the monomials P_j3, P_k3

    Returns:
        L2 inner product <P_j3, P_k3>
    '''
    ms = min(j, k)
    s1 = 0
    for l in range(j - ms, j + 1):
        s1 += alpha(j - l + 1) * eta(k + l + 2) - alpha(k + l + 2) * eta(j -
                                                                         l + 1)
    return 18 * s1
예제 #2
0
파일: innerprods.py 프로젝트: s769/op_on_sg
def inner0_j1k1(j, k):
    '''
    Calculates the L2 inner product <P_j1, P_k1>

    Args:
        j, k: indices for the monomials P_j1, P_k1

    Returns:
        L2 inner product <P_j1, P_k1>

    '''

    ms = min(j, k)
    s1 = 0
    for l in range(j - ms, j + 1):
        s1 += alpha(j - l) * eta(k + l + 1) - alpha(k + l + 1) * eta(j - l)
    return 2 * s1
예제 #3
0
def d_pnj1(nn, j, i):
    '''
    This function calculates the value of the normal derivative of 
        P_{j,1}^(n) at q_i.

    Args:
        nn: corresponds to the value of (n) in P_{j,1}^(n)
        j: corresponds to the value of j in P_{j,1}^(n)
        i: corresponds to the boundary index q_i

    Returns:
        Value of the normal derivative of P_{j,1}^(n) at q_i
    '''
    return 0 if i == nn else eta(j)
예제 #4
0
파일: innerprods.py 프로젝트: s769/op_on_sg
def inner0_j1k2(j, k):
    '''
    Calculates the L2 inner product <P_j1, P_k2>

    Args:
        j, k: indices for the monomials P_j1, P_k2

    Returns:
        L2 inner product <P_j1, P_k2>

    '''
    s1 = 0
    for l in range(j + 1):
        s1 += alpha(j - l) * alpha(k + l + 1) + beta(k + l + 1) * eta(j - l)
    return -2 * s1
예제 #5
0
파일: innerprods.py 프로젝트: s769/op_on_sg
def dnpj3(j):
    return 3 * eta(j + 1)