  Adaptive Mesh Refinement (AMR) enhances the Finite Element Method, an
important technique for simulating complex problems in engineering, by
dynamically refining mesh regions, enabling a favorable trade-off between
computational speed and simulation accuracy. Classical methods for AMR depend
on heuristics or expensive error estimators, hindering their use for complex
simulations. Recent learning-based AMR methods tackle these issues, but so far
scale only to simple toy examples. We formulate AMR as a novel Adaptive Swarm
Markov Decision Process in which a mesh is modeled as a system of simple
collaborating agents that may split into multiple new agents. This framework
allows for a spatial reward formulation that simplifies the credit assignment
problem, which we combine with Message Passing Networks to propagate
information between neighboring mesh elements. We experimentally validate our
approach, Adaptive Swarm Mesh Refinement (ASMR), on challenging refinement
tasks. Our approach learns reliable and efficient refinement strategies that
can robustly generalize to different domains during inference. Additionally, it
achieves a speedup of up to $2$ orders of magnitude compared to uniform
refinements in more demanding simulations. We outperform learned baselines and
heuristics, achieving a refinement quality that is on par with costly
error-based oracle AMR strategies.
