postprocessing data with tassellationWrapper

Asked by Marco Previtali

Hello,
I plan to use the tasselationWrapper utility to compute some micro-strain. However, first I wanted to test it out on a simple problem. I tried using the triaxial example [1] but I don't see anything in the VTK results. Therefore, I modified it slightly to increase the resolution (i.e. the number of grains) and the total strain and tried playing around with Paraview's clip/slice/threshold filters, with no improvements. Am I missing something? I'm not sure exactly what I should see from the example as the youtube link [2] only shows the compression phase and not the postprocessing. I'm using Yade 2021-06-08

tt=TriaxialTest()
tt.numberOfGrains = 5000
tt.generate("test.yade")
O.load("test.yade")
O.run(100,True)
TW=TesselationWrapper()
TW.triangulate() #compute regular Delaunay triangulation, don’t construct tesselation
TW.computeVolumes() #will silently tesselate the packing, then compute volume of each Voronoi cell
TW.volume(10) #get volume associated to sphere of id 10
TW.setState(0) #store current positions internaly for later use as the "0" state
O.run(20000,True) #make particles move a little (let's hope they will!)
TW.setState(1) #store current positions internaly in the "1" (deformed) state
#Now we can define strain by comparing states 0 and 1, and average them at the particles scale
TW.defToVtk("strain.vtk")

Cheers

[1] https://gitlab.com/yade-dev/trunk/blob/master/examples/tesselationwrapper/tesselationWrapper.py
[2] https://www.youtube.com/watch?v=2o3Y4znBmh8

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Karol Brzezinski
Solved:
Last query:
Last reply:
Revision history for this message
Karol Brzezinski (kbrzezinski) said :
#1

Hi Marco,

when you say you don't see anything after loading the file with ParaView you mean completely nothing, or just the result is not 'impressive'? In this example, the results don't show any distinct features. The strain fields are be uniform, with some noise. Maybe try this modification.

from yade import pack
pred=pack.inAlignedBox((0,0,0),(1,1,1))
spheres=pack.randomDensePack(pred,spheresInCell=2000,radius=.05,rRelFuzz=0,returnSpherePack=True)
spheres.toSimulation()
TW=TesselationWrapper()
TW.triangulate() #compute regular Delaunay triangulation, don’t construct tesselation
TW.computeVolumes() #will silently tesselate the packing, then compute volume of each Voronoi cell
TW.setState(0) #store current positions internaly for later use as the "0" state
for b in O.bodies:
 if isinstance(b.shape,Sphere):
  b.state.blockedDOFs = 'xyz'
  if b.state.pos[0]>0.5:
   b.state.vel = (0,1,0)

O.run(20,True) #make particles move a little (let's hope they will!)
TW.setState(1) #store current positions internaly in the "1" (deformed) state
#Now we can define strain by comparing states 0 and 1, and average them at the particles scale
TW.defToVtk("strain.vtk")

Cheers,
Karol

Revision history for this message
Marco Previtali (mprev) said :
#2

Hi Karol,
when I say I don't see anthing in the result, I mean that I don't see any distinct feature (i.e. I tried increasing the strain and resolution).

the example you proposed does indeed show what one would expect (a vertical shear band).

I will try again with a triaxial test increasing the number of particles even further, hoping some visible shear band developes.

Thank you, this pretty much answered my question.

I have one last question: what does the TW.volume(10) command do? Get the volume of an arbitary particle? As far as I can tell that's something required for micro-stresses but I'm not certain. From Catalano 2014 et al, [1], Fig. 9, I would say the volumes are obtained at run-time, not a-priori.

Kind regards,
Marco

[1] https://arxiv.org/pdf/1304.4895.pdf

Revision history for this message
Best Karol Brzezinski (kbrzezinski) said :
#3

Hi Marco,

I think that the purpose of the command

TW.volume(10)

used in the example, is to show that you can inspect TesselationWrapper manually. It isn't required to generate vtk files.

Best wishes,
Karol

Revision history for this message
Marco Previtali (mprev) said :
#4

Thanks Karol Brzezinski, that solved my question.

Revision history for this message
Marco Previtali (mprev) said :
#5

Hello again,
I have tried carrying out postprocessing of experimental data as suggested here [1].

### code running as post-processing with TesselationWrapper
from yade import ymport
O.bodies.append(ymport.text("state0.txt"))
TW=TesselationWrapper()
TW.triangulate()
TW.computeVolumes()
TW.setState(0)
#
O.reset()
O.bodies.append(ymport.text("state1.txt"))
TW.setState(1)
#
TW.defToVtk("strain.vtk")
###

However, despite a 20% deviatoric strain being applied to the sample, the code provides no useful outputs:

Triangulated Grains : 2690
sym_grad_u_total_g (wrong averaged strain):
0 0 0
0 0 0
0 0 0

Total volume = 0, grad_u =
0 0 0
0 0 0
0 0 0

sym_grad_u (true average strain):
0 0 0
0 0 0
0 0 0

Macro strain :
0 0 0
0 0 0
0 0 0

(Note that this is a 2D problem).

If I do something similar, i.e. updating the position of the particles instead of using O.reset() and re-generating them, I get the same (lack of) results.

Is there any issue with the approach or am I missing something?

[1] https://answers.launchpad.net/yade/+question/684747

Revision history for this message
Karol Brzezinski (kbrzezinski) said (last edit ):
#6

Hi,

you can compute strains also directly from external files by using method defToVtkFromPositions()[2].

But I think that the main problem is 2D formulation. I would try to prepare thicker samples (artificially replicate your 2D "layers").

Cheers
Karol

[2] https://yade-dem.org/doc/yade.wrapper.html?highlight=tesselation#yade.wrapper.TesselationWrapper

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#7

Hi,
Just a quick comment.
"Not seeing distinct features" is somewhat expected in most cases.
Persistent shear bands are never fully persistent and always a bit noisy, so seeing them depends very much on the strain magnitude between the two states (too small or too large: nothing visible).
And sometimes there is just no persistent shear bands...

Bruno

Revision history for this message
Marco Previtali (mprev) said :
#8

Hi,
I have managed to obtain visible shear bands by converting my 2D experiment to a pseudo-3D and then carrying out the analysis.
I was mostly confused because the image on the wiki showed a very clear shear band, while the example provided (i.e. an uniaxial compression test) looked like it would exhibit sometime similar but didn't show anything in the post-processing. The fixed displacement example proposed by Karol worked very well in this context.

Marco