Complex results from a modal or harmonic analysis#

This example shows how you can access complex results from a modal or harmonic analysis.

Perform required imports#

Perform required imports.

from ansys.dpf import post
from ansys.dpf.post import examples

Get Solution object#

Get the Solution object.

solution = post.load_solution(examples.complex_rst)
solution.has_complex_result()
True

Get displacement result#

Get the displacement Result object. It contain a field for real values and a field for imaginary values.

disp_result = solution.displacement()

Check if support has complex frequencies#

Check if the support has complex frequencies.

disp_result.has_complex_frequencies()
True

Compute the result

disp = disp_result.vector
disp.num_fields
2

Define phase#

Define the phase. The phase value must be a float. The phase unit is degrees.

phase = 39.0
disp_at_phase = disp_result.vector_at_phase(phase)
print(f"Maximum displacement at phase {phase}:", disp_at_phase.max_data)
print(f"There are {disp_at_phase.num_fields} fields")
real_field = disp_result.vector_at_phase(0.0)
img_field = disp_result.vector_at_phase(90.0)

real_field
Maximum displacement at phase 39.0: [[2.15187123e-09 2.15185939e-09 3.19282171e-10]]
There are 1 fields

<ansys.dpf.post.result_data.ResultData object at 0x7f9ed67b0970>

Get amplitude#

Get the amplitude.

disp_ampl = disp_result.vector_amplitude
disp_ampl.num_fields
disp_ampl.max_data
DPFArray([[2.76946052e-09, 2.76952555e-09, 4.10914321e-10]])

Total running time of the script: (0 minutes 0.039 seconds)

Gallery generated by Sphinx-Gallery