This command :
*set cond Point-forces *nodes
*add cond Line-forces *nodes
creates internally a list of nodes with the condition Point-forces or the condition Line-forces.
If two conditions are applied over the same node, if you use *canrepeat, then, the node is listed two times (one for each value),
but if not use canrepeat, the last condition overwrite the first condition.
Note: If you use a field *cond(3,real), must be sured that the 3? field exists for Point-forces, and also for Line-forces
(is best to use field names instead field numbers: for example, instead *cond(3,real), use *cond(Pressure-Z,real) )
If you use *set cond, then the previous *set/add are reset.
Regards
Enrique Escolano
----- Original Message -----
From: Adisorn Owatsiriwong
To: GiD
Sent: Thursday, August 07, 2003 9:50 AM
Subject: [GiDlist] (no subject)
Dear Gid team,
Is the order of command *set, *add is important to gid? Please see this code.
*#--- Nodal Forces
*set cond Point-forces *nodes ---Line 1
*add cond Line-forces *nodes ---Line 2
*add cond Surface-forces *nodes ---Line 3
*if(condnumentities(int)0)
*loop nodes *onlyincond
*format "%d %.3f %.3f %.3f"
*nodesnum *cond(1,real) *cond(2,real) *cond(3,real) ---Line 4
*end nodes
*endif
The problem occurs if I swap the line no. 1 and 3 to be
*set cond Surface-forces *nodes ---Line 1
*add cond Line-forces *nodes ---Line 2
*add cond Point-forces *nodes ---Line 3
The command on line 4 will print nothing unless I apply the surface condition. But it counts the right value of entities if we look in *condnumentities variable.
My questions are:
1. If these command work like a 'union' operation, why do their order be important? If not so, how we judge which statement should be defined as *set.
2. How does gid judge which condition should be the criteria of *onlyincond ('union' or 'intersect'), is it depend on the oder of those statement?
3. What happens if I use more than one *set command to setup the condition. Will it be only the last condition that gid accept? And how can I apply those command in the 'intersect' sense.
Thank you in advanced.
Best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030811/1b0e63a9/attachment.htm