In solving for magnetic potential for a cylinder, we need to solve a Poisson Equation for each component.Suppose the results are Ax, Ay and Az.How can we combine them as a vector.I have used
# Plotting
Vp = VectorFunctionSpace(mesh_tot,'P',1)
A_tot = project(as_vector(Ax,Ay,Az),Vp)
vtkfile = File('Vectorpotential.pvd')
vtkfile << A_tot
But this gives the following error:
Expecting a single Index object.
Traceback (most recent call last):
File “/home/fenics/shared/Cylinder/cylinder_dokken.py”, line 80, in
A_tot = project(as_vector((Ax,Ay,Az),Vp))
File “/usr/local/lib/python3.6/dist-packages/ufl/tensors.py”, line 318, in as_vector
error(“Expecting a single Index object.”)
File “/usr/local/lib/python3.6/dist-packages/ufl/log.py”, line 172, in error
raise self._exception_type(self._format_raw(*message))
ufl.log.UFLException: Expecting a single Index object
Can someone point me towards a better way of doing it?