Complex solver despite real input

Hello,

I am dealing with Maxwell equations and want to have a vector-valued electical field whose components are complex values [Ex,Ey,Ez]. The imaginary part of each of the three components corresponds to the phase phi, which is equal for all three components of the vector [Ex+1i*phi, Ey+1i*phi, Ez+1i*phi]. This allows to formulate the problem depending on four real inputs Ex,Ey,Ez,phi but requires a complex solver due to appearing imaginary i’s within the integrals. They appear due to the product rule as (dx(Ex)+1i*Ex*dx(phi))*exp(1i*phi). Is it possible to define a complex solver without complex inputs and correspondingly non-complex fespace? And how do I have to deal with the separation of Ex*dx(phi), since from my understanding Ex and dx(phi) are not allowed as product in a single integral?

Thanks in advance!

I think you can just define the two groups of FE spaces, once corresponding to real parts, and the other to imaginary ones, and work out the complex operations by hand, i.e., exp(1iphi)=cos(phi) + 1isin(phi).