-
Notifications
You must be signed in to change notification settings - Fork 103
Options periodicY function #3175
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
base: next
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||
| /*! | ||||||
| /*!A | ||||||
| * \file fieldgenerators.hxx | ||||||
| * | ||||||
| * These classes are used by FieldFactory | ||||||
|
|
@@ -352,4 +352,34 @@ private: | |||||
| FieldGeneratorPtr test, gt0, lt0; | ||||||
| }; | ||||||
|
|
||||||
| /// Function that evaluates to 1 when Y is periodic (i.e. in the core), 0 otherwise | ||||||
| class FieldPeriodicY : public FieldGenerator { | ||||||
| public: | ||||||
| FieldPeriodicY(Mesh* mesh) : mesh(mesh) { | ||||||
| // Note: Assumes symmetricGlobalX | ||||||
| local_inner_boundary = | ||||||
| 0.5 * (mesh->GlobalX(mesh->xstart - 1) + mesh->GlobalX(mesh->xstart)); | ||||||
|
||||||
| 0.5 * (mesh->GlobalX(mesh->xstart - 1) + mesh->GlobalX(mesh->xstart)); | |
Outdated
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: 'local_outer_boundary' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer]
src/field/fieldgenerators.hxx:357:
- FieldPeriodicY(Mesh* mesh) : mesh(mesh) {
+ FieldPeriodicY(Mesh* mesh) : mesh(mesh), local_outer_boundary(0.5 * (mesh->GlobalX(mesh->xend + 1) + mesh->GlobalX(mesh->xend))) {| 0.5 * (mesh->GlobalX(mesh->xend + 1) + mesh->GlobalX(mesh->xend)); | |
bendudson marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
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 'local_index' of type 'int' can be declared 'const' [misc-const-correctness]
| int local_index = mesh->xstart | |
| int const local_index = mesh->xstart |
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 header providing "std::make_shared" is directly included [misc-include-cleaner]