First, It's a illegal syntax to cross two loops or if - endif blocks
And you use some as:
*if(N0)
*format "%11i"
*LayerName
*loop elems *OnlyInLayer
*ElemsNum
*end if
*end elems
It's not valid to close the endif before to close the end elems
A valid sytax is:
*if(N0)
*format "%11i"
*LayerName
*loop elems *OnlyInLayer
*ElemsNum
*end elems
*end if
Other bug, you use *format "%11i" before to print *Layername, this format is not valid for a string, you probably try
to print *ElemsNum with this integer format, must use this format order just before *ElemenNum
Other efficiency detail: If you do not require to count the number or elements of a layer,
and only need to know if has elements, instead
*set var N=0
*loop elems *OnlyInLayer
*if(ElemsLayerNum0)
*set var N=operation(N+1)
*end if
*end elems
Why check if ElemsLayerNum is 0 ?, and also, it,s much more efficient exit the loop with break,
for example:
*set var N=0
*loop elems *OnlyInLayer
*set var N=1
*break
*end elems
About the last problem: are written all nodes for each layer, it's a GiD bug. It not works correctly the modifier *onlyinlayer
for a loop nodes.
This bug is corrected for the next 7.4.5b beta version, but until this version is available, can avoid this bug chequing
with a *if the node layer
*loop layers
*set Layer *LayerName *nodes
*LayerName
*loop nodes
*if(LayerNum==NodesLayerNum)
*format "%10i"
*NodesNum
*endif
*end nodes
*end layers
Note than instead *loop nodes *OnlyInLayer only is used *loop nodes , and is added the *if(LayerNum==NodesLayerNum)
I attach the corrected *.bas compressed
Enrique Escolano
----- Original Message -----
From:
aliok at boun.edu.tr
To:
gidlist at gatxan.cimne.upc.es
Sent: Tuesday, November 04, 2003 3:17 PM
Subject: [GiDlist] element set and node set
Hi Enrique,
I tried to create element and node set by using layer utility.
I wrote follwing bas file to get sets.
ELEMENT SETS
*loop layers
*set Layer *LayerName *elems
*set var N=0
*loop elems *OnlyInLayer
*if(ElemsLayerNum0)
*set var N=operation(N+1)
*end if
*end elems
*if(N0)
*format "%11i"
*LayerName
*loop elems *OnlyInLayer
*ElemsNum
*end if
*end elems
*end layers
NODE SETS
*loop layers
*set Layer *LayerName *nodes
*format "%10i"
*LayerName
*loop nodes *OnlyInLayer
*NodesNum
*end nodes
*end layers
I encountered two problems. First one is that I could not get the triangle
element in the element sets. Secondly, although I set different nodes in
different subsets, it gives all nodes in the mesh generation for each layer.
Thanks a lot.
Ali OK
_______________________________________________
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/20031105/ec070284/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Aliok.zip
Type: application/x-zip-compressed
Size: 297 bytes
Desc: not available
Url :
http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20031105/ec070284/attachment.bin