(Deleted) Finding dof indices corresponding to split and mixed FEM space?


15
views
0
5 weeks ago by
medaka  
I'm trying to extract a dof map from a mixed FEM space which the code below. It is not clear how the ordering of the u/u2 sol split extracts the solution components. That is, the dofinds pointers point to the whole sol vector (pointers whith values from 0 to n_dof(E0)+n_dof(E1)), and even taking unique(dofinds) does not match up with the ordering of in the extracted u vector. How can I get the actual global dof numbering corresponding to the u solution component (with corresponding dof coordinates)?

E0 = FiniteElement("P", mesh.ufl_cell(), 1)
E1 = FiniteElement("P", mesh.ufl_cell(), 2)
V = FunctionSpace(mesh, MixedElement([E1, E0]))
sol = Function(V)

# ...

import numpy as np
u, u2 = sol.split(deepcopy=True)
element = V.sub(0).element()
dofmap  = V.sub(0).dofmap()
coords  = np.empty([0, 2], dtype="float64")
dofinds   = np.empty([], dtype="int32")
for cell in cells(mesh):
    coords = np.vstack((coords, element.tabulate_dof_coordinates(cell)))
    dofinds  = np.hstack((cinds, dofmap.cell_dofs(cell.index())))​
Community: FEniCS Project
Please login to add an answer/comment or follow this question.
The thread is closed. No new answer/comment may be added.

Similar posts:
Search »
  • Nothing matches yet.