I am trying to simulate the complex ginzburg landau equation using a complex element. The PDE is a diffusion equation of a complex field with a complex diffusion equation and a non-linear term. I succeeded in simulating the system using two real fields (one for real part and the other for the complex part) but my simulation with a complex element didn’t agree with the simulation using two real spaces. The simulation uses a Laplacian and a non-linear operator which are here:
fes = ngsolve.H1(mesh, order=3, complex=True)
u, v = fes.TnT()
D_u = (1 + 1.j*alpha) # complex!
a = ngsolve.BilinearForm(fes, symmetric=True)
a += D_u*ngsolve.grad(u)*ngsolve.grad(v)*ngsolve.dx
# This is laplacian with a complex diffusion coef
# For the nonlinear part of the PDE, the function:
def mkgfun(fes,b_3):
gfun = ngsolve.BilinearForm(fes,nonassemble=True)
# don't assemble so nonlinear part can be updated!
gfun += u*v*ngsolve.dx
gfun += -1*(b_3 - 1.0j)*ngsolve.InnerProduct(ngsolve.Conj(u),u)*u*v*ngsolve.dx # Chate's form
return gfun
I assemble the non-linear operator gfun while doing the integration. The scheme for update is Crank Nicolson and then I add on the non-linear part by hand with first order explicit Eulerian op split. I am curious whether the multiplication with complex numbers is ok. Thank you!