fields.mixins.components.FieldComponentCoreMixin.reshape_element#

FieldComponentCoreMixin.reshape_element(new_element_shape: Sequence[int], *args, **kwargs) _SupFCCore[source]#

Reshape the element-wise portion of the buffer (i.e., trailing dimensions) to a new shape.

This allows for reshaping vector/tensor field components, while keeping the spatial shape and axes unchanged.

Parameters:
  • new_element_shape (sequence of int) – The new shape of the element-wise (non-spatial) portion of the buffer.

  • *args – Forwarded to the buffer’s reshape method.

  • **kwargs – Forwarded to the buffer’s reshape method.

Returns:

A new field component with reshaped element dimensions.

Return type:

FieldComponent

Raises:

ValueError – If the total number of elements is incompatible with the original buffer shape.