This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Assembling multilinear form from two function spaces

+2 votes

Is it possible to assemble a multilinear form involving functions from different function spaces?
What I would like to do is something along these lines:

mesh = Mesh('mesh.xml')
bmesh = BoundaryMesh(mesh)
V = FunctionSpace(mesh, 'CG', 1)
V_b = FunctionSpace(bmesh, 'CG', 1)
f1 = TrialFunction(V)
f2 = TestFunction(V_b)
ml_form = f1 * f2 * ds
ml_tensor = assemble(ml_form)

where the integration is supposed to be carried out on the surface of the mesh (i.e. the ds of mesh, but the dx of bmesh), and the resulting tensor will not be square.

Is there a way to do this? Obviously the above code cannot work in this form...

asked Feb 5, 2014 by Nikolaus Rath FEniCS User (2,100 points)
edited Feb 25, 2014 by Nikolaus Rath

1 Answer

+2 votes
 
Best answer

Generally, yes, can assemble bilinear forms on $U \times V$ where $U$ and $V$ are different spaces, thus resulting in generally rectangular matrices. Nevertheless, for now you cannot currently combine different meshes in a single form. Removing this deficiency is one of highest priority of the developers.

answered Feb 5, 2014 by Jan Blechta FEniCS Expert (51,420 points)
edited Feb 5, 2014 by Jan Blechta

Jan, Is it possible to project one Function space into another one to assembler forms
with different meshes?

...