← Back to team overview

ufl team mailing list archive

Re: [Question #219998]: unconventional linear and bilinear forms

 

Question #219998 on UFL changed:
https://answers.launchpad.net/ufl/+question/219998

    Status: Open => Answered

Marie Rognes proposed the following answer:

Yes, this is perfectly feasible and  not so unconventional (at least for moderate n): Here's some suggested DOLFIN code (replace VectorFunctionSpace with VectorElement etc to get UFL) 

from dolfin import *
mesh = UnitIntervalMesh(20)

n = 30
V = VectorFunctionSpace(mesh, "CG", 1, dim=n)
u = TrialFunction(V)
v = TestFunction(V)

a = inner(u, v)*dx

Q = FunctionSpace(mesh, "DG", 0)
f = Function(Q)
A = as_matrix([[f for i in range(n)] for i in range(n)])

a = inner(A*u, v)*dx

-- 
You received this question notification because you are a member of UFL
Team, which is an answer contact for UFL.