[GiDlist] How can I apply a automatic condition before mesh

Hi,

How can I do to apply a automatic condition before mesh generation. For
example, I want to write a bas file and I have three conditions that could
be applied automatic before mesh generation. I wrote a tcl procedure but
didn’t happen anything.

proc BeforeMeshGeneration { elementsize } {

set numpoints [GiD_Info Geometry NumPoints]
set numlines [GiD_Info Geometry NumLines]
set numsurfaces [GiD_Info Geometry NumSurfaces]

GiD_AssignData condition points Keypoint-Var … 1:$numpoints
GiD_AssignData condition lines Line-Var … 1:$numlines
GiD_AssignData condition surfaces Surface-Var … 1:$numsurfaces

}

What is wrong? Please, let me know

Best Regards

Rodrigo Alves Augusto
-------------- next part --------------
An HTML attachment was scrubbed…
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20080625/75a853de/attachment.htm

The GiD_AssignData condition tcl command has as arguments the condition name, and then the type of entity to be applied (points, lines, etc)
you have reversed this two parameters!!
and then the values … as a single item (off course the number of values must be the same as the number of questions of the condition definition)
finally a item with the entities selection. As trick you can use “end” for the last entity number, then it’s unnecessary to ask for the amount on entities,
Another detail: maybe the last entity identifier is greater than the amount of entities (e.g. when deleting some entity),
instead [GiD_Info Geometry NumPoints] you must had to use [GiD_Info Geometry MaxNumPoints]

Concluding you can use something like this (using off course your own condition values)

proc BeforeMeshGeneration { elementsize } {
GiD_AssignData condition Keypoint-Var points {3 1 5} 1:end
GiD_AssignData condition Line-Var lines {45 1 12} 1:end
GiD_AssignData condition Surface-Var surfaces {27 4 8.5} 1:end
}

Regards

Enrique Escolano
----- Original Message -----
From: Rodrigo Augusto
To: gidlist at gid.cimne.upc.edu
Sent: Wednesday, June 25, 2008 11:44 PM
Subject: [GiDlist] How can I apply a automatic condition before mesh generation?


Hi,

How can I do to apply a automatic condition before mesh generation. For example, I want to write a bas file and I have three conditions that could be applied automatic before mesh generation. I wrote a tcl procedure but didn’t happen anything.

proc BeforeMeshGeneration { elementsize } {

set numpoints [GiD_Info Geometry NumPoints]
set numlines [GiD_Info Geometry NumLines]
set numsurfaces [GiD_Info Geometry NumSurfaces]

GiD_AssignData condition points Keypoint-Var … 1:$numpoints
GiD_AssignData condition lines Line-Var … 1:$numlines
GiD_AssignData condition surfaces Surface-Var … 1:$numsurfaces

}

What is wrong? Please, let me know

Best Regards

Rodrigo Alves Augusto
-------------- next part --------------
An HTML attachment was scrubbed…
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20080626/82605bf0/attachment.htm