[GiDlist] Thanks a lot for the Tcl on local nodes numbers an

Moderator: GiD Team

Post Reply
Andrea Calaon

[GiDlist] Thanks a lot for the Tcl on local nodes numbers an

Post by Andrea Calaon »

Dear GiD and Mr. Escolano,
thank you very much for your long and detailed answer.

Regarding one of my recent questions (copied at the end of this
mail) I was trying to loop directly form a .bas file on nodes and
elements, like in an exemple in the Mail list Archives, modified
for the present case ...
In principle I found the way but I have a problem:
if I select 2 geometrical points is OK, but with more I get an
error:

"Error in base file C:\Program
Files\GiD\GiD7.2\problemtypes\My_PT\Problem_LowRisk.gid\Po
int_Constraints.bas at line number 5: Max. 3 for"

I attach part of the .cnd file and the .bas of interest.

I forgot before, but compliments for GiD!!!
Only your "SAME1ST" and "DIFF1ST" information on surfaces
around volumes allowed me to automatise completely
something till now almost impossible with programs that are
not real solid modellers. And the whole program is amazingly
powerful.

Just some more documentation on customisation wouldn't be
bad.

Thanks

Regards

**************************************************
Hello,
I'm writing an interface for a BEM software and I need to
provide point (mesh) boundary conditions.

The input file needs the number of the element AND the local
node. Only one of the elements sharing that node.

es: "DISPLX1 234 3 0.0000000e001"
where the condition DISPLX1 applies to the node 3 of element
234 (which could be of any kind).

Is it possible to obtain this information in some way with a tcl
function?
I thought a loop on the element connectivity table checking the
presence of an absolute node number coming from the
condition.

Regards


