Eng-Tips is the largest forum for Engineering Professionals on the Internet.

Members share and learn making Eng-Tips Forums the best source of engineering information on the Internet!

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

loop over the node component/selected node, in which nodes numbers are not in sequence. 2

Status
Not open for further replies.

naturepointing

Marine/Ocean
Joined
Mar 5, 2014
Messages
4
Location
NL
Hello, everybody

Is it possible to loop over the node component or the selected node numbers, in which nodes number are not in sequence.

Thank you a lot

wind
 
Use the NXTH function from *GET. Your script may look something like:

Code:
nsel,s,node,,.......             ! select the node set
*get,currn,node,0,num,min        ! get minimum node num in variable currn
*get,num_of_nodes,node,0,count   ! get num of nodes

! Create a loop to carry out some function such 
! as finding the nodal x co-ordinate

*do,J,1,num_of_nodes
         ncx = nx(currn)      
	*get,currn,node,currn,nxth   ! Get the node number in the set higher than currn
	node = currn
*enddo



------------
See faq569-1083 for details on how to make best use of Eng-Tips.com
 
You can also use currn = ndnext(currn) instead of the *get,currn,node,currn,nxth

 

*get,nmax,node,platei,count
*get,minno,node,platei,num,min

*dim,p1node,,nmax

n0=minno
p1node(1)=n0

*do,i,2,nmax
n0=ndnext(n0)
p1node(i)=n0
*enddo

*do,in,1,nmax ! start loop over all nodes in one plate
*get,xno,node,p1node(in),loc,x
*get,yno,node,p1node(in),loc,y
*get,zno,node,p1node(in),loc,z


dz = wopl*(b1*sin(pi*(xno-0)/a)+b3*sin(3*(xno-0)*pi/a))*sin(pi*(yno+375)/b)
n,p1node(in),xno,yno,zno+dz

*end do
 
Drej and Orel, Thank you two.

I combined what you two said, and write the above code, it works.

many thanks to you two.

cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top