Updating a function dependent on unknown vector

I want to update beta function which is dependent on a vector `bigphi’ (some RT1 function). bigphi is obtained after solving some linear eqns. But I am getting the error.

mesh = UnitSquareMesh(10,10)
x = SpatialCoordinate(mesh) 
RT1 = FiniteElement("RT", mesh.ufl_cell(), 1)
CG1 = FiniteElement("CG", mesh.ufl_cell(), 1)
mixed_A = MixedElement([RT1, CG1, RT1])
W_A = FunctionSpace(mesh, mixed_A)
(vpsi, vphi, vbigphi) = TestFunctions(W_A)
trials_1A = TrialFunction(W_A)
Sol_A = Function(W_A) 
(psi, phi, bigphi) = split(Sol_A)
(psi_1, phi_1, bigphi_1) = split(trials_1A)
def beta(bigphi):
  return dot(bigphi, bigphi)
A = inner(psi_1, vbigphi)*dx + div(vbigphi)*phi_1*dx
f = Expression(" 1 + sin (x[1] + x[0] - t )", degree = 2, t = 0)
b = inner(f, vphi)*dx
solve(A == b, Sol_A)
bigphi = Sol_A.split(2)
beta(bigphi)

Split does not take integers as input,

bigphi = Sol_A.split()[1]
beta(bigphi)
1 Like

I think its
bigphi = Sol_A.split()[2]

thank you … It works