Hello,
I would like to compute the grad of a piecewise linear Lagrange FE function uh on each cell
and to use those values for some calculations.
W2 = VectorFunctionSpace(mesh, "DG", 0)
pgrad_u = project(grad(uh), W2)
How can I use the dofmap and the dof_cells to allocate the dofs on the cell and then the values of pgrad_u on that cell?
The following does not work:
dm = [W2.sub(i).dofmap() for i in range(2)]
for cell in cells(mesh):
for dms_i in enumerate(dms):
vdof1 = dms_i.cell_dofs(cell.index())
The error message is that
AttributeError: 'tuple' object has no attribute 'cell_dofs'
Can you please help me?
Thank you in advance,
Fotini