Skip to content

(0.98.0) Modify interface for OpenBoundaryConditions with schemes and use Tuples in boundary_mass_fluxes #4687

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

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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/Models/NonhydrostaticModels/boundary_mass_fluxes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ function initialize_boundary_mass_fluxes(velocities::NamedTuple)
total_area_matching_scheme_boundaries += boundary_fluxes.top_area
end

boundary_fluxes = merge(boundary_fluxes, (; left_matching_scheme_boundaries,
right_matching_scheme_boundaries,
boundary_fluxes = merge(boundary_fluxes, (; left_matching_scheme_boundaries = Tuple(left_matching_scheme_boundaries),
right_matching_scheme_boundaries = Tuple(right_matching_scheme_boundaries),
total_area_matching_scheme_boundaries))
Copy link
Member

Choose a reason for hiding this comment

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

What are the benefits of a NamedTuple vs type here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure I understand the question. What do you mean by type?

Copy link
Member

Choose a reason for hiding this comment

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

a type other than NamedTuple --- a custom struct, which is an alternative to using a NamedTuple

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess just the simplicity of using a common type that everyone's familiar with. I don't see disadvantages of using NamedTuples.


if length(left_matching_scheme_boundaries) == 0 && length(right_matching_scheme_boundaries) == 0
Expand Down
1 change: 1 addition & 0 deletions src/Oceananigans.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export
# Boundary conditions
BoundaryCondition,
FluxBoundaryCondition, ValueBoundaryCondition, GradientBoundaryCondition, OpenBoundaryCondition,
PerturbationAdvectionOpenBoundaryCondition,
FieldBoundaryConditions,

# Fields and field manipulation
Expand Down
Loading