Skip to content

Commit 7f127ce

Browse files
authored
Merge branch 'main' into dockerdoc
2 parents 2c56ef9 + e87a4ab commit 7f127ce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2688
-1818
lines changed

README.rst

Lines changed: 106 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,63 @@
1-
PyDyna
2-
######
3-
4-
PyDyna is a pythonic dyna package that aims to provide user a more convenient and complete way to
5-
build up ansys-dyna input deck, submit to solver and finally post processing their results.
6-
7-
8-
Project Overview
9-
----------------
10-
There are 3 related packages here, pre and solver are all under the ansys/pydyna/ directory,
11-
while pyDPF is used for post-processing.
12-
13-
**pre** contains highly abstracted APIs for setting up a LS-DYNA input deck, so far,
14-
it includes DynaMech, DynaIGA, DynaICFD, DynaSALE, DynaEM, DynaAirbag and so on.
15-
16-
**solver** contains code for interfacing with the LS-DYNA solver directly.
17-
As LS-DYNA is primarily a batch solver with very limited interactive
18-
capabilities, the code here is similarly limited. The target
19-
use case is that LS-DYNA will be running in a container environment
20-
such as Docker or Kubernetes. The code here then allows for pushing
21-
input files to the container, starting LS-DYNA and monitoring its
22-
progress, and retrieving results files.
23-
24-
The **Data Processing Framework (DPF)** is designed to provide numerical
25-
simulation users/engineers with a toolbox for accessing and
26-
transforming simulation data. DPF can access data from solver result
27-
files as well as several neutral formats (csv, hdf5, vtk,
28-
etc.). Various operators are available allowing the manipulation and
29-
the transformation of this data.
30-
31-
The Python `ansys-dpf-post` package provides a simplified Python
32-
interface to DPF, thus enabling rapid postprocessing without ever
33-
leaving a Python environment.
34-
35-
Visit the `DPF-Post Documentation <https://postdocs.pyansys.com>`_ for a
36-
detailed description of the package.
37-
38-
Install PyDyna-Pre Docker
39-
-------------------------
40-
41-
Launching the PyDyna-Pre service locally, the only requirement is that:
42-
43-
* Docker is installed on your machine.
1+
Overview
2+
========
3+
PyDYNA is a Pythonic package for providing a more convenient and complete way to
4+
build an Ansys DYNA input deck, submit it to the Ansys LS-DYNA solver, and
5+
finally postprocess the results.
6+
7+
In the PyDYNA installation, the ``docker`` directory has two child
8+
directories:
9+
10+
- ``pre``: Provides the interface for creating DYNA input decks.
11+
This service includes highly abstracted APIs for setting up
12+
LS-DYNA input decks. Included are DynaMech, DynaIGA, DynaICFD,
13+
DynaSALE, DynaEM, and DynaAirbag.
14+
- ``solver``: Contains the code for interfacing directly with
15+
the Ansys LS-DYNA solver. Because LS-DYNA is primarily a batch
16+
solver with very limited interactive capabilities, the code in
17+
this directory is similarly limited. The target use case is that
18+
LS-DYNA is running in a container environment such as Docker or
19+
Kubernetes. The code in the ``solver`` directory allows you to push
20+
input files to the container, start LS-DYNA and monitor its progress,
21+
and then retrieve results (RST) files.
22+
23+
Once you have results, you can use the Ansys Data Processing Framework (DPF),
24+
which is designed to provide numerical simulation users and engineers
25+
with a toolbox for accessing and transforming simulation data. DPF
26+
can access data from Ansys solver result files and from several
27+
files with neutral formats, including CSV, HDF5, and VTK. Using DPF's
28+
various operators, you can manipulate and transform this data.
29+
30+
The `ansys-dpf-post package <https://github.com/ansys/pydpf-post>`_ provides
31+
a simplified Python interface to DPF, thus enabling rapid postprocessing
32+
without ever leaving a Python environment. For more information on DPF-Post,
33+
see the `DPF-Post documentation <https://post.docs.pyansys.com>`_.
34+
35+
Installation
36+
============
37+
To use PyDYNA, you must install Docker images for the ``pre`` and ``solver``
38+
services and the package.
39+
40+
Install Docker image for the ``pre`` service
41+
--------------------------------------------
42+
To launch the ``pre`` service locally, you must have Docker installed
43+
on your machine.
4444

4545
.. caution::
4646

47-
The PyDyna-Pre service is currently available only as a Linux Docker image.
48-
make sure that your Docker engine is configured to run Linux Docker images.
47+
The ``pre`` service is available only as a Linux Docker image.
48+
Make sure that your Docker engine is configured to run Linux Docker images.
4949

50-
Please refer to ``docker/README.rst`` to install PyDyna-Pre service docker container
50+
For information on installing the Docker container for the ``pre`` service,
51+
see the ``README.rst`` file in the repository's ``docker/pre`` directory.
5152

