Accessing Results

The Solution object is the entry point for browsing the contents of a result file (see Loading the Results File). It also provides access to the results themselves. These are contained in Result objects that can be returned from dedicated methods:

Instantiate the solution object

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.multishells_rst)

Instantiate a displacement result object

>>> displacement = solution.displacement()
>>> # stress, elastic_strain (...) can also be called.

Refer to the list below to know which result object can be
instantiated.

A number of options, formulated as keyword arguments, can be used to further specify the result type, scope, and time, among others. For detailed examples see ANSYS DPF-POST Use result keywords.

At present, DPF-Post supports two types of result files:

  • Structural (*.rst)

  • Thermal/Electric (*.rth)

Once loaded into the Solution instance, a result file will offer its own variety of Result objects in accordance with its type.

Only request results types that are available in the file. To verify their presence see Browsing Result Metadata.

Structural (*.rst) result files

Upon loading a Solution object from a structural analysis results file (*.rst), the following Result objects may be queried:

  • displacement

  • stress

  • elastic_strain

  • plastic_strain

  • structural_temperature

Displacement

Displacement is the DOF solution for structural analyses. Its Result object can be obtained as follows:

Instantiate the solution object

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.multishells_rst)

Instantiate the displacement result object

>>> displacement = solution.displacement()

Being a DOF solution, its location argument must be nodal (inferred above).

The displacement Result corresponds to a vector field. To obtain the scalar components of this field, e.g., y-components, access the following subresult:

Instantiate the solution object

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.multishells_rst)

Instantiate the displacement result object

>>> displacement = solution.displacement()

Get the y displacement result data

>>> u_y = displacement.y
>>> u_y.get_data_at_field()

For more details, see ResultData object.

class ansys.dpf.post.displacement.Displacement(**kwargs)

Defines the displacement object, that is a vector object.

has_complex_frequencies()

Returns True if the result support contains complex frequencies.

property norm

Returns the norm of the vector as a ResultData.

property vector

Returns the vector values as a ResultData.

property x

Returns X component of the vector as a ResultData.

property y

Returns Y component of the vector as a ResultData.

property z

Returns Z component of the vector as a ResultData.

Stress

The stress Result object can be obtained as follows:

Instantiate the solution object

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.multishells_rst)

Instantiate the stress result object

>>> stress = solution.stress()

The stress Result corresponds to a tensor field. To obtain the scalar components of this field, e.g., the normal y-stresses, access the following subresult:

Instantiate the solution object

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.multishells_rst)

Instantiate the displacement result object

>>> stress = solution.stress()

Get the yy stress result data

>>> s_yy = stress.yy
>>> s_yy.get_data_at_field()

Other components, as well as whole tensor data, can be queried accordingly. For more details, see ResultData object.

class ansys.dpf.post.stress.Stress(**kwargs)

Defines the stress object, that is a tensor object.

Examples

Extract the stress from a solution

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.multishells_rst)
>>> stress = solution.stress(location=post.locations.nodal, time_scoping=[1])
has_complex_frequencies()

Returns True if the result support contains complex frequencies.

property principal_1

Returns first principal component of the tensor as a ResultData.

property principal_2

Returns second principal component of the tensor as a ResultData.

property principal_3

Returns third principal component of the tensor as a ResultData.

property tensor

Returns the tensor values as a ResultData.

property von_mises

Returns the von mises stress as a ResultData.

property xx

Returns XX component of the tensor as a ResultData.

property xy

Returns XY component of the tensor as a ResultData.

property xz

Returns XZ component of the tensor as a ResultData.

property yy

Returns YY component of the tensor as a ResultData.

property yz

Returns YZ component of the tensor as a ResultData.

property zz

Returns ZZ component of the tensor as a ResultData.

Strain (elastic, plastic)

The elastic and plastic strain Result objects can be obtained as follows:

Instantiate the solution object

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.multishells_rst)

Instantiate the strain result objects

>>> elastic_strain = solution.elastic_strain()
>>> plastic_strain = solution.plastic_strain()

A strain Result corresponds to a tensor field. To obtain the scalar components of this field, e.g., shear xy-strains, access the following subresult:

Instantiate the solution object

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.multishells_rst)

Instantiate the displacement result object

>>> elastic_strain = solution.elastic_strain()

Get the xy elastic strain result data

>>> e_yy = elastic_strain.xy
>>> e_yy.get_data_at_field()

Other components, as well as whole tensor data, can be queried accordingly. For more details, see ResultData object.

class ansys.dpf.post.strain.ElasticStrain(**kwargs)

Defines the elastic strain object, that is a tensor object.

has_complex_frequencies()

Returns True if the result support contains complex frequencies.

