Thank you. This is a good point start.
Supposing I apply the condition Point_Déplacement_imposé first with the
arguments dx=0 dy=0 dz=0 and the with the arguments dx=10 dy=0 dz=10
using the a procedere to find out all the conditions, sort them and
printing only once each condition is OK.
But If I apply twice the condition Point_Déplacement_imposé with the
some arguments dx=0 dy=0 dz=0 using the method you proposed me I will
get only one condition in my bas file. For my problem I need to be able
to print individualy each condition (the two I applied and not for each
point), even if they have the same parameter.
The reasons why I need individualy acces to each condition are driven by
the FEM code I use.
Supposing that I want simulate a stamping process. I need to aplpy some
conditions to block parts in space and other conditions to move down the
punch. Normaly the conditions are different. By maybe in some cases they
will have the some values in the firts step. The some is true for
forces. I need to be able to apply forces with the some values but one
will constant over time and other will evolue fonction of time.
Best regards,
-------------------------------------------------
Mihai TEODORESCU
Email: mihai.teodorescu at prevost-industries.com
-------------------------------------------------
[GiDlist] loop over conditions
Moderator: GiD Team
[GiDlist] loop over conditions
Hi Mihai
Same as I asked the GiD team but I think to do what
you mentioned here you have to be an expert on Tcl and
understand very well how this tcl works with GiD. What
I have done in my case is such:(but not convinient)
1. Specify the conditions in .prb file
2. Then create the assign conditions in .cnd file
Same as I asked the GiD team but I think to do what
you mentioned here you have to be an expert on Tcl and
understand very well how this tcl works with GiD. What
I have done in my case is such:(but not convinient)
1. Specify the conditions in .prb file
2. Then create the assign conditions in .cnd file
[GiDlist] loop over conditions
If you use from tcl
set res [.central.s info conditions Point-Load mesh]
and obtain {N 11 - 0.0 4} {N 6 - 0.0 1} {N 1 - 0.0 1}
Then filter whit tcl commands this result to write for example (avoing repetition of "basic values"):
Point-Load basic values:
Basic 1 - 0.0 1
Basic 2 - 0.0 4
Applied basic values:
Node 1 - Basic 1
Node 6 - Basic 1
Node 11 - Basic 2
This is a procedure to "filter" and write this result
proc WritePointLoads { } {
#obtain the conditions infomation from GiD
#set conds [.central.s info conditions Point-Load mesh]
#to test use for example this:
set conds {{N 11 - 0.0 4} {N 1 - 0.0 3} {N 6 - 0.0 1} {N 1 - 0.0 2} {N 1 - 0.0 1}}
#define a procedure to be used to compare two items ignorig the first 3 words, for example ignoring "N 11 -"
proc CompareCond {a b} {
set a0 [lrange $a 3 end]
set b0 [lrange $b 3 end]
if {$a0 $b0} {
return -1
} elseif {$a0 $b0} {
return 1
}
return 0
}
#sort your list using this comparation procedure
set conds [lsort -command CompareCond $conds]
#write results to output temporaty in two variables: values and entities
#write basic values without repetition
set values "Point-Load basic values:\n"
set entities "Applied basic values:\n"
set ibasic 1
set ientities 1
set cprev ""
foreach c $conds {
append entities "Node [lindex $c 1] - Basic $ibasic\n"
incr ientities
if { [CompareCond $c $cprev] != 0 } {
append values "Basic $ibasic - [lrange $c 3 end]\n"
incr ibasic
set cprev $c
}
}
#this returned walue is printed directly to the output file if the
#procedure is called from the bas file with *tcl(WritePointLoads)
return "$values\n$entities"
}
Enrique escolano
----- Original Message -----
From: "Mihai TEODORESCU" mihai.teodorescu at prevost-industries.com
To: gidlist at gatxan.cimne.upc.es
Sent: Friday, March 07, 2003 8:48 AM
Subject: RE: [GiDlist] loop over conditions
Thank you. This is a good point start.
Supposing I apply the condition Point_Déplacement_imposé first with the
arguments dx=0 dy=0 dz=0 and the with the arguments dx=10 dy=0 dz=10
using the a procedere to find out all the conditions, sort them and
printing only once each condition is OK.
But If I apply twice the condition Point_Déplacement_imposé with the
some arguments dx=0 dy=0 dz=0 using the method you proposed me I will
get only one condition in my bas file. For my problem I need to be able
to print individualy each condition (the two I applied and not for each
point), even if they have the same parameter.
The reasons why I need individualy acces to each condition are driven by
the FEM code I use.
Supposing that I want simulate a stamping process. I need to aplpy some
conditions to block parts in space and other conditions to move down the
punch. Normaly the conditions are different. By maybe in some cases they
will have the some values in the firts step. The some is true for
forces. I need to be able to apply forces with the some values but one
will constant over time and other will evolue fonction of time.
Best regards,
-------------------------------------------------
Mihai TEODORESCU
Email: mihai.teodorescu at prevost-industries.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/20030307/d2577a71/attachment.htm
set res [.central.s info conditions Point-Load mesh]
and obtain {N 11 - 0.0 4} {N 6 - 0.0 1} {N 1 - 0.0 1}
Then filter whit tcl commands this result to write for example (avoing repetition of "basic values"):
Point-Load basic values:
Basic 1 - 0.0 1
Basic 2 - 0.0 4
Applied basic values:
Node 1 - Basic 1
Node 6 - Basic 1
Node 11 - Basic 2
This is a procedure to "filter" and write this result
proc WritePointLoads { } {
#obtain the conditions infomation from GiD
#set conds [.central.s info conditions Point-Load mesh]
#to test use for example this:
set conds {{N 11 - 0.0 4} {N 1 - 0.0 3} {N 6 - 0.0 1} {N 1 - 0.0 2} {N 1 - 0.0 1}}
#define a procedure to be used to compare two items ignorig the first 3 words, for example ignoring "N 11 -"
proc CompareCond {a b} {
set a0 [lrange $a 3 end]
set b0 [lrange $b 3 end]
if {$a0 $b0} {
return -1
} elseif {$a0 $b0} {
return 1
}
return 0
}
#sort your list using this comparation procedure
set conds [lsort -command CompareCond $conds]
#write results to output temporaty in two variables: values and entities
#write basic values without repetition
set values "Point-Load basic values:\n"
set entities "Applied basic values:\n"
set ibasic 1
set ientities 1
set cprev ""
foreach c $conds {
append entities "Node [lindex $c 1] - Basic $ibasic\n"
incr ientities
if { [CompareCond $c $cprev] != 0 } {
append values "Basic $ibasic - [lrange $c 3 end]\n"
incr ibasic
set cprev $c
}
}
#this returned walue is printed directly to the output file if the
#procedure is called from the bas file with *tcl(WritePointLoads)
return "$values\n$entities"
}
Enrique escolano
----- Original Message -----
From: "Mihai TEODORESCU" mihai.teodorescu at prevost-industries.com
To: gidlist at gatxan.cimne.upc.es
Sent: Friday, March 07, 2003 8:48 AM
Subject: RE: [GiDlist] loop over conditions
Thank you. This is a good point start.
Supposing I apply the condition Point_Déplacement_imposé first with the
arguments dx=0 dy=0 dz=0 and the with the arguments dx=10 dy=0 dz=10
using the a procedere to find out all the conditions, sort them and
printing only once each condition is OK.
But If I apply twice the condition Point_Déplacement_imposé with the
some arguments dx=0 dy=0 dz=0 using the method you proposed me I will
get only one condition in my bas file. For my problem I need to be able
to print individualy each condition (the two I applied and not for each
point), even if they have the same parameter.
The reasons why I need individualy acces to each condition are driven by
the FEM code I use.
Supposing that I want simulate a stamping process. I need to aplpy some
conditions to block parts in space and other conditions to move down the
punch. Normaly the conditions are different. By maybe in some cases they
will have the some values in the firts step. The some is true for
forces. I need to be able to apply forces with the some values but one
will constant over time and other will evolue fonction of time.
Best regards,
-------------------------------------------------
Mihai TEODORESCU
Email: mihai.teodorescu at prevost-industries.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/20030307/d2577a71/attachment.htm