fields.mixins.components.FieldComponentCoreMixin.zeros#

classmethod FieldComponentCoreMixin.zeros(grid: GridBase, axes: Sequence[str], *args, element_shape: Sequence[int] | None = None, buffer_class: Type[_SupFCCore] | None = None, buffer_registry: BufferRegistry | None = None, **kwargs) _SupFCCore[source]#

Create a component filled with zeros.

This is a convenience constructor that builds a zero-initialized FieldComponent.

Parameters:
  • grid (GridBase) – The structured grid over which the field is defined.

  • axes (list of str) – The spatial axes of the underlying coordinate system over which the field is defined. This must be some subset of the axes available in the coordinate system of grid.

  • *args – Additional positional arguments forwarded to the buffer constructor. The specific available args will depend on buffer_class and buffer_registry.

  • element_shape (tuple of int, optional) – Shape of the element-wise data structure (e.g., vector or tensor dimensions). This does not include the spatial shape, which is fixed by the grid. The resulting buffer will have an overall shape of (*spatial_shape, *element_shape).

  • buffer_class (str or BufferBase, optional) –

    The buffer class to use for holding the data. This may be specified as a string, in which case the buffer_registry is queried for a matching class or it may be a specific buffer class.

    The relevant *args and **kwargs arguments will be passed underlying buffer class’s .zeros() method.

  • buffer_registry (BufferRegistry, optional) – Custom registry to use for resolving buffer class strings. By default, the standard registry is used.

  • **kwargs – Additional keyword arguments forwarded to the buffer constructor (e.g., dtype, units).

Returns:

A new field component filled with zeros and defined over the specified grid and axes.

Return type:

FieldComponent