[GiDlist] tcl zip attachment

Moderator: GiD Team

Benedictus Benny Po

[GiDlist] tcl zip attachment

Postby Benedictus Benny Po » Sat Nov 06, 2004 11:48 pm

Hallo Enrique,

Thanks for you explanation about GiD's symbol.

I'am afraid not to really understand you about the tcl zip attachment,

and then you said I could copy the SampleLoad.cnd, SampleLoad.bas,

SampleLoad.cnd. But I couldn't find them in the previous mail

(in GiDlist archives ?). Could you send me again the zip attachment

regarding uniform load distribution.

Or you meant only these files below as previous mail

that I should copy ?

This is a sample: File .cnd Define a condition over lines, over face elements (not =over=20 =3D nodes), for example, named Face-Load NUMBER: 1 CONDITION: Face-Load CONDTYPE: over lines CONDMESHT! YPE: over face elements QUESTION: Pressure VALUE: 0.0 HELP: Pressure on line to be transferred as equivalent nodal loads END CONDITION File .bas Call a tcl procedure, named SampleLoadWriteNodalLoads .. *tcl(SampleLoadWriteNodalLoads) .. File .tcl Define this tcl procedure. proc SampleLoadWriteNodalLoads { } { #set a {{10 1 - 3} {2 1 - 3} {6 3 - 3} {1 1 - 3}} set infocond [GiD_Info conditions Face-Load mesh] foreach item $infocond { set elem [lindex $item 0] set face [lindex $item 1] set pressure [lindex $item 3] set infoelem [GiD_Info mesh elements Triangle $elem] if { $face =3D3D=3D3D 1 } { set n1 [lindex $infoelem 1] set n2 [lindex $infoelem 2]=3D20 } elseif { $face =3D3D=3D3D 2 } { set n1 [lindex $infoelem 2] set n2 [!
lindex
$infoelem 3] } else { #assumed face=3D3D=3D3D3 ,only for triangles set n1 [lindex $infoelem 3] set n2 [lindex $infoelem 1] } set c1 [lrange [GiD_Info mesh nodes $n1] 1 end] set c2 [lrange [GiD_Info mesh nodes $n2] 1 end] set dist [::MathUtils::VectorDistance $c1 $c2] set force [expr {$dist*$pressure*0.5}] if { [info exists F($n1)] } { set F($n1) [expr {$F($n1)+$force} ] =3D20 } else { set F($n1) $force } if { [info exists F($n2)] } { set F($n2) [expr {$F($n2)+$force} ] =3D20 } else { set F($n2) $force } } set result "LOAD\n" append result "Node F\n" foreach node [array names F] { append result "$node $F($node)\n" } ! return $result }



Many thanks in advance,

Benedictus Benny PO

Message: 4From: "Enrique Escolano" escolano at cimne.upc.esTo: gidlist at gatxan.cimne.upc.esSubject: Re: [GiDlist] GiD's drawing symbolDate: Thu, 4 Nov 2004 11:53:26 +0100Reply-To: gidlist at gid.cimne.upc.esThis is a multi-part message in MIME format.------=_NextPart_000_0481_01C4C264.E49D9FF0Content-Type: text/plain; charset="iso-8859-1"Content-Transfer-Encoding: quoted-printableAt this moment, 'draw conditions' is only a temporary state, it's not =possible to draw permanently.=20Maybe for the next version...About the attachment of the previous mail, probably your mail server =remove (by security) the zip attachments.=20You can directly copy and paste form the previous mail the contents of =the related files: SampleLoad.cnd, SampleLoad.bas , and SampleLoad.tcl, =and put inside a problemtype directory named SampleLoad.gidEnrique Escolano ----- Original Message -----=20 From: Benedictus Benny Po=20 To: gidlist at gatxan.cimne.upc.es=20 Sent: Wednesday, November 03, 2004 1:53 PM
Subject: [GiDlist] GiD's drawing symbol Dear GiD's team and users, I have created some symbols of support and of nodal load in my *.sim =file. After I assign all of them in GiD (under Condition menu) I saw =that every symbols that I assign are appeared. But if I leave the =Condition menu, all the symbols that I have assigned and drawed are =disappeared, so I cannot maintain them to stay together with my whole =structure I have drawn. My question is, is it possible to maintain these =symbols appearance ? because I have to go to the menu everytimes I want =to see the condition that I have in my structure. Another question regarding my previous problem with uniform load, I did not find the attach file in zip that you said you attach a zip =file with that sample problemtype. Best Regards, Benedictus Benny PO Today's Topics: 1. Uniform load distribution (Benedictus Benny Po) 2. Re: Uniform load distribution (Enrique Escolano) -- __--__-- Message: 1 Date: Mon,!
1 Nov
2004 20:45:14 +0100 (CET) From: Benedictus Benny Po v_e_r_s_e_a_u at yahoo.fr To: gidlist at gatxan.cimne.upc.es Subject: [GiDlist] Uniform load distribution Reply-To: gidlist at gid.cimne.upc.es --0-1613127892-1099338314=3D:75164 Content-Type: text/plain; charset=3Diso-8859-1 Content-Transfer-Encoding: 8bit Hello GiD fans, users and experts wherever you are, I want to share with you my problem that I have and hope to get any=20 solutions and suggest from you. I'm devoloping interface between FEAP and GiD 7.2 at my institute for=20 my Master Thesis. I would like GiD to generate uniform load to be=20 distributed along the nodes I have after mesh generation. This load=20 generation result in form of single nodal loads over every node along =the line=20 will be used in FEAP as input for LOAD macro editor: LOAD node1, X-coor ,Y-coord ,p_x, p_y node2, X-coor ,Y-coord, p_x, p_y node3, X-coor ,Y-coord, p_x, p_y ..etc....... My .cnd file : NUMBER:5 CONDITION:Face-Loa!
d
CONDTYPE:over lines CONDMESHTYPE:over nodes QUESTION:L1.....(length of constant uniform load) VALUE:10 (m) QUESTION:n_x....(Number of face elements (which are under uniform =load)=20 to be generated) =20 VALUE:4 QUESTION:q_x...(Uniform Load x direction) VALUE:0.0 QUESTION:q_y...(Uniform Load y direction) VALUE:-10 (kN/m) QUESTION:p_x..(Nodal load x direction) VALUE:0.0 =QUESTION:p_y#FUNC#(Cond(4,real)*Cond(1,real)/Cond(2,int)*0.5).....(nodal = load y direction) VALUE:Autocalculate STATE:hidden and my .bas file : *Set Cond Face-Load *nodes *Canrepeat *If(CondNumEntities(Int)0) LOAD *loop nodes *onlyInCond *Nodesnum *NodesCoord(1,real) *NodesCoord(2,real) *cond(p_x,real)=20 *cond(p_y,real) *End loop nodes *endif The result I have in my .dat file is like that:=20 (for L1=3D10(m), n_x=3D4 and q_y =3D -10(kN/m)) LOAD Node X-coor Y-Coord p_x p_y 1, 0.00, 0.0, 0.0, -12.5 2, 2.50, !

0.0, 0.0, -12.5 3, 5.00, 0.0, 0.0, -12.5 4, 7.50, 0.0, 0.0, -12.5 5, 0.00, 0.0, 0.0, -12.5 I did not see any possibility to tell GiD that at node 2, 3 and 4,=20 since they get two t! imes the half of the load from left element and =right=20 element, they should be each -25 , instead of -12.5.=20 If I would use in my .cnd file CANREPEAT: yes after CONDMESHTYPE:=20 nodes, I would get the same list of LOAD as above once more time , and it's=20 still not correct. The correct result should be : =20 LOAD Node X-coor Y-Coord p_x p_y 1, 0.00, 0.0, 0.0, -12.5 2, 2.50, 0.0, 0.0, -25 3, 5.00, 0.0, 0.0, -25 4, 7.50, 0.0, 0.0, -25 5, 10.00, 0.0, 0.0, !

-12.5 I hope you understand what I meant and I'm looking forward to hearing=20 from you. Best regards, Benedictus Benny PO Message: 2 From: "Enrique Escolano" escolano at cimne.upc.es To: gidlist at gatxan.cimne.upc.es Subject: Re: [GiDlist] Un! iform load distribution Date: Tue, 2 Nov 2004 11:07:36 +0100 Reply-To: gidlist at gid.cimne.upc.es This is a multi-part message in MIME format. ------=3D_NextPart_000_02B0_01C4C0CC.2918A980 Content-Type: multipart/alternative; boundary=3D"----=3D_NextPart_001_02B1_01C4C0CC.2918A980" ------=3D_NextPart_001_02B1_01C4C0CC.2918A980 Content-Type: text/plain; charset=3D"iso-8859-1" Content-Transfer-Encoding: quoted-printable You can use Tcl language for enhanced features.=3D20 Can call a tcl procedure from the bas file with the *tcl command This is a sample: File .cnd Define a condition over lines, over face elements (not =over=20 =3D nodes), for example, named Face-Load NUMBER: 1 CONDITION: Face-Load CONDTYPE: over!
lines
CONDMESHT! YPE: over face elements QUESTION: Pressure VALUE: 0.0 HELP: Pressure on line to be transferred as equivalent nodal loads END CONDITION File .bas Call a tcl procedure, named SampleLoadWriteNodalLoads .. *tcl(SampleLoadWriteNodalLoads) .. File .tcl Define this tcl procedure. proc SampleLoadWriteNodalLoads { } { #set a {{10 1 - 3} {2 1 - 3} {6 3 - 3} {1 1 - 3}} set infocond [GiD_Info conditions Face-Load mesh] foreach item $infocond { set elem [lindex $item 0] set face [lindex $item 1] set pressure [lindex $item 3] set infoelem [GiD_Info mesh elements Triangle $elem] if { $face =3D3D=3D3D 1 } { set n1 [lindex $infoelem 1] set n2 [lindex $infoelem 2]=3D20 } elseif { $face =3D3D=3D3D 2 } { set n1 [lindex $infoelem 2] set n2 [lindex $infoelem 3] } else { #assumed face=3D3D=3D3D3 ,only for triangles set n1 [lindex $infoelem 3] set n2 [lindex $infoelem 1] } set c1 [lrange [GiD_Info mesh nodes $n1!
] 1 end]
set c2 [lrange [GiD_Info mesh nodes $n2] 1 end] set dist [::MathUtils::VectorDistance $c1 $c2] set force [expr {$dist*$pressure*0.5}] if { [info exists F($n1)] } { set F($n1) [expr {$F($n1)+$force} ] =3D20 } else { set F($n1) $force } if { [info exists F($n2)] } { set F($n2) [expr {$F($n2)+$force} ] =3D20 } else { set F($n2) $force } } set result "LOAD\n" append result "Node F\n" foreach node [array names F] { append result "$node $F($node)\n" } ! return $result } This procedure requires the last 7.5.0b GiD beta version. GiD_Info (or .gid.central.s info) is a tcl procedure defined by GiD to = =3D return internal information.(read GiD help about Tcl-Tk extension) The other command are Tcl standard (can see more information about =3D Tcl/Tk language from the Internet) I attach a zip file with this sample problemtype source. Regards Enrique Escolano




---------------------------------
Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
Créez votre Yahoo! Mail

Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis.Téléchargez GRATUITEMENT ici !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20041106/db763417/attachment.htm

Return to “2004 - 2003”

Who is online

Users browsing this forum: No registered users and 2 guests