Skip to content

New shifted metric 2: coordinate system labelling - #1465

Closed
johnomotani wants to merge 8 commits into
new_shifted_metric2from
new_shifted_metric2-coordinate-system-labelling-merge
Closed

New shifted metric 2: coordinate system labelling#1465
johnomotani wants to merge 8 commits into
new_shifted_metric2from
new_shifted_metric2-coordinate-system-labelling-merge

Conversation

@johnomotani

Copy link
Copy Markdown
Contributor

This PR allows field-aligned Field3Ds to be stored and passed to derivatives, etc. If the coordinate_system of a Field3D f is COORDINATE_SYSTEM::FieldAligned, then ShiftToFieldAligned::toFieldAligned(f) will just return f without doing anything. ShiftToFieldAligned::fromFieldAligned(f) will still transform FieldAligned->Orthogonal, so for example DDY(f) where f.coordinate_system == COORDINATE_SYSTEM::FieldAligned will only have to do one FFT/rFFT zShift operation, and will return a result in Orthogonal coordinates.

Note: the only changes apart from the merge of the coordinate-system-labelling branch are to src/mesh/paralllel/shifttofieldaligned.hxx, src/mesh/parallel/shifttofieldaligned.cxx and tests/integrated/test-yupdown-shifttofieldaligned/test_yupdown.cxx.

Define enum class COORDINATE_SYSTEM.

Add a COORDINATE_SYSTEM member to Field3D and write as an attribute in
output files. The default is set by the ParallelTransform but changed to
FieldAligned by 'toFieldAligned()' and changed back by
'fromFieldAligned()'.
Derivative functions are templates, so Field2D needs get/setCoordinates
methods (even if these are never called).
Initialize ParallelTransform in BoutMesh::load(), so it is almost always
available. Creating the FCITransform requires nx/ny/nz to be set in the
mesh, so cannot call setParallelTransform() in the Mesh constructor,
since it is called before these are initialized.
test-yupdown has a custom field-aligned derivative that did not set the
coordinate system, causing an exception when checking was turned on.
Also reduce CHECK level of COORDINATE_SYSTEM asserts in ShiftedMetric
from 2 to 1.
@johnomotani johnomotani added work in progress Not ready for merging feature labels Dec 17, 2018
@johnomotani

Copy link
Copy Markdown
Contributor Author

Closing: This is a merge of #1459 and #1460, which have been closed.

@ZedThree
ZedThree deleted the new_shifted_metric2-coordinate-system-labelling-merge branch November 30, 2021 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature work in progress Not ready for merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants