# UFL-file to test sums in as_matrix or as_vector # Compile this form with FFC: ffc -l dolfin as_matrix.ufl def test_vector(u): return as_vector([ u[0]+u[1], u[1] ]) def test_matrix(u): return as_matrix([[ u[0]+u[1], u[1] ]]) element = VectorElement("Lagrange", triangle, degree=1, dim=2) # test and trial functions u = TrialFunction(element) v = TestFunction(element) # variational problem: Linear form L = inner( test_vector(u), test_vector(v) ) * dx #L = inner( test_matrix(u), test_matrix(v) ) * dx