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.

compute L2 error

More
3 years 8 months ago #3091 by wen jing
compute L2 error was created by wen jing
How to compute the error over a subdomain ?
More
3 years 8 months ago #3092 by hvwahl
Replied by hvwahl on topic compute L2 error
Hello Wen Jing,

have a Look at the tutorial on subdomains you see that bilinear forms use the `definedon` to determine which domain to act on If you look at the docstring of the Integrate function
Code:
help(Integrate)
you will see that is also has an optional Flag 'definedon' which you can use just as as in a BilinearForm to integrate over a subdomain.

Best wishes
Henry
More
3 years 8 months ago #3093 by wen jing
Replied by wen jing on topic compute L2 error
Thanks for your reply. I tried “ erru3 = sqrt( Integrate(errDD,mesh,order = 2*order, definedon=[2]) )” , but it doesn't seem to be able to use it that way.

TypeError: Integrate(): incompatible function arguments. The following argument types are supported:
More
3 years 8 months ago #3095 by hvwahl
Replied by hvwahl on topic compute L2 error
`definedon` expects a ngsolve.Region object (as stated in the docstring) so you need to give is something like mesh.Materials("region_name")
More
3 years 8 months ago #3097 by wen jing
Replied by wen jing on topic compute L2 error
Thanks for your help!

Best regards,
Wen jing
More
3 years 8 months ago #3105 by wen jing
Replied by wen jing on topic compute L2 error
We can compute the error of the subregion, so can we graph the solution on the subregion? If yes, could you give me a general idea? Looking for your reply, thanks!

Best regards,
Wen Jing
Time to create page: 0.155 seconds