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

Support location in Mesh::get() #2183

Merged
merged 2 commits into from
Dec 29, 2020
Merged

Support location in Mesh::get() #2183

merged 2 commits into from
Dec 29, 2020

Conversation

johnomotani
Copy link
Contributor

It is useful to be able to request a Field at a certain location from Mesh::get() - when the grid data comes from input file expressions, these can now be evaluated at the correct location. This PR adds a CELL_LOC location argument to the Field versions of Mesh::get(), and uses it in Coordinates. Makes it possible to use expressions for things like mesh:g_11_ylow, etc.

Arguably a bugfix - input file expressions support staggering, so I expected GridFromOptions to support it too, but we were actually evaluating at CELL_CENTRE and then calling var.setLocation(location).

I think I need this to fix test-twistshift-staggered in #2179.

It is useful to be able to request a Field at a certain location from
Mesh::get() - when the grid data comes from input file expressions,
these can now be evaluated at the correct location.

Note: includes a fix for GridFromOptionsTest::CoordinatesYlowInterp so
it now actually interpolates to CELL_YLOW, not CELL_XLOW.
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/mesh/coordinates.cxx Show resolved Hide resolved
src/mesh/coordinates.cxx Show resolved Hide resolved
src/mesh/coordinates.cxx Show resolved Hide resolved
src/mesh/coordinates.cxx Show resolved Hide resolved
tests/unit/mesh/data/test_gridfromoptions.cxx Outdated Show resolved Hide resolved
tests/unit/test_extras.hxx Show resolved Hide resolved
tests/unit/test_extras.hxx Show resolved Hide resolved
tests/unit/test_extras.hxx Show resolved Hide resolved
@johnomotani johnomotani merged commit 1b79ed9 into next Dec 29, 2020
@johnomotani johnomotani deleted the mesh-get-location branch December 29, 2020 11:58
@ZedThree ZedThree mentioned this pull request Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants