Hi,
I slightly modified the timeDG-skeleton.py example and implemented the theta-method (and a slightly different convection vector). As a check, I took theta=0 so that my implementation is again an Euler method. I now compare the norm of the final solution of my code with the norm of the final solution of the timeDG-skeleton.py code. In my code: 24.5994557645812. In the timeDG-skeleton.py code: 25.21957468067155. I was wondering if this has to do with the solvers: I'm using Inverse instead of SolveM and I'm not sure if these are direct solvers of iterative solvers with some tolerance?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
the difference comes from numerical integration. Split the BFI (uv + b u grad(v)) into two seperate ones, and you get the same result.
NGSolve proposes to use the integration order of order(Trial) + order(Test), and reduces by the order of the differential operator (on simplicial elements).
So, on the space of order 4, it uses intorder=8 for uv, but only intorder=7 for u grad(v).
If you combine terms, it uses the maximal order for both.
Hi,
I slightly modified the timeDG-skeleton.py example and implemented the theta-method (and a slightly different convection vector). As a check, I took theta=0 so that my implementation is again an Euler method. I now compare the norm of the final solution of my code with the norm of the final solution of the timeDG-skeleton.py code. In my code: 24.5994557645812. In the timeDG-skeleton.py code: 25.21957468067155. I was wondering if this has to do with the solvers: I'm using
Inverse
instead ofSolveM
and I'm not sure if these are direct solvers of iterative solvers with some tolerance?Attached the slightly modified timeDG-skeleton.py code
And my implementation of the theta-method.
thanks,
Sander
Hi Sander,
the difference comes from numerical integration. Split the BFI (uv + b u grad(v)) into two seperate ones, and you get the same result.
NGSolve proposes to use the integration order of order(Trial) + order(Test), and reduces by the order of the differential operator (on simplicial elements).
So, on the space of order 4, it uses intorder=8 for uv, but only intorder=7 for u grad(v).
If you combine terms, it uses the maximal order for both.
Here you find how to use your own integration-rule:
https://ngsolve.org/news/new-features/3-specify-integrationrule
or select a predefined via IntegrationRule(TRIG,10)
Joachim
Thanks - I indeed now get the same!
Sander