Plot results#

DPF-Post provides functionality for plotting results. Here is a summary of the steps:

  1. Load the DpfSolution object with the result file.

  2. Request a Result object and obtain the scalar field of interest.

  3. Use the plot_contour method to render it.

Subsequent sections provide some plotting examples.

Total deformation#

You can plot the total deformation (norm of the displacement vector field) with:

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()
>>> norm = displacement.norm  # this is the result data (data container)

Plot the result data

>>> norm.plot_contour()

Normal stresses#

You can plot the normal x-component of stress with:

Instantiate the solution object

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

Instantiate a stress result object

>>> stress = solution.stress()
>>> s_xx = stress.xx  # this is the result data (data container)

Plot the result data

>>> s_xx.plot_contour()