v= perp(u) gives also a ufl tensor instead of a dolfin function. So it is the same as
v = as_vector(-u[1], u[0]])
I also tried FunctionAssigner like explained here but for Nedelec or RT element which are vector element by construction I don’t see how to access the components of the FunctionSpace, I try something like
N1 = FiniteElement(‘RTE’, cell=‘triangle’, degree=1)
FN1 = FunctionSpace(mesh,N1)
FN10 = FN1.extract_sub_space([0])
but it does not seem to work.
RuntimeError Traceback (most recent call last)
in
18 #v = as_vector([u[1], -u[0]])
19 #w=perp(u)
—> 20 FN10 = FN1.extract_sub_space([0])
/anaconda3/envs/fenicsproject/lib/python3.7/site-packages/dolfin/function/functionspace.py in extract_sub_space(self, component)
204
205 def extract_sub_space(self, component):
→ 206 V = self._cpp_object.extract_sub_space(component)
207 return FunctionSpace(V)
208
RuntimeError:
*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
****** fenics-support@googlegroups.com
****** Remember to include the error message listed below and, if possible,
*** include a minimal running example to reproduce the error.
****** -------------------------------------------------------------------------
*** Error: Unable to extract subsystem of finite element.
*** Reason: There are no subsystems.
*** Where: This error was encountered inside FiniteElement.cpp.
*** Process: 0
*** *** DOLFIN version: 2019.1.0
*** Git changeset:
*** -------------------------------------------------------------------------