concatenate scalar Functions together to one VectorFunction

Asked by Nico Schlömer

I'm solving a complex-valued problem for which there is no straighforward support in Dolfin, but where you have to take the real and imaginary part of your equations apart. This works well and gives me the real and imaginary part of the solution, phi_r and phi_i.
For plotting them out to a file, what I do is

f = File('phi.pvd')
f << phi_r
f << phi_i

which treats phi_r and phi_i as different (time) steps. Ideally, I'd write out phi_r and phi_i as one state, much like VectorFunctions are treated.
Is there a way to concatenate phi_r and phi_i?

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Nico Schlömer
Solved:
Last query:
Last reply:
Revision history for this message
Nico Schlömer (nschloe) said :
#1

Okay , so it turns out that when phi is in V*V (with, e.g., V=FunctonSpace(mesh, 'CG', 1)),

File('test.pvd') << phi

will write out phi to the coordinates X and Y; Z is set to 0 overall.
While the latter is probably unnecessary, this is working alright.