[GiDlist] Access to local coordinates in Tcl

Moderator: GiD Team

Post Reply
Andrea Calaon

[GiDlist] Access to local coordinates in Tcl

Post by Andrea Calaon »

Hello everyone,
I would like to have access to local coordinates in the Tcl
scripts. Is there any way to do it?

Short explanation.

I need to know the local coordinates of the nodes of 2D
elements which lay on the lines boundary of the surface
hosting the element (not the best explanation
). So first
I need to have the list of the 2D elements with one side
on the surface boundary, and then, for each one of those
elements, the set of local coordinates corresponding to
the nodes on the boundary side/s.


I could use a code similar to the following:

In the .cnd file:

NUMBER:
CONDITION: Line_BC
CONDTYPE: over Lines
CONDMESHTYPE: over face elems
State: Hidden
VALUE:

END CONDITION


In the .bas file:

*set elems(All)
*Set cond Line_BC *elems *CanRepeat


*set elems(triangle)
*add elems(quadrilateral)


*loop elems *OnlyInCond
*ElemsNum *localnodes
*end

and then read the file in Tcl, store the data and use them
inside the Tcl procedure. But it would be easier to do it
directly in Tcl.

Thanks for any suggestion

Best regards,

Andrea

P.S. Sorry for any error in the formatting of this message,
but the mail program I have to use is not doing what it
should ...


Andrea Calaon

Ashurst Lodge, Ashurst
Southampton, Hampshire
SO40 7AA, UK
Tel. office: +44 23 80 293 223
Fax office: +44 23 80 292 853
Mobile: +44 7766 488 225
E-mail: andrea at beasy.com
Enrique Escolano

[GiDlist] Access to local coordinates in Tcl

Post by Enrique Escolano »

It is not necessary to write a file and read it from tcl, you can get
directly this information from tcl:

set res [.central.s info conditions Line_BC mesh]

this tcl command returns a subitems list, where each item has:
element number face local number - value1 ... value n
for example, returns some similar to:
{2 1 - 0.0} {18 1 - 5.3 0.2} {6 1 - 9.8 1.0} {13 1 - 4.6 1.5} ...

So, the local implicit GiD numeration of the faces is:
Triangle: 12 23 31
Quadrilateral: 12 23 34 41
Tetrahedra: 123 243 341 421
Hexahedra: 1234 1562 2673 3784 1485 5876

You can also get info about the elements if needed
for example:
.central.s info list_entities elements 2 18 6 13


Note: To test easily this info commands, can write in the command line some
as:
-np- WarnWinText [.central.s info list_entities elements 2 18 6 13]

Regards

Enrique Escolano

----- Original Message -----
From: "Andrea Calaon" andrea at beasy.com
To: gidlist at gatxan.cimne.upc.es
Sent: Tuesday, February 17, 2004 3:39 PM
Subject: [GiDlist] Access to local coordinates in Tcl


Hello everyone,
I would like to have access to local coordinates in the Tcl
scripts. Is there any way to do it?

Short explanation.

I need to know the local coordinates of the nodes of 2D
elements which lay on the lines boundary of the surface
hosting the element (not the best explanation .). So first
I need to have the list of the 2D elements with one side
on the surface boundary, and then, for each one of those
elements, the set of local coordinates corresponding to
the nodes on the boundary side/s.


I could use a code similar to the following:

In the .cnd file:

NUMBER: . CONDITION: Line_BC
CONDTYPE: over Lines
CONDMESHTYPE: over face elems
State: Hidden
VALUE: .
END CONDITION


In the .bas file:

*set elems(All)
*Set cond Line_BC *elems *CanRepeat
.
*set elems(triangle)
*add elems(quadrilateral)
.
*loop elems *OnlyInCond
*ElemsNum *localnodes
*end

and then read the file in Tcl, store the data and use them
inside the Tcl procedure. But it would be easier to do it
directly in Tcl.

Thanks for any suggestion

Best regards,

Andrea

P.S. Sorry for any error in the formatting of this message,
but the mail program I have to use is not doing what it
should ...


Andrea Calaon

Ashurst Lodge, Ashurst
Southampton, Hampshire
SO40 7AA, UK
Tel. office: +44 23 80 293 223
Fax office: +44 23 80 292 853
Mobile: +44 7766 488 225
E-mail: andrea at beasy.com

_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist

Post Reply