Implement Strang splitting with space charge#920
Conversation
| 9.029112e-04, | ||
| 9.029112e-04, | ||
| 1.841402e-06, | ||
| 8.94427191e-04, |
There was a problem hiding this comment.
Here the targets were tuned to analytically-determined values, instead of being set to coincide with a low-resolution run.
| atol = 0.0 # ignored | ||
| rtol = 2.0e-3 # from random sampling of a smooth distribution | ||
| rtol = 3.5e-3 # from random sampling of a smooth distribution | ||
| print(f" rtol={rtol} (ignored: atol~={atol})") |
There was a problem hiding this comment.
The original tolerance was too tight.
|
The attached result illustrates the improvement in numerical convergence obtained when running the expanding beam test with envelope tracking ( |
Add linear return maps for additional elements (BLAST-ImpactX#923)
| << " slice_step=" << slice_step << "\n"; | ||
| } | ||
|
|
||
| std::visit([&ref, &cm](auto&& element) |
There was a problem hiding this comment.
Is the reference particle pushed twice now? o.0
Happens again in line 176 below
There was a problem hiding this comment.
Clarified in person:
- also includes envelope push
- note the difference in weights (half step for push, full step for SC & CSR, another half step for push)
There was a problem hiding this comment.
We have to make sure that thin elements, which only go through this loop body once, are still only kicked once though.
3d57bbb to
dcae328
Compare
9a1e4af to
fa61eba
Compare
|
A small comment: this PR attempted a map/2 + collective kick + map/2 strang split, because intuitively this keeps the more costly collective kick centered and avoids doing +1 kick per element on its slices. But, this only holds for Under that viewpoint, I personally would recommend to do optimizations for number of collective kicks done later on: it complicates the code for a subset of the elements, and alternatives to optimize, like merging the half-kick at the last nslice with the next half-kick of the next element could be explored too (both optimizations are a bit messy in book-keeping). Even with kick/2 + map + kick/2: in practice, because of the lower nslice needed now it might not even always pay off to carve out that one extra collective kick per element... (to be measured). Of course, for low numbers of nslice the cost is big, a regime we can now enter more with strang splitting... |
|
Hm; I don't understand your last comment. The idea, as it is implemented in IMPACT-Z, is to use map/2 + collective kick + map/2 for all thick elements. If there is an s-dependence in the field, then the calculation of map is applied by numerical integration via splitting into substeps, whose number is set by the |
This PR modifies the main tracking loop with collective effects to use a second-order Strang splitting.
nslicesis time-symmetric, which is needed for reversible back-trackingClose #846
A follow-up PR will address Issue #794