mcvine / acc

Accelerated mcvine engine
0 stars 1 forks source link

Add new optics: Slit and Beamstop. #67

Closed mtbc closed 2 years ago

mtbc commented 2 years ago

Fixes #59 and fixes #62 by adding new Slit and Beamstop components with associated tests.

mtbc commented 2 years ago

There is a fair bit of copy-and-paste code here. If numba's @jitclass support were better or it were otherwise easier to inject lambdas into the heart of propagate then the four categories - {rectangle, circle} × {slit, beamstop} - could be covered by one piece of code that has a small helper function set by __init__ from float × float → boolean. @ckendrick points to https://stackoverflow.com/questions/52807489/programmatic-nested-numba-cuda-function-calls as possibly presenting an avenue toward that with current numba but I fear that the attendant complication is worse than the current duplication.

mtbc commented 2 years ago

... easier to inject lambdas into the heart of propagate ...

Another issue here may be that the ComponentBase sets the process kernel class-wide.