  This contribution introduces the idea of refinement patterns for the
generation of optimal meshes in the context of the Finite Element Method. The
main idea is to generate a library of possible patterns on which elements can
be refined and use this library to inform an h adaptive code on how to handle
complex refinements in regions of interest. There are no restrictions on the
type of elements that can be refined, and the patterns can be generated for any
element type. The main advantage of this approach is that it allows for the
generation of optimal meshes in a systematic way where, even if a certain
pattern is not available, it can easily be included through a simple text file
with nodes and sub-elements. The contribution presents a detailed methodology
for incorporating refinement patterns into h adaptive Finite Element Method
codes and demonstrates the effectiveness of the approach through mesh
refinement of problems with complex geometries.
