-
Notifications
You must be signed in to change notification settings - Fork 104
Remove global mesh #3131
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?
Remove global mesh #3131
Conversation
- Removing bout::globals::mesh - Delete GRID_LOAD2 .. GRID_LOAD6 - Move GRID_LOAD macro into bout/mesh.hxx
Not compiling yet. Issues in IO and Solver.
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 116. Check the log or trigger a new build to see more.
| * By default the global Mesh pointer (mesh) is used. | ||
| */ | ||
| Field2D(Mesh* localmesh = nullptr, CELL_LOC location_in = CELL_CENTRE, | ||
| Field2D(Mesh* localmesh, CELL_LOC location_in = CELL_CENTRE, |
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 "CELL_CENTRE" is directly included [misc-include-cleaner]
Field2D(Mesh* localmesh, CELL_LOC location_in = CELL_CENTRE,
^| * By default the global Mesh pointer (mesh) is used. | ||
| */ | ||
| Field2D(Mesh* localmesh = nullptr, CELL_LOC location_in = CELL_CENTRE, | ||
| Field2D(Mesh* localmesh, CELL_LOC location_in = CELL_CENTRE, |
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 "CELL_LOC" is directly included [misc-include-cleaner]
include/bout/field2d.hxx:26:
- class Field2D;
+ #include "bout/bout_types.hxx"
+ class Field2D;| * boundary cells. | ||
| */ | ||
| Field2D(BoutReal val, Mesh* localmesh = nullptr); | ||
| Field2D(BoutReal val, Mesh* localmesh); |
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 "BoutReal" is directly included [misc-include-cleaner]
Field2D(BoutReal val, Mesh* localmesh);
^| static constexpr auto default_type = "hermitespline"; | ||
|
|
||
| ReturnType create(Options* options, int y_offset = 0, Mesh* mesh = nullptr, | ||
| ReturnType create(Mesh* mesh, Options* options, int y_offset = 0, |
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 "Options" is directly included [misc-include-cleaner]
include/bout/interpolation_z.hxx:26:
- #include "bout/paralleltransform.hxx"
+ #include "bout/options.hxx"
+ #include "bout/paralleltransform.hxx"| } | ||
| ReturnType create(const std::string& type, Options* options) const { | ||
| return Factory::create(type, nullptr, options, CELL_CENTRE); | ||
| ReturnType create(const std::string& type, Mesh* mesh, Options* options) const { |
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::string" is directly included [misc-include-cleaner]
include/bout/invert/laplacexz.hxx:38:
+ #include <string>| static constexpr auto option_name = "scheme"; | ||
| static constexpr auto default_type = RKSCHEME_RKF45; | ||
|
|
||
| ReturnType create(const std::string& type, Mesh*, Options* options) const { |
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: all parameters should be named in a function [readability-named-parameter]
| ReturnType create(const std::string& type, Mesh*, Options* options) const { | |
| ReturnType create(const std::string& type, Mesh* /*unused*/, Options* options) const { |
| static constexpr auto option_name = "scheme"; | ||
| static constexpr auto default_type = RKSCHEME_RKF45; | ||
|
|
||
| ReturnType create(const std::string& type, Mesh*, Options* options) const { |
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 "Mesh" is directly included [misc-include-cleaner]
include/bout/rkscheme.hxx:32:
- class RKScheme;
+ #include "bout/field2d.hxx"
+ class RKScheme;| SOLVERPVODE; | ||
| #endif | ||
|
|
||
| ReturnType create(const std::string& type, Mesh*, Options* options) const { |
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: all parameters should be named in a function [readability-named-parameter]
| ReturnType create(const std::string& type, Mesh*, Options* options) const { | |
| ReturnType create(const std::string& type, Mesh* /*unused*/, Options* options) const { |
| bout::globals::mpi = new MpiWrapper(); | ||
| bout::globals::mesh = Mesh::create(); | ||
| bout::globals::mesh->load(); | ||
| auto mesh = Mesh::create(); |
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: 'auto mesh' can be declared as 'auto *mesh' [readability-qualified-auto]
| auto mesh = Mesh::create(); | |
| auto *mesh = Mesh::create(); |
| // fieldmesh==nullptr indicates that some initialization that would | ||
| // be done in the constructor if fieldmesh was a valid Mesh object | ||
| // still needs to be done. | ||
| ASSERT0(fieldmesh); |
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 "ASSERT0" is directly included [misc-include-cleaner]
src/field/field_data.cxx:1:
- #include "bout/parallel_boundary_op.hxx"
+ #include "bout/assert.hxx"
+ #include "bout/parallel_boundary_op.hxx"
Very much a breaking change. Experimental, to see what changes are needed to remove the global mesh.
Work in progress.