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

Hermes-3 unnecessarily recalculating metric coefficients by default and erroring with nonorthogonal grids #286

Open
mikekryjak opened this issue Jan 31, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@mikekryjak
Copy link
Collaborator

There is a setting called loadmetric which recalculates the metric coefficients based on R,Z etc:

hermes-3/hermes-3.cxx

Lines 204 to 207 in 88aa8c6

if (options["loadmetric"]
.doc("Load Rxy, Bpxy etc. to create orthogonal metric?")
.withDefault(true)) {
LoadMetric(rho_s0, Bnorm);

This was done for back when Hypnotoad wasn't saving metric coefficients to file. It is enabled by default. When reading a nonorthogonal grid, it creates an error of the kind g22 is non finite at (0,2) - this is because the reconstruction calculation assumes orthogonality.

The option should be disabled by default as Hypnotoad saves the metrics now.
Enabling it should print a warning that the metrics will not be compatible with nonorthogonal grids.

Thanks @mrhardman and @bendudson for diagnosing this.

@mikekryjak mikekryjak added the bug Something isn't working label Jan 31, 2025
@bendudson
Copy link
Owner

Time to resurrect PR #87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants