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

add a method to compute the T derivative of an NSE table quantity #1407

Merged
merged 6 commits into from
Dec 18, 2023

Conversation

zingale
Copy link
Member

@zingale zingale commented Dec 12, 2023

this works by differentiating the cubic interpolant

@zingale zingale changed the base branch from main to development December 12, 2023 00:51
// we take x_i to be x[1]
// then return dfdx = 3 a (x - x_i)**2 + 2 b (x - x_i) + c

Real a = (3 * fs[1] - 3 * fs[2] + fs[3] - fs[0]) / (6 * std::pow(dx, 3));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the integer 3 gets cast to a float in std::pow, so this will take a much slower path compared to just writing (dx * dx * dx).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these have been switched to amrex::Math::powi(x)

@zingale zingale merged commit 43b5138 into AMReX-Astro:development Dec 18, 2023
24 checks passed
@zingale zingale deleted the nse_derivs branch December 18, 2023 19:38
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.

3 participants