[GiDlist] entities references

Moderator: GiD Team

Post Reply
Zoubir Khatir

[GiDlist] entities references

Post by Zoubir Khatir »

Hello,

Is it possible to get the entities references (volumes, surfaces,...) in
the entry data file ?
I would like to associate each mesh element to its entity. exemple :
element mesh number x belongs to the volume number y...
I am working wit GiD 6.2.0.c .

Thank you for any help...


Zoubir Khatir,
Laboratoire des Technologies Nouvelles (LTN)

INRETS, 2. Av. Malleret-Joinville, 94114 Arcueil Cedex
Tel: (33).01.47.40.73.34 Fax:(33).01.45.47.56.06 mail: khatir at inrets.fr
web: www.inrets.fr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20020314/733a7a7e/attachment.htm
Enrique Escolano

[GiDlist] entities references

Post by Enrique Escolano »

You can dowload from the web page http://gid.cimne.upc.es the Advanced course documentation of the GiD Courses previous to the 1st Conference on Advances and Applications of GiD (Barcelona 20, 21 and 22 February 2002).

Inside the Word document: A2-Problem type details.doc, see the chapter 5. "INSTRUCTION *tcl IN THE .bas FILE".

This is the chapter:

5. INSTRUCTION *tcl IN THE .bas FILE
In the .bas file, that GiD takes as a template for writing the file for calculus, it can be used a special *tcl(parameter) function, with which we can make complicated operations in tcl, or for example we can access to data of GiD obtained from tcl with the info command.

In the next example we want to obtain information of the geometric entities of GiD. Without the tcl instruction, from the *.bas file there's only access to mesh data, but not to the geometric entities.

For example, imagine we need to know the surface to which the elements belong and which is the entirely definition of that surface.

It can be used the field #FUNC(NumEntity) for checking with a condition on the entity ( that will be its number as entity ) every element which comes from that entity, so we can know the entity from which comes every mesh element. We can use the *.tcl instruction for writing the information of that surface, as showed in this example GeomInfoBas.tcl:

GeomInfoBas.cnd file:

NUMBER: 1 CONDITION: Surface_Id

CONDTYPE: over surfaces

CONDMESHTYPE: over face elems

QUESTION: Num_Entity#FUNC#(NumEntity)

VALUE: 0

STATE: HIDDEN

END CONDITION

(Note that there can be created occult fields with STATE:HIDDEN)

GeomInfoBas.tcl file:

proc InitGIDProject { dir } {

}



proc EndGIDProject {} {

}



proc NumSurfaces { } {

set a [.central.s info list_entities Status]

regexp -nocase {number of surfaces: ([0-9]+)} $a none num

return $num

}



proc WriteAllSurfacesInfo { } {

return [.central.s info list_entities Surfaces 1:[NumSurfaces]]

}



proc WriteSurfaceInfo { num } {

return [.central.s info list_entities Surfaces $num]

}

GeomInfoBas.bas file:

NUM_ELEM FACE_CONECTIVITIES NUM_SURFACE

*set cond Surface_Id *elems *CanRepeat

*loop elems *OnlyInCond

*elemsnum *elemsconec *Cond(Num_Entity,int)

*end elemsn

INI SURFACES

*tcl(WriteAllSurfacesInfo)

END SURFACES

*# sample to write oly the surface 1 description

*# *set var num=1

*# *tcl(WriteSurfaceInfo *num)

In the tcl file there have been defined three entities: NumSurfaces returns the number of surfaces of the model, whereas WriteSurfaceInfo prints in the calculus file the definition of the surface indicated in its parameter "num"; finally, WriteAllSurfacesInfo has no parameters and prints all surfaces.

In the .bas file there are written the elements and the origin surface number, with *Cond(Num_Entity,int), and then there are listed all surfaces.

Here are shown in two columns an arbitrary file example, obtained with that problem type.





NUM_ELEM FACE_CONECTIVITIES NUM_SURFACE

1 18 19 23 1

2 19 21 26 1

.

33 38 34 37 1

34 19 18 14 2

.

60 4 7 10 2



INI SURFACES



NURBSURFACE

Num: 1 HigherEntity: 0 conditions: 1 material: 0

LAYER: Layer0

NumLines: 4

Line: 6 Orientation: DIFF1ST

Line: 5 Orientation: DIFF1ST

Line: 1 Orientation: SAME1ST

Line: 7 Orientation: DIFF1ST

Number of Control Points= 2 2 Degree= 1 1

Point 1,1 coords:-5.081426,4.132659,0.000000

Point 1,2 coords:-5.081426,-0.799912,0.000000

Point 2,1 coords:1.745159,4.132659,0.000000

Point 2,2 coords:1.745159,-0.799912,0.000000

Number of knots in U= 4

knot 1 value=0.000000

knot 2 value=0.000000

knot 3 value=1.000000

knot 4 value=1.000000

Number of knots in V= 4

knot 1 value=0.000000

knot 2 value=0.000000

knot 3 value=1.000000

knot 4 value=1.000000

Non rational

IsTrimmed: 1

Center: -1.654929 1.619719 0.000000

Normal: 0.000000 0.000000 1.000000

END NURBSURFACE

...



END SURFACES



----- Original Message -----
From: Zoubir Khatir
To: gidlist at gatxan.cimne.upc.es
Sent: Thursday, March 14, 2002 9:15 AM
Subject: [GiDlist] entities references




Hello,

Is it possible to get the entities references (volumes, surfaces,...) in the entry data file ?
I would like to associate each mesh element to its entity. exemple : element mesh number x belongs to the volume number y...
I am working wit GiD 6.2.0.c .

Thank you for any help...


Zoubir Khatir,
Laboratoire des Technologies Nouvelles (LTN)

INRETS, 2. Av. Malleret-Joinville, 94114 Arcueil Cedex
Tel: (33).01.47.40.73.34 Fax:(33).01.45.47.56.06 mail: khatir at inrets.fr
web: www.inrets.fr


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