-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from jagoosw/jsw/change-to-discrete-bcs
(0.5.3) Changes everything to be discrete boundary conditions to make compatible with flattend dimensions
- Loading branch information
Showing
11 changed files
with
192 additions
and
235 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "Walrus" | ||
uuid = "bec5164f-1c7a-4c32-8768-be9354254d6a" | ||
authors = ["Jago Stong-Wright <[email protected]>"] | ||
version = "0.5.2" | ||
version = "0.5.3" | ||
|
||
[deps] | ||
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" | ||
|
@@ -14,8 +14,8 @@ Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" | |
Adapt = "3.7" | ||
CUDA = "5" | ||
KernelAbstractions = "0.9.22" | ||
OceanBioME = "0.10.3" | ||
Oceananigans = "0.91.3" | ||
OceanBioME = "0.10.5" | ||
Oceananigans = "0.91.7" | ||
Roots = "2" | ||
Test = "1.10" | ||
julia = "1.10" | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using Oceananigans.Fields: AbstractField, Center | ||
using Oceananigans.Grids: xnode, ynode | ||
|
||
# fallback | ||
@inline get_value(f, args...) = f | ||
|
||
struct ContinuousSurfaceFunction{F} | ||
func :: F | ||
end | ||
|
||
@inline function get_value(f::ContinuousSurfaceFunction, i, j, grid, clock, args...) | ||
t = clock.time | ||
|
||
x = xnode(i, j, grid.Nz, grid, Center(), Center(), Center()) | ||
y = ynode(i, j, grid.Nz, grid, Center(), Center(), Center()) | ||
|
||
return f.func(x, y, t, args...) | ||
end | ||
|
||
@inline get_value(f::ContinuousSurfaceFunction, ::Nothing, ::Nothing, t, args...) = f(0, 0, t) | ||
|
||
struct DiscreteSurfaceFuncton{F} | ||
func :: F | ||
end | ||
|
||
@inline get_value(f::DiscreteSurfaceFuncton, i, j, grid, clock, args...) = f.func(i, j, grid, clock, args...) | ||
|
||
# GPU compatible, mainly for fields | ||
@inline get_value(f::AbstractArray{<:Any, 2}, i, j, grid, clock, args...) = @inbounds f[i, j] | ||
@inline get_value(f::AbstractArray{<:Any, 3}, i, j, grid, clock, args...) = @inbounds f[i, j, grid.Nz] | ||
|
||
# fallback | ||
normalise_surface_function(f; kwargs...) = f | ||
|
||
normalise_surface_function(f::Function; discrete_form = false) = discrete_form ? DiscreteSurfaceFuncton(f) : ContinuousSurfaceFunction(f) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
75848da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
75848da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/112776
Tip: Release Notes
Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.
To add them here just re-invoke and the PR will be updated.
Tagging
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:
Also, note the warning: Version 0.5.3 skips over 0.5.1
This can be safely ignored. However, if you want to fix this you can do so. Call register() again after making the fix. This will update the Pull request.