PDE Toolbox extremely slow for cases with many boundaries
9 views (last 30 days)
Show older comments
We are writing some code using the PDE toolbox. Our domain is generated programmatically, and has many boundary edges. This is causing the PDE solver to execute extremely slowly. Based on the profiler, the issue is that the meshToPet function is being called for every boundary edge each iteration, even though the mesh boundaries never change.
Here is the output from top level of the profiler:

Here is the next level down showing how mshToPet is causing the slowdown.

The fix to pde3DBCImpl.generateBoundaryFacetData seems very simple. I can just call mshToPet once before the loop over all the boundaries, and cache the output.
Here is the question/issue:
- I don't have write permissions to the PDEToolbox folder files. How can I edit that class method to test/implement my fix?
- Is there a way to shadow that Toolbox class method with a local implementation so that we don't need to edit the base toolbox code?
- I could make my own derived class to replace @pde3DBCImpl, but then I would also need to change all the other PDE toolbox classes up the chain to call my custom method.
3 Comments
Ravi Kumar
on 12 Apr 2024
Thanks, Alex! When I investigated this issue, I was looking at the transient cases. I will investigate the nonlinear solver case.
Regards,
Ravi
Answers (0)
See Also
Categories
Find more on PDE Solvers in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!