Block-Structured AMR

For my class on numerical methods for partial differential equations, my final project involved an implementation of Adaptive Mesh Refinement (AMR) in two dimensions. Having done a good bit of AMR in the past, I thought this would be fairly straightforward, but it turned out to be waaaaaaaay more complex than I expected. For such a straightforward idea, the amount of code that goes under the hood of AMR is staggering. My implementation was for the axisymmetric vorticity equations in polar coordinates.

An example simulation of an arbitrary initial field. Note the blocks and refined areas of the grid follow the deforming flow such that computational importance is centered on regions where it is most necessary.

I’m happy to report the code worked swimmingly. The level management and patch allocation/reallocation functioned as intended. With more levels, the computation accelerated without increasing computational cost quadratically.

The full project is available on this Github . There are more cool videos here, which are always fun to watch. In the future, I may continue to update this to improve the AMR procedure or expand to more complex problems.

My project report is available here and my presentation is here . This was also the first time making a presentation in PowerPoint and not Google Slides, and oh boy, I will never go back.