Andrea Calaon
**************************************************


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030402/e21bebdb/attachment.htm
-------------- next part --------------
NUMBER: 8 CONDITION: Point_Displacements
CONDTYPE: over points
CONDMESHTYPE: over nodes
CANREPEAT: No
QUESTION: Considering_X_Displacement?#CB#(1,0)
VALUE: 0
DEPENDENCIES:(0,HIDE,X_Displacement,#CURRENT#)(1,RESTORE,X_Displacement,#CURRENT#)
QUESTION: X_Displacement
VALUE: 0.0
QUESTION: Considering_Y_Displacement?#CB#(1,0)
VALUE: 0
DEPENDENCIES:(0,HIDE,Y_Displacement,#CURRENT#)(1,RESTORE,Y_Displacement,#CURRENT#)
QUESTION: Y_Displacement
VALUE: 0.0
QUESTION: Considering_Z_Displacement?#CB#(1,0)
VALUE: 0
DEPENDENCIES:(0,HIDE,Z_Displacement,#CURRENT#)(1,RESTORE,Z_Displacement,#CURRENT#)
QUESTION: Z_Displacement
VALUE: 0.0
END CONDITION--Message-Boundary-9358
Content-type: text/plain; charset=US-ASCII
Content-disposition: inline
Content-description: Attachment information.

The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any another MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.

---- File information -----------
File: Point_Constraints.bas
Date: 2 Apr 2003, 11:46
Size: 551 bytes.
Type: Program-source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Point_Constraints.bas
Type: application/octet-stream
Size: 551 bytes
Desc: not available
Url : http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030402/e21bebdb/attachment.obj
Enrique Escolano

[GiDlist] Thanks a lot for the Tcl on local nodes numbers an

Post by Enrique Escolano »

This is a GiD bug using a 'break' inside a 'for' block.
Currently in the documentation, a break must be inside a 'loop' block.
For the next GiD beta version (the current last is 7.3b) this bug is corrected, and the break also exits a 'for' block.

At this moment, you can use this corrected code, bypassing the bug.
(also is more efficient, it exits the loop elements if it found some element pointing the node)

*Set Cond Point_Displacements *nodes
*loop nodes *OnlyInCond
*loop elems
*set var found=0
*for(i=1;i=ElemsNNode;i=i+1)
*set var inode=ElemsConec(*i,int)
*if((NodesNum==inode))
*if(strcmp(cond(1),"1")==0)
*format "%5i%5i%14.7E"
DISPLX1 NODAL *ElemsNum *i *cond(2,real)
*endif
*if(strcmp(cond(3),"1")==0)
*format "%5i%5i%14.7E"
DISPLX2 NODAL *ElemsNum *i *cond(4,real)
*endif
*if(strcmp(cond(5),"1")==0)
*format "%5i%5i%14.7E"
DISPLX3 NODAL *ElemsNum *i *cond(6,real)
*endif
*set var found=1
*endif
*end for
*if(found)
*break
*endif
*end elems
*end nodes

Regards
Enrique Escolano
----- Original Message -----
From: Andrea Calaon
To: gidlist at gatxan.cimne.upc.es
Sent: Wednesday, April 02, 2003 1:27 PM
Subject: [GiDlist] Thanks a lot for the Tcl on local nodes numbers and point conditions


Dear GiD and Mr. Escolano,
thank you very much for your long and detailed answer.


Regarding one of my recent questions (copied at the end of this mail) I was trying to loop directly form a .bas file on nodes and elements, like in an exemple in the Mail list Archives, modified for the present case ...
In principle I found the way but I have a problem:
if I select 2 geometrical points is OK, but with more I get an error:


"Error in base file C:\Program Files\GiD\GiD7.2\problemtypes\My_PT\Problem_LowRisk.gid\Point_Constraints.bas at line number 5: Max. 3 for"


I attach part of the .cnd file and the .bas of interest.


I forgot before, but compliments for GiD!!!
Only your "SAME1ST" and "DIFF1ST" information on surfaces around volumes allowed me to automatise completely something till now almost impossible with programs that are not real solid modellers. And the whole program is amazingly powerful.


Just some more documentation on customisation wouldn't be bad.


Thanks


Regards


**************************************************
Hello,
I'm writing an interface for a BEM software and I need to
provide point (mesh) boundary conditions.


The input file needs the number of the element AND the local
node. Only one of the elements sharing that node.


es: "DISPLX1 234 3 0.0000000e001"
where the condition DISPLX1 applies to the node 3 of element
234 (which could be of any kind).


Is it possible to obtain this information in some way with a tcl
function?
I thought a loop on the element connectivity table checking the
presence of an absolute node number coming from the
condition.


Regards




Andrea Calaon
**************************************************




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


------------------------------------------------------------------------------


NUMBER: 8 CONDITION: Point_Displacements
CONDTYPE: over points
CONDMESHTYPE: over nodes
CANREPEAT: No
QUESTION: Considering_X_Displacement?#CB#(1,0)
VALUE: 0
DEPENDENCIES:(0,HIDE,X_Displacement,#CURRENT#)(1,RESTORE,X_Displacement,#CURRENT#)
QUESTION: X_Displacement
VALUE: 0.0
QUESTION: Considering_Y_Displacement?#CB#(1,0)
VALUE: 0
DEPENDENCIES:(0,HIDE,Y_Displacement,#CURRENT#)(1,RESTORE,Y_Displacement,#CURRENT#)
QUESTION: Y_Displacement
VALUE: 0.0
QUESTION: Considering_Z_Displacement?#CB#(1,0)
VALUE: 0
DEPENDENCIES:(0,HIDE,Z_Displacement,#CURRENT#)(1,RESTORE,Z_Displacement,#CURRENT#)
QUESTION: Z_Displacement
VALUE: 0.0
END CONDITION--Message-Boundary-9358
Content-type: text/plain; charset=US-ASCII
Content-disposition: inline
Content-description: Attachment information.

The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any another MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.

---- File information -----------
File: Point_Constraints.bas
Date: 2 Apr 2003, 11:46
Size: 551 bytes.
Type: Program-source

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030402/85d4182b/attachment.htm
Post Reply