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

Major refactor of FieldBoundaryConditions #1843

Merged
merged 61 commits into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
a49c6d5
Reworking FieldBoundaryConditions
glwagner Jul 7, 2021
5f5fd37
Refactors FieldBoundaryConditions
glwagner Jul 9, 2021
b5b9150
Merge branch 'master' into glw/refactor-field-bcs
glwagner Jul 9, 2021
a32d8fd
Fixes many tests
glwagner Jul 9, 2021
3d5cc25
More test fixes
glwagner Jul 9, 2021
7b80872
Update docs/src/model_setup/boundary_conditions.md
glwagner Jul 9, 2021
44ebd8d
Nuke AuxiliaryFieldBoundaryConditions; just use special FieldBoundary…
glwagner Jul 9, 2021
7b0fef7
Merge branch 'glw/refactor-field-bcs' of https://github.com/CliMA/Oce…
glwagner Jul 9, 2021
4b12688
No more x, y, z, right, left...
glwagner Jul 10, 2021
8d981a3
Banish DiffusivityBoundaryConditions
glwagner Jul 10, 2021
4564721
Banish CoordinateBoundaryConditions
glwagner Jul 10, 2021
1b2f8d5
Fixes boundary condition test with ContinuousBoundaryFunction
glwagner Jul 10, 2021
499cf00
Adds better default bcs for VelocityFields and TracerFields
glwagner Jul 10, 2021
d14582f
New syntax!
glwagner Jul 12, 2021
5f7998d
Iterate better over boundary conditions
glwagner Jul 12, 2021
5ee3a10
Fixes bug in field_boundary_conditions
glwagner Jul 12, 2021
be76169
Fix TracerFields implementation
glwagner Jul 12, 2021
cfca406
Were not ready for zero flux boundary conditions...
glwagner Jul 12, 2021
7712d05
Fixes bottom-top mix up
glwagner Jul 12, 2021
dfd1ddb
Fixes broken ref to Nx in Poisson solver test
glwagner Jul 12, 2021
d3f33da
Default for ZFaceField was changed so now broadcasting tests need to …
glwagner Jul 12, 2021
1613c21
Fix regularize_boundary_condition for CubedSpheres
glwagner Jul 12, 2021
0a8e575
West vs east
glwagner Jul 13, 2021
4e401d5
Fix issues with TKEBasedVerticalDiffusivity
glwagner Jul 13, 2021
a0217af
Fiddling with AMD boundary conditions
glwagner Jul 13, 2021
56598c7
Adds regularize_boundary_conditions for regular bcs on ConformalCubed…
glwagner Jul 13, 2021
27dcd6c
Fixes bug in determining tracer diffusivity bcs with AMD
glwagner Jul 13, 2021
726d2f9
Adds location to FieldBoundaryConditions for broadcasting test
glwagner Jul 13, 2021
6c36f2f
Properly inject CubedSphere exchange bcs during regularization
glwagner Jul 13, 2021
58ceeb5
Adds a method for nested NamedTuple boundary conditions
glwagner Jul 13, 2021
8b7520e
Fixes VelocityFields constructor to use valid regularized boundary co…
glwagner Jul 13, 2021
00b889b
Updates to new syntax for stratified couette flow
glwagner Jul 13, 2021
ac95def
Elide tendency fields when velocities are prescribed
glwagner Jul 13, 2021
5182c6d
Import regularize_boundary_conditions into field_tuples
glwagner Jul 13, 2021
4146c44
Try 2 with poisson solver test refactor
glwagner Jul 13, 2021
082a2f5
Simplifies default calculation
glwagner Jul 13, 2021
8927895
Fixes ommission of tracer tendencies when using prescribed velocities
glwagner Jul 13, 2021
f5ae272
Import regularize_field_boundary_conditions into poisson solver tests
glwagner Jul 13, 2021
503c7b9
Eta is prognostic, not w
glwagner Jul 13, 2021
a1840de
Adds missing comma in show methods
glwagner Jul 13, 2021
1289195
Fix doctests
glwagner Jul 13, 2021
b27e820
Fix doctests
glwagner Jul 13, 2021
0c54913
Fix doctests
glwagner Jul 13, 2021
e20c5dd
Fix docstring in Field constructor
glwagner Jul 13, 2021
594ba12
Use FluxBoundaryCondition
glwagner Jul 13, 2021
1ee0142
Where bc?
glwagner Jul 13, 2021
98c46f2
Ancient issues with library.md
glwagner Jul 13, 2021
5695eea
Comments out library to see what happens
glwagner Jul 13, 2021
386a903
Deletes misleading and impertinent comments
glwagner Jul 13, 2021
6e800cc
Bump to 0.59.0
glwagner Jul 13, 2021
1c83b2f
Merge branch 'master' into glw/refactor-field-bcs
glwagner Jul 13, 2021
d65b498
Comments out appendix in docs
glwagner Jul 13, 2021
deced42
Cleans up BoundaryConditions code + docstrings
glwagner Jul 13, 2021
d3d4d6a
Docs despration
glwagner Jul 13, 2021
797de77
update BoundaryConditions pages
navidcy Jul 13, 2021
d31fc41
resolve conflicts
navidcy Jul 13, 2021
e39c509
can't document call syntax; see https://github.com/JuliaDocs/Document…
navidcy Jul 14, 2021
e640f37
back to including everything
navidcy Jul 14, 2021
12c654a
improves some docstrings
navidcy Jul 14, 2021
809cb98
Updates validation experiments
glwagner Jul 14, 2021
95f8c96
Fixes typos in TKEBasedVerticalMixing validation
glwagner Jul 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/BoundaryConditions/apply_flux_bcs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ end
@inline flip(::Face) = Center()

