-
Notifications
You must be signed in to change notification settings - Fork 103
Some more examples fixes #2951
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
Some more examples fixes #2951
Conversation
|
See #2950 for comments |
|
clang-tidy review says "All clean, LGTM! 👍" |
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.
clang-tidy made some suggestions
examples/performance/tuning_regionblocksize/tuning_regionblocksize.cxx
Outdated
Show resolved
Hide resolved
924ca0a to
5fe6896
Compare
675b706 to
8573ed1
Compare
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.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 25 out of 67. Check the log or trigger a new build to see more.
| #include <bout/physicsmodel.hxx> | ||
| #include <bout/smoothing.hxx> | ||
|
|
||
| class ESEL : public PhysicsModel { |
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.
warning: constructor does not initialize these fields: D, mu, zeta, bm [cppcoreguidelines-pro-type-member-init]
examples/2Dturbulence_multigrid/esel.cxx:12:
- BoutReal D, mu; // Diffusion coefficients
+ BoutReal D{}, mu{}; // Diffusion coefficientsexamples/2Dturbulence_multigrid/esel.cxx:14:
- BoutReal zeta; // rho/R0
+ BoutReal zeta{}; // rho/R0| Field3D vort_error; | ||
|
|
||
| protected: | ||
| int init(bool UNUSED(restart)) { |
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.
warning: annotate this function with 'override' or (rarely) 'final' [cppcoreguidelines-explicit-virtual-functions]
| int init(bool UNUSED(restart)) { | |
| int init(bool UNUSED(restart)) override { |
| return 0; | ||
| } | ||
|
|
||
| Field3D C(const Field3D& f) { return zeta * DDZ(f); } |
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.
warning: method 'C' can be made const [readability-make-member-function-const]
| Field3D C(const Field3D& f) { return zeta * DDZ(f); } | |
| Field3D C(const Field3D& f) const { return zeta * DDZ(f); } |
|
|
||
| Field3D C(const Field3D& f) { return zeta * DDZ(f); } | ||
|
|
||
| int rhs(BoutReal UNUSED(time)) { |
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.
warning: annotate this function with 'override' or (rarely) 'final' [cppcoreguidelines-explicit-virtual-functions]
| int rhs(BoutReal UNUSED(time)) { | |
| int rhs(BoutReal UNUSED(time)) override { |
| } | ||
| }; | ||
|
|
||
| BOUTMAIN(ESEL); |
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.
warning: variable 'init_err' of type 'int' can be declared 'const' [misc-const-correctness]
BOUTMAIN(ESEL);
^Additional context
include/bout/physicsmodel.hxx:420: expanded from macro 'BOUTMAIN'
int init_err = BoutInitialise(argc, argv); \
^
examples/fci-wave-logn/fci-wave.cxx
Outdated
|
|
||
| for (reg->first(); !reg->isDone(); reg->next()) { | ||
| BoutReal n_b = exp(0.5 | ||
| * (logn_next(reg->x, reg->y + reg->dir, reg->z) |
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.
warning: no member named 'z' in 'BoundaryRegionPar' [clang-diagnostic-error]
* (logn_next(reg->x, reg->y + reg->dir, reg->z)
^
examples/fci-wave-logn/fci-wave.cxx
Outdated
| for (reg->first(); !reg->isDone(); reg->next()) { | ||
| BoutReal n_b = exp(0.5 | ||
| * (logn_next(reg->x, reg->y + reg->dir, reg->z) | ||
| + logn(reg->x, reg->y, reg->z))); |
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.
warning: no member named 'x' in 'BoundaryRegionPar' [clang-diagnostic-error]
+ logn(reg->x, reg->y, reg->z)));
^
examples/fci-wave-logn/fci-wave.cxx
Outdated
| for (reg->first(); !reg->isDone(); reg->next()) { | ||
| BoutReal n_b = exp(0.5 | ||
| * (logn_next(reg->x, reg->y + reg->dir, reg->z) | ||
| + logn(reg->x, reg->y, reg->z))); |
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.
warning: no member named 'y' in 'BoundaryRegionPar' [clang-diagnostic-error]
+ logn(reg->x, reg->y, reg->z)));
^
examples/fci-wave-logn/fci-wave.cxx
Outdated
| for (reg->first(); !reg->isDone(); reg->next()) { | ||
| BoutReal n_b = exp(0.5 | ||
| * (logn_next(reg->x, reg->y + reg->dir, reg->z) | ||
| + logn(reg->x, reg->y, reg->z))); |
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.
warning: no member named 'z' in 'BoundaryRegionPar' [clang-diagnostic-error]
+ logn(reg->x, reg->y, reg->z)));
^
examples/fci-wave-logn/fci-wave.cxx
Outdated
| + logn(reg->x, reg->y, reg->z))); | ||
| BoutReal v_b = | ||
| 0.5 | ||
| * (v_next(reg->x, reg->y + reg->dir, reg->z) + v(reg->x, reg->y, reg->z)); |
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.
warning: no member named 'x' in 'BoundaryRegionPar' [clang-diagnostic-error]
* (v_next(reg->x, reg->y + reg->dir, reg->z) + v(reg->x, reg->y, reg->z));
^…ch next-options-nocopy.
ba73cef to
21a3b6e
Compare
7ef021e to
6120ef2
Compare
|
clang-tidy review says "All clean, LGTM! 👍" |
Use reference to Options (not a copy). Required since changes in branch next-options-nocopy.
|
clang-tidy review says "All clean, LGTM! 👍" |
A couple of lines are just commented-out rather than deleted -- please delete them if appropriate (or let me know so that I will).