← Back to team overview

yade-users team mailing list archive

[Question #661618]: Grids visualization in ParaView

 

New question #661618 on Yade:
https://answers.launchpad.net/yade/+question/661618

Hello everyone,

I want to simulate something similar to this vid:  https://www.youtube.com/watch?v=YW5IsINjCvw
but pulling the grid upward.

Since I'm new with grids in Yade, I'm playing with the examples given in the documentation. I'm using a machine with no graphical interface, so to explore the scene I have to use VTKs and Paraview. The fact is that I get the spheres/nodes visualized correctly, but not the GridConnections.
Are the connecting cylinders there and it's just a visualization problem, or is something missing in the code?

Here's the code I used (taken by the documentation, I just added the VTKExporter):

-------------------------------------------

# encoding: utf-8

from yade import pack,geom,export
from yade.gridpfacet import *
from pylab import *
# qt.View()


O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_GridConnection_Aabb()]),
	InteractionLoop(
		[Ig2_GridNode_GridNode_GridNodeGeom6D()],
		[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False)],
		[Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
	),
	NewtonIntegrator(gravity=(0,0,-10),damping=0.1,label='newton'),
	PyRunner(command="vtke.exportFacets(ids='all')",virtPeriod=1.5e-2),
	PyRunner(command="vtke.exportSpheres(ids='all')",virtPeriod=1.5e-2),
]


O.materials.append(CohFrictMat(young=3e2,poisson=0.3,density=1e1,frictionAngle=10,normalCohesion=1e7,shearCohesion=1e7,momentRotationLaw=True,label='mat'))


### Parameters ###
L=0.1 #length [m]
n=10	#number of nodes for the length	[#]
r=L/100.	#radius
color=[255./255.,102./255.,0./255.]

### Create all nodes first
nodeIds=[]
for i in range(0,n):
  nodeIds.append( O.bodies.append( gridNode([i*L/n,0,0],r,wire=False,fixed=False,material='mat',color=color) ) )

### Create connections between the nodes
connectionIds=[]
for i,j in zip(nodeIds[:-1],nodeIds[1:]):
  connectionIds.append( O.bodies.append( gridConnection(i,j,r,color=color) ) )

### Set a fixed node
O.bodies[0].dynamic=False

O.dt=1e-06

### VTK Exporter
vtke=export.VTKExporter('vtk_grid')
vtke.exportFacets(ids='all')
vtke.exportSpheres(ids='all')

O.stopAtIter=1000000
O.run()

-------------------------------------------

Thanks in advance.

Best regards,

Alessandro

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