Example #1
0
def ij2ab(ne, ngq, panel, ei, ej, gi, gj):
    gq_pts, gq_wts = gausslobatto(ngq-1)
    delta_angles = (gq_pts[:] + 1)*np.pi/(4*ne) 

    alpha = -np.pi/4 + np.pi/(2*ne)*(ei-1) + delta_angles[gi-1]
    beta  = -np.pi/4 + np.pi/(2*ne)*(ej-1) + delta_angles[gj-1]

    return alpha, beta
Example #2
0
    def __init__(self, cubegrid, rotated=False, homme_style=False):
        self.cubegrid = cubegrid
        self.rotated= rotated

        ngq = cubegrid.ngq
        local_ep_size = cubegrid.local_ep_size
        gq_pts, gq_wts = gausslobatto(ngq-1)    # ngq-1: polynomial order

        Dvv = np.zeros(ngq*ngq, 'f8')
        Dinv = np.zeros(local_ep_size*2*2, 'f8')
        jac = np.zeros(local_ep_size, 'f8')


        self.init_derivative_matrix(Dvv, gq_pts)

        if homme_style:
            self.init_transform_matrix_homme(Dinv, jac)
            area_ratio = self.calc_area_ratio(gq_wts, jac)

            Dinv[:] /= np.sqrt(area_ratio)
            jac[:] *= area_ratio

        else:
            self.init_transform_matrix(Dinv, jac)
            #area_ratio1 = self.calc_area_ratio(gq_wts, jac)

            self.revise_transform_matrix_by_elem_area(gq_wts, jac, Dinv)

        #area_ratio2 = self.calc_area_ratio(gq_wts, jac)
        #print cubegrid.myrank, area_ratio1, area_ratio2



        #-----------------------------------------------------
        # Public variables
        #-----------------------------------------------------
        self.gq_pts = gq_pts
        self.gq_wts = gq_wts
        self.Dvv = Dvv
        self.Dinv = Dinv
        self.jac = jac