property principal_1

Returns first principal component of the tensor as a ResultData.

property principal_2

Returns second principal component of the tensor as a ResultData.

property principal_3

Returns third principal component of the tensor as a ResultData.

property tensor

Returns the tensor values as a ResultData.

property xx

Returns XX component of the tensor as a ResultData.

property xy

Returns XY component of the tensor as a ResultData.

property xz

Returns XZ component of the tensor as a ResultData.

property yy

Returns YY component of the tensor as a ResultData.

property yz

Returns YZ component of the tensor as a ResultData.

property zz

Returns ZZ component of the tensor as a ResultData.

class ansys.dpf.post.strain.PlasticStrain(**kwargs)

Defines the plastic strain object, that is a tensor object.

has_complex_frequencies()

Returns True if the result support contains complex frequencies.

property principal_1

Returns first principal component of the tensor as a ResultData.

property principal_2

Returns second principal component of the tensor as a ResultData.

property principal_3

Returns third principal component of the tensor as a ResultData.

property tensor

Returns the tensor values as a ResultData.

property xx

Returns XX component of the tensor as a ResultData.

property xy

Returns XY component of the tensor as a ResultData.

property xz

Returns XZ component of the tensor as a ResultData.

property yy

Returns YY component of the tensor as a ResultData.

property yz

Returns YZ component of the tensor as a ResultData.

property zz

Returns ZZ component of the tensor as a ResultData.

Structural temperature

The structural (or system) temperature Result object can be obtained as follows:

Instantiate the solution object

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.multishells_rst)

Instantiate the elastic strain result object

>>> structural_temperature = solution.structural_temperature()

To access the temperature scalar field use the following:

Instantiate the solution object

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.multishells_rst)

Instantiate the displacement result object

>>> structural_temperature = solution.structural_temperature()

Get the xy elastic strain result data

>>> temperature = structural_temperature.scalar
>>> temperature.get_data_at_field()
class ansys.dpf.post.temperature.StructuralTemperature(**kwargs)

Defines the strctural temperature object, that is a scalar object.

has_complex_frequencies()

Returns True if the result support contains complex frequencies.

property scalar

Returns the scalar values as a ResultData.

Miscellaneous results

Other Result objects may be available in the Solution:

Instantiate the solution object

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.multishells_rst)

Get the result data

>>> acceleration = solution.misc.nodal_acceleration()

All keyword arguments are available for miscellaneous results (see ANSYS DPF-POST Use result keywords), except location. Notably, some subresults may be available as keyword arguments, for example, the scalar components of acceleration:

Instantiate the solution object

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.multishells_rst)

Get the result data

>>> acceleration = solution.misc.nodal_acceleration(subresult="Y")

Verify the result file contents to determine available queries (see Browsing Result Metadata).

class ansys.dpf.post.misc_results.MecanicMisc(model, data_sources)
elemental_accu_eqv_creep_strain(**kwargs)

Returns a elemental_accu_eqv_creep_strain result data.

elemental_accu_eqv_plastic_strain(**kwargs)

Returns a elemental_accu_eqv_plastic_strain result data.

elemental_artificial_hourglass_energy(**kwargs)

Returns a elemental_artificial_hourglass_energy result data.

elemental_co_energy(**kwargs)

Returns a elemental_co_energy result data.

elemental_contact_fluid_penetration_pressure(**kwargs)

Returns a elemental_contact_fluid_penetration_pressure result data.

elemental_contact_friction_stress(**kwargs)

Returns a elemental_contact_friction_stress result data.

elemental_contact_penetration(**kwargs)

Returns a elemental_contact_penetration result data.

elemental_contact_pressure(**kwargs)

Returns a elemental_contact_pressure result data.

elemental_contact_sliding_distance(**kwargs)

Returns a elemental_contact_sliding_distance result data.

elemental_contact_status(**kwargs)

Returns a elemental_contact_status result data.

elemental_contact_surface_heat_flux(**kwargs)

Returns a elemental_contact_surface_heat_flux result data.

elemental_contact_total_stress(**kwargs)

Returns a elemental_contact_total_stress result data.

elemental_contactgap_distance(**kwargs)

Returns a elemental_contactgap_distance result data.

elemental_creep_strain_energy_density(**kwargs)

Returns a elemental_creep_strain_energy_density result data.

elemental_elastic_strain(**kwargs)

Returns a elemental_elastic_strain result data.

elemental_elastic_strain_energy_density(**kwargs)

Returns a elemental_elastic_strain_energy_density result data.

elemental_eqv_stress_parameter(**kwargs)

Returns a elemental_eqv_stress_parameter result data.

elemental_force(**kwargs)

Returns a elemental_force result data.

