Twistshift into paralleltransforms #1759
Open
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.
Proposed resolution to #375.
ParallelTransform
classes seem like the logical place for twist-shift logic. This PR creates aParallelTransform::applyTwistShift
method, which is called during communications byBoutMesh::wait
throughField3D::applyTwistShift
.ParallelTransformIdentity
applies twist-shift to all fields (ifTwistShift==true
).ShiftedMetric
applies twist-shift only to field-aligned fields (checkingTwistShift==true
if a field-aligned field is found).FCITransform
does not twist-shift any field, checking that no field passed to it is field-aligned.The points where twist-shifts should be applied are given by
TwistShiftDown
andTwistShiftUp
regions created byBoutMesh
.Fixes a bug where twist-shift would not be applied when using
ParallelTransformIdentity
for fields withYDirectionType::Standard
- it should be applied then because all fields are field-aligned when usingParallelTransformIdentity
.Also moves the code for
shiftZ
functions fromfield3d.hxx
/field3d.cxx
into methodsParallelTransform
, which are disabled forFCITransform
(where presumably shifting in Z with FFTs doesn't make sense). Free-functionshiftZ
s are still present, but deprecated.This PR increases rather than decreases the number of lines... so does it seem more logical and simpler? If not I can make a fix for the bug mentioned above as a different PR.
Closes #375.