Skip to content

Conversation

@tomc271
Copy link
Collaborator

@tomc271 tomc271 commented Jul 29, 2024

A couple of lines are just commented-out rather than deleted -- please delete them if appropriate (or let me know so that I will).

@tomc271 tomc271 requested a review from ZedThree July 29, 2024 15:35
@dschwoerer
Copy link
Contributor

See #2950 for comments

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

@github-actions github-actions bot left a 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

Copy link
Contributor

@github-actions github-actions bot left a 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 {
Copy link
Contributor

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 coefficients

examples/2Dturbulence_multigrid/esel.cxx:14:

-   BoutReal zeta;                                 // rho/R0
+   BoutReal zeta{};                                 // rho/R0

Field3D vort_error;

protected:
int init(bool UNUSED(restart)) {
Copy link
Contributor

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]

Suggested change
int init(bool UNUSED(restart)) {
int init(bool UNUSED(restart)) override {

return 0;
}

Field3D C(const Field3D& f) { return zeta * DDZ(f); }
Copy link
Contributor

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]

Suggested change
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)) {
Copy link
Contributor

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]

Suggested change
int rhs(BoutReal UNUSED(time)) {
int rhs(BoutReal UNUSED(time)) override {

}
};

BOUTMAIN(ESEL);
Copy link
Contributor

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);                     \
    ^


for (reg->first(); !reg->isDone(); reg->next()) {
BoutReal n_b = exp(0.5
* (logn_next(reg->x, reg->y + reg->dir, reg->z)
Copy link
Contributor

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)
                                                                          ^

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)));
Copy link
Contributor

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)));
                                            ^

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)));
Copy link
Contributor

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)));
                                                    ^

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)));
Copy link
Contributor

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)));
                                                            ^

+ 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));
Copy link
Contributor

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));
                             ^

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Use reference to Options (not a copy). Required since changes in branch next-options-nocopy.
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@ZedThree ZedThree changed the title Fix examples extra Some more examples fixes Sep 18, 2024
@ZedThree ZedThree merged commit 30ed12c into fix-examples Sep 18, 2024
11 of 27 checks passed
@ZedThree ZedThree deleted the fix_examples_extra branch September 18, 2024 15:48
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.

4 participants