elemental_hydrostatic_pressure(**kwargs)

Returns a elemental_hydrostatic_pressure result data.

elemental_incremental_energy(**kwargs)

Returns a elemental_incremental_energy result data.

elemental_kinetic_energy(**kwargs)

Returns a elemental_kinetic_energy result data.

elemental_mass(**kwargs)

Returns a elemental_mass result data.

elemental_nodal_accu_eqv_creep_strain(**kwargs)

Returns a elemental_nodal_accu_eqv_creep_strain result data.

elemental_nodal_accu_eqv_plastic_strain(**kwargs)

Returns a elemental_nodal_accu_eqv_plastic_strain result data.

elemental_nodal_creep_strain_energy_density(**kwargs)

Returns a elemental_nodal_creep_strain_energy_density result data.

elemental_nodal_elastic_strain(**kwargs)

Returns a elemental_nodal_elastic_strain result data.

elemental_nodal_elastic_strain_energy_density(**kwargs)

Returns a elemental_nodal_elastic_strain_energy_density result data.

elemental_nodal_eqv_stress_parameter(**kwargs)

Returns a elemental_nodal_eqv_stress_parameter result data.

elemental_nodal_force(**kwargs)

Returns a elemental_nodal_force result data.

elemental_nodal_hydrostatic_pressure(**kwargs)

Returns a elemental_nodal_hydrostatic_pressure result data.

elemental_nodal_plastic_state_variable(**kwargs)

Returns a elemental_nodal_plastic_state_variable result data.

elemental_nodal_plastic_strain(**kwargs)

Returns a elemental_nodal_plastic_strain result data.

elemental_nodal_plastic_strain_energy_density(**kwargs)

Returns a elemental_nodal_plastic_strain_energy_density result data.

elemental_nodal_stress(**kwargs)

Returns a elemental_nodal_stress result data.

elemental_nodal_stress_ratio(**kwargs)

Returns a elemental_nodal_stress_ratio result data.

elemental_nodal_structural_temperature(**kwargs)

Returns a elemental_nodal_structural_temperature result data.

elemental_nodal_thermal_strains(**kwargs)

Returns a elemental_nodal_thermal_strains result data.

elemental_plastic_state_variable(**kwargs)

Returns a elemental_plastic_state_variable result data.

elemental_plastic_strain(**kwargs)

Returns a elemental_plastic_strain result data.

elemental_plastic_strain_energy_density(**kwargs)

Returns a elemental_plastic_strain_energy_density result data.

elemental_stiffness_matrix_energy(**kwargs)

Returns a elemental_stiffness_matrix_energy result data.

elemental_stress(**kwargs)

Returns a elemental_stress result data.

elemental_stress_ratio(**kwargs)

Returns a elemental_stress_ratio result data.

elemental_structural_temperature(**kwargs)

Returns a elemental_structural_temperature result data.

elemental_thermal_dissipation_energy(**kwargs)

Returns a elemental_thermal_dissipation_energy result data.

elemental_thermal_strains(**kwargs)

Returns a elemental_thermal_strains result data.

elemental_volume(**kwargs)

Returns a elemental_volume result data.

modal_basis(**kwargs)

Returns a modal_basis result data.

nodal_acceleration(**kwargs)

Returns a nodal_acceleration result data.

nodal_accu_eqv_creep_strain(**kwargs)

Returns a nodal_accu_eqv_creep_strain result data.

nodal_accu_eqv_plastic_strain(**kwargs)

Returns a nodal_accu_eqv_plastic_strain result data.

nodal_creep_strain_energy_density(**kwargs)

Returns a nodal_creep_strain_energy_density result data.

nodal_displacement(**kwargs)

Returns a nodal_displacement result data.

nodal_elastic_strain(**kwargs)

Returns a nodal_elastic_strain result data.

nodal_elastic_strain_energy_density(**kwargs)

Returns a nodal_elastic_strain_energy_density result data.

nodal_eqv_stress_parameter(**kwargs)

Returns a nodal_eqv_stress_parameter result data.

nodal_force(**kwargs)

Returns a nodal_force result data.

nodal_hydrostatic_pressure(**kwargs)

Returns a nodal_hydrostatic_pressure result data.

nodal_moment(**kwargs)

Returns a nodal_moment result data.

nodal_plastic_state_variable(**kwargs)

Returns a nodal_plastic_state_variable result data.

nodal_plastic_strain(**kwargs)

Returns a nodal_plastic_strain result data.

nodal_plastic_strain_energy_density(**kwargs)

Returns a nodal_plastic_strain_energy_density result data.

nodal_raw_displacement(**kwargs)

Returns a nodal_raw_displacement result data.

