fields.mixins.base.DFieldCoreMixin.zeros#

classmethod DFieldCoreMixin.zeros(*args, **kwargs) _SupDFieldCore[source]#

Create a dense field filled with zeros.

This is a convenience constructor that builds a zero-initialized FieldComponent using the provided grid and axes, then wraps it in a DenseField.

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 object filled with zeros and defined over the specified grid and axes.

Return type:

DenseField