Hi, I have some problems with the definition of mixed functional space and I’m doing wrong something about the code. I need a mixed functional space with elements like [u,F_v1,…F_vn] where u is a vector in 2D and Fv_i are 2x2 tensors.
from dolfin import *
from mshr import*
import ufl
from ufl import ln
import numpy as np
u_build=VectorElement(‘P’,mesh.ufl_cell(),1,2)
Fv_build=TensorElement(‘P’,mesh.ufl_cell(),1)
elements_build=[u_build]
only_viscous_def=
for i in range(n_kelvin):
elements_build.append(Fv_build)
only_viscous_def.append(Fv_build)
TypeError: \ When constructing an Argument, TestFunction or TrialFunction, you
must to provide a FunctionSpace and not a FiniteElement. The
FiniteElement class provided by ufl only represents an abstract finite
element space and is only used in standalone .ufl files, while the
FunctionSpace provides a full discrete function space over a given
mesh and should be used in dolfin programs in Python.
You have not followed my advice of making a minimal, reproducible example that one can copy-paste and get your error message. Therefore, I cannot help you further.