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

You are not logged in.

#1 2019-10-24 13:41:23

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

[SOLVED]How can i export nodes or node coordinates?

Hello all,

i would like to ask if it is possible to export in a python script inside the .comm file the nodes or nodes coordinates.
Where should i search for this particular operation?Through the documentation i might have missed something, are there
any suggestions?

Thank you.

Last edited by GPSalachs (2019-12-04 09:36:33)

Offline

#2 2019-10-28 08:06:45

konyaro
Member
From: Genève
Registered: 2016-04-02
Posts: 177

Re: [SOLVED]How can i export nodes or node coordinates?

Hello,
you can access the nodes coordinates with the following commands:

DEBUT(PAR_LOT='NON')
from Utilitai import partition

mesh0 = LIRE_MAILLAGE(FORMAT='MED',
                      UNITE=2)

mesh0=DEFI_GROUP(reuse=mesh0,
                 MAILLAGE=mesh0,
                 CREA_GROUP_MA=_F(NOM='tout', TOUT='OUI',),);    
                 
mesh1 = partition.MAIL_PY()
mesh1.FromAster('mesh0')
el_no = mesh1.gma.get('tout')

for el in el_no: 
    for node in mesh1.co[el]:    
        print('Node number: {!s}, coordinates: {!s}'.format(node, mesh1.cn[node]))
    
FIN()

Konyaro

Related topics:
- https://code-aster.org/forum2/viewtopic.php?id=23914
- Jean-Pierre's book: §18.4

Last edited by konyaro (2019-11-05 16:06:19)


失敗は成功のもと (L'échec est la base de la réussite)

Offline

#3 2019-11-05 12:20:21

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

Re: [SOLVED]How can i export nodes or node coordinates?

Thank you very much for the code and the reference provided.
I have read and still reading  Jean Pierre's book but in a bible like that things are missed.
A question if i may. Since it is possible to extract node coordinates, is it also possible to extract the connecting lines coordinates too?

Thank you in advance!

Offline