-
Notifications
You must be signed in to change notification settings - Fork 60
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
Refactor cell diameter computation to utilities #1265
Conversation
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.
One small thing to change
include/core/utilities.h
Outdated
double h; | ||
if constexpr (dim == 2) | ||
h = std::sqrt(4. * cell_measure / numbers::PI) / fe_degree; | ||
else if constexpr (dim == 3) | ||
h = std::pow(6. * cell_measure / numbers::PI, 1. / 3.) / fe_degree; | ||
return h; |
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.
double h; | |
if constexpr (dim == 2) | |
h = std::sqrt(4. * cell_measure / numbers::PI) / fe_degree; | |
else if constexpr (dim == 3) | |
h = std::pow(6. * cell_measure / numbers::PI, 1. / 3.) / fe_degree; | |
return h; | |
if constexpr (dim == 2) | |
return std::sqrt(4. * cell_measure / numbers::PI) / fe_degree; | |
else if constexpr (dim == 3) | |
return std::cbrt(6. * cell_measure / numbers::PI, 1. / 3.) / fe_degree; | |
else | |
Assert("....") |
The code does not support 1D anyway right now so might as well assert if the wrong number is called instead of returning something without an initial value.
2763a9f
to
cbe3b5c
Compare
cbe3b5c
to
3a29bd9
Compare
Description The cell diameter calculation was repeated in every scratch data. This PR refactors it in an inline function in the utilities. Testing No impact on current tests. Co-authored-by: Bruno Blais <[email protected]> Former-commit-id: a9099c0
Description The cell diameter calculation was repeated in every scratch data. This PR refactors it in an inline function in the utilities. Testing No impact on current tests. Co-authored-by: Bruno Blais <[email protected]> Former-commit-id: a9099c0
Description
The cell diameter calculation was repeated in every scratch data. This PR refactors it in an inline function in the utilities.
Testing
No impact on current tests.
Checklist (will be removed when merged)
See this page for more information about the pull request process.
Code related list:
Pull request related list: