Exemple #1
0
    def __init__(self):
        def tensor_points(P):
            PP0, PP1 = np.array(np.meshgrid(P, P))
            return np.array((PP0.ravel(), PP1.ravel())).T

        def tensor_weights(W):
            return np.dot(W[:, np.newaxis], W[np.newaxis, :]).ravel()

        self._quadrature_points = [
            tensor_points(GaussQuadratures.quadrature(npoints=p + 1)[0])
            for p in range(GaussQuadratures.maxpoints())
        ]
        self._quadrature_weights = [
            tensor_weights(GaussQuadratures.quadrature(npoints=p + 1)[1])
            for p in range(GaussQuadratures.maxpoints())
        ]
        self._quadrature_npoints = np.arange(1,
                                             GaussQuadratures.maxpoints() +
                                             1)**2
        self._quadrature_orders = GaussQuadratures.orders
        self._quadrature_order_map = GaussQuadratures.order_map