-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance initialization of Grid
#171
Conversation
Also, the function |
Right, this has to be update. But I did not intended it for this PR. |
@@ -47,7 +47,7 @@ end | |||
signalsum += abs(evt.waveforms[i].value[end]) | |||
end | |||
@info signalsum | |||
@test isapprox( signalsum, T(2), atol = 4e-3 ) | |||
@test isapprox( signalsum, T(2), atol = 0.02 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any idea why the signalsum
is getting worse? Is it a coarser grid now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe so. By default the initial grid is really coarse now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then, I would prefer increasing the number of refinements rather than lowering the tolerance.
It might be that we miss some bugs by allowing greater tolerances.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but the refinement will also be updated soon.
Including keywords and default settings.
And we might want to overhaul the tests (especially simulation of test detectors) anyhow.
So I would prefer not to do this here.
I was about to ask whether you could shortly explain what your changes are and how this enhances the initialization 😅 |
This PR addresses the initialization of the Grid.
In order to have a fast convergence towards equilibrium it is good when the widths of the voxels
are not too different compared to the widths of the neighbor voxels.
In extreme cases this can lead to the effect of shadowing (blocking the spreading of the electric potential in the SOR).
See comment: #163 (comment)
To avoid this I implemented the function
initialize_axis_ticks
in 4e3c5fbwhich add axis ticks next to existing axis ticks (generated by the geometry of objects) where the ratio of the distances to the neighboring ticks (left and right) exceeds a certain limit. The limit ratio can be tuned via a keyword. Default is
2
.Here an example:
The black lines are the existing ticks and the red lines are all ticks after
initialize_axis_ticks
: