New question #680641 on Yade: https://answers.launchpad.net/yade/+question/680641
Hi, I’m working on triaxial test simulation of sand particle breaking. I'm trying fragment replace method recently. Refer to Jan's answer to this question: https://answers.launchpad.net/yade/+question/675477. My conditions for breaking are referenced to an article of Ciantia[1]. But segmentation falut occurs when this breaking condition is reached, catchsegv's output is as follow. Can you help me solve this problem? Thank you! catchsegv's output: Register dump: RAX: 000055ea62954c30 RBX: fffffffffffffff0 RCX: 000055da5e6d5560 RDX: 000055da60668210 RSI: 000055da60592330 RDI: 000055da60586e00 RBP: 000055ea62954c30 R8 : 000055da5e6cffe0 R9 : 000055da5e2c31c0 R10: 000055da5e7349e0 R11: 00007f956a1923a0 R12: 0000000000000000 R13: 0000000000000000 R14: 000055da60668210 R15: 00007f95b6ead0b0 RSP: 00007f956bffe610 RIP: 00007f95b8cfe55d EFLAGS: 00010206 CS: 0033 FS: 0000 GS: 0000 Trap: 0000000e Error: 00000004 OldMask: 00000000 CR2: 62954c30 FPUCW: 0000037f FPUSW: 00000020 TAG: 00000000 RIP: a1eee2c4 RDP: 00000000 ST(0) ffff 8000000000000000 ST(1) 0000 0000000000000000 ST(2) 0000 0000000000000000 ST(3) ffff f800000000000000 ST(4) ffff 81ceb32c4b43fcf5 ST(5) ffff a000000000000000 ST(6) ffff 81ceb32c4b43fcf5 ST(7) 81ce 81ceb32c4b43fcf5 mxcsr: 1fa0 XMM0: 000000000000000000000000ffffffff XMM1: 000000000000000000000000ffffffff XMM2: 000000000000000000000000ffffffff XMM3: 000000000000000000000000ffffffff XMM4: 000000000000000000000000ffffffff XMM5: 000000000000000000000000ffffffff XMM6: 000000000000000000000000ffffffff XMM7: 000000000000000000000000ffffffff XMM8: 000000000000000000000000ffffffff XMM9: 000000000000000000000000ffffffff XMM10: 000000000000000000000000ffffffff XMM11: 000000000000000000000000ffffffff XMM12: 000000000000000000000000ffffffff XMM13: 000000000000000000000000ffffffff XMM14: 000000000000000000000000ffffffff XMM15: 000000000000000000000000ffffffff Backtrace: /usr/lib/x86_64-linux-gnu/yade/libyade.so(_ZN13BodyContainer5eraseEib+0x4d)[0x7f95b8cfe55d] /usr/lib/x86_64-linux-gnu/yade/py/yade/wrapper.so(_ZN5boost6python7objects23caller_py_function_implINS0_6detail6callerIM15pyBodyContainerFbibENS0_21default_call_policiesENS_3mpl7vector4IbRS5_ibEEEEEclEP7_objectSG_+0xf7)[0x7f95a6160017] /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.65.1(_ZNK5boost6python7objects8function4callEP7_objectS4_+0x285)[0x7f95b6eace55] /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.65.1(+0x22008)[0x7f95b6ead008] /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.65.1(_ZN5boost6python21handle_exception_implENS_9function0IvEE+0x73)[0x7f95b6eb39a3] /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.65.1(+0x1f6c9)[0x7f95b6eaa6c9] /usr/bin/python(PyEval_EvalFrameEx+0x54a0)[0x55da5e2b0420] /usr/bin/python(PyEval_EvalFrameEx+0x52b2)[0x55da5e2b0232] /usr/bin/python(PyEval_EvalCodeEx+0x6da)[0x55da5e2a8d0a] /usr/bin/python(PyEval_EvalCode+0x19)[0x55da5e2a8629] /usr/bin/python(+0x12461f)[0x55da5e2d961f] /usr/bin/python(PyRun_StringFlags+0x66)[0x55da5e3063d6] /usr/bin/python(PyRun_SimpleStringFlags+0x3c)[0x55da5e306adc] /usr/lib/x86_64-linux-gnu/yade/libyade.so(_Z11pyRunStringRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x1b)[0x7f95b987bd2b] /usr/lib/x86_64-linux-gnu/yade/libyade.so(_ZN5Scene18moveToNextTimeStepEv+0x4b2)[0x7f95b8d91882] /usr/lib/x86_64-linux-gnu/yade/libyade.so(_ZN14SimulationFlow12singleActionEv+0x33)[0x7f95b8d94d83] /usr/lib/x86_64-linux-gnu/yade/libyade.so(_ZN12ThreadWorker16callSingleActionEv+0x4f)[0x7f95b8d9879f] /usr/lib/x86_64-linux-gnu/yade/libyade.so(_ZN12ThreadRunner4callEv+0x47)[0x7f95b8d959b7] /usr/lib/x86_64-linux-gnu/yade/libyade.so(_ZN12ThreadRunner3runEv+0x50)[0x7f95b8d95c90] /usr/lib/x86_64-linux-gnu/yade/libyade.so(_ZN5boost6detail11thread_dataINS_9function0IvEEE3runEv+0x32)[0x7f95b8d97d52] /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.65.1(+0x11bcd)[0x7f95b5f54bcd] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76db)[0x7f95bc16c6db] /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[0x7f95bc4a588f] breaking criterion: def selectBodiesToCrush(): breakparticle = [] for b in O.bodies: if not isinstance(b.shape,Sphere):continue # exclude walls sigma_lim0 = 500e4 diamter0 = 2.0 diamter = 2.0 * b.shape.radius m = 10.0 sigma_lim = sigma_lim0 * math.pow((diamter/diamter0), (-3.0/m)) Fn_max = 0 for i in b.intrs(): Fn_abs = math.sqrt(i.phys.normalForce[0]*i.phys.normalForce[0]+i.phys.normalForce[1]*i.phys.normalForce[1]+i.phys.normalForce[2]*i.phys.normalForce[2]) if Fn_abs > Fn_max:Fn_max = Fn_abs if Fn_abs == Fn_max: b1,b2=[O.bodies[ii] for ii in (i.id1,i.id2)] if not isinstance(b1.shape,Sphere):continue if not isinstance(b2.shape,Sphere):continue r_apostrophe = math.pow(1/b1.shape.radius + 1/b2.shape.radius,-1.0) E_apostrophe = math.pow(((1-b1.material.poisson*b1.material.poisson)/b1.material.young)+((1-b2.material.poisson*b2.material.poisson)/b2.material.young),-1.0) rH = math.pow((3*r_apostrophe)/(4*E_apostrophe),1.0/3.0) F_lim = math.pow((sigma_lim * math.pi * rH * rH),3.0) if Fn_max >= F_lim: breakparticle.append(b) return breakparticle def createChildren(bb): p = bb.state.pos r = bb.shape.radius # Particle replacement mode s1 = sphere(p+(0,0.5359*r,0),0.4641*r,material='spheres',color=(0,0,1)) s2 = sphere(p+(-0.4641*r,-0.2679*r,0),0.4641*r,material='spheres',color=(0,0,1)) s3 = sphere(p+(0.4641*r,-0.2679*r,0),0.4641*r,material='spheres',color=(0,0,1)) s4 = sphere(p+(-0.6720*r,0.3880*r,0),0.2240*r,material='spheres',color=(0,0,1)) s5 = sphere(p+(0.6720*r,0.3880*r,0),0.2240*r,material='spheres',color=(0,0,1)) s6 = sphere(p+(0,-0.7760*r,0),0.2240*r,material='spheres',color=(0,0,1)) s7 = sphere(p+(0,0,0.6339*r),0.3659*r,material='spheres',color=(0,0,1)) s8 = sphere(p+(0,0,-0.6339*r),0.3659*r,material='spheres',color=(0,0,1)) s9 = sphere(p+(0,-0.5942*r,0.4456*r),0.2573*r,material='spheres',color=(0,0,1)) s10 = sphere(p+(0.5146*r,0.2671*r,0.4456*r),0.2573*r,material='spheres',color=(0,0,1)) s11 = sphere(p+(-0.5146*r,0.2971*r,0.4456*r),0.2573*r,material='spheres',color=(0,0,1)) s12 = sphere(p+(0,-0.5942*r,-0.4456*r),0.2573*r,material='spheres',color=(0,0,1)) s13 = sphere(p+(0.5146*r,0.2971*r,-0.4456*r),0.2573*r,material='spheres',color=(0,0,1)) s14 = sphere(p+(-0.5146*r,0.2971*r,-0.4456*r),0.2573*r,material='spheres',color=(0,0,1)) return s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14 def replace(): bodiesToDelete = selectBodiesToCrush() for bb in bodiesToDelete: if isinstance(bb.shape,Sphere) and bb.shape.radius > minr/4: children = createChildren(bb) O.bodies.erase(bb.id) O.bodies.append(children) [1]https://www.researchgate.net/publication/272794711_An_approach_to_enhance_efficiency_of_DEM_modelling_of_soils_with_crushable_grains Regards, Cloud -- You received this question notification because your team yade-users is an answer contact for Yade. _______________________________________________ Mailing list: https://launchpad.net/~yade-users Post to : [email protected] Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp

