@@ -0,0 +1,2600 @@
+import pytest%0Aimport FIAT%0Aimport finat%0Aimport gem%0Aimport numpy as np%0Afrom finat.physically_mapped import PhysicalGeometry%0Afrom gem.interpreter import evaluate%0A%0A%0Aclass MyMapping(PhysicalGeometry):%0A    def __init__(self, ref_cell, phys_cell):%0A        self.ref_cell = ref_cell%0A        self.phys_cell = phys_cell%0A%0A        self.A, self.b = FIAT.reference_element.make_affine_mapping(%0A            self.ref_cell.vertices,%0A            self.phys_cell.vertices)%0A%0A    def cell_size(self):%0A        # Firedrake interprets this as 2x the circumradius%0A        # cs = (np.prod(%5Bself.phys_cell.volume_of_subcomplex(1, i)%0A        #                for i in range(3)%5D)%0A        #       / 2.0 / self.phys_cell.volume())%0A        # return np.asarray(%5Bcs for _ in range(3)%5D)%0A        # Currently, just return 1 so we can compare FIAT dofs%0A        # to transformed dofs.%0A%0A        return np.ones((3,))%0A%0A    def detJ_at(self, point):%0A        return self.A%0A%0A    def jacobian_at(self, point):%0A        return self.A%0A%0A    def reference_normals(self):%0A        return gem.Literal(%0A            np.asarray(%5Bself.ref_cell.compute_normal(i)%0A                        for i in range(3)%5D))%0A%0A    def physical_normals(self):%0A        return gem.Literal(%0A            np.asarray(%5Bself.phys_cell.compute_normal(i)%0A                        for i in range(3)%5D))%0A%0A    def physical_tangents(self):%0A        return gem.Literal(%0A            np.asarray(%5Bself.phys_cell.compute_normalized_edge_tangent(i)%0A                        for i in range(3)%5D))%0A%0A    def physical_edge_lengths(self):%0A        return gem.Literal(%0A            np.asarray(%5Bself.phys_cell.volume_of_subcomplex(1, i)%0A                        for i in range(3)%5D))%0A%0A    def physical_points(self, ps, entity=None):%0A        prefs = ps.points%0A        A, b = self.A, self.b%0A        return gem.Literal(np.asarray(%5BA @ x + b for x in prefs%5D))%0A%0A    def physical_vertices(self):%0A        return gem.Literal(self.phys_cell.verts)%0A%0A%0Adef test_morley():%0A    ref_cell = FIAT.ufc_simplex(2)%0A    ref_element = finat.Morley(ref_cell, 2)%0A    ref_pts = finat.point_set.PointSet(ref_cell.make_points(2, 0, 4))%0A%0A    phys_cell = FIAT.ufc_simplex(2)%0A    phys_cell.vertices = ((0.0, 0.1), (1.17, -0.09), (0.15, 1.84))%0A%0A    mppng = MyMapping(ref_cell, phys_cell)%0A    z = (0, 0)%0A    finat_vals_gem = ref_element.basis_evaluation(0, ref_pts, coordinate_mapping=mppng)%5Bz%5D%0A    finat_vals = evaluate(%5Bfinat_vals_gem%5D)%5B0%5D.arr%0A%0A    phys_cell_FIAT = FIAT.Morley(phys_cell)%0A    phys_points = phys_cell.make_points(2, 0, 4)%0A    phys_vals = phys_cell_FIAT.tabulate(0, phys_points)%5Bz%5D%0A%0A    assert np.allclose(finat_vals, phys_vals.T)%0A

Add a test for Morley using the gem interpreter.