Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Picking a random node or element

Status
Not open for further replies.

sadegh87

Bioengineer
Dec 28, 2012
4
0
0
DE
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
 
Replies continue below

Recommended for you

You would have to write some APDL to do this. APDL has a random function PAR = RAND() which you could include as part of a script to select nodes (NSEL) or elements (ESEL).

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 for details on how to make best use of Eng-Tips.com
 
Hello Drej,

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.
 
I have a solution concerning the workbench I dont know whether it would help you, You can export the nodes list from the solution of the simulation and in that list there are the numbers and coordinates of each point.. you can select the nodes if you select the option >select mesh and next to it >single select and you can easily then pick the nodes you need.. but I dont know what you want to do further.. you can put a load or something if thats what you need!

Regards,
Jessi M.
 
Status
Not open for further replies.
Back
Top