← Back to team overview

yade-users team mailing list archive

Re: [Question #688528]: Multiple Geogrids

 

Question #688528 on Yade changed:
https://answers.launchpad.net/yade/+question/688528

    Status: Open => Solved

Luis Barbosa confirmed that the question is solved:
Deal all, I solved the problem by doing:


#Create all nodes first :
for i in range(0,nbL):
	for j in range(0,nbl):
		nodesIds.append( O.bodies.append(gridNode([i*L/nbL,j*l/nbl,0],r,wire=False,fixed=False,material='spheremat',color=color)) )
		nodesIds2.append( O.bodies.append(gridNode([i*L/nbL,j*l/nbl,0.05],r,wire=False,fixed=False,material='spheremat',color=color)) )
		nodesIds3.append( O.bodies.append(gridNode([i*L/nbL,j*l/nbl,-0.05],r,wire=False,fixed=False,material='spheremat',color=color)) )

#Create connection between the nodes
a=len(nodesIds)
b=len(nodesIds2)
c=len(nodesIds3)
d=a+b+c

for i in range(0,d):
	for j in range(i+1,d):
		dist=(O.bodies[i].state.pos - O.bodies[j].state.pos).norm()
		if(dist<=L/nbL*1.01):		
			O.bodies.append( gridConnection(i,j,r,color=color) )

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.