Mercurial > repos > public > sbplib
comparison +multiblock/local2globalPenalty.m @ 864:c51b3f945c65 bcSetupExperiment
Add functions for taking local closures and penalties global
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Wed, 25 Jul 2018 15:24:37 -0700 |
| parents | |
| children | ba10f24bf476 |
comparison
equal
deleted
inserted
replaced
| 863:77aa40da2008 | 864:c51b3f945c65 |
|---|---|
| 1 % Takes the local penalty for ice or water and turns it into a penalty for the whole system | |
| 2 % local -- The local penalty | |
| 3 % div -- block matrix division for the diffOp | |
| 4 % I -- Index of blockmatrix block | |
| 5 function penalty = local2globalPenalty(local, div, I) | |
| 6 penaltyDiv = {div{1}, size(local,2)}; | |
| 7 penalty_bm = blockmatrix.zero(penaltyDiv); | |
| 8 penalty_bm{I,1} = local; | |
| 9 | |
| 10 penalty = blockmatrix.toMatrix(penalty_bm); | |
| 11 end |
