Hi I was trying to understand what the difference between the two splits. In particular I would really appreciate an example of different use cases.
For example if I have the following:
U2 = ufl.VectorElement("Lagrange", domain.ufl_cell(), 2) # For displacement
P1 = ufl.FiniteElement("Lagrange", domain.ufl_cell(), 1) # For pressure
TH = ufl.MixedElement([U2, P1]) # Taylor-Hood style mixed element
ME = FunctionSpace(domain, TH) # Total space for all DOFs
w = Function(ME)
I understand u, p = split(w) would give me the functions for the two subelements
However I don’t understand what u, p = w.split() would output.
Can Function.split() and split(Function) all be used to assemble the bilinear form and linear form in variational formulation?
The reason why I guess this is that in my code, both methods can work.
You should not use Function.split() in a variational form. ufl.split should be used in variational forms. Function.split should be used for interpolation etc.