  This paper presents a novel method designed to generate multigrid solvers
optimized for octree-based software frameworks. Our approach focuses on
accurately capturing local features within a domain while leveraging the
efficiency inherent in multigrid techniques. We outline the essential steps
involved in generating specialized kernels for local refinement and
communication routines, integrating on-the-fly interpolations to seamlessly
transfer information between refinement levels. For this purpose, we
established a software coupling via an automatic fusion of generated multigrid
solvers and communication kernels with manual implementations of complex octree
data structures and algorithms often found in established software frameworks.
We demonstrate the effectiveness of our method through numerical experiments
with different interpolation orders. Large-scale benchmarks conducted on the
SuperMUC-NG CPU cluster underscore the advantages of our approach, offering a
comparison against a reference implementation to highlight the benefits of our
method and code generation in general.
