JuliaPhysics / JuliaPhysics/SolidStateDetectors.jl
Speed up initialization of boundary conditions onto the grid
- Dominant language
- Julia
- Stars
- 178
- Forks
- 59
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 4
Description
Before the electric potential is calculated via SOR, the initial boundary conditions are applied onto the grid
and some constant weights (needed in the SOR) are precalculated. This also happens after each grid refinement.
If there are many objects in the world, e.g. highly pixelated detectors, and the grid becomes finer and finer,
these precalculations actually can take quite some time.
There are some ways to improve this:
- [ ] **Get rid of unnecessary point conversions**
The time critical part is the lookup to which object each individual point belongs: the `in`-method.
Right now, we only parse the grid point in form of the coordinate system of the world, e.g. cylindrical coordinates, to this method. Depending on the geometry of the object, the parsed point might be converted into the other coordinate system, e.g. cartesian. And this several times. We should do this just once and parse the point in both forms to the in methods.
- [x] **Parallize** (#206)
Right now, no multithreading is used here.
But the loop running over the grid points can be parallized.
- [x] **Remove allocations in `in` method for larger CSG's**
See #207
- [ ] **Clustering of objects**
Divide the grid in subgrids and add an external additinal loop running over those subgrids (in parallel).
But before executing this loop, all objects should be assigned to all subgrids in which they might be located.
Thus, in each subgrid there are less objects to be checked reducing the calls of `in`.
This might also be used in order to speed up the charge drift.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.