Skip to content

Conversation

@claudiaalvgar
Copy link
Collaborator

This PR introduces a new function compute_min_tick_distance as a possible solution to replace the previous hard-coded min_tick_distance in simulation. The new function computes a minimum grid spacing for both Cartesian and Cylindrical grids, taking into account the grid dimensions.
This function provides a finer default grid for detectors of O(100µm) size. The example introduced (BEGe_03.yaml) shows the default grid spacing provided by the simulation with the previous hard-coded method using a small detector:
BEGe_um_size_oldcode_1e-5
and using the new function:
BEGe_um_size_newchange

@fhagemann fhagemann added enhancement Improvement of existing features convenience Improve user-friendliness breaking Changes syntax to older versions labels Dec 8, 2025
@fhagemann fhagemann added this to the v0.11.0 milestone Dec 8, 2025
@claudiaalvgar
Copy link
Collaborator Author

I think I implemented the changes. Now the tests are using BEGe_01.yaml with cf["units"]["length"] = "µm" and no impurities, this is the comparison using the old code:
BEGe_01_um_oldcode
and the new code:
BEGe_01_um_newcode

@fhagemann
Copy link
Collaborator

That looks very nice! I can have a closer look later today.

@claudiaalvgar
Copy link
Collaborator Author

Thank you ! Is there anything else to add/change in this PR ?

@fhagemann
Copy link
Collaborator

I think this should be good.
We might wanna check (but can be a separate PR) if we need to adjust max_tick_distance as well, but this should be finished

@claudiaalvgar
Copy link
Collaborator Author

Nice, is this what's discussed in issue #530 or something separate ?

@fhagemann
Copy link
Collaborator

It’s not an issue yet, and I don‘t think we need to change anything, but just like a minimum tick distance, there is also a maximum tick distance. I just want to cross-check that, after changing the minimum tick distance, we are not messing anything up by not adjusting the maximum tick distance (default).

@fhagemann fhagemann changed the title Possible solution for min_tick_distance and tests Adjust default min_tick_distance based on the grid dimensions Dec 11, 2025
@fhagemann fhagemann merged commit eb4f609 into JuliaPhysics:main Dec 11, 2025
10 checks passed
fhagemann added a commit that referenced this pull request Dec 11, 2025
* Add function compute_min_tick_distance

* Add test

* Add yaml file for test

* Changes in compute_min_tick_distance and tests

* Simulation changes and test

* Shorten test code

* Minor code style changes

---------

Co-authored-by: Felix Hagemann <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Changes syntax to older versions convenience Improve user-friendliness enhancement Improvement of existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Release v0.11.0 Update default value of min_tick_distance in potential calculation

2 participants