52-
Install PyDyna-Solver Docker
53-
----------------------------
53+
Install Docker image for the ``solver`` service
54+
-----------------------------------------------
55+
Once you install the ``ansys.dyna.core`` package, you can find the
56+
``docker-compose.yml`` file in the repository's ``docker`` directory.
57+
This file is used to build and launch the ``solver`` service.
5458

55-
Once pydyna is installed, the docker-compose.yml file to build and launch the dyna solver docker can be located
56-
under ``docker``. The yml file can be copied locally. To run the docker the following command can be used
59+
You can copy this YML file locally and run the Docker image for the
60+
``solver`` service with this command:
5761

5862
.. code:: bash
5963
@@ -62,51 +66,57 @@ under ``docker``. The yml file can be copied locally. To run the docker the foll
6266
6367
Install the package
6468
-------------------
69+
The ``ansys.dyna.core`` package supports Python 3.8 through
70+
Python 3.11 on Windows, Linux, and MacOS.
71+
72+
You should consider installing PyDYNA in a virtual environment.
73+
For more information, see Python's
74+
`venv -- Creation of virtual environments <https://docs.python.org/3/library/venv.html>`_.
6575

66-
PyDyna has three installation modes: user, developer, and offline.
76+
PyDYNA has three installation modes: user, developer, and offline.
6777

6878
Install in user mode
69-
^^^^^^^^^^^^^^^^^^^^
79+
~~~~~~~~~~~~~~~~~~~~
7080

71-
Before installing PyDyna in user mode, make sure you have the latest version of
72-
`pip`_ with:
81+
Before installing PyDYNA in user mode, make sure you have the latest version of
82+
`pip`_ with this command:
7383

7484
.. code:: bash
7585
7686
python -m pip install -U pip
7787
78-
Then, install PyDyna with:
88+
Then, install PyDYNA with this command:
7989

8090
.. code:: bash
8191
8292
python -m pip install ansys-dyna-core
8393
8494
.. caution::
8595

86-
PyDyna is currently hosted in a private PyPI repository. You must provide the index
87-
URL to the private PyPI repository:
88-
89-
* Index URL: ``https://pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/``
96+
PyDYNA is currently hosted in a private PyPI repository. You must provide the index
97+
URL to the private PyPI repository: ``https://pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/``.
9098

91-
If access to this package registry is needed, email `[email protected] <mailto:[email protected]>`_
92-
to request access. The PyAnsys team can provide you a read-only token to be inserted in ``${PRIVATE_PYPI_ACCESS_TOKEN}``.
93-
Once you have it, run the following command:
99+
If access to this package registry is needed, email `[email protected] <mailto:[email protected]>`_
100+
to request access. The PyAnsys team can provide you with a read-only token.
101+
102+
Once you have the token, run this command, replacing ``${PRIVATE_PYPI_ACCESS_TOKEN}`` with the
103+
read-only token:
94104

95105
.. code:: bash
96106
97107
pip install ansys-dyna-core --index-url=https://${PRIVATE_PYPI_ACCESS_TOKEN}@pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/
98108
99109
Install in developer mode
100-
^^^^^^^^^^^^^^^^^^^^^^^^^
110+
~~~~~~~~~~~~~~~~~~~~~~~~~
101111

102-
Installing PyDyna in developer mode allows you to modify the source and enhance it.
112+
Installing PyDYNA in developer mode allows you to modify the source and enhance it.
103113

104114
.. note::
105115

106116
Before contributing to the project, ensure that you are thoroughly familiar
107117
with the `PyAnsys Developer's Guide`_.
108118

109-
Start by cloning the repository
119+
Start by cloning and installing the repository with these commands:
110120

111121
.. code::
112122
@@ -115,41 +125,40 @@ Start by cloning the repository
115125
pip install -e .
116126
117127
Install in offline mode
118-
^^^^^^^^^^^^^^^^^^^^^^^
128+
~~~~~~~~~~~~~~~~~~~~~~~
119129

120-
If you lack an internet connection on your installation machine (or you do not have access to the
121-
private Ansys PyPI packages repository), you should install PyDyna by downloading the wheelhouse
122-
archive from the `Releases Page <https://github.com/pyansys/pydyna/releases>`_ for your
123-
corresponding machine architecture.
130+
If you lack an internet connection on your installation machine (or you do not have access
131+
to the private Ansys PyPI packages repository), you should install PyDYNA by downloading
132+
the wheelhouse archive for your corresponding machine architecture from the
133+
`Releases Page <https://github.com/pyansys/pydyna/releases>`_.
124134

