annotate src/SbpOperators/boundaryops/normal_derivative.jl @ 925:6b47a9ee1632 feature/laplace_opset

Add functionality for creating operators from a stencil set. Note: Tests are not updated yet!
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Mon, 21 Feb 2022 13:13:37 +0100
parents 86776d06b883
children d83f685f1031
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
620
bfc893d03cbf Add NormalDerivative as a BoundaryOperator and reintroduce tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff changeset
1 """
925
6b47a9ee1632 Add functionality for creating operators from a stencil set. Note: Tests are not updated yet!
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 871
diff changeset
2 normal_derivative(grid, closure_stencil::Stencil, boundary)
620
bfc893d03cbf Add NormalDerivative as a BoundaryOperator and reintroduce tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff changeset
3
bfc893d03cbf Add NormalDerivative as a BoundaryOperator and reintroduce tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff changeset
4 Creates the normal derivative boundary operator `d` as a `TensorMapping`
bfc893d03cbf Add NormalDerivative as a BoundaryOperator and reintroduce tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff changeset
5
925
6b47a9ee1632 Add functionality for creating operators from a stencil set. Note: Tests are not updated yet!
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 871
diff changeset
6 `d` computes the normal derivative of a grid function on `boundary` a `Stencil` `closure_stencil`.
620
bfc893d03cbf Add NormalDerivative as a BoundaryOperator and reintroduce tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff changeset
7 `d'` is the prolongation of the normal derivative of a grid function to the whole grid using the same `closure_stencil`.
bfc893d03cbf Add NormalDerivative as a BoundaryOperator and reintroduce tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff changeset
8 On a one-dimensional `grid`, `d` is a `BoundaryOperator`. On a multi-dimensional `grid`, `d` is the inflation of
925
6b47a9ee1632 Add functionality for creating operators from a stencil set. Note: Tests are not updated yet!
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 871
diff changeset
9 a `BoundaryOperator`. See also [`SbpOperators.boundary_operator`](@ref).
620
bfc893d03cbf Add NormalDerivative as a BoundaryOperator and reintroduce tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff changeset
10 """
925
6b47a9ee1632 Add functionality for creating operators from a stencil set. Note: Tests are not updated yet!
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 871
diff changeset
11 function normal_derivative(grid, closure_stencil::Stencil, boundary)
620
bfc893d03cbf Add NormalDerivative as a BoundaryOperator and reintroduce tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff changeset
12 direction = dim(boundary)
bfc893d03cbf Add NormalDerivative as a BoundaryOperator and reintroduce tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff changeset
13 h_inv = inverse_spacing(grid)[direction]
bfc893d03cbf Add NormalDerivative as a BoundaryOperator and reintroduce tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff changeset
14 return SbpOperators.boundary_operator(grid, scale(closure_stencil,h_inv), boundary)
bfc893d03cbf Add NormalDerivative as a BoundaryOperator and reintroduce tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff changeset
15 end
925
6b47a9ee1632 Add functionality for creating operators from a stencil set. Note: Tests are not updated yet!
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 871
diff changeset
16
6b47a9ee1632 Add functionality for creating operators from a stencil set. Note: Tests are not updated yet!
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 871
diff changeset
17 """
6b47a9ee1632 Add functionality for creating operators from a stencil set. Note: Tests are not updated yet!
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 871
diff changeset
18 normal_derivative(grid, stencil_set, boundary)
6b47a9ee1632 Add functionality for creating operators from a stencil set. Note: Tests are not updated yet!
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 871
diff changeset
19
6b47a9ee1632 Add functionality for creating operators from a stencil set. Note: Tests are not updated yet!
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 871
diff changeset
20 Creates a `normal_derivative` operator on `grid` given a parsed TOML
6b47a9ee1632 Add functionality for creating operators from a stencil set. Note: Tests are not updated yet!
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 871
diff changeset
21 `stencil_set`.
6b47a9ee1632 Add functionality for creating operators from a stencil set. Note: Tests are not updated yet!
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 871
diff changeset
22 """
6b47a9ee1632 Add functionality for creating operators from a stencil set. Note: Tests are not updated yet!
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 871
diff changeset
23 normal_derivative(grid, stencil_set, boundary) = normal_derivative(grid, parse_stencil(stencil_set["e"]["closure"]), boundary)