- Thank you received: 0
Conjugate of a complex grid function solution
- BenWilson94
- Topic Author
- Offline
- Junior Member
Less
More
5 years 11 months ago #1341
by BenWilson94
Conjugate of a complex grid function solution was created 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
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
5 years 11 months ago #1345
by cwinters
Replied by cwinters on topic Conjugate of a complex grid function solution
Hi,
should work. You still get a complex as return value, but can use ".real" to get what you want.
Best,
Christoph
Code:
Integrate(InnerProduct(gfu,Conj(gfu)),mesh)
Best,
Christoph
Time to create page: 0.107 seconds