Giter VIP home page Giter VIP logo

pymapdl's Introduction

PyMAPDL Logo

pyansys pypi PyPIact codecov GH-CI zenodo MIT black pre-commit

Overview

The PyMAPDL project supports Pythonic access to MAPDL to be able to communicate with the MAPDL process directly from Python. The latest ansys-mapdl-core package enables a more comprehensive interface with MAPDL and supports:

  • All the features of the original module (for example, Pythonic commands and interactive sessions).

  • Remote connections to MAPDL from anywhere via gRPC.

  • Direct access to MAPDL arrays, meshes, and geometry as Python objects.

  • Low-level access to the MAPDL solver through APDL math in a SciPy- like interface.

Here's a quick demo of PyMAPDL within Visual Studio Code:

landing_demo

PyMAPDL works within Jupyter Notebooks, the standard Python console, or in batch mode on Windows, Linux, and even Mac OS.

Documentation and issues

Documentation for the latest stable release of PyMAPDL is hosted at PyMAPDL Documentation.

In the upper right corner of the documentation's title bar, there is an option for switching from viewing the documentation for the latest stable release to viewing the documentation for the development version or previously released versions.

You can also view or download the PyMAPDL cheat sheet. This one-page reference provides syntax rules and commands for using PyMAPDL.

For troubleshooting, visit Troubleshooting PyMAPDL

On the PyMAPDL Issues page, you can create issues to report bugs and request new features. On the PyMAPDL Discussions page or the Discussions page on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.

To reach the project support team, email PyAnsys Core team. Unfortunately, this team cannot answer specific library questions or issues. You must use the PyMAPDL Issues and PyMAPDL Discussions pages for raising issues, request new features, and asking questions.

You can contribute to PyMAPDL by developing new features, fixing bugs, improving the documentation, fixing typos, writing examples, etc. To learn how to contribute to PyMAPDL, visit Contributing section.

Project transition - legacy support

This project was formerly known as pyansys, and we'd like to thank all the early adopters, contributors, and users who submitted issues, gave feedback, and contributed code through the years. The pyansys project has been taken up at Ansys and is being leveraged in creating new Pythonic, cross-platform, and multi-language service-based interfaces for Ansys's products. Your contributions to pyansys has shaped it into a better solution.

The pyansys project is expanding beyond just MAPDL, and while there are many new features and changes to the original Python module, many steps have been taken to ensure compatibility with legacy code while supporting new features. The original Python module has been split up into the following projects and modules:

For more information on each project, visit their GitHub pages.

Citing this module

If you use PyMAPDL for research and would like to cite the module and source, you can visit pyansys Zenodo and generate the correct citation. For example, the BibTex citation is:

