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

You are not logged in.

#1 2021-02-09 16:56:30

GPSalachs
Member
Registered: 2018-03-10
Posts: 251

C.A. python version instead of UNITE what is used?

Hello,

i would like to ask some questions regarding the pythonic version of Code_Aster!
In the examples that i have seen it is possible to read a mesh file with :

MESH = code_aster.Mesh()
MESH.readMedFile(path+"/NAMEOFTHEFILE.med")

Now i want to ask how to print the results but not in format "RESULTAT" but in format "MED". Also if it is possible to know
how to assign external files in the UNITE now, or will the UNITE not be used?

Thank you!

Offline

#2 2021-02-10 08:57:15

GPSalachs
Member
Registered: 2018-03-10
Posts: 251

Re: C.A. python version instead of UNITE what is used?

I have found a workaround on this read/write results :

unit = 3

DEFI_FICHIER(ACTION='ASSOCIER',
                FICHIER=path + "/RESULT.med",
                UNITE=unit,);

IMPR_RESU(FORMAT='MED',
          RESU=_F(RESULTAT= RESLIN),UNITE = 3)


One can also read from external files by defining with defi_fischier the wanted file. I would like to know also if there are
alternative solutions on this matter!

Thank you very much!

Offline

#3 2021-02-10 08:59:39

nicolas_p
Member
Registered: 2020-04-14
Posts: 41

Re: C.A. python version instead of UNITE what is used?

If you want to use IMPR_RESU, this is the only way.

You can also try: myResult.printMEDFile("myPath")

Offline

#4 2021-02-10 09:07:28

GPSalachs
Member
Registered: 2018-03-10
Posts: 251

Re: C.A. python version instead of UNITE what is used?

nicolas_p wrote:

If you want to use IMPR_RESU, this is the only way.

You can also try: myResult.printMEDFile("myPath")

Thank you very much for the reply! I will indeed use that too because it seems to be a way to keep the script cleaner from all the UNITE used.
I would like to come back with a question instead. Where can the readMEDFIle(), printMEDFile() commands or other commands be found (?) Is there a documentation that indicates them or they are gathered from the available testcases?

Thank you very much!

Offline

#5 2021-02-10 09:26:33

nicolas_p
Member
Registered: 2020-04-14
Posts: 41

Re: C.A. python version instead of UNITE what is used?

There is a documentation. It is seperated (for the moment).

You need to compile a development version to have it (waf configure && waf install && waf doc). For me, this is in src/build/std/doc

Offline

#6 2021-03-04 16:08:24

rodrigofarias
Member
Registered: 2020-09-03
Posts: 61

Re: C.A. python version instead of UNITE what is used?

nicolas_p wrote:

There is a documentation. It is seperated (for the moment).

You need to compile a development version to have it (waf configure && waf install && waf doc). For me, this is in src/build/std/doc

GPSalachs, were you able to access this documentation? Is there a easy way besides compiling all Aster?

Offline

#7 2021-03-04 16:24:23

GPSalachs
Member
Registered: 2018-03-10
Posts: 251

Re: C.A. python version instead of UNITE what is used?

Hello,

no i was not able to access yet the documentation described above..

Offline

#8 2021-03-04 18:39:53

nicolas_p
Member
Registered: 2020-04-14
Posts: 41

Re: C.A. python version instead of UNITE what is used?

see zzzz503a.py

Offline

#9 2021-03-15 13:56:35

sameer21101970
Banned
Registered: 2019-09-06
Posts: 354

Re: C.A. python version instead of UNITE what is used?

couldnot find above test case. if you can attach in forum.

Offline

#10 2021-03-15 18:21:32

rodrigofarias
Member
Registered: 2020-09-03
Posts: 61

Re: C.A. python version instead of UNITE what is used?

nicolas_p wrote:

see zzzz503a.py

I'm also interested.

Couldn't find this file on the installation folder of the version I have installed.

Offline

#11 2021-03-15 18:30:01

nicolas_p
Member
Registered: 2020-04-14
Posts: 41

Re: C.A. python version instead of UNITE what is used?

It is in the development version 15.3.9


Attachments:
zzzz503a.py, Size: 5.56 KiB, Downloads: 161

Offline

#12 2021-03-16 11:40:12

Paul___
Member
Registered: 2021-02-12
Posts: 20

Re: C.A. python version instead of UNITE what is used?

If I understood well, if I want to use the readMEDFIle() or printMEDFile() commands, I need to download the code_aster development version 15.3.9 ?

Thanks

Last edited by Paul___ (2021-03-16 13:20:57)

Offline

#13 2021-03-17 09:59:12

nicolas_p
Member
Registered: 2020-04-14
Posts: 41

Re: C.A. python version instead of UNITE what is used?

This is available since 15.2 for most of these new functions

Offline

#14 2021-10-27 08:11:08

ing.nicola
Member
Registered: 2017-12-11
Posts: 139

Re: C.A. python version instead of UNITE what is used?

Hi,
ther is a way to obtain the path defined in .export from the UNITE number  ?

Offline