Skip to content
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

Merged
merged 6 commits into from
Jul 8, 2021
Merged

Enhance initialization of Grid #171

merged 6 commits into from
Jul 8, 2021

Conversation

lmh91
Copy link
Collaborator

@lmh91 lmh91 commented Jul 7, 2021

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)

shadowing

To avoid this I implemented the function initialize_axis_ticks in 4e3c5fb
which 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:

gridspacing

@fhagemann
Copy link
Collaborator

Also, the function get_world_limits_from_objects would require an update as it relies on functions that do not longer work. Is this the PR to implement this?

@lmh91
Copy link
Collaborator Author

lmh91 commented Jul 7, 2021

Also, the function get_world_limits_from_objects would require an update as it relies on functions that do not longer work. Is this the PR to implement this?

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 )
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

@lmh91 lmh91 marked this pull request as ready for review July 8, 2021 07:56
@lmh91 lmh91 merged commit 9ecc8b0 into JuliaPhysics:v0.6 Jul 8, 2021
@fhagemann
Copy link
Collaborator

I was about to ask whether you could shortly explain what your changes are and how this enhances the initialization 😅

@lmh91 lmh91 deleted the grid_initialization branch July 14, 2021 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants