Giter VIP home page Giter VIP logo

Comments (12)

1990chs avatar 1990chs commented on June 5, 2024 1

OK , I get it. Thinks

from pymapdl.

akaszynski avatar akaszynski commented on June 5, 2024

Hello,

Yes, I can do that. I'm a bit swamped with work with other projects, but if you provide an example file and expected ANSYS results, I can put something together. Please make the example file small (<1 MB) so I'll be able to include this in the test files.

from pymapdl.

kokninski avatar kokninski commented on June 5, 2024

Hi,
thanks for your answer! I will generate such .rst.

from pymapdl.

kokninski avatar kokninski commented on June 5, 2024

Hi,
here is the sample .rst I created. It is a brick with temperatures applied. Only one load step in file.
file.rst.gz

from pymapdl.

akaszynski avatar akaszynski commented on June 5, 2024

Sorry, took about a year to get around to this! Suppose better late than never:

You can as of d742ea1 and pyansys=0.39.7 (to be uploaded to PyPi shortly.

import pyansys

# load result and grab the nodal tempatures
result = pyansys.read_binary('file.rst')
nnum, ndata = result.nodal_temperature(0)

# print the first 10 values
for i, temp in enumerate(ndata[:10]):
    print('%5d  %.2f' % (nnum[i], temp))
    1  60.00
    2  60.00
    3  60.00
    4  60.00
    5  60.00
    6  60.00
    7  60.00
    8  60.00
    9  60.00
   10  60.00

from pymapdl.

akaszynski avatar akaszynski commented on June 5, 2024

You can plot it too!

import pyansys

# load result and grab the nodal tempatures
result = pyansys.read_binary('file.rst')

# plot and take a screenshot
result.plot_nodal_temperature(0, show_edges=True, screenshot='screenshot.png')

screenshot

from pymapdl.

1990chs avatar 1990chs commented on June 5, 2024

@akaszynski
nnum, ndata = result.nodal_temperature(0)
It means that temperature(0) return node numbers list (nnum) and corresponding node temperatures list(ndata) ?
By the way what's the different meaning about the index in result.nodal_temperature(index) ?

from pymapdl.

akaszynski avatar akaszynski commented on June 5, 2024

It means that temperature(0) return node numbers list (nnum) and corresponding node temperatures list(ndata) ?
Correct, except ndata is an array.

By the way what's the different meaning about the index in result.nodal_temperature(index) ?
The index variable is the 0 indexed result number corresponding to the index of the result in rst.time_values

from pymapdl.

1990chs avatar 1990chs commented on June 5, 2024

@akaszynski
The index variable is the 0 meaning that the temperature is the first step result? The index means the step number ?

from pymapdl.

akaszynski avatar akaszynski commented on June 5, 2024

Index corresponds to the cumulative result number. I should have provided a better interface for this, but the table can be obtained nonetheless via:

>>> from ansys.mapdl.reader import examples
>>> from ansys.mapdl import reader as pymapdl_reader
>>> rst = examples.download_academic_rotor_result()
>>> rst._resultheader['ls_table']
array([[ 1,  1,  1],
       [ 1,  2,  2],
       [ 2,  1,  3],
       [ 2,  2,  4],
       [ 3,  1,  5],
       [ 3,  2,  6],
       [ 4,  1,  7],
       [ 4,  2,  8],
       [ 5,  1,  9],
       [ 5,  2, 10],
       [ 6,  1, 11],
       [ 6,  2, 12],
       [ 7,  1, 13],
       [ 7,  2, 14],
       [ 8,  1, 15],
       [ 8,  2, 16],
       [ 9,  1, 17],
       [ 9,  2, 18],
       [10,  1, 19],
       [10,  2, 20],
       [11,  1, 21],
       [11,  2, 22],
       [12,  1, 23],
       [12,  2, 24],
       [13,  1, 25],
       [13,  2, 26]], dtype=int32)

Where the columns are [loadstep, substep, cumulative number].

from pymapdl.

1990chs avatar 1990chs commented on June 5, 2024

Does pyansys replace by the following modulus ?

from ansys.mapdl import reader as pymapdl_reader
resultfile = os.path.join(mapdl.path, '%s.rst' % mapdl.jobname)
result = pymapdl_reader.read_binary(result file)

from pymapdl.

akaszynski avatar akaszynski commented on June 5, 2024

Does pyansys replace by the following modulus ?

Yes. We've split up the modules such that ansys-mapdl-core is the interface for MAPDL and ansys-mapdl-reader is an interface to the files.

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.