Add some Mesh methods for handling Z parallelisation #3245
Open
Add some Mesh methods for handling Z parallelisation #3245
Mesh methods for handling Z parallelisation #3245Conversation
dschwoerer
previously approved these changes
Jan 13, 2026
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
| zlength(zlength_in), ydown_index(mesh.ystart) { | ||
|
|
||
| if (mesh.getNZPE() > 1) { | ||
| throw BoutException("ShiftedMetricInterp only works with 1 processor in Z"); |
Contributor
There was a problem hiding this comment.
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); |
Contributor
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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