Giter VIP home page Giter VIP logo

Comments (24)

akaszynski avatar akaszynski commented on May 25, 2024

from pymapdl.

rostar avatar rostar commented on May 25, 2024

Thank you very much! But I'd rather need to learn how to display/extract the stresses and other results myself as I will need to do that more frequently with various ANSYS models.
I am developing a predictive probabilistic tool that evaluates thermal fields, plastic strains, von Mieses stresses etc. and transforms these into probabilities of failure, lifetimes etc.
Don't you plan to write PlotStress and PlotStrain methods similiar to the PlotDisplacement one?
Thank you

from pymapdl.

akaszynski avatar akaszynski commented on May 25, 2024

from pymapdl.

rostar avatar rostar commented on May 25, 2024

test_pyansys.zip

from pymapdl.

rostar avatar rostar commented on May 25, 2024

OK, here is a simple example. Thank you!

from pymapdl.

akaszynski avatar akaszynski commented on May 25, 2024

The sample runs with the following code

from pyansys import Reader

result = Reader.ResultReader('test_pyansys.rst')
result.LoadCDB('test_pyansys.cdb')
result.GetTimeValues()
result.GetResult(0)
result.PlotDisplacement(0)

With this from VTK
screenshot

Aside from renaming PlotDisplacement to PlotResult, is there anything else that needs to be done? Were there more results in the result file?

from pymapdl.

ilyafyodorov avatar ilyafyodorov commented on May 25, 2024

Hi! Thanks for a very useful script! Do you know how to extract element solution data? How to get a pointer similar to ptrNSLl, but to the element solution? Many thanks!

from pymapdl.

akaszynski avatar akaszynski commented on May 25, 2024

I'll take a look at tonight and add a way to extract element solution data.

from pymapdl.

ilyafyodorov avatar ilyafyodorov commented on May 25, 2024

Just found it - it is the next pointer after nodal results, ptrESL :)

from pymapdl.

akaszynski avatar akaszynski commented on May 25, 2024

Good find! Would you like to contribute your code?

from pymapdl.

jfb62 avatar jfb62 commented on May 25, 2024

Thank you very much for this sript. I have a problem to read displacement solution data with a rst file containing a large number of sets--> the Reader give an error of overflow.
I put the error below:
Warning (from warnings module):
File "C:\Python27\lib\site-packages\pyansys\Reader.py", line 352
f.seek(((self.rpointers[rnum] + 12)*4)) # item 12
RuntimeWarning: overflow encountered in int_scalars

Traceback (most recent call last):
File "C:\Users\jbrunel\Downloads\Bureau_24032016\TEI\2Faces\tempe.py", line 29, in
fobj.PlotDisplacement(300)
File "C:\Python27\lib\site-packages\pyansys\Reader.py", line 246, in PlotDisplacement
result = self.GetResult(rnum, True)
File "C:\Python27\lib\site-packages\pyansys\Reader.py", line 352, in GetResult
f.seek(((self.rpointers[rnum] + 12)*4)) # item 12
IOError: [Errno 22] Invalid argument

(fobj.rpointers[300]+12)*4

Warning (from warnings module):
File "C:\Users\jbrunel\Downloads\Bureau_24032016\TEI\2Faces\tempe.py", line 2
"""
RuntimeWarning: overflow encountered in int_scalars

Some ideas?
Thanks!!

from pymapdl.

akaszynski avatar akaszynski commented on May 25, 2024

from pymapdl.

jfb62 avatar jfb62 commented on May 25, 2024

You can find the rst file at the link : www.transfernow.net/296e01e09pgu

Sorry for the size of the file (2Gb)!!!)

the '.py' file:

# Load the reader from pyansys
from pyansys import Reader
from ANSYScdb import CDB_Reader
from ANSYScdb import PythonReader
# Create result reader object
fobj = Reader.ResultReader('disc.rth')
temp = fobj.GetResult(300)

If you modify the rnum at 299 is ok, the problem occurs when rnum is greater than 300!

from pymapdl.

akaszynski avatar akaszynski commented on May 25, 2024

from pymapdl.

akaszynski avatar akaszynski commented on May 25, 2024

from pymapdl.

akaszynski avatar akaszynski commented on May 25, 2024

I'm ready to work on this project again, but I can't seem to find the database I downloaded. Could you please upload it again?

from pymapdl.

akaszynski avatar akaszynski commented on May 25, 2024

rostar,

I've added stress and geometry loading to release 0.16 and see the new documentation.

Let me know if it works out. It's not on PyPi yet, so you'll have to download and install from source here from GitHub. Let me know if it works out.

from pymapdl.

rostar avatar rostar commented on May 25, 2024

Hi akazynski,

if I run

python setup.py install

the process stops with the following error:
c1 : fatal error C1083: Cannot open source file: 'pyansys/cython/reader.c': No such file or directory

If I clone from git, I get this on import

from pyansys import _parsefull

ImportError: cannot import name _parsefull

Very much appreciate your help!

from pymapdl.

akaszynski avatar akaszynski commented on May 25, 2024

Forgot to include reader.c, sorry about that!

I've just added it and tested the install on python 2.7 on Linux by cloning to a virtual environment and testing it there, so it will work from GitHub.

from pymapdl.

rostar avatar rostar commented on May 25, 2024

Thank you.
Unfortunately, python now crashes on calling
pyansys.ResultReader(rstfile)

"python.exe has stopped working"
... no futher relevant details ...

I am using Windows 10 but I will install Ubuntu 16 in virtualbox to check whether its platform dependent.
R

from pymapdl.

rostar avatar rostar commented on May 25, 2024

... with python 2.7 from Anaconda

from pymapdl.

akaszynski avatar akaszynski commented on May 25, 2024

Just ran it on windows 7 and it's indeed a problem. I'll fix it and post the updated code. Thanks for testing this out.

from pymapdl.

akaszynski avatar akaszynski commented on May 25, 2024

Fixed Windows bugs with Python 2 and 3 and uploaded it to PyPi.

from pymapdl.

rostar avatar rostar commented on May 25, 2024

Great! Works perfectly.
Thank you very much.

from pymapdl.

Related Issues (20)

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.