Conjugate of a complex grid function solution

More
5 years 11 months ago #1341 by BenWilson94
Hello,

I’m solving a PDE for which the solution is complex. In the post-processing, I would like to compute an integral over the domain involving the inner product of the solution and its complex conjugate integrated over the domain (for example as you would do when working out the L2 inner product).

I’ve tried the InnerProduct function integrated over the domain, but this returns a complex rather than a real value:

Integrate(InnerProduct(gfu,gfu),mesh)

I’ve tried

Integrate(InnerProduct(gfu,gfu.conjugate),mesh)

But it didn’t accept this I’ve also tried to define a new bilinear form, but it does not like the attribute .conjugate on the weight function.

Is there a simple solution to this problem?

Many thanks

Ben
More
5 years 11 months ago #1345 by cwinters
Hi,
Code:
Integrate(InnerProduct(gfu,Conj(gfu)),mesh)
should work. You still get a complex as return value, but can use ".real" to get what you want.

Best,
Christoph
Time to create page: 0.107 seconds