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.
44
44
45
45
.. caution ::
46
46
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.
49
49
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.
51
52
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.
54
58
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:
57
61
58
62
.. code :: bash
59
63
@@ -62,51 +66,57 @@ under ``docker``. The yml file can be copied locally. To run the docker the foll
62
66
63
67
Install the package
64
68
-------------------
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 >`_.
65
75
66
- PyDyna has three installation modes: user, developer, and offline.
76
+ PyDYNA has three installation modes: user, developer, and offline.
67
77
68
78
Install in user mode
69
- ^^^^^^^^^^^^^^^^^^^^
79
+ ~~~~~~~~~~~~~~~~~~~~
70
80
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 :
73
83
74
84
.. code :: bash
75
85
76
86
python -m pip install -U pip
77
87
78
- Then, install PyDyna with:
88
+ Then, install PyDYNA with this command :
79
89
80
90
.. code :: bash
81
91
82
92
python -m pip install ansys-dyna-core
83
93
84
94
.. caution ::
85
95
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/ ``.
90
98
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:
94
104
95
105
.. code :: bash
96
106
97
107
pip install ansys-dyna-core --index-url=https://${PRIVATE_PYPI_ACCESS_TOKEN} @pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/
98
108
99
109
Install in developer mode
100
- ^^^^^^^^^^^^^^^^^^^^^^^^^
110
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
101
111
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.
103
113
104
114
.. note ::
105
115
106
116
Before contributing to the project, ensure that you are thoroughly familiar
107
117
with the `PyAnsys Developer's Guide `_.
108
118
109
- Start by cloning the repository
119
+ Start by cloning and installing the repository with these commands:
110
120
111
121
.. code ::
112
122
@@ -115,41 +125,40 @@ Start by cloning the repository
115
125
pip install -e .
116
126
117
127
Install in offline mode
118
- ^^^^^^^^^^^^^^^^^^^^^^^
128
+ ~~~~~~~~~~~~~~~~~~~~~~~
119
129
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 >`_ .
124
134
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.
128
138
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:
130
141
131
142
.. code :: bash
132
143
133
144
unzip ansys-dyna-core-v0.3.dev0-wheelhouse-Linux-3.8.zip -d wheelhouse
134
145
pip install ansys-dyna-core -f wheelhouse --no-index --upgrade --ignore-installed
135
146
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.
140
149
141
150
Documentation
142
- -------------
143
- For comprehesive information on PyDyna , see the latest release
151
+ =============
152
+ For comprehesive information on PyDYNA , see the latest release
144
153
`documentation <https://dyna.docs.pyansys.com/ >`_.
145
154
146
155
On the `PyDyna Issues <https://github.com.mcas.ms/pyansys/pyDyna/issues >`_ page, you can create
147
156
issues to submit questions, report bugs, and request new features. To reach
148
157
the PyAnsys support team, email `
[email protected] <
[email protected] >`_.
149
158
150
159
Usage
151
- -----
152
- Here is a basic pre-processing example:
160
+ =====
161
+ Here is a basic preprocessing example:
153
162
154
163
.. code :: python
155
164
@@ -232,8 +241,6 @@ Here is a basic pre-processing example:
232
241
downloadfile = os.path.join(downloadpath," cylinder_flow.k" )
233
242
icfd_solution.download(serveroutfile,downloadfile)
234
243
235
- For more examples, visit https://dyna.docs.pyansys.com/version/stable/examples/index.html
236
-
237
244
Here is a basic solving example:
238
245
239
246
.. code :: python
@@ -244,9 +251,7 @@ Here is a basic solving example:
244
251
>> > dyna.start(4 ) # start 4 ranks of mppdyna
245
252
>> > dyna.run(" i=input.k memory=10m ncycle=20000" ) # begin execution
246
253
247
- Here is a basic post-processing example:
248
-
249
- lsdyna::d3plot: :stress_von_mises
254
+ Here is a basic postprocessing example:
250
255
251
256
.. code :: python
252
257
@@ -261,10 +266,21 @@ lsdyna::d3plot::stress_von_mises
261
266
resultOp.inputs.time_scoping.connect([3 ])
262
267
result = resultOp.outputs.stress_von_mises()
263
268
269
+ For more examples, see `Examples <https://dyna.docs.pyansys.com/version/stable/examples/index.html >`_
270
+ in the PyDYNA documentation.
271
+
264
272
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.
268
284
269
285
.. LINKS AND REFERENCES
270
286
.. _pip : https://pypi.org/project/pip/
0 commit comments