The mismatach of the sample after using export.text()

Asked by jasperb on 2020-02-03

Hi
I encountered a weird thing..
I was preparing a dense sample(composed of polydisperse spheres initially generated by makeCloud and the friction angle is set to zero) by using PeriTriaxController.

A mini script goes like below:

.............................................................................................................................................................................

triax=PeriTriaxController(
 dynCell=True,
 mass=0.2,
 maxUnbalanced=stabilityThreshold,
 relStressTol=0.005,
 growDamping=0,
 goal=(-1000,-1000,-1000),
 stressMask = 7, #the vertical direction of wall is controlled by rate of strain
 globUpdate=1000,
 maxStrainRate=(0.01,0.01,0.01),
 doneHook='generating1()'
)
newton=NewtonIntegrator(damping=damp) #set non-viscous damping

#set one triaxial loop
O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb()]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()]
 ),
 GlobalStiffnessTimeStepper(active=True,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.9),
 triax,
 newton,
 PyRunner(iterPeriod = 1000, command = 'history()')
]

def generating1():
 newton.damping = 0.4
 triax.relStressTol=0.005
 triax.goal=(-2000,-2000,-2000)
 triax.doneHook='generating1_1()'

.............................................................................................................................................................................

Things go quite well and the porosity is below 0.4 after 24h's compression. And the visualization is right a compacted sample inside the cell box.
And then I want to export the sphere information about its position and radius.So I typed export.text(filename='').
But when I ymport this sample infomation, i got a cluster of exploded spheres( each far away from the other), which is totally different from what I saw in the sampleGeneration.py.

Could you help me with this?

Thanks

Japser

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
2020-02-03
Last query:
2020-02-03
Last reply:
2020-02-03
Best Jan Stránský (honzik) said : #1

I guess you are using O.periodic=True. In this case, the particles' positions are virtually wrapped to the cell for both computational and visualization purposes, even they are "exploded" in reality.
Before exporting, do
##
for b in O.bodies:
   b.state.pos = O.cell.wrapPt(b.state.pos)
export.text(...)
##

cheers
Jan

jasperb (jasperb) said : #2

Thanks Jan Stránský, that solved my question.