Skip to content

Field class should remember its entire memory layout

Currently, the Field class only remembers the order of its spatial dimensions in its layout property, but forgets about its index dimensions. As a consequence, whether a field was created with fzyx or zyxf layout specification cannot be determined later on. This should be fixed, since the order of all dimensions can be crucial information for a runtime system.

Proposition

  • Deprecate and later remove the layout property (it has always had a misleading name).
  • Introduce something like a spatial_axes_order with the same semantics, meaning it holds the iteration order of the spatial dimensions. The spatial_axes_order can translate directly to the loop order (for CPU) or thread index translation order (for GPU).
  • In addition, introduce the more general axes_order property which describes the linearization order of all dimensions, spatial and index. This information is required when inferring and checking mappings of fields onto array data structures, such as std::mdspan in pystencils-sfg, or waLBerla fields.
Edited by Frederik Hennig