nodal_raw_reaction_force(**kwargs)

Returns a nodal_raw_reaction_force result data.

nodal_reaction_force(**kwargs)

Returns a nodal_reaction_force result data.

nodal_stress(**kwargs)

Returns a nodal_stress result data.

nodal_stress_ratio(**kwargs)

Returns a nodal_stress_ratio result data.

nodal_structural_temperature(**kwargs)

Returns a nodal_structural_temperature result data.

nodal_thermal_strains(**kwargs)

Returns a nodal_thermal_strains result data.

nodal_velocity(**kwargs)

Returns a nodal_velocity result data.

von_mises_stress(**kwargs)

von_mises_stress output default location is Nodal. Use the location keyword with ‘ElementalNodal’ value to get an ElementalNodal result, and the ‘Elemental’ value to get Elemental result.

Thermal/Electric (*.rth) result files

Upon loading a Solution object from a thermal/electric analysis results file (*.rth), the following Result objects may be queried:

  • temperature

  • heat_flux

  • electric_field

  • electric_potential

Temperature

Temperature is the DOF solution for thermal analyses. Its Result object can be obtained as follows:

Instantiate the solution object

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.steady_therm)

Instantiate the temperature result object

>>> temperature = solution.temperature()

Being a DOF solution, its location argument must be nodal (inferred above). The scalar field can be obtained directly:

Instantiate the solution object

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.multishells_rst)

Instantiate the temperature result object

>>> temperature = solution.temperature()

Get the y temperature result data

>>> temp = temperature.scalar
>>> temp.get_data_at_field()
class ansys.dpf.post.temperature.Temperature(**kwargs)

Defines the temperature object for thermal analysis, that is a scalar object.

has_complex_frequencies()

Returns True if the result support contains complex frequencies.

property scalar

Returns the scalar values as a ResultData.

Heat flux

The heat flux Result object can be obtained as follows:

Instantiate the solution object

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.steady_therm)

Instantiate the heat_flux result object

>>> heat_flux = solution.heat_flux()

The heat flux Result corresponds to a vector field. To obtain the scalar components of this field, e.g., x-components, access the following subresult:

Instantiate the solution object

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.multishells_rst)

Instantiate the temperature result object

>>> heat_flux = solution.heat_flux()

Get the y heat_flux result data

>>> heat_flux_x = heat_flux.x
>>> heat_flux_x.get_data_at_field()

Other components can be queried accordingly. For more details, see ResultData object.

class ansys.dpf.post.temperature.HeatFlux(**kwargs)

Defines the heat flux object for thermal analysis, that is a scalar object.

has_complex_frequencies()

Returns True if the result support contains complex frequencies.

property norm

Returns the norm of the vector as a ResultData.

property vector

Returns the vector values as a ResultData.

property x

Returns X component of the vector as a ResultData.

property y

Returns Y component of the vector as a ResultData.

property z

Returns Z component of the vector as a ResultData.

Electric field

The electric field Result object can be obtained as follows:

Instantiate the solution object

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.electric_therm)

Instantiate the electric field result object

>>> electric_field = solution.electric_field()

The electric field Result corresponds to a vector field. To obtain the scalar components of this field, e.g., x-components, access the following subresult:

Instantiate the solution object

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.multishells_rst)

Instantiate the electric field result object

>>> electric_field = solution.electric_field()

Get the y electricfield result data

>>> electric_field_x = electric_field.x
>>> electric_field_x.get_data_at_field()

For more details, see ResultData object.

class ansys.dpf.post.electric_results.ElectricField(**kwargs)

Defines the temperature object for thermal/electric analysis, that is a scalar object.

has_complex_frequencies()

Returns True if the result support contains complex frequencies.

property norm

Returns the norm of the vector as a ResultData.

property vector

Returns the vector values as a ResultData.

property x

Returns X component of the vector as a ResultData.

property y

Returns Y component of the vector as a ResultData.

property z

Returns Z component of the vector as a ResultData.

Electric potential

The electric potential Result object can be obtained as follows:

Instantiate the solution object

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.steady_therm)

Instantiate the electric potential result object

>>> electric_potential = solution.electric_potential()

It represents a scalar field whose values can be obtained as follows:

Instantiate the solution object

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.multishells_rst)

Instantiate the electric potential result object

>>> electric_potential = solution.electric_potential()

Get the y electric potential result data

>>> ep = electric_potential.scalar
>>> ep.get_data_at_field()
class ansys.dpf.post.electric_results.ElectricPotential(**kwargs)

Defines the temperature object for thermal/electric analysis, that is a scalar object.

has_complex_frequencies()

Returns True if the result support contains complex frequencies.

property scalar

Returns the scalar values as a ResultData.