Hi,
I have a basic question related to the old one of http://fenicsproject.org/qa/1216/linear-dependent-basis-function-on-fenics-formulations.
I can not understand the relationship of global functions of two different meshes on
the assembled system matrix. The code below illustrates my point.
from dolfin import *
mesh1 = UnitIntervalMesh(4)
mesh2 = UnitIntervalMesh(2)
V1 = FunctionSpace(mesh1, "CG", 2) # 9 Lagrange global functions of degree 2
V2 = FunctionSpace(mesh2, "CG", 1) # 3 Lagrange global functions of degree 1
V = V1 * V2
(u1, u2) = TrialFunctions(V)
v1 = TestFunction(V1)
a = (inner(grad(u1), grad(v1)) * dx) + (inner(grad(u2), grad(v1)) * dx)
A = assemble(a)
V1_dofs = V.sub(0).collapse(mesh1)[1].values()
V2_dofs = V.sub(1).collapse(mesh2)[1].values()
print 'V1 dofs = ', V1_dofs
print 'V2 dofs = ', V2_dofs
print 'A = ', A.array()
I would expect to find three V2 dofs associated with the functions of space V2. Mesh2 has
only 3 nodes. But there are five V2 dofs = [4, 2, 6, 9, 13]. There is no problem with
V1 dofs = [0, 1, 3, 5, 7, 8, 10, 11, 12]. There are 5 mesh nodes and
the midpoints of its elements. The assembled system matrix don't have 12 columns. I can t
understand it. Any help will be appreciated.
Thanks for availability.