ResultInfo#

class ansys.dpf.core.result_info.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'

Overview#

add_result

Add an available result to the ResultInfo.

qualifier_label_support

Return what supports an available qualifier label.

analysis_type

Retrieves the analysis type.

physics_type

Type of the physics.

n_results

Number of results.

unit_system

Unit system of the result.

cyclic_symmetry_type

Cyclic symmetry type of the result.

has_cyclic

Check the result file for cyclic symmetry.

cyclic_support

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

unit_system_name

Name of the unit system.

solver_version

Version of the solver.

solver_date

Date of the solver.

solver_time

Time of the solver.

user_name

Name of the user.

job_name

Name of the job.

product_name

Name of the product.

main_title

Main title.

available_results

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

available_qualifier_labels

Returns a list of labels defining result qualifiers.

__str__

Return a string representation of the instance providing detailed information.

__contains__

Check if a given name is present in available results.

__len__

Return the number of results available.

__iter__

Return an iterator over the results.

__getitem__

Retrieve a result by index or name.

__del__

Clean up resources associated with the instance.

Import detail#

from ansys.dpf.core.result_info import ResultInfo

Property detail#

property ResultInfo.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 ResultInfo.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'
property ResultInfo.n_results#

Number of results.

property ResultInfo.unit_system#

Unit system of the result.

property ResultInfo.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 ResultInfo.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 ResultInfo.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 ResultInfo.unit_system_name#

Name of the unit system.

property ResultInfo.solver_version#

Version of the solver.

property ResultInfo.solver_date#

Date of the solver.

property ResultInfo.solver_time#

Time of the solver.

property ResultInfo.user_name#

Name of the user.

property ResultInfo.job_name#

Name of the job.

property ResultInfo.product_name#

Name of the product.

property ResultInfo.main_title#

Main title.

property ResultInfo.available_results#

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

Returns:

available_result

Return type:

list[AvailableResult]

property ResultInfo.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.

Method detail#

ResultInfo.__str__()#

Return a string representation of the instance providing detailed information.

ResultInfo.__contains__(value)#

Check if a given name is present in available results.

ResultInfo.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.

ResultInfo.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.

ResultInfo.__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

ResultInfo.__iter__()#

Return an iterator over the results.

ResultInfo.__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.

ResultInfo.__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.