Picking a random node or element
Picking a random node or element
(OP)
Hello,
I am using Ansys Mechanical and doing some stress simulations. Is there an option to select random nodes or elements?
I want to pick for example 10% of all nodes randomly.
Thanks for your help.
sadegh87
I am using Ansys Mechanical and doing some stress simulations. Is there an option to select random nodes or elements?
I want to pick for example 10% of all nodes randomly.
Thanks for your help.
sadegh87





RE: Picking a random node or element
A sample random number generator code might be:
*GET,DIM,ACTIVE,0,TIME,WALL
DIM=DIM*3600
*DIM,DUMMY,ARRAY,DIM
*VFILL,DUMMY(1),RAND
*DEL,DIM
*DEL,DUMMY
Then combine the above with other APDL functions to select nodes / elements.
------------
See FAQ569-1083: Asking questions the smart way on Eng-Tips fora for details on how to make best use of Eng-Tips.com
RE: Picking a random node or element
thank you for your help. It helped me so far.
I have now written an APDL as follows:
*DIM,dtab,ARRAY,100,2
NSEL,S,S,3,-1,0, ,0
*VGET,dtab(1,1),node,,nlist
*vfill,dtab(1,2),rand,0,100
So I have selected some Nodes by results and stored their nodenumbers into the first column of the array.
Then I have put a random number from 0 to 100 into the second column.
So now each nodenumber has one random number.
Now unfortunately I dont know the next step.
I want to select nodes, for example which have random numbers in their second column, that are equal 10 or below.
Thats how I want to make sure, that I have chosen around about 10% of all nodes.
How can I get those nodenumbers, which have a 10 or below in the second column
And how can I select the nodes, that have these nodenumbers?
I would be very happy if you have a solution for me.
Thank you.
Bye.
RE: Picking a random node or element
Regards,
Jessi M.