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

Fill halo regions for diffusivity #385

Merged
merged 3 commits into from
Aug 29, 2019
Merged

Conversation

glwagner
Copy link
Member

@glwagner glwagner commented Aug 29, 2019

This fixes a bug in which halo regions were not filled for subgrid-scale LES diffusivities.

To do this robustly for various diffusivity structures with different nesting hierarchies, a recursive halo region filling functionality is implemented that dispatches on bcs::NamedTuple{(:x, :y:, :z)}, corresponding to a FieldBoundaryCondition. Thus, when fill_halo_regions!(fields, bcs, grid) is called with matching tuples for both fields and bcs, a simultaneous loop is done over the members of the two tuples. However, when fill_halo_regions!(fields, bcs, grid) is called and bcs is a FieldBoundaryCondition, a loop is performed over the members of fields only, and bcs is reused for every member of fields. Thus halo regions for fields embedded in nested structures (like diffusivities in AnisotropicMinimumDissipation) are all filled with a single call to fill_halo_regions!.

For now, the code uses temperature boundary conditions to determine the diffusivity boundary conditions. This will work until we implement the changes proposed in #371.

@codecov
Copy link

codecov bot commented Aug 29, 2019

Codecov Report

Merging #385 into master will increase coverage by 0.01%.
The diff coverage is 80%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #385      +/-   ##
==========================================
+ Coverage   70.57%   70.58%   +0.01%     
==========================================
  Files          23       23              
  Lines        1383     1387       +4     
==========================================
+ Hits          976      979       +3     
- Misses        407      408       +1
Impacted Files Coverage Δ
src/time_steppers.jl 76.12% <100%> (+0.15%) ⬆️
src/halo_regions.jl 86.27% <66.66%> (-1.23%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a2b7c0e...0c07933. Read the comment docs.

@ali-ramadhan
Copy link
Member

Looks good to me! Should make it into v0.10.0.

@ali-ramadhan ali-ramadhan merged commit 747e3eb into master Aug 29, 2019
@ali-ramadhan ali-ramadhan deleted the diffusivity-halo-regions branch August 29, 2019 18:51
Copy link
Member

@ali-ramadhan ali-ramadhan left a comment

Choose a reason for hiding this comment

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

Looks good to merge!

arcavaliere pushed a commit to arcavaliere/Oceananigans.jl that referenced this pull request Nov 6, 2019
…gions

Fill halo regions for diffusivity

Former-commit-id: 747e3eb
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.

2 participants