New shifted metric 2: coordinate system labelling - #1465
Closed
johnomotani wants to merge 8 commits into
Closed
Conversation
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.
…oordinate-system-labelling-merge
Also reduce CHECK level of COORDINATE_SYSTEM asserts in ShiftedMetric from 2 to 1.
Contributor
Author
ZedThree
deleted the
new_shifted_metric2-coordinate-system-labelling-merge
branch
November 30, 2021 14:17
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.
This PR allows field-aligned
Field3Ds to be stored and passed to derivatives, etc. If thecoordinate_systemof aField3D fisCOORDINATE_SYSTEM::FieldAligned, thenShiftToFieldAligned::toFieldAligned(f)will just returnfwithout doing anything.ShiftToFieldAligned::fromFieldAligned(f)will still transform FieldAligned->Orthogonal, so for exampleDDY(f)wheref.coordinate_system == COORDINATE_SYSTEM::FieldAlignedwill 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-labellingbranch are tosrc/mesh/paralllel/shifttofieldaligned.hxx,src/mesh/parallel/shifttofieldaligned.cxxandtests/integrated/test-yupdown-shifttofieldaligned/test_yupdown.cxx.