[GiDlist] Counting boundary conditions

Moderator: GiD Team

Post Reply
Esneyder Montoya

[GiDlist] Counting boundary conditions

Post by Esneyder Montoya »

Hi Enrique

many thanks for your answer. However it did not solve my problem. To
refresh the idea what I want the program to do is:
Let's say I have the following nodes with the restraints in X , Y , and
Z directions (1: restrained 0:free)

Node Rx Ry Rz
12 1 0 0
16 1 1 1
22 0 0 1
25 0 1 1

The list of commands you suggested will write the following
set var =
0 = 1
0 = 3
0 = 1
0 = 2
No. of restraints = 0

However what I need to write into the *.bas files is ONLY:

No. of restraints = 7

That is the total number of restraints ( node 12 is 1, node 16 is 3,
node 22 is 1, node 25 is 2, total = 1 + 3 + 1 + 2 = 7), for the four
nodes.

Thanks for any hint on this, really appreciated.
Gracias




I don,'t understand exactly what's the desired value, and your =
definition=20
of the Support-Constraints condition, but your code can similar to this:

*set var restraints=3D0
*Set Cond Support-Constraints *nodes
*loop nodes *OnlyInCond
set var =
restraints=3DOperation(restraints+cond(1,int)+cond(2,int)+cond(3,int))
*end nodes
No. of restraints: *restraints

It's assumed that the fields 1,2 and 3 of Support-Constraints can be set =
only to 0 or 1, and 1=3Ddegree constraint.

Enrique Escolano

----- Original Message -----=20
From: esneyder.montoya at utoronto.ca
To: gidlist at gatxan.cimne.upc.es
Sent: Wednesday, June 25, 2003 1:30 AM
Subject: [GiDlist] Counting boundary conditions



Hi there
=20
Could somebody help me out in something, I am trying to count the =


number of

restrains in nodes and write the results down in my *.bas files, for a =


nonlinear

finite element program. This is the first time I use GiD and have no =


success so

far in doing this.
=20
the *.bas commands of GiD count the number of nodes with a certain =


condition

BUT not the number of restraints, that is, if a node XX has three =


degrees of

freedom restrained (say a fixed support) , the *set cond estatement =


will count

ONE node BUT not THREE restraints. How can I count the restraints?
=20
I am attaching a piece of the *.bas for your reference:
=20
No. of restraints : *\
*set var restraints=3D0
*Set Cond Support-Constraints *nodes
*if(CondNumEntities(int)0)
*loop nodes *OnlyInCond
*format {"%4i"}
*restraints=3D*Operation(cond(1,int)+cond(2,int)+cond(3,int))
*end nodes
*endif






-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030627/9185bff6/attachment.htm
Enrique Escolano

[GiDlist] Counting boundary conditions

Post by Enrique Escolano »

My previous code was not tested (It was only a explanation requiring slight modifications for your especific use)
Is missing an asterisc before "set var restraints=3DOperation(restraints+cond(1,int)+cond(2,int)+cond(3,int))"

I attach a problemtype (CountRest.gid.zip) and a small sample (SampleCount.gid.zip)
whit your related contition over the nodes 12,16,22 and 25.

the result is as expected:

No. of restraints: 7

Enrique
----- Original Message -----
From: Esneyder Montoya
To: gidlist at gatxan.cimne.upc.es
Sent: Friday, June 27, 2003 12:42 AM
Subject: [GiDlist] Counting boundary conditions



Hi Enrique

many thanks for your answer. However it did not solve my problem. To refresh the idea what I want the program to do is:
Let's say I have the following nodes with the restraints in X , Y , and Z directions (1: restrained 0:free)

Node Rx Ry Rz
12 1 0 0
16 1 1 1
22 0 0 1
25 0 1 1

The list of commands you suggested will write the following
set var =
0 = 1
0 = 3
0 = 1
0 = 2
No. of restraints = 0

However what I need to write into the *.bas files is ONLY:

No. of restraints = 7

That is the total number of restraints ( node 12 is 1, node 16 is 3, node 22 is 1, node 25 is 2, total = 1 + 3 + 1 + 2 = 7), for the four nodes.

Thanks for any hint on this, really appreciated.
Gracias





I don,'t understand exactly what's the desired value, and your =
definition=20
of the Support-Constraints condition, but your code can similar to this:

*set var restraints=3D0
*Set Cond Support-Constraints *nodes
*loop nodes *OnlyInCond
set var =
restraints=3DOperation(restraints+cond(1,int)+cond(2,int)+cond(3,int))
*end nodes
No. of restraints: *restraints

It's assumed that the fields 1,2 and 3 of Support-Constraints can be set =
only to 0 or 1, and 1=3Ddegree constraint.

Enrique Escolano

----- Original Message -----=20
From: esneyder.montoya at utoronto.ca
To: gidlist at gatxan.cimne.upc.es
Sent: Wednesday, June 25, 2003 1:30 AM
Subject: [GiDlist] Counting boundary conditions


Hi there
=20
Could somebody help me out in something, I am trying to count the =
number of
restrains in nodes and write the results down in my *.bas files, for a =
nonlinear
finite element program. This is the first time I use GiD and have no =
success so
far in doing this.
=20
the *.bas commands of GiD count the number of nodes with a certain =
condition
BUT not the number of restraints, that is, if a node XX has three =
degrees of
freedom restrained (say a fixed support) , the *set cond estatement =
will count
ONE node BUT not THREE restraints. How can I count the restraints?
=20
I am attaching a piece of the *.bas for your reference:
=20
No. of restraints : *\
*set var restraints=3D0
*Set Cond Support-Constraints *nodes
*if(CondNumEntities(int)0)
*loop nodes *OnlyInCond
*format {"%4i"}
*restraints=3D*Operation(cond(1,int)+cond(2,int)+cond(3,int))
*end nodes
*endif




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030627/b7629755/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CountRest.gid.zip
Type: application/x-zip-compressed
Size: 631 bytes
Desc: not available
Url : http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030627/b7629755/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SampleCount.gid.zip
Type: application/x-zip-compressed
Size: 2795 bytes
Desc: not available
Url : http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030627/b7629755/attachment-0001.bin
Post Reply