(points, cells)
| 25 | |
| 26 | # Create simple triangle mesh |
| 27 | def perform_test(points, cells): |
| 28 | domain = ufl.Mesh(element("Lagrange", "triangle", 1, shape=(2,), dtype=default_real_type)) |
| 29 | mesh = create_mesh(MPI.COMM_WORLD, cells, domain, points) |
| 30 | V = functionspace(mesh, (space_type, order)) |
| 31 | f = Function(V) |
| 32 | x = f.x.array |
| 33 | output = [] |
| 34 | for dof in range(len(x)): |
| 35 | x[:] = 0.0 |
| 36 | x[dof] = 1 |
| 37 | points = np.array([[0.5, 0.5, 0], [0.5, 0.5, 0]]) |
| 38 | cells = np.array([0, 1]) |
| 39 | result = f.eval(points, cells) |
| 40 | normal = np.array([-1.0, 1.0]) |
| 41 | output.append(result.dot(normal)) |
| 42 | return output |
| 43 | |
| 44 | points = np.array([[0, 0], [1, 0], [1, 1], [0, 1]], dtype=default_real_type) |
| 45 | cells = np.array([[0, 1, 2], [2, 3, 0]]) |
no test coverage detected