How to change the refPos of spheres to current position of consolidation stage, and not particle generation stage, to extract vtk files for plotting of displacement field in Paraview

Asked by Nicholas Ng on 2019-05-31

Hi all,

This question is a continuation from [1] which I had asked a few days before, as I face new problem when I try to plot the displacement field of particles in Paraview (from my direct shear test simulation in Yade).

This time, I'm planning to extract vtk files (to plot particle displacement field later in Paraview) from my direct shear test simulation which had around 200K - 400K particles. The true height of my shear box to be simulated should be only 27mm, but because I need to generate so many particles using "makeCloud" command, I had to increase the height of shear box to 3 times during particle generation stage, to allow for particles to generate and fall down by gravity to the bottom of shear box. I adjust the height of shear box back to 27mm later during consolidation stage.

So the sequence of my direct shear test simulation is like this:
1) Run 1st script for particle generation
2) Save state for particle generation
3)Run 2nd script > load particle generation saved state > consolidation process> shearing process
          + Extract vtk files for particle displacement from consolidation process to shearing process

***My problem is when I plot the displacement field vector plot in ParaView, I notice all my arrows actually start from 3 times of my true shear box height (i.e. 3 x 27mm = 81mm), and the arrows becomes very big with scale factor 1 (recommended value from [2]). I understand that this is because the refPos of particles is when they are being generated, that's why my displacement field looks like this.

***However, this is not what I intended. My goal is to plot displacement field for particle only during consolidation stage and shearing stage, and I guess the refPos of sphere should be the position during consolidation stage, and not particle generation stage. From [2], the comment did mention we can just change the refPos of spheres to the value we intended, so in my 2nd script, I use following commands to extract vtk files as follow:

===================================================================================

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb(),],verletDist=.05*radius_mean),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()]
 ),

 PyRunner(iterPeriod=200, command='doExport()'),

]
O.dt=5e-1*PWaveTimeStep()

vtk= export.VTKExporter('.../M4c_delS_displ3-')

b.state.refPos= b.state.pos # to change the refPos of spheres from particle generation stage to current position of consolidation stage

def doExport():
 vtk.exportSpheres(useRef=True,what=[('dspl','b.state.displ()')])

=====================================================================================================

However, even after I change try to change the refPos of spheres to that of consolidation stage, it doesn't seem to work, because when I plot my displacement field in Paraview, the arrows still start at 3 times shear box height.

I hope someone can give me some suggestion on how to tackle this problem of mine.

Thank you and Regards,

Nicholas Ng

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

[2] https://answers.launchpad.net/yade/+question/478212?fbclid=IwAR2vHyBaUXaq_VOOA61GUN2ZgLojH3XIf3h1U9YP6iU9121Yh2Ecf7Kxx5g

[3] https://answers.launchpad.net/yade/+question/673124?fbclid=IwAR2RQh-bClCyo2OffjysYup8coHKHzbYmgVEOWRnny_tZ2nTEYIzzknNELk

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
2019-05-31
Last reply:
2019-05-31
Jan Stránský (honzik) said : #1

> b.state.refPos= b.state.pos # to change the refPos of spheres from particle generation stage to current position of consolidation stage

is this the actual code? if so, it just modifies refPos of "b", one body I guess. Try:
###
for b in O.bodies:
   b.state.refPos = b.state.pos
###

cheers
Jan

Nicholas Ng (nngyongjie) said : #2

Hi Jan,

Yes this is the actual code.

Thanks for the reply. I will try out your suggestion.

Regards,
Nicholas

Can you help with this problem?

Provide an answer of your own, or ask Nicholas Ng for more information if necessary.

To post a message you must log in.