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 non-trivial horizontal coordinates for single column grids #3627

Open
wants to merge 39 commits into
base: main
Choose a base branch
from

Conversation

glwagner
Copy link
Member

This PR makes it so we can build single column grids with non-trivial horizontal coordinates and nice syntax.

Resolves #3626

@simone-silvestri

@glwagner
Copy link
Member Author

The kind of thing we want to do:

from_grid = RectilinearGrid(size=(4, 4, 4), x=(1, 2), y=(2, 3), z=(0.5, 2.5), topology=(Periodic, Periodic, Bounded))
xyz = CenterField(from_grid)
set!(xyz, (x, y, z) -> x + y + z)
Oceananigans.BoundaryConditions.fill_halo_regions!(xyz)

column_grid = RectilinearGrid(size=2, x=1.3, y=2.7,  z=(0.5, 2.5), topology=(Flat, Flat, Bounded))
xyz_column = CenterField(column_grid)
Oceananigans.Fields.interpolate!(xyz_column, xyz)

which gives

julia> xyz_column[1, 1, 1:2]
2-element Vector{Float64}:
 5.0
 6.0

@glwagner
Copy link
Member Author

@simone-silvestri @navidcy please review

@glwagner
Copy link
Member Author

@navidcy any idea what the documenter error is?

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.

Allow single column grids with a specific location
2 participants