Instancing example¶
Let's make a mock-class containing the position and masses of 100 000 particles to push the performance of the current MDView implementation. This example should be able to deal with 1 000 000 bubbles, depending on you setup.
Keep in mind, however, that the planned upgrade to WebGPU will significantly boost this ability.
In [ ]:
Copied!
import bubblebox as bb
import evince as ev
import numpy as np
b = bb.mdbox(100,size=(100,100,100))
n_bubbles = 100000
b.pos = np.random.multivariate_normal(np.zeros(3), 1250*np.eye(3), n_bubbles).T
b.masses = 10 - 10*np.exp(-.01*np.sum(b.pos**2, axis = 0)**.5)
ev.MDView(b)
import bubblebox as bb
import evince as ev
import numpy as np
b = bb.mdbox(100,size=(100,100,100))
n_bubbles = 100000
b.pos = np.random.multivariate_normal(np.zeros(3), 1250*np.eye(3), n_bubbles).T
b.masses = 10 - 10*np.exp(-.01*np.sum(b.pos**2, axis = 0)**.5)
ev.MDView(b)
In [ ]:
Copied!