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

Grid cell precision fixes #177

Merged

Conversation

wtbarnes
Copy link
Member

@wtbarnes wtbarnes commented Nov 4, 2024

This PR fixes two related two problems that were leading non-deterministic segmentation faults related to the construction of the grid in the initial conditions calculation:

  • Make default value of maximum_cells 30000. Previously, this was by default calculated as $n_{max}=2^{L_R}n_{min}$. However, for sufficiently small refinement levels and larger choices of the max grid cell width, this can lead to an insufficient maximum number of grid cells in the initial conditions calculation, leading to a segmentation fault. Using this sufficiently high value as a default largely avoids this problem as the configuration code will always fall back to this value if it is specified.
  • Limit representation of loop length to use 4 significant figures. This avoids a problem where specifying the loop length at very high precision can lead to an inconsistency between the minimum number of grid cells and the maximum grid cell width as computed in HYDRAD. See also High precision in loop length input can lead to segmentation fault in initial conditions HYDRAD#82 for a more extended discussion of this problem.
  • Use ceil instead of floor to compute the minimum number of cells.

Copy link

codecov bot commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.41%. Comparing base (2a31ec1) to head (6cb92be).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #177   +/-   ##
=======================================
  Coverage   70.41%   70.41%           
=======================================
  Files          11       11           
  Lines         730      730           
=======================================
  Hits          514      514           
  Misses        216      216           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wtbarnes wtbarnes merged commit 557e41a into rice-solar-physics:main Nov 5, 2024
15 checks passed
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.

1 participant