Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update doc home page #311

Merged
merged 6 commits into from
Mar 6, 2023
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 56 additions & 35 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,80 @@
PyDPF-Post
==========

The Data Processing Framework (DPF) provides numerical simulation
users and engineers with a toolbox for accessing and transforming simulation
data. With DPF, you can perform complex preprocessing or postprocessing of
large amounts of simulation data within a simulation workflow.
The Data Processing Framework (DPF) is designed to provide numerical
simulation users/engineers with a toolbox for accessing and
transforming simulation data.

DPF is an independent, physics-agnostic tool that you can plug into many
apps for both data input and data output, including visualization and
result plots. It can access data from solver result files and other neutral
formats, such as CSV, HDF5, and VTK files.
The Python `ansys-dpf-post` package provides a high level, physics oriented API for postprocessing.
Loading a simulation (defined by its result files) allows you to extract simulation metadata as well
as results and apply postprocessing operations on it.

Using the many DPF operators that are available, you can manipulate and
transform this data. You can also chain operators together to create simple
or complex data-processing workflows that you can reuse for repeated or
future evaluations.

The data in DPF is defined based on physics-agnostic mathematical quantities
described in self-sufficient entities called *fields*. This allows DPF to be
a modular and easy-to-use tool with a large range of capabilities.

.. image:: images/dpf-flow.png
:width: 670
:alt: DPF flow

The ``ansys.dpf.post`` package leverages the ``ansys.dpf.core`` package, which
is available at `PyDPF-Core GitHub <https://github.com/pyansys/DPF-Core>`_. With
PyDPF-Core, you can build more advanced and customized DPF workflows.
This module leverages the PyDPF-Core project's ``ansys-dpf-core`` package and can
be found by visiting [PyDPF-Core
GitHub](https://github.com/pyansys/pydpf-core). Use ``ansys-dpf-core`` for
building more advanced and customized workflows using Ansys DPF.


Brief demo
~~~~~~~~~~
Here is how you open and plot a result file generated by Ansys Workbench or
MAPDL:

Provided you have ANSYS 2023 R1 installed, a DPF server will start
automatically once you start using PyDPF-Post.
Loading a simulation for a MAPDL result file to extract and post-process results:

.. code:: python

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.multishells_rst)
>>> stress = solution.stress()
>>> stress.xx.plot_contour(show_edges=False)
>>> simulation = post.load_simulation(examples.download_crankshaft())
>>> displacement = simulation.displacement()
>>> print(displacement)


.. rst-class:: sphx-glr-script-out

.. code-block:: none

results U
set_id 3
node comp
4872 X -3.41e-05
Y 1.54e-03
Z -2.64e-06
9005 X -5.56e-05
Y 1.44e-03
Z 5.31e-06
...

.. code:: python

>>> displacement.plot()

.. figure:: ./images/main_example.png

.. figure:: ./images/crankshaft_disp.png
:width: 300pt

.. code:: python

>>> stress_eqv = simulation.stress_eqv_von_mises_nodal()
>>> stress_eqv.plot()

.. figure:: ./images/crankshaft_stress.png
:width: 300pt

Basic stress contour plot
To run PyDPF-Post with Ansys versions starting from 2021 R1 to 2022 R2, use the following legacy PyDPF-Post
tools:

Here is how you extract the raw data as a :class:`numpy.ndarray` array:
.. code:: python

>>> stress.xx.get_data_at_field(0)
array([-3.37871094e+10, -4.42471752e+10, -4.13249463e+10, ...,
3.66408342e+10, 1.40736914e+11, 1.38633557e+11])
>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.download_crankshaft())
>>> stress = solution.stress()
>>> stress.eqv.plot_contour(show_edges=False)

.. figure:: ./images/crankshaft_stress.png
:width: 300pt


For comprehensive demos, see :ref:`gallery`.
Expand Down