Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

Conjugate of a complex grid function solution

More
5 years 4 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 4 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.134 seconds