facets erase time

Asked by German Varas

Hello,

following a previous post on how to erase the faces of a cylinder, I managed to do it using the recommended function O.bodies.erase () . This works perfectly without problems, except when I have a lot of particles in the system. In this case, when reaching the imposed condition the system freezes for a while (about 1 hour) and then continues as usual (deleting the cylinder facets). I don't know if this is normal, or I am making a basic error. Maybe there is a way to optimize this easily.

--------------
CODE
--------------
...
cylinderFacetsIds = O.bodies.append(geom.facetCylinder((0,0,-0.5),0.25,3.0,segmentsNumber=30, wallMask=4))

sp=pack.SpherePack()
sp.makeCloud((-0.2,-0.2,-0.5),(0.2,0.2,1.0),rMean=0.03,rRelFuzz=0.1)
pred=pack.inCylinder((0.0,0.0,-4.0),(0.0,0.0,1.5),radius=0.2)
sp2 = pack.filterSpherePack(pred,sp,returnSpherePack=True)
# add the sphere pack to the simulation
sp2.toSimulation(material='sphereMat')

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
 InteractionLoop(
  # handle sphere+sphere and facet+sphere collisions
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()]
 ),
 NewtonIntegrator(gravity=(0,0,-9.81),damping=0.2),
 # call the checkUnbalanced function
 PyRunner(iterPeriod=1,command='checkUnbalanced()')
]

def checkUnbalanced():
 if O.iter==15000:
   for f in cylinderFacetsIds:
    O.bodies.erase(f)
------------------------------------------------------------------------------------------------

Question information

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

Hi,

I just wanted to comment a little bit about the code. It may be useful, however, not necessarily solving the problem:
- it is rare to run PyRunner for every iteration.
- there is no reason to call the function 'checkUnbalanced()' since it doesn't check unbalanced force,
- in the current version of the code, you can easily get rid of the PyRunner, since you want to run part of the code only once. Instead of the PyRunner run the simulation for 15 000 iterations, run extra code, and run again.

O.run(15000, wait=True)
  for f in cylinderFacetsIds:
    O.bodies.erase(f)
O.run()

One more thing. Do you have preview turned on during this process? It may be the culprit.

Best wishes,
Karol

Revision history for this message
Jan Stránský (honzik) said :
#2

Hello,

> following a previous post

next time please provide specific link

> CODE

the part you provided looks OK, like it should not "freezes for a while (about 1 hour) and then continues as usual (deleting the cylinder facets)"
I am afraid the complete code (however ideally adjusted to the Minimum example - MWE) is needed to help..

Cheers
Jan

Revision history for this message
Launchpad Janitor (janitor) said :
#3

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.