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.

Attributes

data: str#

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, optional#

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

Default:

None

include: list[str], optional#

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.

Default:

None

exclude: list[str], optional#

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.

Default:

None

operations: list[Average | Expression | GetAttribute], optional#

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

Default:

None

variables: list[Variable], optional#

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

Default:

None

Additional Constructors

classmethod from_file(filename)#

Load a Flow360BaseModel from a .json file.

Parameters:

filename (str)

Return type:

Flow360BaseModel

Methods

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

help(methods=False)#

Print fields and methods of a Flow360BaseModel using rich.

Parameters:

methods (bool)

Return type:

None

to_file(filename, **kwargs)#

Export Flow360BaseModel instance to a .json file.

Parameters:
Return type:

None