-
Notifications
You must be signed in to change notification settings - Fork 192
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
Numerically invert Jacobian in combined call #6223
Numerically invert Jacobian in combined call #6223
Conversation
determinant_and_inverse(jac).second, std::move(jac), | ||
std::move(frame_velocity)}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add in the CoordinateMap.hpp
docs for this function that we don't call the individual inverse_jacobian
functions and multiply them together, but rather just compute the jacobian and numerically invert it because most of our production time-dependent maps do this already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to keep the inverse_jacobian
implementations on the individual maps at all? Doesn't need to be done in this PR, but removing them would be nicer than documenting that they are unused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well they are still used in the individual inverse_jacobian
function of CoordinateMap{Base}
, correct? Whether or not that function is actually used in practice, I don't know. If not, then yes we can probably get rid of it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we could make it do the numerical inversion like this function now does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we could! Let's discuss on the Monday call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing for a separate PR: this function could also return the Jacobian determinant. We need this a bit in the hydro cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the Monday call: We can just numerically invert the jacobian in the individual function as well which means we don't need the individual inverse_jacobian
functions. See #6233
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with the code. Thanks for doing this!
determinant_and_inverse(jac).second, std::move(jac), | ||
std::move(frame_velocity)}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing for a separate PR: this function could also return the Jacobian determinant. We need this a bit in the hydro cases.
bc43652
to
e442112
Compare
I added a comment about the inverse Jacobian being inverted numerically in |
Sounds good. Probably would require updating some tags. I think it's low priority :) Thank you! |
In some maps like
Shape
andRotScaleTrans
, the inverse jacobian is compute by computing the jacobian and inverting it numerically. This means that for BBH simulations, we currently compute these jacobians twice, invert them and multiply them together. In this PR, this is changed so that only the jacobian is computed for all maps and the final jacobian is inverted.For BBH simulations, I found this speeds up the simulation between 10% and 18%, depending on the number of l-modes.