changeset 1036:99d1f5651d0b feature/stencil_set_type

Remove todo, add ::StencilSet to some methods, and update docs
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Tue, 22 Mar 2022 13:53:07 +0100
parents 3031ce7a4999
children 815a549bb8fe
files TODO.md docs/src/operator_file_format.md src/SbpOperators/boundaryops/boundary_restriction.jl src/SbpOperators/volumeops/derivatives/first_derivative.jl src/SbpOperators/volumeops/derivatives/second_derivative.jl src/SbpOperators/volumeops/inner_products/inner_product.jl src/SbpOperators/volumeops/inner_products/inverse_inner_product.jl src/SbpOperators/volumeops/laplace/laplace.jl
diffstat 8 files changed, 6 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/TODO.md	Tue Mar 22 10:02:47 2022 +0100
+++ b/TODO.md	Tue Mar 22 13:53:07 2022 +0100
@@ -23,7 +23,6 @@
  - [ ] Add custom pretty printing to LazyTensors/SbpOperators to enhance readability of e.g error messages.
        See (https://docs.julialang.org/en/v1/manual/types/#man-custom-pretty-printing)
  - [ ] Move export statements to top of each module
- - [ ] Add a type StencilSet for easier dispatch
 
 ## Repo
  - [ ] Rename repo to Sbplib.jl
--- a/docs/src/operator_file_format.md	Tue Mar 22 10:02:47 2022 +0100
+++ b/docs/src/operator_file_format.md	Tue Mar 22 13:53:07 2022 +0100
@@ -16,7 +16,7 @@
 ```
 Advanced user might want to get access to the individual objects of an
 operator file. This can be accomplished using functions such as
-* [`StencilSet`](@ref)
+* [`read_stencil_set`](@ref)
 * [`parse_scalar`](@ref)
 * [`parse_stencil`](@ref)
 * [`parse_tuple`](@ref)
--- a/src/SbpOperators/boundaryops/boundary_restriction.jl	Tue Mar 22 10:02:47 2022 +0100
+++ b/src/SbpOperators/boundaryops/boundary_restriction.jl	Tue Mar 22 13:53:07 2022 +0100
@@ -1,6 +1,3 @@
-# TODO: The type parameter closure_stencil::Stencil is required since there isnt any suitable type
-# for stencil_set. We should consider adding type ::StencilSet and dispatch on that instead.
-# The same goes for other operators
 """
     boundary_restriction(grid, closure_stencil::Stencil, boundary)
 
--- a/src/SbpOperators/volumeops/derivatives/first_derivative.jl	Tue Mar 22 10:02:47 2022 +0100
+++ b/src/SbpOperators/volumeops/derivatives/first_derivative.jl	Tue Mar 22 13:53:07 2022 +0100
@@ -43,4 +43,4 @@
 
 Creates a `first_derivative` operator on a 1D `grid` given a `stencil_set`.
 """
-first_derivative(grid::EquidistantGrid{1}, stencil_set) = first_derivative(grid, stencil_set, 1)
+first_derivative(grid::EquidistantGrid{1}, stencil_set::StencilSet) = first_derivative(grid, stencil_set, 1)
--- a/src/SbpOperators/volumeops/derivatives/second_derivative.jl	Tue Mar 22 10:02:47 2022 +0100
+++ b/src/SbpOperators/volumeops/derivatives/second_derivative.jl	Tue Mar 22 13:53:07 2022 +0100
@@ -43,4 +43,4 @@
 
 Creates a `second_derivative` operator on a 1D `grid` given a `stencil_set`.
 """
-second_derivative(grid::EquidistantGrid{1}, stencil_set) = second_derivative(grid, stencil_set, 1)
\ No newline at end of file
+second_derivative(grid::EquidistantGrid{1}, stencil_set::StencilSet) = second_derivative(grid, stencil_set, 1)
\ No newline at end of file
--- a/src/SbpOperators/volumeops/inner_products/inner_product.jl	Tue Mar 22 10:02:47 2022 +0100
+++ b/src/SbpOperators/volumeops/inner_products/inner_product.jl	Tue Mar 22 13:53:07 2022 +0100
@@ -39,7 +39,7 @@
 
 Creates a `inner_product` operator on `grid` given a `stencil_set`.
 """
-function inner_product(grid, stencil_set)
+function inner_product(grid, stencil_set::StencilSet)
     inner_stencil = parse_scalar(stencil_set["H"]["inner"])
     closure_stencils = parse_tuple(stencil_set["H"]["closure"])
     return inner_product(grid, inner_stencil, closure_stencils)
--- a/src/SbpOperators/volumeops/inner_products/inverse_inner_product.jl	Tue Mar 22 10:02:47 2022 +0100
+++ b/src/SbpOperators/volumeops/inner_products/inverse_inner_product.jl	Tue Mar 22 13:53:07 2022 +0100
@@ -35,7 +35,7 @@
 
 Creates a `inverse_inner_product` operator on `grid` given a `stencil_set`.
 """
-function inverse_inner_product(grid, stencil_set)
+function inverse_inner_product(grid, stencil_set::StencilSet)
     inner_stencil = parse_scalar(stencil_set["H"]["inner"])
     closure_stencils = parse_tuple(stencil_set["H"]["closure"])
     return inverse_inner_product(grid, inner_stencil, closure_stencils)
--- a/src/SbpOperators/volumeops/laplace/laplace.jl	Tue Mar 22 10:02:47 2022 +0100
+++ b/src/SbpOperators/volumeops/laplace/laplace.jl	Tue Mar 22 13:53:07 2022 +0100
@@ -17,7 +17,7 @@
 
 See also [`laplace`](@ref).
 """
-function Laplace(grid::EquidistantGrid, stencil_set)
+function Laplace(grid::EquidistantGrid, stencil_set::StencilSet)
     inner_stencil = parse_stencil(stencil_set["D2"]["inner_stencil"])
     closure_stencils = parse_stencil.(stencil_set["D2"]["closure_stencils"])
     Δ = laplace(grid, inner_stencil,closure_stencils)