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

Find dof indices in a mixed function space

+1 vote

Hello
I have a mixed function space

V = VectorFunctionSpace(mesh, 'CG', 2)
W = FunctionSpace(mesh, 'CG', 1)
X = MixedFunctionSpace([V, W])

u = Function(X)

How can get the indices of the dofs in u corresponding to the space W ?

Thanks

asked Mar 26, 2014 by praveen FEniCS User (2,760 points)

1 Answer

+1 vote
 
Best answer

Hi, use

dofs_W = X.sub(1).dofmap().dofs()
print u.vector()[dofs_W].array()
answered Mar 26, 2014 by MiroK FEniCS Expert (80,920 points)
selected Mar 26, 2014 by praveen
...