(Deleted) Convert a dolfin function into a ufl tensor
I am working on an elasticity problem which has more than 1 unknown type, i.e. 2 vectors and 2 single value scalars. Since MixedFunctionSpace got deprecated, I have had to use the below workaround:
# Old version (before fenics 2.0) gives dolfin functions: Vp = FunctionSpace(mesh, "CG", 1) Vu = VectorFunctionSpace(mesh, "CG", 1) V = MixedFunctionSpace([Vu, Vu, Vp, Vp]) # New version (suggested in the forums) gives ufl tensors: p = 1 V_ele = VectorElement("CG", mesh.ufl_cell(), p) F_ele = FiniteElement("CG", mesh.ufl_cell(), p) V = FunctionSpace(mesh, MixedElement([V_ele, V_ele, F_ele, F_ele]))
This has been working fine so far, but now I need to do operations like + between the ufl tensors from above and dolfin functions which gives me this error:
unsupported operand type(s) for +: 'Product' and 'Form'
which makes sense. What I need is another workaround to MixedFunctionSpace that allows me to use functions, and not ufl tensors, or a way to convert my dolfin functions into ufl tensors and vice versa. Any help would be much appreciated.