Skip to content

Commit

Permalink
Restoring content for PyDPF-Core from my messed-up attempt to resolve…
Browse files Browse the repository at this point in the history
… merge conflicts
  • Loading branch information
PipKat committed Sep 7, 2022
1 parent acbf1c4 commit 4c2d4e4
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 39 deletions.
18 changes: 15 additions & 3 deletions docs/source/getting_started/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ Install using ``pip``

`pip <https://pypi.org/project/pip/>`_ is the package installer for Python.

To use PyDPF-Core with Ansys 2021 R2 or later, install a 0.2.* PyDPF-Core
version with:
To use PyDPF-Core with Ansys 2021 R2 or later, install teh latest version
with:

.. code::
pip install ansys-dpf-core<0.3.0
pip install ansys-dpf-core
To use PyDPF-Core with Ansys 2021 R1, install the latest version
Expand All @@ -33,6 +33,18 @@ network isolation, download the latest wheel file from `PyDPF-Post
GitHub <https://github.com/pyansys/pydpf-post>`_ or
`PyDPF-Post PyPi <https://pypi.org/project/ansys-dpf-post/>`_.

Install for a quick tryout
--------------------------

For a quick tryou, use:

.. code::
from ansys.dpf.core import Model
from ansys.dpf.core import examples
model = Model(examples.simple_bar)
print(model)
Install in development mode
---------------------------
Expand Down
58 changes: 26 additions & 32 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,42 +21,34 @@ 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
.. image:: images/drawings/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.
The ``ansys.dpf.core`` package provides a Python interface to DPF, enabling
rapid postprocessing of a variety of Ansys file formats and physics solutions
without ever leaving the Python environment.


Brief demo
~~~~~~~~~~
Here is how you open and plot a result file generated by Ansys Workbench or
MAPDL:
Here is how you open a result file generated by MAPDL (or another ANSYS solver)
and extract 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)
>>> from ansys.dpf.core import Model
>>> from ansys.dpf.core import examples
>>> model = Model(examples.simple_bar)
>>> print(model)
.. figure:: ./images/main_example.png
:width: 300pt

Basic stress contour plot

Here is how you extract the raw data as a :class:`numpy.ndarray` array:
Here is how you plot displacement results:

.. 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])
>>> disp = model.results.displacement().X()
model.metadata.meshed_region.plot(disp.outputs.fields_container())
For comprehensive demos, see :ref:`gallery`.

Expand All @@ -66,20 +58,22 @@ Key features

**Computational efficiency**

PyDPF-Post is based on DPF, whose data framework localizes loading and
postprocessing on the DPF server, enabling rapid postprocessing workflows
because they are written in C and FORTRAN. Because DPF-Post presents results
in a Pythonic manner, you can rapidly develop simple or complex postprocessing
scripts.
DPF is a modern framework based on new hardware architectures. Thanks
to continued development, new capabilities are frequently added.

**Generic interface**

DPF is physics-agnostic, which means that its use is not limited to a particular
field, physics solution, or file format.

**Extensibility and customization**
DPF is developed around two core entities:

**Easy to use**
- Data represented as a *field*
- An *operator* to act upon this data

The PyDPF-Post API automates the use of DPF's chained operators to make
postprocessing easier. The PyDPF-Post documentation describes how you can
use operators to compute results. This allows you to build your own custom,
low-level scripts to enable fast postprocessing of potentially multi-gigabyte
models using `PyDPF-Core <https://github.com/pyansys/pydpf-core>`_.
Each DPF capability is developed through operators that allow for componentization
of the framework. Because DPF is plugin-based, new features or formats can be easily added.


.. toctree::
Expand Down
6 changes: 2 additions & 4 deletions docs/source/user_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ computation, customization, and remote postprocessing accessible in Python.

This section has the following goals:

- Describe basic DPF concepts, including terminology

- Describe the most-used DPF entities and how they can help you to access and modify solver data

- Describe basic DPF concepts, including terminology.
- Describe the most-used DPF entities and how they can help you to access and modify solver data.
- Provide simple how-tos for tackling most common use cases.

Other sections of this guide include :ref:`ref_api_section`, :ref:`ref_dpf_operators_reference`,
Expand Down

0 comments on commit 4c2d4e4

Please sign in to comment.