PALab / RUS

Resonant Ultrasound Spectroscopy
12 stars 7 forks source link

Question about e_fill(tabs,dimensions,rho,shape,irk) and e_fill(tabs,dimensions,rho,shape,irk) #16

Open Binary1119 opened 2 years ago

Binary1119 commented 2 years ago
def e_fill(tabs,dimensions,rho,shape,irk):
    """
    Generates and returns the value e.
    TODO: What is e?
    """
    e = [scipy.zeros((irk[i],irk[i])) for i in range(8)]
    for k in range(8):
        irs = 0
        for ik in range(k):
            irs += irk[ik]
        irf = irs + irk[k]

        irv = 0
        ir1 = irs
        while ir1 < irf:
            irh = 0
            ir2 = irs
            while ir2 < irf:
                [i1,l1,m1,n1] = tabs[ir1]
                [i2,l2,m2,n2] = tabs[ir2]
                l = l1 + l2
                m = m1 + m2
                n = n1 + n2
                if i1 == i2 and l % 2 == 0 and m % 2 == 0 and n % 2 == 0:
                    e[k][irv][irh] = rho * volintegral(dimensions,l,m,n,shape);
                else:
                    e[k][irv][irh] = 0.0
                ir2 += 1
                irh += 1
            ir1 += 1
            irv += 1
    return e
def gamma_fill(tabs,dimensions,cm,shape,irk):
    """
    Calculate a value, gamma, and return it.

    gamma is a set of 8, 2D square arrays,
    based on the values in irk.

    The function calls gamma_helper() for much
    of the work.

    TODO: What is this function doing?
    """
    gamma = [scipy.zeros((irk[i],irk[i])) for i in range(8)]
    c = stiffness(cm)
    for k in range(8):
        irs = sum(irk[0:k])
        irf = irs + irk[k]
        irv = 0
        for ir1 in range(irs,irf):
            irh = 0
            tabs1 = tabs[ir1]
            for ir2 in range(irs,irf):
                tabs2 = tabs[ir2]
                gamma_helper(gamma[k],c,tabs1,tabs2,irv,irh,dimensions,shape)
                irh += 1
            irv += 1
    return gamma

I have question about this two functions. What are this two functions doing? Thanks for you reply!