-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a5a5797
commit fc7407b
Showing
6 changed files
with
51 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
|
||
function ∇_collocated(f, grid::Grid, k::Int) | ||
return (f[k+1] - f[k-1]) / 2 * grid.dzi | ||
end | ||
|
||
function ∇_collocated(f::SVector, grid::Grid) | ||
@assert length(f) == 3 | ||
return (∇_staggered(f[2:3], grid) - ∇_staggered(f[1:2], grid)) * grid.dzi | ||
end | ||
|
||
function ∇_staggered(f, grid::Grid) | ||
@assert length(f) == 2 | ||
return (f[2] - f[1]) * grid.dzi | ||
end | ||
|
||
function ∇f2c(f, grid::Grid, k::Int) | ||
return (f[k] - f[k-1]) * grid.dzi | ||
end | ||
|
||
function ∇c2f(f, grid::Grid, k::Int) | ||
return (f[k+1] - f[k]) * grid.dzi | ||
end | ||
|
||
function ∇_upwind(f, grid::Grid, k::Int) | ||
return (f[k+1] - f[k]) * grid.dzi | ||
end | ||
|
||
function interpc2f(f, grid::Grid, k::Int) | ||
return 0.5*(f[k+1] + f[k]) | ||
end | ||
|
||
function cut(f, k) | ||
return SVector(f[k-1], f[k], f[k+1]) | ||
end |
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