"""
apply_x_west_bc!(Gc, west_flux::BC{<:Flux}, j, k, grid, args...)
apply_x_west_bc!(Gc, loc, west_flux::BC{<:Flux}, j, k, grid, args...)

Add the flux divergence associated with a west flux boundary condition on `c`.
Note that because
Expand Down Expand Up @@ -125,7 +125,7 @@ end
end

"""
apply_x_east_bc!(Gc, top_flux::BC{<:Flux}, j, k, grid, args...)
apply_x_east_bc!(Gc, loc, east_flux::BC{<:Flux}, j, k, grid, args...)

Add the part of flux divergence associated with a east boundary condition on `c`.
Note that because
Expand Down
7 changes: 5 additions & 2 deletions src/BoundaryConditions/boundary_condition.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct BoundaryCondition{C<:AbstractBoundaryConditionClassification, T}
end

"""
BoundaryCondition(Classification, condition)
BoundaryCondition(Classification::DataType, condition)

Construct a boundary condition of type `BC` with a number or array as a `condition`.

Expand All @@ -20,7 +20,10 @@ Boundary condition types include `Periodic`, `Flux`, `Value`, `Gradient`, and `O
BoundaryCondition(Classification::DataType, condition) = BoundaryCondition(Classification(), condition)

"""
BoundaryCondition(Classification, condition::Function; parameters=nothing, discrete_form=false)
BoundaryCondition(Classification::DataType, condition::Function;
parameters = nothing,
discrete_form = false,
field_dependencies=())

Construct a boundary condition of type `Classification` with a function boundary `condition`.

Expand Down
2 changes: 1 addition & 1 deletion src/BoundaryConditions/discrete_boundary_function.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
DiscreteBoundaryFunction(func, parameters)
struct DiscreteBoundaryFunction{P, F} <: Function

A wrapper for boundary condition functions with optional parameters.
When `parameters=nothing`, the boundary condition `func` is called with the signature
Expand Down
2 changes: 1 addition & 1 deletion src/BoundaryConditions/field_boundary_conditions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Returns boundary conditions for auxiliary fields (fields
whose values are derived from a model's prognostic fields) on `grid`
and at `location`.

Keyword arguments specify boundary conditions on the 7 possible boundaries:
Keyword arguments specify boundary conditions on the 6 possible boundaries:
navidcy marked this conversation as resolved.
Show resolved Hide resolved

* `west`, left end point in the `x`-direction where `i=1`
* `east`, right end point in the `x`-direction where `i=grid.Nx`
Expand Down
2 changes: 1 addition & 1 deletion src/BoundaryConditions/fill_halo_regions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using OffsetArrays: OffsetArray
fill_halo_regions!(::Nothing, args...) = []

"""
fill_halo_regions!(fields, arch)
fill_halo_regions!(fields::Union{Tuple, NamedTuple}, arch, args...)

Fill halo regions for each field in the tuple `fields` according to their boundary
conditions, possibly recursing into `fields` if it is a nested tuple-of-tuples.
Expand Down