Mercurial > repos > public > sbplib_julia
comparison Notes.md @ 1621:8141c184cc2f feature/boundary_conditions
Merge with default
| author | Vidar Stiernström <vidar.stiernstrom@gmail.com> |
|---|---|
| date | Mon, 10 Jun 2024 22:38:31 -0700 |
| parents | 8ebcac8edd9d bb4c119e91fa |
| children | e551fe1fff14 |
comparison
equal
deleted
inserted
replaced
| 1620:48596b2f7923 | 1621:8141c184cc2f |
|---|---|
| 1 # Notes | 1 # Notes |
| 2 | |
| 3 ## How to dispatch for different operators | |
| 4 We have a problem in how dispatch for different operators work. | |
| 5 * We want to keep the types simple and flat (Awkward to forward `apply`) | |
| 6 * We want to dispatch SATs on the parameters of the continuous operator. (a * div for example) | |
| 7 * We want to allow keeping the same stencil_set across different calls. (maybe not so bad for the user to be responsible) | |
| 8 | |
| 9 Could remove the current opset idea and introduce a description of continuous operators | |
| 10 ```julia | |
| 11 abstract type DifferentialOperator end | |
| 12 | |
| 13 struct Laplace <: DifferentialOperator end | |
| 14 struct Advection <: DifferentialOperator | |
| 15 v | |
| 16 end | |
| 17 | |
| 18 difference_operator(::Laplace, grid, stencil_set) = ... # Returns a plain LazyTensor. Replaces the current `laplace()` function. | |
| 19 sat_tensors(::Laplace, grid, stencil_set, bc) = ... | |
| 20 | |
| 21 sat(::DifferentialOperator, grid, stencil_set, bc) = ... | |
| 22 ``` | |
| 2 | 23 |
| 3 ## Reading operators | 24 ## Reading operators |
| 4 | 25 |
| 5 Jonatan's suggestion is to add methods to `Laplace`, `SecondDerivative` and | 26 Jonatan's suggestion is to add methods to `Laplace`, `SecondDerivative` and |
| 6 similar functions that take in a filename from which to read stencils. These | 27 similar functions that take in a filename from which to read stencils. These |
