[GiDlist] Some coupling between Remove and cond?

Moderator: GiD Team

Post Reply
Andrea Calaon

[GiDlist] Some coupling between Remove and cond?

Post by Andrea Calaon »

Hello everyone,
I had some problems with the command “Remove”.

Here is the part of the .bas file where I used it:

*# For triangular elements
*set Elems(All)
*Remove elems(Quadrilateral)
*set cond Type_of_field *elems
*loop elems
*if(strcmp(cond(1),"Linear")==0)
T2 *\
*elseif(strcmp(cond(1),"Quadratical9")==0)
*MessageBox error: Quadratical9 elements can NOT be Triangular.
Please redefine the element type on this surface.
*else
T3 *\
*endif
*elemsnum *ElemsConec *elemsnum
*end elems
*# For quadrilateral elements
*set Elems(all)
*Remove elems(Triangle)
*set cond Type_of_field *elems
*loop elems
*if(strcmp(cond(1),"Linear")==0)
Q2 *\
*elseif(strcmp(cond(1),"Quadratical9")==0)
Q3 *\
*else
Q38 *\
*endif
*elemsnum *ElemsConec *elemsnum
*end elems*\

I noticed that only the first loop worked, and the second one was
always going to the “else” cllause, no matter the condition
“Type_of_field”. The same happened swapping the two loops: only
the firs one worked properly.
I don’t know exactly what the problem was, but I solved it thanks
to an advice of a friend (Andres Peratta) who suggested me to try
to use “Set elems(
)” instead of “*Remove elems(
)”. In this way
both loops work fine.
I hope this notice will be useful.
I wish a nice day to everyone.


Andrea Calaon

Ashurst Lodge, Ashurst
Southampton, Hampshire
SO40 7AA, UK
Tel. office: +44 23 80 293 223
Fax office: +44 23 80 292 853
Mobile: +44 7766 488 225
E-mail: andrea at beasy.com
Enrique Escolano

[GiDlist] Some coupling between Remove and cond?

Post by Enrique Escolano »

This is a GiD bug with a internal cache to speed the write calculation file procedure. It's corrected for the next version.

A detail: instead to use
*loop elems
must use
*loop elems *onlyincond
because a loop over all selected elements not necessary has the related condition fields: *if(strcmp(cond(1),"Linear")==0)

Another detail: it's more easy to mantain a problemtype using fielnames instead fieldnumbers
instead cond(1) use for example cond(quadratic)

Enrique Escolano

----- Original Message -----
From: "Andrea Calaon" andrea at beasy.com
To: gidlist at gatxan.cimne.upc.es
Sent: Tuesday, August 26, 2003 12:57 PM
Subject: [GiDlist] Some coupling between Remove and cond?


Hello everyone,
I had some problems with the command "Remove".

Here is the part of the .bas file where I used it:

*# For triangular elements
*set Elems(All)
*Remove elems(Quadrilateral)
*set cond Type_of_field *elems
*loop elems
*if(strcmp(cond(1),"Linear")==0)
T2 *\
*elseif(strcmp(cond(1),"Quadratical9")==0)
*MessageBox error: Quadratical9 elements can NOT be Triangular.
Please redefine the element type on this surface.
*else
T3 *\
*endif
*elemsnum *ElemsConec *elemsnum
*end elems
*# For quadrilateral elements
*set Elems(all)
*Remove elems(Triangle)
*set cond Type_of_field *elems
*loop elems
*if(strcmp(cond(1),"Linear")==0)
Q2 *\
*elseif(strcmp(cond(1),"Quadratical9")==0)
Q3 *\
*else
Q38 *\
*endif
*elemsnum *ElemsConec *elemsnum
*end elems*\

I noticed that only the first loop worked, and the second one was
always going to the "else" cllause, no matter the condition
"Type_of_field". The same happened swapping the two loops: only
the firs one worked properly.
I don't know exactly what the problem was, but I solved it thanks
to an advice of a friend (Andres Peratta) who suggested me to try
to use "Set elems(.)" instead of "*Remove elems(.)". In this way
both loops work fine.
I hope this notice will be useful.
I wish a nice day to everyone.


Andrea Calaon

Ashurst Lodge, Ashurst
Southampton, Hampshire
SO40 7AA, UK
Tel. office: +44 23 80 293 223
Fax office: +44 23 80 292 853
Mobile: +44 7766 488 225
E-mail: andrea at beasy.com

_______________________________________________
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/20030903/7d6d0c6f/attachment.htm
Post Reply