Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Find neighbouring/nearest nodes APDL? 1

Status
Not open for further replies.

GeorgeEllwood

Mechanical
Aug 22, 2006
134
Hello,
I'm wondering if there is a way to find neighbouring or nearest nodes in APDL? I know I can use the NODE(x,y,z) command and that will find the nearest node to the point x,y,z. But I'm wondering if there is a different command that will tell me the numbers of the neighbouring nodes given a node number?
I think it might be possible to write a routine that can do this, but it could be time consuming to write and to run so I was wondering if there is a command or subroutine already out there that would do the job?
Thanks
George
 
Replies continue below

Recommended for you

What do you mean by "neighbouring or nearest nodes"? Do you mean attached to the same element as a particular node? Or within a finite range of a particular node?


------------
See faq569-1083 for details on how to make best use of Eng-Tips.com
 
Hi Drej,
I mean within a finite range of a node. From the way I am creating my mesh I know the number of the nodes that are part of the same element as a particular node. I'd like to automate the process of finding the nodes that are nearby but not part of the same element.
Thanks
George
 
This code will get you started.

It selects a finite box of nodes based on a centre node ("nodenum") and a range which is box shaped ("range"), where the box edge lengths are twice the "range" variable. It only works in 2D also (X and Y plane) but easy enough to extend.

Code:
! =============================================
! Identify a node number and a finite range
nodenum = 1795
range = 2.6E-02
! =============================================

alls
nsel,s,node,,nodenum
xloc = NX(nodenum)
yloc = NY(nodenum)

nsel,s,loc,x,xloc-range,xloc+range
nsel,r,loc,y,yloc-range,yloc+range
nplot



------------
See faq569-1083 for details on how to make best use of Eng-Tips.com
 
Hi Drej,
Thanks for the script, that should find all the nodes within a bounding box. I've found another command NNEAR(x), that will find the nearest node to node x, it only returns one node and I'm not sure how it decides which one when there are several nodes all the same distance apart from the target node.
Thanks
George
 
Create spherical locaL coordinate system, located at the node around which you desire to find other nodes. select new nodes based on the radius.
Commands
Local....
Nsel, s, loc,...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor