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

Extract degree and family from VectorFunctionSpace

+1 vote

Say I have a dolfin's VectorFunctionSpace. How can I assess its degree and element type for further use?

import dolfin
mesh = dolfin.UnitSquareMesh(10,10)
V = dolfin.VectorFunctionSpace(mesh, 'CG', 1)

# How to get 'CG' and degree=1 back ....
asked Apr 8, 2014 by Jan FEniCS User (8,290 points)

1 Answer

+3 votes
 
Best answer
V.ufl_element().degree()
V.ufl_element().family()
answered Apr 8, 2014 by mikael-mortensen FEniCS Expert (29,340 points)
selected Apr 8, 2014 by Jan
...