Results#

class ansys.dpf.core.results.Results(connector, result_info, mesh_by_default=True, server=None, generate_ops=True)#

Organizes the results from DPF into accessible methods.

All the available results are dynamically created base on the model’s class:’ResultInfo’ class.

displacement#

Result provider helper wrapping the regular displacement operator. With this wrapper, time and mesh scopings can easily be customized.

Type:

Result

Examples

Create a displacement result from the model and choose its time and mesh scopings.

>>> from ansys.dpf import core as dpf
>>> from ansys.dpf.core import examples
>>> model = dpf.Model(examples.find_msup_transient())
>>> disp = model.results.displacement.on_last_time_freq.on_named_selection("_CONSTRAINEDNODES")
>>> last_time_disp = disp.eval()
stressResult

Result provider helper wrapping the regular stress operator. With this wrapper, time and mesh scopings, location, and more can easily be customized.

Examples

Create a stress result from the model and choose its time and mesh scopings.

>>> from ansys.dpf import core as dpf
>>> from ansys.dpf.core import examples
>>> model = dpf.Model(examples.find_msup_transient())
>>> stress = model.results.stress.on_last_time_freq.on_named_selection('_CONSTRAINEDNODES')
>>> last_time_stress = stress.eval()
…. all other resultsResult

Result provider helper wrapping all types of providers available for a given result file.

Examples

>>> from ansys.dpf import core as dpf
>>> from ansys.dpf.core import examples
>>> model = dpf.Model(examples.find_electric_therm())
>>> v = model.results.electric_potential
>>> dissip = model.results.thermal_dissipation_energy

Examples

Extract the result object from a model.

>>> from ansys.dpf import core as dpf
>>> from ansys.dpf.core import examples
>>> model = dpf.Model(examples.find_simple_bar())
>>> results = model.results # printable object

Access the displacement at all times.

>>> from ansys.dpf.core import Model
>>> from ansys.dpf.core import examples
>>> transient = examples.download_transient_result()
>>> model = Model(transient)
>>> displacements = model.results.displacement.on_all_time_freqs.eval()

Overview#

__result__

Create and return a result of the specified type.

__str__

Return a string representation of the Results object.

__iter__

Iterate over the available results.

__getitem__

Access a result by index.

__len__

Return the number of results available.

Import detail#

from ansys.dpf.core.results import Results

Method detail#

Results.__result__(result_type, *args)#

Create and return a result of the specified type.

Parameters:
  • result_type (any) – The type of the result to generate.

  • *args (tuple) – Additional arguments required for creating the result.

Returns:

An instance of the Result class, providing access to the specified result.

Return type:

Result

Results.__str__()#

Return a string representation of the Results object.

Returns:

String description of the Results object.

Return type:

str

Results.__iter__()#

Iterate over the available results.

Yields:

Result – Each result dynamically added to the Results object.

Results.__getitem__(val)#

Access a result by index.

Parameters:

val (int) – The index of the result to retrieve.

Returns:

The result at the specified index.

Return type:

Result

Results.__len__()#

Return the number of results available.

Returns:

The number of results.

Return type:

int