125-
Each wheelhouse archive contains all the Python wheels necessary to install PyDyna from scratch on Windows
126-
and Linux, from Python 3.7 to 3.10. You can install this on an isolated system with a fresh Python
127-
installation or on a virtual environment.
135+
Each wheelhouse archive contains all the Python wheels necessary to install
136+
PyDYNA from scratch on Windows and Linux for Python 3.8 through 3.11. You can install
137+
PyDYNA on an isolated system with a fresh Python installation or on a virtual environment.
128138

129-
For example, on Linux with Python 3.8, unzip the wheelhouse archive and install it with:
139+
For example, on Linux with Python 3.8, unzip the wheelhouse archive and install PyDYNA
140+
with these commands:
130141

131142
.. code:: bash
132143
133144
unzip ansys-dyna-core-v0.3.dev0-wheelhouse-Linux-3.8.zip -d wheelhouse
134145
pip install ansys-dyna-core -f wheelhouse --no-index --upgrade --ignore-installed
135146
136-
If you are on Windows with Python 3.8, unzip the corresponding wheelhouse to a wheelhouse directory
137-
and install using the preceding command.
138-
139-
Consider installing using a `virtual environment <https://docs.python.org/3/library/venv.html>`_.
147+
If you're on Windows with Python 3.8, unzip thw wheelhouse archive to a ``wheelhouse``
148+
directory and install PyDYNA using the preceding command.
140149

141150
Documentation
142-
-------------
143-
For comprehesive information on PyDyna, see the latest release
151+
=============
152+
For comprehesive information on PyDYNA, see the latest release
144153
`documentation <https://dyna.docs.pyansys.com/>`_.
145154

146155
On the `PyDyna Issues <https://github.com.mcas.ms/pyansys/pyDyna/issues>`_ page, you can create
147156
issues to submit questions, report bugs, and request new features. To reach
148157
the PyAnsys support team, email `[email protected] <[email protected]>`_.
149158

150159
Usage
151-
-----
152-
Here is a basic pre-processing example:
160+
=====
161+
Here is a basic preprocessing example:
153162

154163
.. code:: python
155164
@@ -232,8 +241,6 @@ Here is a basic pre-processing example:
232241
downloadfile = os.path.join(downloadpath,"cylinder_flow.k")
233242
icfd_solution.download(serveroutfile,downloadfile)
234243
235-
For more examples, visit https://dyna.docs.pyansys.com/version/stable/examples/index.html
236-
237244
Here is a basic solving example:
238245

239246
.. code:: python
@@ -244,9 +251,7 @@ Here is a basic solving example:
244251
>>> dyna.start(4) # start 4 ranks of mppdyna
245252
>>> dyna.run("i=input.k memory=10m ncycle=20000") # begin execution
246253
247-
Here is a basic post-processing example:
248-
249-
lsdyna::d3plot::stress_von_mises
254+
Here is a basic postprocessing example:
250255

251256
.. code:: python
252257
@@ -261,10 +266,21 @@ lsdyna::d3plot::stress_von_mises
261266
resultOp.inputs.time_scoping.connect([3])
262267
result = resultOp.outputs.stress_von_mises()
263268
269+
For more examples, see `Examples <https://dyna.docs.pyansys.com/version/stable/examples/index.html>`_
270+
in the PyDYNA documentation.
271+
264272
License
265-
-------
266-
Distributed under the MIT license. See LICENSE in the root directory
267-
of the repository for details.
273+
=======
274+
PyDYNA is licensed under the MIT license.
275+
276+
PyDYNA makes no commercial claim over Ansys whatsoever. This libray extends the functionality of
277+
Ansys LS-DYNA by adding a Python interface to LS-DYNA without changing the core behavior or
278+
license of the original software. The use of the interactive control of PyDYNA requires a legally
279+
licensed local copy of LS-DYNA.
280+
281+
For more information on LS-DYNA, see the
282+
`Ansys LS-DYNA <https://www.ansys.com/products/structures/ansys-ls-dyna>`_
283+
page on the Ansys website.
268284

269285
.. LINKS AND REFERENCES
270286
.. _pip: https://pypi.org/project/pip/

doc/source/_autoapi_templates/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
API reference
22
=============
33

4-
This page contains the ``ansys-dyna-core`` API reference.
4+
This section provides descriptions of PyDYNA subpackages, submodules, classes,
5+
methods, and attributes. Use the search feature or click links to view API documentation.
56

67
.. toctree::
78
:titlesonly:

doc/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
inheritance_node_attrs = dict(shape="ellipse", fontsize=14, height=0.75, color="dodgerblue1", style="filled")
9494

9595
# -- Options for HTML output -------------------------------------------------
96-
html_short_title = html_title = "PyDyna"
96+
html_short_title = html_title = "PyDYNA"
9797
html_show_sourcelink = True
9898
html_theme = "ansys_sphinx_theme"
9999
html_logo = pyansys_logo_black

0 commit comments

Comments
 (0)