1
- PyDyna
1
+ PyDYNA
2
2
######
3
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.
4
+ PyDYNA is a Pythonic package for providing a more convenient and complete way to
5
+ build an Ansys DYNA input deck, submit it to the Ansys LS-Dyna solver, and
6
+ finally postprocess the results.
7
+
8
+ Overview
9
+ --------
10
+ In the PyDYNA installation, the ``docker `` directory has two child
11
+ directories:
12
+
13
+ - ``pre ``: Provides the interface for creating DYNA input decks.
14
+ This service includes highly abstracted APIs for setting up
15
+ LSN-DYNA input decks. Included are DynaMech, DynaIGA, DynaICFD,
16
+ DynaSALE, DynaEM, and DynaAirbag.
17
+ - ``solver ``: Contains the code for interfacing directly with
18
+ the Ansys LS-DYNA solver. Because LS-DYNA is primarily a batch
19
+ solver with very limited interactive capabilities, the code in
20
+ this directory is similarly limited. The target use case is that
21
+ LS-DYNA is running in a container environment such as Docker or
22
+ Kubernetes. The code in the ``solver `` directory allows you to push
23
+ input files to the container, start LS-DYNA and monitor its progress,
24
+ and then retrieve results (RST) files.
25
+
26
+ Once you have results, you can use the Data Processing Framework (DPF),
27
+ which is designed to provide numerical simulation users and engineers
28
+ with a toolbox for accessing and transforming simulation data. DPF
29
+ can access data from Ansys solver result files and from several
30
+ files with neutral formats, including CSV, HDF5, and VTK. Using DPF's
31
+ various operators, you can manipulate and transform this data.
32
+
33
+ The `ansys-dpf-post package <https://github.com/ansys/pydpf-post >`_ provides
34
+ a simplified Python interface to DPF, thus enabling rapid postprocessing
35
+ without ever leaving a Python environment. For more information on DPF-Post,
36
+ see the `DPF-Post documentation <https://post.docs.pyansys.com >`_.
37
+
38
+ Install Docker image for the ``pre `` service
39
+ --------------------------------------------
40
+ To launch the ``pre `` service locally, you must have Docker installed
41
+ on your machine.
44
42
45
43
.. caution ::
46
44
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.
45
+ The `` pre `` service is available only as a Linux Docker image.
46
+ Make sure that your Docker engine is configured to run Linux Docker images.
49
47
50
- Please refer to ``docker/README.rst `` to install PyDyna-Pre service docker container
48
+ For information on installing the Docker container for the ``pre `` service,
49
+ see the ``README.rst `` file in the repository's ``docker/pre `` directory.
51
50
52
- Install PyDyna-Solver Docker
53
- ----------------------------
51
+ Install Docker image for the ``solver `` service
52
+ -----------------------------------------------
53
+ Once you install the ``ansys.dyna.core `` package, you can find the
54
+ ``docker-compose.yml `` file in the repository's ``docker `` directory.
55
+ This file is used to build and launch the ``solver `` service.
54
56
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
57
+ You can copy this YML file locally and run the Docker image for the
58
+ `` solver `` service with this command:
57
59
58
60
.. code :: bash
59
61
@@ -62,35 +64,41 @@ under ``docker``. The yml file can be copied locally. To run the docker the foll
62
64
63
65
Install the package
64
66
-------------------
67
+ The ``ansys.dyna.core `` package supports Python 3.8 through
68
+ Python 3.11 on Windows, Linux, and MacOS.
65
69
66
- PyDyna has three installation modes: user, developer, and offline.
70
+ You should consider installing PyDYNA in a virtual environment.
71
+ For more information, see Python's
72
+ `venv -- Creation of virtual environments <https://docs.python.org/3/library/venv.html >`_.
73
+
74
+ PyDYNA has three installation modes: user, developer, and offline.
67
75
68
76
Install in user mode
69
77
^^^^^^^^^^^^^^^^^^^^
70
78
71
- Before installing PyDyna in user mode, make sure you have the latest version of
72
- `pip `_ with:
79
+ Before installing PyDYNA in user mode, make sure you have the latest version of
80
+ `pip `_ with this command :
73
81
74
82
.. code :: bash
75
83
76
84
python -m pip install -U pip
77
85
78
- Then, install PyDyna with:
86
+ Then, install PyDYNA with this command :
79
87
80
88
.. code :: bash
81
89
82
90
python -m pip install ansys-dyna-core
83
91
84
92
.. caution ::
85
93
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/ ``
94
+ PyDYNA is currently hosted in a private PyPI repository. You must provide the index
95
+ URL to the private PyPI repository: ``https://pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/ ``.
90
96
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:
97
+ If access to this package registry is needed, email `
[email protected] <
mailto:[email protected] >`_
98
+ to request access. The PyAnsys team can provide you with a read-only token.
99
+
100
+ Once you have the token, run this command, replacing ``${PRIVATE_PYPI_ACCESS_TOKEN} `` with the
101
+ read-only token:
94
102
95
103
.. code :: bash
96
104
@@ -99,14 +107,14 @@ Then, install PyDyna with:
99
107
Install in developer mode
100
108
^^^^^^^^^^^^^^^^^^^^^^^^^
101
109
102
- Installing PyDyna in developer mode allows you to modify the source and enhance it.
110
+ Installing PyDYNA in developer mode allows you to modify the source and enhance it.
103
111
104
112
.. note ::
105
113
106
114
Before contributing to the project, ensure that you are thoroughly familiar
107
115
with the `PyAnsys Developer's Guide `_.
108
116
109
- Start by cloning the repository
117
+ Start by cloning and installing the repository with these commands:
110
118
111
119
.. code ::
112
120
@@ -116,31 +124,29 @@ Start by cloning the repository
116
124
117
125
Install in offline mode
118
126
^^^^^^^^^^^^^^^^^^^^^^^
127
+ If you lack an internet connection on your installation machine (or you do not have access
128
+ to the private Ansys PyPI packages repository), you should install PyDYNA by downloading
129
+ the wheelhouse archive for your corresponding machine architecture from the
130
+ `Releases Page <https://github.com/pyansys/pydyna/releases >`_ .
119
131
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.
132
+ Each wheelhouse archive contains all the Python wheels necessary to install
133
+ PyDYNA from scratch on Windows and Linux for Python 3.8 through 3.11. You can install
134
+ PyDYNA on an isolated system with a fresh Python installation or on a virtual environment.
124
135
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.
128
-
129
- For example, on Linux with Python 3.8, unzip the wheelhouse archive and install it with:
136
+ For example, on Linux with Python 3.8, unzip the wheelhouse archive and install PyDYNA
137
+ with these commands:
130
138
131
139
.. code :: bash
132
140
133
141
unzip ansys-dyna-core-v0.3.dev0-wheelhouse-Linux-3.8.zip -d wheelhouse
134
142
pip install ansys-dyna-core -f wheelhouse --no-index --upgrade --ignore-installed
135
143
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 >`_.
144
+ If you're on Windows with Python 3.8, unzip thw wheelhouse archive to a ``wheelhouse ``
145
+ directory and install PyDYNA using the preceding command.
140
146
141
147
Documentation
142
148
-------------
143
- For comprehesive information on PyDyna , see the latest release
149
+ For comprehesive information on PyDYNA , see the latest release
144
150
`documentation <https://dyna.docs.pyansys.com/ >`_.
145
151
146
152
On the `PyDyna Issues <https://github.com.mcas.ms/pyansys/pyDyna/issues >`_ page, you can create
@@ -149,7 +155,7 @@ the PyAnsys support team, email `
[email protected] <pyansys.support@ansy
149
155
150
156
Usage
151
157
-----
152
- Here is a basic pre-processing example:
158
+ Here is a basic preprocessing example:
153
159
154
160
.. code :: python
155
161
@@ -232,8 +238,6 @@ Here is a basic pre-processing example:
232
238
downloadfile = os.path.join(downloadpath," cylinder_flow.k" )
233
239
icfd_solution.download(serveroutfile,downloadfile)
234
240
235
- For more examples, visit https://dyna.docs.pyansys.com/version/stable/examples/index.html
236
-
237
241
Here is a basic solving example:
238
242
239
243
.. code :: python
@@ -244,9 +248,7 @@ Here is a basic solving example:
244
248
>> > dyna.start(4 ) # start 4 ranks of mppdyna
245
249
>> > dyna.run(" i=input.k memory=10m ncycle=20000" ) # begin execution
246
250
247
- Here is a basic post-processing example:
248
-
249
- lsdyna::d3plot: :stress_von_mises
251
+ Here is a basic postprocessing example:
250
252
251
253
.. code :: python
252
254
@@ -261,10 +263,21 @@ lsdyna::d3plot::stress_von_mises
261
263
resultOp.inputs.time_scoping.connect([3 ])
262
264
result = resultOp.outputs.stress_von_mises()
263
265
266
+ For more examples, see `Examples <https://dyna.docs.pyansys.com/version/stable/examples/index.html >`_
267
+ in the PyDYNA documentation.
268
+
264
269
License
265
270
-------
266
- Distributed under the MIT license. See LICENSE in the root directory
267
- of the repository for details.
271
+ PyDYNA is licensed under the MIT license.
272
+
273
+ PyDYNA makes no commercial claim over Ansys whatsoever. This libray extends the functionality of
274
+ Ansys LS-DYNA by adding a Python interface to LS-DYNA without changing the core behavior or
275
+ license of the original software. The use of the interactive control of PyDYNA requires a legally
276
+ licensed local copy of LS-DYNA.
277
+
278
+ For more information on LS-DYNA, see the
279
+ `Ansys LS-DYNA <https://www.ansys.com/products/structures/ansys-ls-dyna >`_
280
+ page on the Ansys website.
268
281
269
282
.. LINKS AND REFERENCES
270
283
.. _pip : https://pypi.org/project/pip/
0 commit comments