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

model_parser interpolation is using the wrong index #2663

Closed
zingale opened this issue Nov 30, 2023 · 1 comment
Closed

model_parser interpolation is using the wrong index #2663

zingale opened this issue Nov 30, 2023 · 1 comment

Comments

@zingale
Copy link
Member

zingale commented Nov 30, 2023

In model_parser.H, the locate() function returns loc = ihi, which would be the index of the zone to the right of the input r. This means that our linear interpolation should use loc-1 and loc, but we are using loc and loc+1. Since we are linear and are not clamping we never noticed the issue.

For the cubic interpolation in #2659, this one-off indexing causes an issue.

@zingale
Copy link
Member Author

zingale commented Dec 22, 2023

it is actually okay, but just confusing. This is cleaned up in #2664.

@zingale zingale closed this as completed Dec 22, 2023
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