# Path: FIAT/polynomial_set.py
# def mis(m, n):
#     def __init__(self, ref_el, degree, embedded_degree, expansion_set, coeffs,
#                  dmats):
#     def tabulate_new(self, pts):
#     def tabulate(self, pts, jet_order=0):
#     def get_expansion_set(self):
#     def get_coeffs(self):
#     def get_num_members(self):
#     def get_degree(self):
#     def get_embedded_degree(self):
#     def get_dmats(self):
#     def get_reference_element(self):
#     def get_shape(self):
#     def take(self, items):
#     def __init__(self, ref_el, degree, shape=tuple()):
# def project(f, U, Q):
# def form_matrix_product(mats, alpha):
# def polynomial_set_union_normalized(A, B):
#     def __init__(self, ref_el, degree, size=None):
# class PolynomialSet(object):
# class ONPolynomialSet(PolynomialSet):
# class ONSymTensorPolynomialSet(PolynomialSet):
#                     D = form_matrix_product(self.dmats, alpha)
#                     D = numpy.eye(1)
# 
# Path: FIAT/quadrature.py
# class GaussLegendreQuadratureLineRule(QuadratureRule):
#     """Produce the Gauss--Legendre quadrature rules on the interval using
#     the implementation in numpy. This facilitates implementing
#     discontinuous spectral elements.
# 
#     The quadrature rule uses m points for a degree of precision of 2m-1.
#     """
#     def __init__(self, ref_el, m):
#         if m < 1:
#             raise ValueError(
#                 "Gauss-Legendre quadrature invalid for fewer than 2 points")
# 
#         xs_ref, ws_ref = numpy.polynomial.legendre.leggauss(m)
# 
#         A, b = reference_element.make_affine_mapping(((-1.,), (1.)),
#                                                      ref_el.get_vertices())
# 
#         mapping = lambda x: numpy.dot(A, x) + b
# 
#         scale = numpy.linalg.det(A)
# 
#         xs = tuple([tuple(mapping(x_ref)[0]) for x_ref in xs_ref])
#         ws = tuple([scale * w for w in ws_ref])
# 
#         QuadratureRule.__init__(self, ref_el, xs, ws)
# 
# class QuadratureRule(object):
#     """General class that models integration over a reference element
#     as the weighted sum of a function evaluated at a set of points."""
# 
#     def __init__(self, ref_el, pts, wts):
#         if len(wts) != len(pts):
#             raise ValueError("Have %d weights, but %d points" % (len(wts), len(pts)))
# 
#         self.ref_el = ref_el
#         self.pts = pts
#         self.wts = wts
# 
#     def get_points(self):
#         return numpy.array(self.pts)
# 
#     def get_weights(self):
#         return numpy.array(self.wts)
# 
#     def integrate(self, f):
#         return sum([w * f(x) for (x, w) in zip(self.pts, self.wts)])
# 
# Path: FIAT/reference_element.py
# class UFCInterval(UFCSimplex):
#     """This is the reference interval with vertices (0.0,) and (1.0,)."""
# 
#     def __init__(self):
#         verts = ((0.0,), (1.0,))
#         edges = {0: (0, 1)}
#         topology = {0: {0: (0,), 1: (1,)},
#                     1: edges}
#         super(UFCInterval, self).__init__(LINE, verts, topology)


from collections import OrderedDict
from itertools import chain
from FIAT import polynomial_set
from FIAT.quadrature import GaussLegendreQuadratureLineRule, QuadratureRule
from FIAT.reference_element import UFCInterval as interval
import numpy
import sympy

        super().__init__(cell, shp, pt_dict, {}, nm)


class IntegralLegendreNormalMoment(IntegralLegendreDirectionalMoment):
    """Moment of v.n against a Legendre polynomial over an edge"""
    def __init__(self, cell, entity, mom_deg, comp_deg):
        n = cell.compute_scaled_normal(entity)
        super().__init__(cell, n, entity, mom_deg, comp_deg,
                         "IntegralLegendreNormalMoment")


class IntegralLegendreTangentialMoment(IntegralLegendreDirectionalMoment):
    """Moment of v.t against a Legendre polynomial over an edge"""
    def __init__(self, cell, entity, mom_deg, comp_deg):
        t = cell.compute_edge_tangent(entity)
        super().__init__(cell, t, entity, mom_deg, comp_deg,
                         "IntegralLegendreTangentialMoment")


class IntegralLegendreBidirectionalMoment(Functional):
    """Moment of dot(s1, dot(tau, s2)) against Legendre on entity, multiplied by the size of the reference facet"""
    def __init__(self, cell, s1, s2, entity, mom_deg, comp_deg, nm=""):
        # mom_deg is degree of moment, comp_deg is the total degree of
        # polynomial you might need to integrate (or something like that)
        sd = cell.get_spatial_dimension()
        shp = (sd, sd)

        s1s2T = numpy.outer(s1, s2)
        quadpoints = comp_deg + 1

