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
Use Utilities::fixed_power() in step-82. #16449
Conversation
While there, could you also adjust these guys: dealii/examples/step-82/step-82.cc Lines 240 to 242 in b528e0d
dealii/examples/step-82/step-82.cc Lines 990 to 992 in b528e0d
dealii/examples/step-82/step-82.cc Lines 1073 to 1082 in b528e0d
|
After this patch, there are now ~50 occurrences of What would you think of introducing some alias in
|
I addressed the remaining locations. I am not a fan of aliases, not the least because then in the doxygen documentation generated from this program, you cannot just click on the name of the function and get to the documentation of it. I agree that the current state is not as easy to read. I don't know what to suggest otherwise, though -- I'd be ok with just dropping this patch and leaving it up to individual authors to optimize their code, and using the optimizations only in the library proper. |
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.
In terms of best practices, we should definitely use Utilities::fixed_power
. I hoped there was a way to prevent line breaks to preserve readability. The manufactured solution is posted via MathJax in the introduction in a compact and readable form, so I don't feel strongly that we also need to provide it readable in the code.
You can always do // clang-format off
/* ... */
// clang-format on |
Let's not do that in tutorials, though. |
This addresses the last uses of
std::pow
with fixed integer exponent. Fixes #13321.