Skip to content

Make Field2D more like Field3D#3296

Open
dschwoerer wants to merge 15 commits intonextfrom
f2d-more-f3d
Open

Make Field2D more like Field3D#3296
dschwoerer wants to merge 15 commits intonextfrom
f2d-more-f3d

Conversation

@dschwoerer
Copy link
Contributor

Make it easier to write FCI compatible code.

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


std::weak_ptr<Options> getTracking() { return tracking; };

bool allowCalcParallelSlices{true};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: member variable 'allowCalcParallelSlices' has public visibility [cppcoreguidelines-non-private-member-variables-in-classes]

  bool allowCalcParallelSlices{true};
       ^

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a public getter (and setter) instead of making the member variable public?

}

/// Dummy functions to increase portability
bool hasParallelSlices() const { return true; }
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 'hasParallelSlices' can be made static [readability-convert-member-functions-to-static]

Suggested change
bool hasParallelSlices() const { return true; }
static bool hasParallelSlices() { return true; }

bool hasParallelSlices() const { return true; }
void calcParallelSlices() const {}
void clearParallelSlices() {}
int numberParallelSlices() { return 0; }
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 'numberParallelSlices' can be made static [readability-convert-member-functions-to-static]

Suggested change
int numberParallelSlices() { return 0; }
static int numberParallelSlices() { return 0; }

void clearParallelSlices() {}
int numberParallelSlices() { return 0; }

FieldPerp& yup(std::vector<FieldPerp>::size_type UNUSED(index) = 0) { return *this; }
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 header providing "std::vector" is directly included [misc-include-cleaner]

include/bout/fieldperp.hxx:25:

- class FieldPerp;
+ #include <vector>
+ class FieldPerp;

Copy link
Member

@ZedThree ZedThree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks @dschwoerer! I guess my main question is could/should the new methods actually be virtual? Then we could just have a default empty implementation on Field.

Comment on lines +138 to +141
void calcParallelSlices() const {}
void splitParallelSlices() const {}
void clearParallelSlices() const {}
int numberParallelSlices() const { return 0; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be virtual? Or do they only need to be dummy methods?


std::weak_ptr<Options> getTracking() { return tracking; };

bool allowCalcParallelSlices{true};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a public getter (and setter) instead of making the member variable public?

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

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.

2 participants