Welcome to the forums. Please post in English or French.

You are not logged in.

#1 2020-09-04 09:23:54

SalomeRookie
Member
Registered: 2020-07-23
Posts: 14

Import .med-data in python script

Hello, I am new to code Aster and working on salome-meca 2019 version.

I just finished a modell, that calculates the tensions (SIEF_NOEU). I am writing the results to a RESULT-file through IMPR_RESU.
Besides I have a python-module that needs those tensions of the .med-File to do a FKM-proof.

Now my question is: How can I import the med data of the nodes in my python-script? I need every value of SIXX, SIYY, SIZZ seperated. I attached the .med-File, too.

Thanks
Firat


Attachments:
Last.med, Size: 43.29 KiB, Downloads: 16

Offline

#2 2020-09-04 16:45:33

sb1966
Member
Registered: 2015-03-16
Posts: 178

Re: Import .med-data in python script

Hi,

I think, you can use meshio to read your med file within python and process the meshio variables, which are, AFAIK, python dictionaries. Check for meshio in GitHub.

Hope this helps

Regards.

Online

#3 2020-09-04 17:51:06

mf
Member
Registered: 2019-06-18
Posts: 117

Re: Import .med-data in python script

Hello,

why use the .med for this purpose? There may be much more trouble ahead for you if you insist on using the MED (data format in MED etc..).

In IMPR_RESU you are also able to write a plain text file of your data. All you have to do is choose FORMAT --> 'Result' (or RESULTAT if you use CA directly without SM). What is left is searching and finding your data with python and storing it in appropriate variables. No special libraries needed.

Mario.

Last edited by mf (2020-09-04 17:53:02)

Offline