pystencils.field.Field.create_fixed_size

pystencils.field.Field.create_fixed_size#

static Field.create_fixed_size(field_name, shape, index_dimensions=0, dtype=DynamicType.NUMERIC_TYPE, layout='numpy', memory_strides=None, strides=None, field_type=FieldType.GENERIC)#

Creates a field with fixed sizes i.e. can be called only with arrays of the same size and layout.

Parameters:
  • field_name (str) – symbolic name for the field

  • shape (tuple[int, ...]) – overall shape of the array

  • index_dimensions (int) – how many of the trailing dimensions are interpreted as index (as opposed to spatial)

  • dtype (str | type | dtype | PsType | DynamicType) – numpy data type of the array the kernel is called with later

  • layout (str | tuple[int, ...]) – full layout of array, not only spatial dimensions

  • memory_strides (Optional[Sequence[int]]) – Linearization strides for each dimension; i.e. the number of elements to skip to get from one index to the next in the respective dimension.

  • field_type – kind of field

  • strides (None | Sequence[int])

Return type:

Field