Mercurial > repos > public > sbplib_julia
comparison src/BoundaryConditions/sat.jl @ 1396:35840a0681d1 feature/boundary_conditions
Start drafting new implemenentation of boundary conditions
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Wed, 26 Jul 2023 23:11:02 +0200 |
parents | ea2e8254820a |
children | abc5cc0aec94 |
comparison
equal
deleted
inserted
replaced
1395:bdcdbd4ea9cd | 1396:35840a0681d1 |
---|---|
17 | 17 |
18 `op` must implement the function `sat_tensors`. `f` is then constructed as | 18 `op` must implement the function `sat_tensors`. `f` is then constructed as |
19 `f(t,u) = closure(u) + `penalty(g(t))`. | 19 `f(t,u) = closure(u) + `penalty(g(t))`. |
20 """ | 20 """ |
21 function sat(op, grid, bc::BoundaryCondition, params...) | 21 function sat(op, grid, bc::BoundaryCondition, params...) |
22 closure, penalty = sat_tensors(op, grid, bc, params...) | 22 sat_op, L = sat_tensors(op, grid, bc, params...) |
23 g = discretize(data(bc),boundary_grid(grid, bc.id)) | 23 return SAT(u, g) = sat_op*(L*u - g) |
24 return (t,u) -> closure(u) + penalty(g(t)) | |
25 end | 24 end |
26 | |
27 | |
28 """ | |
29 sat(op, grid, bc::BoundaryCondition{ZeroBoundaryData}, params...) | |
30 | |
31 Simultaneous-Approximation-Term for a general `BoundaryCondition` `bc` to `LazyTensor` `op`. | |
32 The function returns a function `f`, where f(t,u)` returns a `LazyTensorApplication` | |
33 weakly imposing a homogenous boundary condition, when added to `op*u`. | |
34 | |
35 `op` must implement the function `sat_tensors`. `f` is then constructed as | |
36 `f(t,u) = closure(u)`. | |
37 """ | |
38 function sat(op, grid, bc::BoundaryCondition{ZeroBoundaryData}, params...) | |
39 closure = sat_tensors(op, grid, bc, params...) | |
40 return (t,u) -> closure(u) | |
41 end |