Hello
I have a multi-physics problem for which I am working with a mixed function space which combines 4 spaces. I create the space as follows:
V = VectorFunctionSpace(mesh, "CG", 1, dim=2)
P = FunctionSpace(mesh, "CG", 1, dim=1)
U = VectorFunctionSpace(mesh, "R", 0, dim=2)
L = VectorfunctionSpace(mesh, "R", 0, dim=2)
Then I find two syntaxes in FEniCS documentation for creating the space:
S = V * P * U * L
and
S = MixedFunctionSpace([V, P, U, L])
which one should be the better/more preferred alternative (if at all there is any such choice) ?
Additionally, now when I want to extract the sub-spaces and define the forms for the variational problem, are the following two syntaxes equivalent ?
s = Function(S)
(w,q,up,lp) = (as_vector(s[0],s[1]),s[2],as_vector(s[3],s[4]),as_vector(s[5],s[6])
and
(w,q,up,lp) = TrialFunctions(S)
Similarly, for the solver-variable, I was wondering whether the instantiation should be done as s=Function(S)
and then use s.split()
to extract the data.
These may sound like simple questions, however (and especially since I am a beginner in FEniCS), it will really be of great help if I can get some clarifications on these.
Thanks.