[GiDlist] Mesh points local number

Moderator: GiD Team

Post Reply
Andrea Calaon

[GiDlist] Mesh points local number

Post by Andrea Calaon »

Hello,
I'm writing an interface for a BEM software and I need to
provide point (mesh) boundary conditions.

The input file needs the number of the element AND the local
node. Only one of the elements sharing that node.

es: "DISPLX1 234 3 0.0000000e001"
where the condition DISPLX1 applies to the node 3 of element
234 (which could be of any kind).

Is it possible to obtain this information in some way with a tcl
function?
I thought a loop on the element connectivity table checking the
presence of an absolute node number coming from the
condition.

Regards


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] Mesh points local number

Post by Enrique Escolano »

You can get from tcl, the information of the list of nodes/elements and values
of a condition with info condition "cond_name" mesh, for example:

set infocnd [.central.s info conditions Displacement mesh]

You can also get the mesh elements and make a loop over the elements to set an array, for example SingleElem(inode)
whit a elem number (only the last is stored)

set elemtypes [lindex [.central.s info mesh] 0 end]
foreach etype $elemtypes {
set infoelems [.central.s info mesh elements $etype]
#get a list with elemsnum elemsconec(1) ... elemsconec(1) elemsmat
#must verify the type and nnode of the element type
if { $etype == Triangle } {
foreach {i n1 n2 n3 mat} $infoelems {
set SingleElem($n1) "$i 1" ;#overwrite a previous element number, store only the last
set SingleElem($n2) "$i 2"
set SingleElem($n3) "$i 3"
}
}
}

#Then write your desired format

set res ""
foreach i $infocnd {
set nnode [lindex $i 1]
set fieldvalue [lindex $i 4] ;#change 4 to the apropiate field incex
append res "DISPLX1 $SingleElem($nnode) $fieldvalue\n"
}
return res


Note: This code is untested, but it can works with small corrections

Enrique Escolano


----- Original Message -----
From: "Andrea Calaon" andrea at beasy.com
To: gidlist at gatxan.cimne.upc.es
Sent: Tuesday, April 01, 2003 1:08 PM
Subject: [GiDlist] Mesh points local number


Hello,
I'm writing an interface for a BEM software and I need to
provide point (mesh) boundary conditions.

The input file needs the number of the element AND the local
node. Only one of the elements sharing that node.

es: "DISPLX1 234 3 0.0000000e001"
where the condition DISPLX1 applies to the node 3 of element
234 (which could be of any kind).

Is it possible to obtain this information in some way with a tcl
function?
I thought a loop on the element connectivity table checking the
presence of an absolute node number coming from the
condition.

Regards


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030401/5ce3602b/attachment.htm
Post Reply