flow360.report.DataItem#

class DataItem#

Bases: Flow360BaseModel

Represents a retrievable data item that can be post-processed.

The DataItem class retrieves data from a specified path within a Case and allows for:
  • Excluding specific boundaries (if applicable).

  • Applying one or more post-processing operations (e.g., mathematical expressions, averaging). Averaging should be applied as the last expression, accessing variables through /averages in path will automatically append an averaging operation to the objectโ€™s operations.

  • Introducing additional variables for use in these operations.

data: str [Required]#

Path to the data item to retrieve from a Case. The path can include nested attributes and dictionary keys (e.g., โ€œresults.surface_forcesโ€).

title: str | None = None#

A human-readable title for this data item. If omitted, the title defaults to the last component of the data path.

include: List[str] | None = None#

Boundaries to be included in the retrieved data (e.g., certain surfaces). Only applicable to some data types, such as surface forces or slicing force distributions.

exclude: List[str] | None = None#

Boundaries to be excluded from the retrieved data (e.g., certain surfaces). Only applicable to some data types, such as surface forces or slicing force distributions.

operations: List[OperationTypes] | None = None#

A list of operations to apply to the retrieved data. Supported operations include: Expression and Average.

variables: List[Variable] | None = None#

Additional user-defined variables that may be referenced in the Expression operations.

type_name: Literal['DataItem'] = 'DataItem'#
calculate(case, cases)#

Calculates the DataItem values based on specified operations.

Parameters:
  • case (Case) โ€“ The target case for which the delta is calculated.

  • cases (List[Case]) โ€“ A list of available cases, including the reference case.

Returns:

The computed data array.

Return type:

float