Grids visualization in ParaView

Asked by Alessandro Balzarotti

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

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Deepak (deepak-kn1990) said :
#1

Hello,

I use the VTK recorder in the O.engines list like this: (I just have gridNodes and gridConnections in my simulation)

VTKRecorder(fileName='fibvtk/frp-',recorders=['intr'],iterPeriod=10000)

This would export all the interactions and you will see it as a lines in paraview when you open it.
In paraview, use the 'tube' filter, set the number of sides (6 is default, I use 12). and the radius of the grid node. You would be able to see the 3D representation for the gridconnections. But the situation would be different when you have spheres in your simulation, you would see the interactions appear as cylinders between the gridconnection-sphere and sphere-sphere interactions.
I think you can use the VTKexporter, exportInteractions() [1] with the ids of the gridnodes for viewing the gridconnections alone.

[1]https://yade-dem.org/doc/yade.export.html?highlight=vtkexporter#yade.export.VTKExporter

Can you help with this problem?

Provide an answer of your own, or ask Alessandro Balzarotti for more information if necessary.

To post a message you must log in.