O.save() / O.load() problem

Asked by Bettina Suhr

Dear all,

in my simulations I use clumps of spheres and write restart files regularly (using O.save()). When I reload these files, I get an error:
python: /home/bettinasuhr/myYade20/trunk/core/ForceContainer.hpp:106: void ForceContainer::addTorqueUnsynced(Body::id_t, const Vector3r&): Assertion `(size_t)id<size' failed.
aborted (core dumped)

I use yade-1.20.0, compiled, without modifications and Cundall-Strack contact law.
Below, a minimal working example is given, which writes some restart files. The error does not occur if spheres instead of clumps are used. The problem seems to be related to clumps.

utils.readParamsFromTable(partType='clumps')#'spheres')#

from yade.params.table import *
from yade import pack

#define material for all bodies:
id_Mat=O.materials.append(FrictMat(young=1e6,poisson=0.3,density=1000,frictionAngle=1))

#define engines:
O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()]
 ),
 NewtonIntegrator(damping=0.7,gravity=[0,0,-9.81])
]

#create a box:
O.bodies.append(geom.facetBox(center=(0.0,0.0,0.25),extents = (0.125,0.125,0.25), wallMask=31))

#add particles eiter spheres or clumps
if partType=='spheres':
  sp=pack.SpherePack()
  sp.makeCloud( (-0.125,-0.125,0), ( 0.125,0.125,0.5), rMean=37.6e-3/2.,rRelFuzz=0.0,num=100)
  sp.toSimulation()
  O.bodies.updateClumpProperties(discretization=10)# correct mass, volume, inertia!!
elif partType=='clumps':
  sp=pack.SpherePack()
  c1=pack.SpherePack([ ((0.,0.,0.),37.6e-3/2.), ((37.6e-3/2.,0.,0.),25e-3/2.) ])# overlap between both spheres
  sp.makeClumpCloud( (-0.125,-0.125,0), ( 0.125,0.125,0.5), [c1],num=100)
  sp.toSimulation()
  O.bodies.updateClumpProperties(discretization=10)# correct mass, volume, inertia!!
else:
  print "ERROR! choose either spheres or clumps for partType!"

O.dt=1e-6

#write some restart files
O.save('restartMinWorkEx_'+partType+'_Initial')
O.run(100000,True)
O.save('restartMinWorkEx_'+partType+str(O.iter))
O.run(300000,True)
O.save('restartMinWorkEx_'+partType+str(O.iter))

The error occurs when:
O.load(‘restartMinWorkEx_clumps100000‘)
O.run(1000, True)
Is called.

Can somebody please help me? I don’t understand what causes the error. Before, I was using restart files in the same way and never had any of these problems.

Thanks in advance,
Bettina

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
Anton Gladky (gladky-anton) said :
#1

It is definitely a bug and should be investigated. It is strange that forcecontainer is not resized correctly after clumps loading.

Revision history for this message
Bettina Suhr (bettina-suhr) said :
#2

Thank you Anton for posting my problem as a bug.
it would be great if a solution/workaround cound be found.

Can you help with this problem?

Provide an answer of your own, or ask Bettina Suhr for more information if necessary.

To post a message you must log in.