Cylinder with a large size in the periodic cell

Asked by Pengfei Tan on 2020-03-23

Dear all,

I would like to simulate the spreading process of spherical powders by a roller under the periodic boundary condition. The roller is represented by a cylindrical particle. Since the radius of the cylindrical roller is larger than a half of the periodic size. The simulation always encountered the error "Segmentation fault (core dumped)". Please give some suggestions about how to add this large cylinder into the periodic cell.

Sincerely appreciate your help.

Best regards,
Pengfei

Please see script as follows:

######################################################################
from yade.gridpfacet import *
from yade import pack, plot,qt,export

#Size of periodic cell
Ls=50.
Ws=8.
Hs=20.

rc=10. #Radius of cylindrical roller

#### Periodic boundary conditions ###
O.periodic = True
O.cell.setBox(Ls,Ws,Hs)

#### Engines ####
O.engines=[
 ForceResetter(),
 InsertionSortCollider([
  Bo1_GridConnection_Aabb(),
  Bo1_Box_Aabb(),
  Bo1_Sphere_Aabb(),
 ],allowBiggerThanPeriod = True),
 InteractionLoop([
  Ig2_GridNode_GridNode_GridNodeGeom6D(),
  Ig2_Sphere_Sphere_ScGeom(),
  Ig2_Box_Sphere_ScGeom(),
  Ig2_Sphere_GridConnection_ScGridCoGeom(),
  Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),

 ],
 [
  Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False),
  Ip2_FrictMat_FrictMat_FrictPhys()
 ],
 [
  Law2_ScGeom_FrictPhys_CundallStrack(),
  Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
  Law2_ScGridCoGeom_FrictPhys_CundallStrack(),
  Law2_GridCoGridCoGeom_FrictPhys_CundallStrack()
 ]
 ),
 GlobalStiffnessTimeStepper(timestepSafetyCoefficient=0.1,label='ts'),
 NewtonIntegrator(gravity=(0.,0,-10),damping=0.5,label='newton'),
 PyRunner(command='addMovement()',iterPeriod=1),

]
O.dt=0.1*PWaveTimeStep()

#### Create materials ####
O.materials.append( CohFrictMat( young=1e9,poisson=0.3,density=1000,frictionAngle=radians(30.),normalCohesion=1e500,shearCohesion=1e500,momentRotationLaw=True,label='cMat' ) )
O.materials.append( FrictMat( young=1e9,poisson=0.3,density=1000,frictionAngle=radians(30.),label='fMat' ) )
O.materials.append(FrictMat(young=1e9,poisson=0.3,frictionAngle=radians(30.),density=1600,label='spheremat'))

### Cylindrical roller ###
#cylinder((12.,0.,rc+1.5),(12.,Ws,rc+1.5),radius=rc,nodesIds=nodesIds,cylIds=cylIds,color=[1,0,0],fixed=False,intMaterial='cMat',extMaterial='fMat')
nodesIds=[]
cylIds=[]
cylinderConnection([[12.,0,rc+1.5],[12.,0.33*Ws,rc+1.5],[12.,0.33*2*Ws,rc+1.5],[12.,Ws,rc+1.5]],radius=rc,fixed = True,nodesIds=nodesIds,cylIds=cylIds,color=[1,0,0],intMaterial='cMat',extMaterial='fMat')
O.engines=O.engines+[ TranslationEngine(translationAxis=[1,0,0],ids=nodesIds+cylIds,label="transEngine")+RotationEngine(rotationAxis=(0,1,0),ids=nodesIds+cylIds,label="rotEngine") ]

### Box as substrate ###
O.bodies.append(box(center= (0,0,0.2),extents=(60.,60.,0),fixed=True,color = (128.,128.,128.),wire = False,material = 'fMat'))

#### Spheres ####
sp=pack.SpherePack()
Ns=sp.makeCloud(Vector3(25.,0.,1.),Vector3(30.,Ws,6.),0.3,0.2,50,False,0.8)
sphereID=sp.toSimulation(material='spheremat')

def addMovement():
 transEngine.velocity=1.
 rotEngine.angularVelocity=-1./5.

qt.View()
O.saveTmp()

Question information

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

Hi,

according to catchsegv:
Backtrace:
/usr/lib/x86_64-linux-gnu/yade/libyade.so(_ZN5Eigen8internal26call_dense_assignment_loopINS_6MatrixIdLi3ELi1ELi0ELi3ELi1EEENS_13CwiseBinaryOpINS0_13scalar_sum_opIddEEKS3_KNS4_INS0_17scalar_product_opIddEEKNS_14CwiseNullaryOpINS0_18scalar_constant_opIdEES7_EES7_EEEENS0_9assign_opIddEEEEvRT_RKT0_RKT1_+0x18)[0x7f9c27c2c788]
/usr/lib/x86_64-linux-gnu/yade/libyade.so(_ZN50Ig2_GridConnection_GridConnection_GridCoGridCoGeom2goERKN5boost10shared_ptrI5ShapeEES5_RK5StateS8_RKN5Eigen6MatrixIdLi3ELi1ELi0ELi3ELi1EEERKbRKNS1_I11InteractionEE+0x5fc)[0x7f9c27d3787c]

On Yade side, it seems the problem to be in Ig2_GridConnection_GridConnection_GridCoGridCoGeom::go, but acutal segfault is somewhere in Eigen code..

cheers
Jan

Pengfei Tan (tpf516) said : #2

Hi Jan,

Thank you for checking the error for me but I still haven't solve it.

Best regards,
Pengfei

I have found that a similar problem was encountered in [1]. Since no code is provided in their discussion, I am confused with their solution. I am trying to understand their ideas. Please help me if anyone else has suggestion.

Pengfei Tan (tpf516) said : #3
Jérôme Duriez (jduriez) said : #4

In your efforts understanding the previous question [1], note that part of it is anterior to the introduction of this allowBiggerThanPeriod attribute [*]

[*] https://gitlab.com/yade-dev/trunk/-/commit/8184896c704345dcbabb7c8581a54d0fe1d22c3b

Pengfei Tan (tpf516) said : #5

Thank you for your information, Jérôme. The code can work now by using a unique cylinder and the allowBiggerThanPeriod attribute.