@software{alexander_kaszynski_2020_4009467,
  author       = {Alexander Kaszynski},
  title        = {{pyansys: Pythonic interface to MAPDL}},
  month        = nov,
  year         = 2021,
  publisher    = {Zenodo},
  version      = {0.60.3},
  doi          = {10.5281/zenodo.4009466},
  url          = {https://doi.org/10.5281/zenodo.4009466}
}

Because the citation here might not be current, visit the link above to obtain the most recent citation.

License and acknowledgments

PyMAPDL is licensed under the MIT license.

ansys-mapdl-core package makes no commercial claim over Ansys whatsoever.
This tool extends the functionality of MAPDL by adding a Python interface to the MAPDL service without changing the core behavior or license of the original software. The use of the interactive APDL control of PyMAPDL requires a legally licensed local copy of Ansys.

To get a copy of Ansys, visit Ansys.

pymapdl's People

Contributors

akaszynski avatar ansys-akaszyns avatar beppo-dd avatar clatapie avatar dependabot[bot] avatar dts12263 avatar fredans avatar germa89 avatar github-actions[bot] avatar gryfenfer97 avatar jgd10 avatar jleonatti avatar jorgepiloto avatar kmkoshy avatar koubaa avatar mcmunich avatar natter1 avatar pipkat avatar plule-ansys avatar pmaroneh avatar pre-commit-ci[bot] avatar pyansys-ci-bot avatar revathyvenugopal162 avatar rileychall avatar robpasmue avatar romanilchenko1308 avatar rs-bh-n avatar simonmarwitz avatar spectereye avatar vnamdeo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pymapdl's Issues

Issue with pulling nodal stress from rst file

Before I'd actually start describing issue I'd like to compliment author's work - pyAnsys is truly amazing tool, great job ! I have some experience in APDL and I'm relatively new to python, but still setting up pyansys took me significantly less time than developing APDL script.

Anyway, there are two things I'd like to comment:

  1. is there a plan to include other result components ? At this moment I'm looking for nodal principal stress - I know I can achieve that by applying laws of mechanics to stress components in python (and I might end up doing that), but it would nice have them directly from ansys.

  2. I'm trying to read whole RST and rewrite it to text file with 10 columns (node ID, XYZcoord, stress components). I've executed following code:
    `
    import pyansys
    import numpy
    result=pyansys.ResultReader('myRstfile.rst')
    nnum = result.nnum
    disp = result.GetNodalResult(0)
    stress = result.NodalStress(0)
    print ("Nodes size: " + str(numpy.shape(nnum)))
    print ("Displ size: " + str(numpy.shape(disp)))
    print ("Stress size: " + str(numpy.shape(stress)))
    '

and as a result I've received:
Nodes size: (727562,)
Displ size: (727562, 3)
Stress size: (554638, 6).
First two look as I expected, third is surprising: how come row count is different ?

Thank you in advance,
Kind Regards,
Pawel.

Can't read layer stress data for shell elements

Hello,
I am having trouble with reading layer data for shell elements - SHELL181 in particular. The method Reader.ElementStress returns the data for one layer only. Also I am having concerns about the coordinates in which the stress tensor is read. I would like the stress tensor to be in global coordinates but I can't quite figure it out. I attached the .rst file and the .lis files with results I was expecting to get with both ElementStress(0) and NodalStress(0) method calls.

test.zip

Nevertheless, pyansys works great and saves a lot of time. Keep up the good work :)

AttributeError: 'ResultReader' object has no attribute 'uGrid'

Hello there,
I am trying to use pyansys to convert a .rst file into a vtk readable file.
This is needed because I'd like to use the .rst in Paraview (if there are other options please let me know).

The file is loaded fine as

import pyansys
rst_file = pyansys.ResultReader("my_file.rst")

but when I try to save it (rst_file.SaveAsVTK("my_new_file.vtu")), I get the following error

AttributeError: 'ResultReader' object has no attribute 'uGrid'

I do not have the VTK python bindings installed. Is that the reason why I get the error?

Thank you!

Remove vtk as a dependency

vtk does not seem to be a very hard dependency. Maybe make it optional and remove it from requirements?

TypeError: DisplayPlot() missing 1 required positional argument: 'text'

Dear Alex,

I tried to start the interactive_plotting mode of pyansys in my old laptop with Windows 7 and the following error raised.

"""
In [7]: ansys = pyansys.ANSYS(run_location=path, interactive_plotting=True)
Cached ANSYS executable not found
Found ANSYS at C:\Program Files\ANSYS Inc\v181\ANSYS\bin\winx64\ansys181.exe
Use this location? [Y/n]y

Exception Traceback (most recent call last)
in ()
----> 1 ansys = pyansys.ANSYS(run_location=path, interactive_plotting=True)

C:\dev\Miniconda3\lib\site-packages\pyansys\ansys.py in init(self, exec_file, run_location, jobname, nproc, override, loglevel, additional_switches, start_timeout, interactive_plotting, log_broadcast, check_version, prefer_pexpect)
387 raise Exception('Lock file exists for jobname %s \n' % self.jobname +
388 ' at %s' % self.lockfile +
--> 389 'Set override=True to delete lock and start ANSYS')
390 else:
391 os.remove(self.lockfile)

Exception: Lock file exists for jobname file
at C:\Users\csevast\Documents\file.lockSet override=True to delete lock and start ANSYS

In [8]: ansys = pyansys.ANSYS(run_location=path, interactive_plotting=True)
Cached ANSYS executable not found
Found ANSYS at C:\Program Files\ANSYS Inc\v181\ANSYS\bin\winx64\ansys181.exe
Use this location? [Y/n]y
2018-08-06 19:20:19,103 [INFO] pyansys.ansys: Connecting to ANSYS via CORBA
2018-08-06 19:20:25,386 [INFO] pyansys.ansys: /SHOW SWITCH PLOTS TO PNG - RASTER MODE.

In [9]: ansys.Prep7()
2018-08-06 19:20:43,127 [INFO] pyansys.ansys: *** ANSYS - ENGINEERING ANALYSIS SYSTEM RELEASE Release 18.1 18.1
***
ANSYS Academic Teaching Advanced
01039803 VERSION=WINDOWS x64 19:20:43 AUG 06, 2018 CP= 0.593

      ***** ANSYS ANALYSIS DEFINITION (PREP7) *****

TypeError Traceback (most recent call last)
in ()
----> 1 ansys.Prep7()

C:\dev\Miniconda3\lib\site-packages\pyansys\ansys_functions.py in Prep7(self, **kwargs)
26206 """
26207 command = "/PREP7," % ()

26208 return self.Run(command, **kwargs)
26209
26210 def Force(self, lab="", **kwargs):

C:\dev\Miniconda3\lib\site-packages\pyansys\ansys.py in Run(self, command)
486 def Run(self, command):
487 if self.using_corba:
--> 488 return self.RunCorbaCommand(command)
489 else:
490 return self.RunProcessCommand(command)

C:\dev\Miniconda3\lib\site-packages\pyansys\ansys.py in RunCorbaCommand(self, command)
679
680 if self._interactive_plotting:
--> 681 self.DisplayPlot()
682
683 return text, additional_text

TypeError: DisplayPlot() missing 1 required positional argument: 'text'

In [10]:

"""

Question: Can I extract nodal temperatures from .rst?

Hi,
first of all I really enjoy the work you put into this library!
My question regards possibility of extracting nodal temperatures (plnsol,bfe,temp) from structural result file ? In a top level manner I would like to have time vs nodal temp and stress for each node to perform LCF calculation.

Thanks for your great work!
Kris

fix examples

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jeff/.local/lib/python3.5/site-packages/pyansys/examples/examples.py", line 34, in RunAll
    any(f() for f in testfunctions)
  File "/home/jeff/.local/lib/python3.5/site-packages/pyansys/examples/examples.py", line 34, in <genexpr>
    any(f() for f in testfunctions)
  File "/home/jeff/.local/lib/python3.5/site-packages/pyansys/examples/examples.py", line 308, in CylinderANSYS
    result.PlotNodalResult(0, colormap='bwr')
AttributeError: 'Result' object has no attribute 'PlotNodalResult'

Stresses read by pyansys do not match ANSYS at every node

Hi, attached a zipped debug_pyansys.rst,

import pyansys
result = pyansys.ResultReader("debug_pyansys.rst")
result.edge_node_num[0:10]
result.NodalStress(0)[0:3]

I get from pyansys

>>> result.edge_node_num[0:10]
array([ 1,  2,  4,  6,  8, 10, 12, 15, 34, 35])
>>> result.NodalStress(0)[0:3]
array([[-1.2874937e-06,  1.2874934e-06,  5.6843419e-14,  0.0000000e+00, 8.1756007e-06, -8.1756007e-06],
       [-1.1674185e-04, -1.1674478e-04, -3.0856981e-04, -1.7892545e-06, -2.5823609e-05,  2.5835518e-05],
       [-5.7354209e-05, -5.5398770e-05, -1.4944717e-04, -1.0580692e-06, -1.7659733e-05, -3.5462126e-06]], dtype=float32)

From ANSYS with

set,1,1
*get,foo,node,1,s,x
*get,foo,node,1,s,y
*get,foo,node,1,s,z
...
 *GET  FOO       FROM  NODE      1  ITEM=S    X     VALUE=-0.128749366E-05
 *GET  FOO       FROM  NODE      1  ITEM=S    Y     VALUE= 0.128749343E-05
 *GET  FOO       FROM  NODE      1  ITEM=S    Z     VALUE= 0.568434189E-13
 *GET  FOO       FROM  NODE      2  ITEM=S    X     VALUE=-0.116741852E-03
 *GET  FOO       FROM  NODE      2  ITEM=S    Y     VALUE=-0.116744777E-03
 *GET  FOO       FROM  NODE      2  ITEM=S    Z     VALUE=-0.308569797E-03
 *GET  FOO       FROM  NODE      4  ITEM=S    X     VALUE=-0.553783551E-04
 *GET  FOO       FROM  NODE      4  ITEM=S    Y     VALUE=-0.536294307E-04
 *GET  FOO       FROM  NODE      4  ITEM=S    Z     VALUE=-0.148084539E-03

Values on nodes 1 and 2 seem to be ok, but on node 4 the values differ.

The mesh is done using solid186 (20 node) element, but the shape of the elements in this mesh is prism. When ANSYS calculates the stress averages, at each location each element is counted only once (and not twice when the nodes of the element are coincident in case of prisms).

debug_pyansys.zip

Fix docs

Ansys functions not showing up in docs

Writing to VTK file

I am in the process of adding the functionality to write results to a VTK unstructured grid (.vtu) format using vtk.vtkXMLPUnstructuredGridWriter(). So that I may view results in Paraview and do further post processing.

So far I have made small changes to the reader file to return the uGrid object and then write this to a file. However in paraview the only available data set are the node number. Indicating that I am unsuccessfully associating the data set with the uGrid object when writing to file.

Is this a functionality you are considering? Or something you be able to assist with?

Cannot import name "_parsefull"

Hi.

I try to call "from pyansys import Reader" and receive ImportEror "Cannot import name "_parsefull""

I can not understand why. Could you help me?

Export RHS/Load vector in full file

I'm attempting to develop state-space models of a finite element model and while I can get the mass and stiffness matrices through pyansys, I am unable to get the RHS/load vector which is needed to develop a full state-space model. Would it be possible to define a method that would perform this action?

Windows compatibility

It is great job for ANSYS, APDL and Python users.

Unfortunately the interactive mode is not usable in Windows. In the pyansys code there are a lot of method calls for the ANSYS process (isalive) which are not available for Windows. The ANSYS output window is black โ€” I don't know how it should be; in ANSYS CLI mode there is the BEGIN: prompt, line 253 self.process.expect('CONTINUE') has to be commented, for every command sent to ANSYS return/enter has to be pressed in ANSYS output window, and many other issues, like plotting, are unsolved. I'm using ANSYS Mechanical v18.1.

Anyway, the postprocessing part of the module shows no problems in Windows. ANSYS surface output files processing should be nice to be added. The VTK display is looking even better than ANSYS's display drivers.

Thank you for your attention.

about assert "Data set index table has negative pointers"

when I follow the instruction and read my rst file, the assert sentence appears.
Could you tell me what happen when it read my .rst file using pyansys.ResultReader() command?
How can I correct the file so that I can get results?

Fix Colormaps

Not specifying a colormap in mode shape plotting results in a white mesh.

Short time

Dear Alex,

I tried the new version of pyansys on a rather old laptop -core2duo- in which the first run of ANSYS server is slow. The pyansys aborts the ANSYS starting procedure due to the short -20.0 seconds- waiting time and the delayed ANSYS server is becoming unreachable from python shell. The started ANSYS server has to be killed and its lock file to be cleaned up manually. After the first startup and cleanup attempt the ansys object can be instantiated.

"""
In [4]: path = os.getcwd()

In [5]: ansys = pyansys.ANSYS(run_location=path, interactive_plotting=True)
Cached ANSYS executable not found
Found ANSYS at C:\Program Files\ANSYS Inc\v181\ANSYS\bin\winx64\ansys181.exe
Use this location? [Y/n]y
2018-08-06 19:17:31,199 [INFO] pyansys.ansys: Connecting to ANSYS via CORBA
2018-08-06 19:17:51,338 [ERROR] pyansys.ansys: Unable to start ANSYS within 20.0 seconds

TimeoutError Traceback (most recent call last)
in ()
----> 1 ansys = pyansys.ANSYS(run_location=path, interactive_plotting=True)

C:\dev\Miniconda3\lib\site-packages\pyansys\ansys.py in init(self, exec_file, run_location, jobname, nproc, overr
ide, loglevel, additional_switches, start_timeout, interactive_plotting, log_broadcast, check_version, prefer_pexpect
)
405 self.OpenProcess(nproc, start_timeout)
406 else: # use corba
--> 407 self.OpenCorba(nproc, start_timeout)
408
409 # separate logger for broadcast file

C:\dev\Miniconda3\lib\site-packages\pyansys\ansys.py in OpenCorba(self, nproc, timeout)
831 err_msg = 'Unable to start ANSYS within %.1f seconds' % timeout
832 self.log.error(err_msg)
--> 833 raise TimeoutError(err_msg)
834
835 # open server

TimeoutError: Unable to start ANSYS within 20.0 seconds

In [6]: ansys.Exit()

NameError Traceback (most recent call last)
in ()
----> 1 ansys.Exit()

NameError: name 'ansys' is not defined
"""

Cannot import pyansys in python 3.6

Hi.

I use Python 3.6.5 on Windows 7 x64. when I import the pyansys and got Import error "cannot import name '_reader'
Could you help me to solve this error?

stresses

Thank you very much for providing this functionality.
Is there an easy way to visualize stresses or other results other than displacements with pyansys?

LoadKM: negative dimensions are not allowed

Dear Alex!

I tried to use pyansys to get stiffness matrix from a fullfile. When I ran the code with my fullfile, it showed the following error message: negative dimensions are not allowed
The code run very well with the example (which contain the pyansys), but with mine its not work!
Do you have any idea, what can I do to solve the problem?

My model contains only one element without boundary conditions.

I used the next code:
import pyansys
from pyansys import examples

file=examples.fullfile
ans=pyansys.FullReader('elem.full')

dof_ref, k, m = ans.LoadKM()

If you want, I can send you the fullfile.
Thanks,
Daniel

[Suggestion] Using Windows Subsystem Linux

Hi there,

I was trying to use your app in windows and as you mentioned in another issue. It does not work, basically because the command output window is not very responsive in windows. (I hope I got the concept properly).

So I was checking the web, and I found out the WSL which allows installing Linux kernel in Windows. So I wonder if it could be possible from that, lunch Ansys from that command line as it was launched from Linux. Maybe you can get all the required flexibility.

It's a crazy idea, but I have no knowledge to check for myself. I can install the WSL and Ubuntu but I can't go from the command line.

I hope it helps! Kind regards,

MAPDL RPC client requesting shutdown

I experience that ANSYS suddenly shuts down prematurely with this message in the error log:

  • MAPDL RPC client requesting shutdown...

It might be due to a license issue. In fact I have the licenses I need, though I'm not able to specify the license to PyAnsys. When using ANSYS from the command line I would use the -p option to specify a product name. I have tried to use the additional_swithes option for this, but without success. It look like the additional_switches setting is ignored.

2D Element Types

It would be really nice if plane42/82 (legacy) and plane182/183 element types were added .
If you don't have the time for it, i think i will try to contribute to the project.

Buffer dtype mismatch, expected 'long' but got 'long long'

hi, there is an error when I get nodal stress using NodalStress() method. I use the rst file in your closed issues "test_pyansys.rst".
I guess there is something wrong with numpy.int64 type.

the code is below:

stress = result.NodalStress(0)
Traceback (most recent call last):

  File "<ipython-input-12-6342d70f8bcd>", line 1, in <module>
    stress = result.NodalStress(0)

  File "C:\Users\zxmy\Anaconda3\lib\site-packages\pyansys\binary_reader.py", line 977, in NodalStress
    self.edge_idx.astype(np.int64))

  File "pyansys/cython/_rstHelper.pyx", line 158, in pyansys._rstHelper.LoadStress

ValueError: Buffer dtype mismatch, expected 'long' but got 'long long'

Generating APDL file

From a developer perspective it's extremely nice to be able to run APDL commands interactively on a running ANSYS instance. However, sometimes it's better to generate the APDL code as a file and run it in ANSYS later.

Would it be a big deal to make it possible to starte a 'fake' ANSYS that simply writes all commands to a file?

Maybe this is what the /OUTPUT flag already does?

Number of Stress Results vs. Number of Nodes

Hello,

for the example file.rst I get a different number of stress results than the number of nodes.
for:
print "number nodes: ", len(result.nnum)
print "number elements: ", len(result.enum)
print "number nodal stress results: ", len(result.NodalStress(0))
I get:
number nodes: 321
number elements: 40
number nodal stress results: 99 (Stress Tensors)

Shouldn't the number of stress tensors be equal to the number of nodes?

Best regards,

error with pyansys 0.15 example

Hi,

when I try to run the "Loading and Plotting an ANSYS Result File" example, I get the following error

raise Exception('Unsupported type {:s} for vtk copy'.format(typestring))

Exception: Unsupported type <type 'vtkobject for vtk copy

The 0.13 version example with LoadCDB works perfectly. Must have been due to some changes in the new version.

Thank you for your support.

Btw I am still struggling to find a way to plot element solutions (stresses, plastic strains etc.). Would be great if the functionality was available as well.

Beam188 stresses in Python workspace

I am trying to get the stresses from an analysis with beam 188 into my Python workspace. In APDL, I do this via etables. Does pyANSYS allow for this?

Thanks in advance!

Question: Is it possible to write binary (.rst) files?

Hi,
Thank you for your work so far! Your library is really useful!

As I wrote in the title beside of the extraction of the binary in certain cases I would like to modify it.
What do you think, is it possible?

Best regards,
Bela

*GET into workspace

A question related to #19

Is it possible to get variables from *GET into the Python workspace?

Mismatch in number of nodes

Working with the rst file in the default example, I see the size of Nodal stress as 99x6 where as the number of nodes, obtained from the geometry attribute, in this example is 321. I guess the 6 corresponds to the stress components, but shouldn't I see 321x6 values of stresses i.e. number of node x DoF?

Different behaviour than documented

  1. VTK plot of hexarchivefile looks different than documented. In ANSYS the mesh looks as documented.
  2. The included RST file contains different data than documented. ANSYS plots different data, so does VTK. Same mesh issue as above.

Non-average Stress @ Top & Bottom Planes of Shell Elements

Hello,

I am currently promoting Pyansys in our company for fast screening of large structures to perform fatigue analysis. However I have two issues to resolve:

(1) I have not been able to extract the element stress (non-average) at top and bottom planes of shell elements. What "result.ElementStress(0)" provides is only the element stress at Mid-plane of shell elements through an array with 4 rows, which cannot be used for fatigue analysis. Is there any way to get the element stress through an array with 8 rows including 4 nodes at the top layer and 4 nodes at the bottom layer ?

(Note: Mid-plane results is indeed the average of top and bottom planes of shell elements. For a rectangular shell elements we have 4 top nodes and 4 bottom nodes, so the stress array should have 8 rows to capture the bending effect. This is how we traditionally extracted the results from ANSYS binary rst file.)

(2) We need to extract the component stresses for shell elements in the Element Coordinate System instead of the Global Coordinate System. Any suggestion?

Thanks in advance.
-Shobeir

Node Locations With Nodal Solution

Hi Alex,

Sorry if this is the wrong platform to ask this, is it possible to get the nodal solutions to export with the node locations from the pyansys.ResultReader object? Or get the node numbers with node locations from the result file?

Install v0.33.0 fail

Hi,

I tried to upgrade pyansys and than reinstall it but non of these worked. I got the following error:

cl : Command line warning D9025 : overriding '/W3' with '/w'
_parsefull.c
c1: fatal error C1083: Cannot open source file: 'pyansys/cython/_parsefull.c': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

Am I missing something? (0.32.4 working fine for me)
Thanks!!

Trouble Reading Shell 281 Elements

Hi Alex,

I am trying to read some ansys RST files containing SHELL 281 and SOLID 186 Elements. PyAnsys seems to plot the solid elements with no issue; however, it does not show any of the shell elements.

In addition, looking at the numerical data, when using the elem command to see the nodes in the element, it looks as though only the first 4 nodes are listed for any element.

Does PyAnsys not support 8 node shell elements yet?
If this is the case, I'm fairly new to python coding, but would be willing to help implement it if you plan on doing it.

Keep up the amazing work!

Cheers,
Jakub

Querying results

Is is possible to make the nodes selectable in the VTK and to know the result and node number at a particular node?

ValueError: 'list' argument must have no negative elements

Hi

When reading in my own rst-file (from Ansys 17.2), I get this error when issuing the PlotNodalStress() command. I can see from the result object that the "edge_idx" and the "edge_node_num_idx" arrays both have a "-1" number in them, which I guess is causing the problem. Can something be done to prevent this?

Thanks in advance!

image

IndexError exception when call NodalSolution method of CyclicResult object

I loaded the result file 'rotor.rst' in #22, but IndexError Exception is raised when call the NodalSolution method.

import pyansys
result = pyansys.ResultReader('rotor.rst')
nnum, ms = result.NodalSolution(10)     # <----- Exception arised here

The detailed exception message is,

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Anaconda3\lib\site-packages\pyansys-0.27.2-py3.6-win-amd64.egg\pyansys\binary_reader.py", line 1473, in NodalSolution
    nnum = nnum[self.mas_ind]  # only concerned with the master sector
IndexError: index 460 is out of bounds for axis 1 with size 460

Read material and section id from CDB?

Hi Alex,
a nice and very fast software you have developed here. Thank you.

For our purpose, we also would be interested to read the section and material properties as given in the EBLOCK statement (element 1 of statement = material, element 4 = section id). Any chance to have this implemented in the reader.c file and then return it as an additional vector?

The actual parsing of the material and section statements I might be able to implement myself in the relevant python code. Or let me know if you need some examples.

Thank you,
Michael

Pyansys

How to read .cas and .dat files obtained from ansys fluent?

Libraries missing "AnsMPI.dll" and "AnsGPU.dll"

Hi there,

After installing and setting the exe path using:

import pyansys

ansys = pyansys.ANSYS(exec_file="C:\\Program Files\\ANSYS Inc\\v180\\ansys\\bin\\winx64\\ANSYS.exe", run_location=None, jobname='file', nproc=None, override=False, wait=True, loglevel='INFO')

I get two windows pup up which say:

The code execution cannot proceed because AnsMPI.dll was not found. Reinstalling the program may fix this problem.

and

The code execution cannot proceed because AnsGPU.dll was not found. Reinstalling the program may fix this problem.

Any idea how to fix it?

Python 3.7 support

When installing in a fresh conda created python 3.7 environment, I get the following error:

(base) C:>conda create -n py37 python=3.7 numpy cython
...
(base) C:>conda activate py37
(py37) C:>pip install pyansys
Collecting pyansys

... (removed the other dependency lines that were successful)

Collecting vtk (from vtkInterface>=0.11.0->pyansys)
Could not find a version that satisfies the requirement vtk (from vtkInterface>=0.11.0->pyansys) (from versions: )
No matching distribution found for vtk (from vtkInterface>=0.11.0->pyansys)

Note: the same procedure for python 3.6 works fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.