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

Loadmetric incompatible with nonorthogonal grids, error verbosity unhelpful #249

Open
mikekryjak opened this issue Aug 27, 2024 · 1 comment

Comments

@mikekryjak
Copy link
Collaborator

mikekryjak commented Aug 27, 2024

If loadmetric.cxx is used to recalculate the metric coefficients, it will calculate g22 from hthe:

coord->g22 = 1.0 / SQ(hthe);

But if you create a nonorthogonal grid with Hypnotoad, hthe will not be saved and will be zero when read into Hermes-3:
https://github.com/boutproject/hypnotoad/blob/d8e6be6086b9c27aa1e1011713e10d829e5dc6d2/hypnotoad/core/mesh.py#L3745-L3747

This means that if you load in a nonorthogonal grid, Hermes-3 will crash with the message:

====== Exception thrown ======
g22 is not finite at (0, 2)

I have to admit I don't know what we use loadmetric.cxx for. Is it when we don't have metric coefficients already, for example if someone defines the grid in the input file instead of reading it from Hypnotoad? If this is true, then I guess I shouldn't be using it.. and maybe it shouldn't be the default, or there should be some verbosity to prevent this issue happening in the future.

Repository owner deleted a comment Aug 27, 2024
@mikekryjak
Copy link
Collaborator Author

Just mentioned this to @bendudson. Loadmetric is on by default because historically Hypnotoad didn't write metric coefficients to file.

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

No branches or pull requests

1 participant