Skip to content

Commit 89ef285

Browse files
committed
missing capacity; Now example works
1 parent e5e932a commit 89ef285

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/fluka_crystal.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
# context = xo.ContextCupy() # For CUDA GPUs
1919
# context = xo.ContextPyopencl() # For OpenCL GPUs
2020

21-
num_part = 100
21+
num_part = int(10_000)
2222

2323
coll = xc.FlukaCrystal(length=0.002, material='si', bending_angle=149e-6,
24-
width=0.002, height=0.05, side='+', jaw=1.e-12, # Hack to make it work for now; jaw should be almost zero
24+
width=0.002, height=0.05, side='+', jaw=-1e-3, # Hack to make it work for now; jaw should be almost zero
2525
_context=context)
2626

2727
# Connect to FLUKA
@@ -34,7 +34,7 @@
3434
px_init = np.random.uniform(low=-50.e-6, high=250.e-6, size=num_part)
3535
y_init = np.random.normal(loc=0., scale=1e-3, size=num_part)
3636
py_init = np.random.normal(loc=0., scale=5.e-6, size=num_part)
37-
part = xp.build_particles(x=x_init, px=px_init, y=y_init, py=py_init, particle_ref=xc.fluka.engine.particle_ref, _context=context)
37+
part = xp.build_particles(x=x_init, px=px_init, y=y_init, py=py_init, particle_ref=xc.fluka.engine.particle_ref, _context=context, _capacity=xc.fluka.engine.capacity)
3838
part_init = part.copy()
3939

4040

0 commit comments

Comments
 (0)