Skip to content
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

Add ShiftedMetricInterp: shifted metric using interpolation in Z #1946

Merged
merged 37 commits into from
Mar 9, 2020

Conversation

ZedThree
Copy link
Member

@ZedThree ZedThree commented Mar 5, 2020

Cherry-picked, rebased, squashed and formatted from #1803

Note that this includes #1944, view 8395d8a onwards to see just ShiftedMetricInterp related changes

johnomotani and others added 26 commits March 4, 2020 17:52
Cherry-picked and rebased

Previous commit message:
Create new class ZInterpolation, to be used by ShiftedMetricInterp

Previous HermiteSplineOnlyZ interpolation class is renamed to
ZHermiteSpline and is now an implementation of ZInterpolation.
Construct and return vector immediately
Also make both ctors explicit

This is needed to make the ZInterpolation ctors cleaner
This avoids assigning to skip_mask in ctor body (prefer init list)

Also make ctors explicit (cleaner for single argument ctors)
Like ShiftedMetric but uses Interpolation object (so Hermite spline by
default) for interpolation instead of FFT.

(Cherry-picked commit removed changes to mesh.cxx due to conflicts
resolved in later commit)
I updated the signatures of toFieldAligned and fromFieldAligned on
ShiftedMetricInterp so that regions are passed as string rather than
the REGION enum. This is so that the class matches the interface
introduced in the next branch.
In ShiftedMetricInterp, do not interpolate in y-boundary points, leave
those to be set by boundary conditions instead. Create parallel boundary
regions "parallel_backward" and "parallel_forward" so that parallel
boundary conditions can be applied.
This ensures the interpolation coefficients are available in
x-boundaries, which is required for the LaplacePetsc3dAmg solver, and in
the guard cells, which is required to use fromFieldAligned in create3D.
By interpolating only in Z, HermiteSplineOnlyZ allows
ShiftedMetricInterp to calculate coefficients for x-boundary cells.
Avoids floating-point exception errors due to calculations using NaNs.
@ZedThree ZedThree added this to the BOUT-5.0 milestone Mar 5, 2020
@ZedThree ZedThree mentioned this pull request Mar 5, 2020
johnomotani
johnomotani previously approved these changes Mar 8, 2020
Copy link
Contributor

@johnomotani johnomotani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I've also pulled in test-yupdown-weights which tests ShiftedMetricInterp.

Options for ParallelTransform and ZInterpolation have been moved to
different sections.
@ZedThree
Copy link
Member Author

ZedThree commented Mar 9, 2020

I opened the PR so GitHub won't let me approve this, but @johnomotani approved up to 7ee4dd2; I have reviewed d85b6d3 onwards and approve those

@ZedThree ZedThree merged commit 8e0c168 into next Mar 9, 2020
@ZedThree ZedThree deleted the shiftedmetricinterp branch March 9, 2020 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants