[GiDlist] how to count the number of 3D elems in a volume

Moderator: GiD Team

Post Reply
Andres Peratta

[GiDlist] how to count the number of 3D elems in a volume

Post by Andres Peratta »

Hi there !
could you give me a hint ?
I need to write a table of volumes in my .bas file.
The table should have Nvol entries,
where Nvol is the number of volumes in the project.
Each record of the table should contain :
(i) the volume label and (ii) the number of 3D elements within that volume
( hexahedra or tetrahedra ).

The additional problem is that some volumes might not be meshed in volume,
that is, only their adjacent surfaces might have a mesh of 2D elems.
For those volumes, the number of 3D elements should be cero.
Do you know any way to write such a table in the bas file ?
thanks in advance,
Andres

PS: Here are the tcl procedures that I use at the moment ,
in order to get some information about volumes:

# This prints some information about volumes
proc master_slave_materials {} {
set VolSurf [.central.s info list_entities volumes 1:[NVol]]
return $VolSurf
}

# This prints the number of volumes
proc NVol { } {
set a [.central.s info list_entities Status]
regexp -nocase {number of volumes: ([0-9]+)} $a none num
return $num
}

but I can't find the number of elems inside a volume from them.
Enrique Escolano

[GiDlist] how to count the number of 3D elems in a volume

Post by Enrique Escolano »

You can apply a condition to all volumes with a autocalculated field
#FUNC#(NumEntity)

for example with this field (can be hidden)
Question: Volume_Num#FUNC#(NumEntity)
Value:0
state: hidden

This set automatically the field value with the geometric entity number. The
conditions are transferred to the volume
elements generated.

Regards
Enrique Escolano

----- Original Message -----
From: "Andres Peratta" andres at wessex.ac.uk
To: gidlist at gatxan.cimne.upc.es
Sent: Tuesday, April 15, 2003 12:32 AM
Subject: [GiDlist] how to count the number of 3D elems in a volume


Hi there !
could you give me a hint ?
I need to write a table of volumes in my .bas file.
The table should have Nvol entries,
where Nvol is the number of volumes in the project.
Each record of the table should contain :
(i) the volume label and (ii) the number of 3D elements within that volume
( hexahedra or tetrahedra ).

The additional problem is that some volumes might not be meshed in volume,
that is, only their adjacent surfaces might have a mesh of 2D elems.
For those volumes, the number of 3D elements should be cero.
Do you know any way to write such a table in the bas file ?
thanks in advance,
Andres

PS: Here are the tcl procedures that I use at the moment ,
in order to get some information about volumes:

# This prints some information about volumes
proc master_slave_materials {} {
set VolSurf [.central.s info list_entities volumes 1:[NVol]]
return $VolSurf
}

# This prints the number of volumes
proc NVol { } {
set a [.central.s info list_entities Status]
regexp -nocase {number of volumes: ([0-9]+)} $a none num
return $num
}

but I can't find the number of elems inside a volume from them.

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

Post Reply