annotate src/SbpOperators/boundaryops/boundary_restriction.jl @ 1099:05a25a5063bb refactor/sbpoperators/inflation

Try to remove volume_operator and boundary_operator methods
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 21 Mar 2022 12:51:39 +0100
parents 1ba8a398af9c
children 157a78959e5d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
966
365bc4e2a6a2 Add comment and todo on introducing a type StencilSet for dispatch
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 947
diff changeset
1 # TODO: The type parameter closure_stencil::Stencil is required since there isnt any suitable type
365bc4e2a6a2 Add comment and todo on introducing a type StencilSet for dispatch
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 947
diff changeset
2 # for stencil_set. We should consider adding type ::StencilSet and dispatch on that instead.
365bc4e2a6a2 Add comment and todo on introducing a type StencilSet for dispatch
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 947
diff changeset
3 # The same goes for other operators
510
db64cfe4d9de Start sketching on 1D boundary restriction operators.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff changeset
4 """
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
5 boundary_restriction(grid, closure_stencil::Stencil, boundary)
580
0779713f95a2 Add constructor that infers T and N
Jonatan Werpers <jonatan@werpers.com>
parents: 579
diff changeset
6
995
1ba8a398af9c Rename types
Jonatan Werpers <jonatan@werpers.com>
parents: 966
diff changeset
7 Creates boundary restriction operators `e` as `LazyTensor`s on `boundary`
510
db64cfe4d9de Start sketching on 1D boundary restriction operators.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff changeset
8
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 `e` is the restriction of a grid function to `boundary` using a `Stencil` `closure_stencil`.
936
22c80fb36400 Fix docs and add some references
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 925
diff changeset
10 `e'` is the prolongation of a grid function on `boundary` to the whole grid using the same `closure_stencil`.
610
e40e7439d1b4 Add a general boundary operator and make BoundaryRestriction a specialization of it.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 588
diff changeset
11 On a one-dimensional `grid`, `e` is a `BoundaryOperator`. On a multi-dimensional `grid`, `e` is the inflation of
947
38d1752a9aff Reformat "See also:"
Jonatan Werpers <jonatan@werpers.com>
parents: 936
diff changeset
12 a `BoundaryOperator`.
38d1752a9aff Reformat "See also:"
Jonatan Werpers <jonatan@werpers.com>
parents: 936
diff changeset
13
38d1752a9aff Reformat "See also:"
Jonatan Werpers <jonatan@werpers.com>
parents: 936
diff changeset
14 See also: [`boundary_operator`](@ref).
610
e40e7439d1b4 Add a general boundary operator and make BoundaryRestriction a specialization of it.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 588
diff changeset
15 """
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 function boundary_restriction(grid, closure_stencil::Stencil, boundary)
827
beae513ef8b3 Fix bug in boundary_restriction when grids and stencil does not have matching type
Jonatan Werpers <jonatan@werpers.com>
parents: 777
diff changeset
17 converted_stencil = convert(Stencil{eltype(grid)}, closure_stencil)
1099
05a25a5063bb Try to remove volume_operator and boundary_operator methods
Jonatan Werpers <jonatan@werpers.com>
parents: 995
diff changeset
18
05a25a5063bb Try to remove volume_operator and boundary_operator methods
Jonatan Werpers <jonatan@werpers.com>
parents: 995
diff changeset
19 op = BoundaryOperator(restrict(grid, dim(boundary)), converted_stencil, region(boundary))
05a25a5063bb Try to remove volume_operator and boundary_operator methods
Jonatan Werpers <jonatan@werpers.com>
parents: 995
diff changeset
20 return LazyTensors.inflate(op, size(grid), dim(boundary))
827
beae513ef8b3 Fix bug in boundary_restriction when grids and stencil does not have matching type
Jonatan Werpers <jonatan@werpers.com>
parents: 777
diff changeset
21 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
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 """
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
24 boundary_restriction(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
25
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
26 Creates a `boundary_restriction` 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
27 `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
28 """
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
29 boundary_restriction(grid, stencil_set, boundary) = boundary_restriction(grid, parse_stencil(stencil_set["e"]["closure"]), boundary)