The Code is crashed when there are two balls with same position and radius

Bug #1759633 reported by Meng Qing Xiang on 2018-03-28
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Undecided
Unassigned

Bug Description

I just find that if there are two balls with the same position and radius and the program is crashed without any information.

 Robert Caulk (rcaulk) wrote on 2018-03-28: #1

Hello,

Will you please provide a minimal working example to demonstrate this bug [1]?

Cheers,

Robert

 Meng Qing Xiang (642229461-k) wrote on 2018-04-09: #2

I use a simple example given by Jan.
This is OK:
O.periodic = True
O.cell.setBox(6,10,14)
b1 = sphere((0,0,0),1,color=(1,0,0))
b2 = sphere((2,4,4),1,color=(0,1,0))
b3 = sphere((4,8,8),1,color=(0,1,1))
O.bodies.append((b1,b2,b3))
O.step()
b3.state.vel = 5e-5*Vector3(-1.1,-2,-2.2)
#
qt.View()
O.run()

This code is wrong:
O.periodic = True
O.cell.setBox(6,10,14)
b1 = sphere((0,0,0),1,color=(1,0,0))
b2 = sphere((2,4,4),1,color=(0,1,0))
b3 = sphere((4,8,8),1,color=(0,1,1))
b4 = sphere((4,8,8),1,color=(0,1,1))
O.bodies.append((b1,b2,b3,b4))
O.step()
b3.state.vel = 5e-5*Vector3(-1.1,-2,-2.2)
#
qt.View()
O.run()

Yours,
Meng

 Jérôme Duriez (jduriez) wrote on 2018-04-17: #3

Hi,

It's true using the "wrong code" I got an infinite (it seems) number of "ValueError: cannot convert float NaN to integer" even when running just one iteration.

Is it what you call "code is crashed" ?
If yes, could you please try to shorten your script ? (for this behavior to occur do we need 4 spheres ? everything coming after O.step() ?) See if this is periodic boundary-dependent, or more general ?

Jérôme