-
Notifications
You must be signed in to change notification settings - Fork 104
Add some Mesh methods for handling Z parallelisation
#3245
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?
Conversation
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
Tests are updated because `FakeMesh` has `GlobalZ(z) == z`. This is completely arbitrary, we could have a `GlobalZ` definition that matches `BoutMesh` (`z / nz`) then we wouldn't need to change the tests, but this way is a bit clearer what we're testing.
Also make related methods all `const`
These are just the `BoutReal` overloads of the equivalent `getGlobal?Index` methods
[skip ci] Co-authored-by: David Bold <dschwoerer@users.noreply.github.com>
ec2b06b to
c876751
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
| zlength(zlength_in), ydown_index(mesh.ystart) { | ||
|
|
||
| if (mesh.getNZPE() > 1) { | ||
| throw BoutException("ShiftedMetricInterp only works with 1 processor in 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 header providing "BoutException" is directly included [misc-include-cleaner]
src/mesh/parallel/shiftedmetricinterp.cxx:32:
- #include "bout/constants.hxx"
+ #include "bout/boutexception.hxx"
+ #include "bout/constants.hxx"| // Find the index positions where the magnetic field line intersects the x-z plane | ||
| // y_offset points up | ||
| Field3D zt_prime_up(&mesh), zt_prime_down(&mesh); | ||
| Field3D zt_prime_up(&mesh); |
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 "Field3D" is directly included [misc-include-cleaner]
src/mesh/parallel/shiftedmetricinterp.cxx:33:
- #include "bout/parallel_boundary_region.hxx"
+ #include "bout/field3d.hxx"
+ #include "bout/parallel_boundary_region.hxx"c876751 to
30c0efd
Compare
Supports #3242
Note these don't actually add Z parallelisation, just let us handle it correctly in various places
Mesh::GlobalZfor global Z index in[0, 1]Mesh::getNZPE/getZProcIndexfor Z processor infobout::fft::checkZSerialto guard routines using FFTThese also make a lot of code more consistent between the directions