# Path: FIAT/polynomial_set.py
# def mis(m, n):
#     def __init__(self, ref_el, degree, embedded_degree, expansion_set, coeffs,
#                  dmats):
#     def tabulate_new(self, pts):
#     def tabulate(self, pts, jet_order=0):
#     def get_expansion_set(self):
#     def get_coeffs(self):
#     def get_num_members(self):
#     def get_degree(self):
#     def get_embedded_degree(self):
#     def get_dmats(self):
#     def get_reference_element(self):
#     def get_shape(self):
#     def take(self, items):
#     def __init__(self, ref_el, degree, shape=tuple()):
# def project(f, U, Q):
# def form_matrix_product(mats, alpha):
# def polynomial_set_union_normalized(A, B):
#     def __init__(self, ref_el, degree, size=None):
# class PolynomialSet(object):
# class ONPolynomialSet(PolynomialSet):
# class ONSymTensorPolynomialSet(PolynomialSet):
#                     D = form_matrix_product(self.dmats, alpha)
#                     D = numpy.eye(1)
# 
# Path: FIAT/quadrature.py
# class GaussLegendreQuadratureLineRule(QuadratureRule):
#     """Produce the Gauss--Legendre quadrature rules on the interval using
#     the implementation in numpy. This facilitates implementing
#     discontinuous spectral elements.
# 
#     The quadrature rule uses m points for a degree of precision of 2m-1.
#     """
#     def __init__(self, ref_el, m):
#         if m < 1:
#             raise ValueError(
#                 "Gauss-Legendre quadrature invalid for fewer than 2 points")
# 
#         xs_ref, ws_ref = numpy.polynomial.legendre.leggauss(m)
# 
#         A, b = reference_element.make_affine_mapping(((-1.,), (1.)),
#                                                      ref_el.get_vertices())
# 
#         mapping = lambda x: numpy.dot(A, x) + b
# 
#         scale = numpy.linalg.det(A)
# 
#         xs = tuple([tuple(mapping(x_ref)[0]) for x_ref in xs_ref])
#         ws = tuple([scale * w for w in ws_ref])
# 
#         QuadratureRule.__init__(self, ref_el, xs, ws)
# 
# class QuadratureRule(object):
#     """General class that models integration over a reference element
#     as the weighted sum of a function evaluated at a set of points."""
# 
#     def __init__(self, ref_el, pts, wts):
#         if len(wts) != len(pts):
#             raise ValueError("Have %d weights, but %d points" % (len(wts), len(pts)))
# 
#         self.ref_el = ref_el
#         self.pts = pts
#         self.wts = wts
# 
#     def get_points(self):
#         return numpy.array(self.pts)
# 
#     def get_weights(self):
#         return numpy.array(self.wts)
# 
#     def integrate(self, f):
#         return sum([w * f(x) for (x, w) in zip(self.pts, self.wts)])
# 
# Path: FIAT/reference_element.py
# class UFCInterval(UFCSimplex):
#     """This is the reference interval with vertices (0.0,) and (1.0,)."""
# 
#     def __init__(self):
#         verts = ((0.0,), (1.0,))
#         edges = {0: (0, 1)}
#         topology = {0: {0: (0,), 1: (1,)},
#                     1: edges}
#         super(UFCInterval, self).__init__(LINE, verts, topology)


# Path: FIAT/functional.py
from collections import OrderedDict
from itertools import chain
from FIAT import polynomial_set
from FIAT.quadrature import GaussLegendreQuadratureLineRule, QuadratureRule
from FIAT.reference_element import UFCInterval as interval
import numpy
import sympy


        super().__init__(cell, shp, pt_dict, {}, nm)


class IntegralLegendreNormalMoment(IntegralLegendreDirectionalMoment):
    """Moment of v.n against a Legendre polynomial over an edge"""
    def __init__(self, cell, entity, mom_deg, comp_deg):
        n = cell.compute_scaled_normal(entity)
        super().__init__(cell, n, entity, mom_deg, comp_deg,
                         "IntegralLegendreNormalMoment")


class IntegralLegendreTangentialMoment(IntegralLegendreDirectionalMoment):
    """Moment of v.t against a Legendre polynomial over an edge"""
    def __init__(self, cell, entity, mom_deg, comp_deg):
        t = cell.compute_edge_tangent(entity)
        super().__init__(cell, t, entity, mom_deg, comp_deg,
                         "IntegralLegendreTangentialMoment")


class IntegralLegendreBidirectionalMoment(Functional):
    """Moment of dot(s1, dot(tau, s2)) against Legendre on entity, multiplied by the size of the reference facet"""
    def __init__(self, cell, s1, s2, entity, mom_deg, comp_deg, nm=""):
        # mom_deg is degree of moment, comp_deg is the total degree of
        # polynomial you might need to integrate (or something like that)
        sd = cell.get_spatial_dimension()
        shp = (sd, sd)

        s1s2T = numpy.outer(s1, s2)
        quadpoints = comp_deg + 1

        Q = GaussLegendreQuadratureLineRule(interval(), quadpoints)