Skip to content

Commit

Permalink
Update doc home page (#311)
Browse files Browse the repository at this point in the history
* Update doc home page

* typo

* read images

* vale fix

* Fix homepage link

* Show legacy examples

---------

Co-authored-by: paul.profizi <[email protected]>
  • Loading branch information
cbellot000 and PProfizi committed Mar 8, 2023
1 parent ccf38c4 commit 6bd968c
Show file tree
Hide file tree
Showing 21 changed files with 68 additions and 43 deletions.
90 changes: 55 additions & 35 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,79 @@
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
6 changes: 3 additions & 3 deletions examples/00-Different-analysis-types/README.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. _ref_different_analysis:

DPF-Post analysis types
~~~~~~~~~~~~~~~~~~~~~~~
These examples show how to post process different simulation types using pydpf-post.
PyDPF-Post analysis types
~~~~~~~~~~~~~~~~~~~~~~~~~
These examples show how to post-process different simulation types using PyDPF-Post.
5 changes: 5 additions & 0 deletions examples/01-Detailed-Examples/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.. _ref_detailed_examples:

PyDPF-Post feature examples
~~~~~~~~~~~~~~~~~~~~~~~~~~~
These examples show how you use PyDPF-Post features.
5 changes: 0 additions & 5 deletions examples/02-Detailed-Examples/README.txt

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions examples/02-Legacy/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.. _ref_legacy_examples:

DPF-Post legacy examples
~~~~~~~~~~~~~~~~~~~~~~~~
These examples show how you use the legacy PyDPF-Post API.

0 comments on commit 6bd968c

Please sign in to comment.