Mercurial > repos > public > sbplib_julia
diff Notes.md @ 1635:b62770cec7d0 update/julia_1.10.3
Merge default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 25 Jun 2024 15:32:19 +0200 |
parents | 8141c184cc2f |
children | e551fe1fff14 |
line wrap: on
line diff
--- a/Notes.md Sat May 25 16:02:55 2024 -0700 +++ b/Notes.md Tue Jun 25 15:32:19 2024 +0200 @@ -1,5 +1,26 @@ # Notes +## How to dispatch for different operators +We have a problem in how dispatch for different operators work. + * We want to keep the types simple and flat (Awkward to forward `apply`) + * We want to dispatch SATs on the parameters of the continuous operator. (a * div for example) + * We want to allow keeping the same stencil_set across different calls. (maybe not so bad for the user to be responsible) + +Could remove the current opset idea and introduce a description of continuous operators + ```julia +abstract type DifferentialOperator end + +struct Laplace <: DifferentialOperator end +struct Advection <: DifferentialOperator + v +end + +difference_operator(::Laplace, grid, stencil_set) = ... # Returns a plain LazyTensor. Replaces the current `laplace()` function. +sat_tensors(::Laplace, grid, stencil_set, bc) = ... + +sat(::DifferentialOperator, grid, stencil_set, bc) = ... + ``` + ## Reading operators Jonatan's suggestion is to add methods to `Laplace`, `SecondDerivative` and