ansys.dpf.core.ResultInfo#

class ansys.dpf.core.ResultInfo(result_info=None, server=None, analysis_type: analysis_types = None, physics_type: physics_types = None)#

Represents the result information.

This class describes the metadata of the analysis and the available results.

Note

Creating a new ResultInfo from an analysis type and physics type is currently only available InProcess.

Parameters:
  • result_info (ctypes.c_void_p, ansys.grpc.dpf.result_info_pb2.ResultInfo) – Existing ResultInfo internal object

  • server (ansys.dpf.core.server, optional) – Server with the channel connected to the remote or local instance. The default is None, in which case an attempt is made to use the global server.

  • analysis_type (analysis_types) – Type of the analysis for a new ResultInfo.

  • physics_type (physics_types) – Type of physics for the new ResultInfo.

Examples

Explore the result info from the model

>>> from ansys.dpf import core as dpf
>>> from ansys.dpf.core import examples
>>> transient = examples.download_transient_result()
>>> model = dpf.Model(transient)
>>> result_info = model.metadata.result_info # printable result_info
>>> result_info.available_results[0].name
'displacement'
>>> result_info.available_results[0].homogeneity
'length'
_server#
_api#
__str__()#

Return a string representation of the instance providing detailed information.

property _description#
property _names#
__contains__(value)#

Check if a given name is present in available results.

add_result(operator_name: str, scripting_name: str, homogeneity: ansys.dpf.core.available_result.Homogeneity, location: ansys.dpf.core.common.locations, nature: ansys.dpf.core.dimensionality.natures, dimensions: List[int] | None = None, description: str = '')#

Add an available result to the ResultInfo.

Note

Adding a new result to a ResultInfo is currently only available InProcess.

Parameters:
  • operator_name – Name of the DPF operator to use for result extraction.

  • scripting_name – Name to use when requesting the result.

  • homogeneity – Homogeneity of the result.

  • location – Location of the result.

  • nature – Mathematical nature of the result (scalar, vector…).

  • dimensions – List of dimensions of the result when vector or matrix. Enter [N] for an N-size vector result. Enter [N, M] for a rank-2, NxM matrix result. For example: * [3]: 3d vector * [3, 3]: 3 x 3 matrix

  • description – Description of the result.

property analysis_type#

Retrieves the analysis type.

Returns:

analysis_type – Type of the analysis, such as static or transient.

Return type:

str

Examples

>>> from ansys.dpf import core as dpf
>>> from ansys.dpf.core import examples
>>> transient = examples.download_transient_result()
>>> model = dpf.Model(transient)
>>> result_info = model.metadata.result_info
>>> result_info.analysis_type
'static'
property physics_type#

Type of the physics.

Examples

Mechanical result

>>> from ansys.dpf import core as dpf
>>> from ansys.dpf.core import examples
>>> transient = examples.download_transient_result()
>>> model = dpf.Model(transient)
>>> result_info = model.metadata.result_info
>>> result_info.physics_type
'mechanical'
_get_physics_type()#

Return the physics type associated with the result.

Returns:

physics_type – Type of the physics, such as mechanical or electric.

Return type:

str

property n_results#

Number of results.

property unit_system#

Unit system of the result.

property cyclic_symmetry_type#

Cyclic symmetry type of the result.

Returns:

cyclic_symmetry_type – Cyclic symmetry type of the results. Options are "single_stage", "multi_stage", and "not_cyclic".

Return type:

str

property has_cyclic#

Check the result file for cyclic symmetry.

Returns:

has_cyclic – Returns True if the result file has cyclic symmetry or is multistage.

Return type:

bool

property cyclic_support#

Cyclic expansion information for a result file that has cyclic symmetry or is multistage.

Returns:

cyclic_support

Return type:

CyclicSupport

Examples

Get a cyclic support from a model.

>>> from ansys.dpf.core import Model
>>> from ansys.dpf.core import examples
>>> multi_stage = examples.download_multi_stage_cyclic_result()
>>> model = Model(multi_stage)
>>> result_info = model.metadata.result_info
>>> cyc_support = result_info.cyclic_support
property unit_system_name#

Name of the unit system.

property solver_version#

Version of the solver.

property solver_date#

Date of the solver.

property solver_time#

Time of the solver.

property user_name#

Name of the user.

property job_name#

Name of the job.

property product_name#

Name of the product.

property main_title#

Main title.

property available_results#

Available results, containing all information about results present in the result files.

Returns:

available_result

Return type:

list[AvailableResult]

property _data_processing_core_api#
_get_result(numres)#

Return requested result.

Parameters:

numres (int) – Index of the requested result.

Returns:

result

Return type:

available_result.AvailableResult

property available_qualifier_labels#

Returns a list of labels defining result qualifiers.

Return type:

list[str]

Notes

Available with server’s version starting at 5.0.

qualifier_label_support(label)#

Return what supports an available qualifier label.

Parameters:

label (str)

Return type:

Support

Notes

Available with server’s version starting at 5.0.

__len__()#

Return the number of results available.

If an exception occurs while attempting to retrieve the number of results, the method returns 0.

Returns:

The number of results, or 0 if an error occurs.

Return type:

int

__iter__()#

Return an iterator over the results.

__getitem__(key)#

Retrieve a result by index or name.

Raises:
  • ValueError – If the key is a string and not found in the result names.

  • TypeError – If the key is not an integer or string.

__del__()#

Clean up resources associated with the instance.

This method calls the deleter function to release resources. If an exception occurs during deletion, a warning is issued.

Raises:

Warning – If an exception occurs while attempting to delete resources.