From b636b33f2093870d050b925299ad7f386cdac4af Mon Sep 17 00:00:00 2001 From: cbellot Date: Mon, 6 Mar 2023 14:51:52 +0100 Subject: [PATCH 1/6] Update doc home page --- docs/source/index.rst | 68 ++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index eca41c226..12abf172b 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -2,59 +2,55 @@ 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 `_. 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) -.. figure:: ./images/main_example.png - :width: 300pt +.. code:: python - Basic stress contour plot + >>> displacement.plot() -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]) + >>> stress_eqv = simulation.stress_eqv_von_mises_nodal() + >>> stress_eqv.plot() + +To run PyDPF-Post with Ansys versions starting from 2021 R1 to 2022 R2, use the following legacy PyDPF-Post +tools: + +.. code:: python + + >>> 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) For comprehensive demos, see :ref:`gallery`. From 7d616b4766bc619abac27a77dfd3c920bff789fc Mon Sep 17 00:00:00 2001 From: cbellot Date: Mon, 6 Mar 2023 15:23:14 +0100 Subject: [PATCH 2/6] typo --- docs/source/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index 12abf172b..077e20b41 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -20,7 +20,7 @@ Brief demo ~~~~~~~~~~ Provided you have ANSYS 2023 R1 installed, a DPF server will start -automatically once you start using pyDPF-Post. +automatically once you start using PyDPF-Post. Loading a simulation for a MAPDL result file to extract and post-process results: .. code:: python From 0bd015c9ae43bed33512809c2981db6c78879a00 Mon Sep 17 00:00:00 2001 From: cbellot Date: Mon, 6 Mar 2023 16:44:33 +0100 Subject: [PATCH 3/6] read images --- docs/source/index.rst | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index 077e20b41..faf05a2cf 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -20,7 +20,7 @@ Brief demo ~~~~~~~~~~ Provided you have ANSYS 2023 R1 installed, a DPF server will start -automatically once you start using PyDPF-Post. +automatically once you start using pyDPF-Post. Loading a simulation for a MAPDL result file to extract and post-process results: .. code:: python @@ -32,15 +32,37 @@ Loading a simulation for a MAPDL result file to extract and post-process results >>> 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/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 + To run PyDPF-Post with Ansys versions starting from 2021 R1 to 2022 R2, use the following legacy PyDPF-Post tools: @@ -52,6 +74,9 @@ tools: >>> stress = solution.stress() >>> stress.eqv.plot_contour(show_edges=False) +.. figure:: ./images/crankshaft_stress.png + :width: 300pt + For comprehensive demos, see :ref:`gallery`. From f2d03c3dfb5de4047d505e461534cb62110f6783 Mon Sep 17 00:00:00 2001 From: cbellot Date: Mon, 6 Mar 2023 16:55:00 +0100 Subject: [PATCH 4/6] vale fix --- docs/source/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index faf05a2cf..284deb706 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -20,7 +20,7 @@ Brief demo ~~~~~~~~~~ Provided you have ANSYS 2023 R1 installed, a DPF server will start -automatically once you start using pyDPF-Post. +automatically once you start using PyDPF-Post. Loading a simulation for a MAPDL result file to extract and post-process results: .. code:: python From 243328ef2526db235b5659dfeab6eb629a029374 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Mon, 6 Mar 2023 17:43:55 +0100 Subject: [PATCH 5/6] Fix homepage link --- docs/source/index.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index 284deb706..df03f3d1b 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -11,9 +11,8 @@ Loading a simulation (defined by its result files) allows you to extract simulat as results and apply postprocessing operations on it. 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. +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 From a82e98e6bc27f3a42b8bd9ac43df2c0e613f9102 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Mon, 6 Mar 2023 17:47:35 +0100 Subject: [PATCH 6/6] Show legacy examples --- examples/00-Different-analysis-types/README.txt | 6 +++--- .../01-named-selections-modal-simulation.py | 0 .../02-modal-extract-sub-results.py | 0 .../03-explore-result-data-harmonic.py | 0 .../04-invariants.py | 0 .../05-export_data.py | 0 examples/01-Detailed-Examples/README.txt | 5 +++++ examples/02-Detailed-Examples/README.txt | 5 ----- examples/{04-Legacy => 02-Legacy}/00-overview_example.py | 0 .../01-get_data_from_static_simulation.py | 0 examples/{04-Legacy => 02-Legacy}/01-introduction.py | 0 examples/{04-Legacy => 02-Legacy}/02-static-analysis.py | 0 examples/{04-Legacy => 02-Legacy}/03-modal-analysis.py | 0 examples/{04-Legacy => 02-Legacy}/04-harmonic-analysis.py | 0 examples/{04-Legacy => 02-Legacy}/05-transient-analysis.py | 0 examples/{04-Legacy => 02-Legacy}/06-complex_results.py | 0 examples/{04-Legacy => 02-Legacy}/07-result_keywords.py | 0 .../08-result_on_path_of_coordinates.py | 0 examples/{04-Legacy => 02-Legacy}/09-basics.py | 0 examples/02-Legacy/README.txt | 5 +++++ 20 files changed, 13 insertions(+), 8 deletions(-) rename examples/{02-Detailed-Examples => 01-Detailed-Examples}/01-named-selections-modal-simulation.py (100%) rename examples/{02-Detailed-Examples => 01-Detailed-Examples}/02-modal-extract-sub-results.py (100%) rename examples/{02-Detailed-Examples => 01-Detailed-Examples}/03-explore-result-data-harmonic.py (100%) rename examples/{02-Detailed-Examples => 01-Detailed-Examples}/04-invariants.py (100%) rename examples/{02-Detailed-Examples => 01-Detailed-Examples}/05-export_data.py (100%) create mode 100644 examples/01-Detailed-Examples/README.txt delete mode 100644 examples/02-Detailed-Examples/README.txt rename examples/{04-Legacy => 02-Legacy}/00-overview_example.py (100%) rename examples/{04-Legacy => 02-Legacy}/01-get_data_from_static_simulation.py (100%) rename examples/{04-Legacy => 02-Legacy}/01-introduction.py (100%) rename examples/{04-Legacy => 02-Legacy}/02-static-analysis.py (100%) rename examples/{04-Legacy => 02-Legacy}/03-modal-analysis.py (100%) rename examples/{04-Legacy => 02-Legacy}/04-harmonic-analysis.py (100%) rename examples/{04-Legacy => 02-Legacy}/05-transient-analysis.py (100%) rename examples/{04-Legacy => 02-Legacy}/06-complex_results.py (100%) rename examples/{04-Legacy => 02-Legacy}/07-result_keywords.py (100%) rename examples/{04-Legacy => 02-Legacy}/08-result_on_path_of_coordinates.py (100%) rename examples/{04-Legacy => 02-Legacy}/09-basics.py (100%) create mode 100644 examples/02-Legacy/README.txt diff --git a/examples/00-Different-analysis-types/README.txt b/examples/00-Different-analysis-types/README.txt index 81e431fcc..c6e0122e8 100644 --- a/examples/00-Different-analysis-types/README.txt +++ b/examples/00-Different-analysis-types/README.txt @@ -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. diff --git a/examples/02-Detailed-Examples/01-named-selections-modal-simulation.py b/examples/01-Detailed-Examples/01-named-selections-modal-simulation.py similarity index 100% rename from examples/02-Detailed-Examples/01-named-selections-modal-simulation.py rename to examples/01-Detailed-Examples/01-named-selections-modal-simulation.py diff --git a/examples/02-Detailed-Examples/02-modal-extract-sub-results.py b/examples/01-Detailed-Examples/02-modal-extract-sub-results.py similarity index 100% rename from examples/02-Detailed-Examples/02-modal-extract-sub-results.py rename to examples/01-Detailed-Examples/02-modal-extract-sub-results.py diff --git a/examples/02-Detailed-Examples/03-explore-result-data-harmonic.py b/examples/01-Detailed-Examples/03-explore-result-data-harmonic.py similarity index 100% rename from examples/02-Detailed-Examples/03-explore-result-data-harmonic.py rename to examples/01-Detailed-Examples/03-explore-result-data-harmonic.py diff --git a/examples/02-Detailed-Examples/04-invariants.py b/examples/01-Detailed-Examples/04-invariants.py similarity index 100% rename from examples/02-Detailed-Examples/04-invariants.py rename to examples/01-Detailed-Examples/04-invariants.py diff --git a/examples/02-Detailed-Examples/05-export_data.py b/examples/01-Detailed-Examples/05-export_data.py similarity index 100% rename from examples/02-Detailed-Examples/05-export_data.py rename to examples/01-Detailed-Examples/05-export_data.py diff --git a/examples/01-Detailed-Examples/README.txt b/examples/01-Detailed-Examples/README.txt new file mode 100644 index 000000000..73df80b4d --- /dev/null +++ b/examples/01-Detailed-Examples/README.txt @@ -0,0 +1,5 @@ +.. _ref_detailed_examples: + +PyDPF-Post feature examples +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +These examples show how you use PyDPF-Post features. diff --git a/examples/02-Detailed-Examples/README.txt b/examples/02-Detailed-Examples/README.txt deleted file mode 100644 index d64d0e65c..000000000 --- a/examples/02-Detailed-Examples/README.txt +++ /dev/null @@ -1,5 +0,0 @@ -.. _ref_detailed_examples: - -DPF-Post feature examples -~~~~~~~~~~~~~~~~~~~~~~~~~~ -These examples show how you use DPF-Post features. diff --git a/examples/04-Legacy/00-overview_example.py b/examples/02-Legacy/00-overview_example.py similarity index 100% rename from examples/04-Legacy/00-overview_example.py rename to examples/02-Legacy/00-overview_example.py diff --git a/examples/04-Legacy/01-get_data_from_static_simulation.py b/examples/02-Legacy/01-get_data_from_static_simulation.py similarity index 100% rename from examples/04-Legacy/01-get_data_from_static_simulation.py rename to examples/02-Legacy/01-get_data_from_static_simulation.py diff --git a/examples/04-Legacy/01-introduction.py b/examples/02-Legacy/01-introduction.py similarity index 100% rename from examples/04-Legacy/01-introduction.py rename to examples/02-Legacy/01-introduction.py diff --git a/examples/04-Legacy/02-static-analysis.py b/examples/02-Legacy/02-static-analysis.py similarity index 100% rename from examples/04-Legacy/02-static-analysis.py rename to examples/02-Legacy/02-static-analysis.py diff --git a/examples/04-Legacy/03-modal-analysis.py b/examples/02-Legacy/03-modal-analysis.py similarity index 100% rename from examples/04-Legacy/03-modal-analysis.py rename to examples/02-Legacy/03-modal-analysis.py diff --git a/examples/04-Legacy/04-harmonic-analysis.py b/examples/02-Legacy/04-harmonic-analysis.py similarity index 100% rename from examples/04-Legacy/04-harmonic-analysis.py rename to examples/02-Legacy/04-harmonic-analysis.py diff --git a/examples/04-Legacy/05-transient-analysis.py b/examples/02-Legacy/05-transient-analysis.py similarity index 100% rename from examples/04-Legacy/05-transient-analysis.py rename to examples/02-Legacy/05-transient-analysis.py diff --git a/examples/04-Legacy/06-complex_results.py b/examples/02-Legacy/06-complex_results.py similarity index 100% rename from examples/04-Legacy/06-complex_results.py rename to examples/02-Legacy/06-complex_results.py diff --git a/examples/04-Legacy/07-result_keywords.py b/examples/02-Legacy/07-result_keywords.py similarity index 100% rename from examples/04-Legacy/07-result_keywords.py rename to examples/02-Legacy/07-result_keywords.py diff --git a/examples/04-Legacy/08-result_on_path_of_coordinates.py b/examples/02-Legacy/08-result_on_path_of_coordinates.py similarity index 100% rename from examples/04-Legacy/08-result_on_path_of_coordinates.py rename to examples/02-Legacy/08-result_on_path_of_coordinates.py diff --git a/examples/04-Legacy/09-basics.py b/examples/02-Legacy/09-basics.py similarity index 100% rename from examples/04-Legacy/09-basics.py rename to examples/02-Legacy/09-basics.py diff --git a/examples/02-Legacy/README.txt b/examples/02-Legacy/README.txt new file mode 100644 index 000000000..7675b8540 --- /dev/null +++ b/examples/02-Legacy/README.txt @@ -0,0 +1,5 @@ +.. _ref_legacy_examples: + +DPF-Post legacy examples +~~~~~~~~~~~~~~~~~~~~~~~~ +These examples show how you use the legacy PyDPF-Post API.