diff --git a/src/ansys/dpf/core/outputs.py b/src/ansys/dpf/core/outputs.py index 9034fc1eaa0..68299336b8e 100644 --- a/src/ansys/dpf/core/outputs.py +++ b/src/ansys/dpf/core/outputs.py @@ -112,6 +112,9 @@ def _get_given_output(self, input_type_name): corresponding_pins.append(pin) return corresponding_pins + def __getitem__(self, index): + return self._outputs[index] + def __str__(self): docstr = "Available outputs:\n" for output in self._outputs: diff --git a/src/ansys/dpf/core/results.py b/src/ansys/dpf/core/results.py index 41d6ffa7adf..697f81060e7 100644 --- a/src/ansys/dpf/core/results.py +++ b/src/ansys/dpf/core/results.py @@ -263,7 +263,12 @@ def eval(self): >>> fc = disp.on_all_time_freqs.eval() """ - fc = self.__call__().outputs.fields_container() + outputs = self.__call__().outputs + if hasattr(outputs, "fields_container"): + fc = outputs.fields_container() + else: + # Support operators where the first output is not named "field_container" + fc = outputs[0]() if self._specific_fc_type == "shape": fc = ElShapeFieldsContainer(fields_container=fc._get_ownership(), server=fc._server) elif self._specific_fc_type == "body":