pystencils.field.Field.create_from_numpy_array

pystencils.field.Field.create_from_numpy_array#

static Field.create_from_numpy_array(field_name, array, index_dimensions=0, field_type=FieldType.GENERIC)#

Creates a field based on the layout, data type, and shape of a given numpy array.

Kernels created for these kind of fields can only be called with arrays of the same layout, shape and type.

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

  • array (ndarray) – numpy array

  • index_dimensions (int) – see documentation of Field

  • field_type – kind of field

Return type:

Field