You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Minimum requirements are numpy to extract results from a results file. To
22
-
convert the raw data to a VTK unstructured grid, VTK 5.0 or greater must
23
-
be installed with Python bindings.
21
+
Minimum requirements are numpy to extract results from a results file. To convert the raw data to a VTK unstructured grid, VTK 5.0 or greater must be installed with Python bindings.
24
22
25
23
26
24
Quick Examples
27
25
--------------
28
-
29
26
Many of the following examples are built in and can be run from the build-in
30
27
examples module. For a quick demo, run:
31
28
@@ -34,6 +31,34 @@ examples module. For a quick demo, run:
34
31
from pyansys import examples
35
32
examples.RunAll()
36
33
34
+
35
+
Controlling ANSYS
36
+
~~~~~~~~~~~~~~~~~
37
+
Create an instance of ANSYS and send commands to it.
38
+
39
+
.. code:: python
40
+
41
+
import os
42
+
import pyansys
43
+
44
+
path = os.getcwd()
45
+
ansys = pyansys.ANSYS(run_location=path)
46
+
47
+
# create a square area using keypoints
48
+
ansys.Prep7()
49
+
ansys.K(1, 0, 0, 0)
50
+
ansys.K(2, 1, 0, 0)
51
+
ansys.K(3, 1, 1, 0)
52
+
ansys.K(4, 0, 1, 0)
53
+
ansys.L(1, 2)
54
+
ansys.L(2, 3)
55
+
ansys.L(3, 4)
56
+
ansys.L(4, 1)
57
+
ansys.Al(1, 2, 3, 4)
58
+
ansys.Save()
59
+
ansys.Exit()
60
+
61
+
37
62
Loading and Plotting an ANSYS Archive File
38
63
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39
64
@@ -58,7 +83,7 @@ be loaded using ReadArchive and then converted to a vtk object.
58
83
59
84
# Create a vtk unstructured grid from the raw data and plot it
60
85
archive.ParseFEM()
61
-
archive.uGrid.Plot()
86
+
archive.grid.Plot()
62
87
63
88
# write this as a vtk xml file
64
89
archive.SaveAsVTK('hex.vtu')
@@ -71,7 +96,7 @@ VTK.
71
96
72
97
# Load this from vtk
73
98
import vtkInterface
74
-
grid = vtkInterface.LoadGrid('hex.vtk')
99
+
grid = vtkInterface.UnstructuredGrid('hex.vtk')
75
100
grid.Plot()
76
101
77
102
@@ -173,9 +198,10 @@ frequencies and mode shapes.
173
198
5781.975 Hz
174
199
6919.399 Hz
175
200
176
-
License
177
-
-------
178
-
179
-
pyansys is licensed under the MIT license.
201
+
License and Acknowledgments
202
+
---------------------------
203
+
``pyansys`` is licensed under the MIT license.
180
204
205
+
ANSYS documentation and functions build from html provided by `Sharcnet <https://www.sharcnet.ca/Software/Ansys/>`_. Thanks!
181
206
207
+
This module, ``pyansys`` makes no commercial claim over ANSYS whatsoever. This tool extends the functionality of ``ANSYS`` by adding a python interface in both file interface as well as interactive scripting without changing the core behavior or license of the original software. The use of the interactive APDL control of ``pyansys`` requires a legally licensed local copy of ANSYS.
0 commit comments