Mercurial > repos > public > sbplib
changeset 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 | 77aa40da2008 |
children | 1cc5a0d26453 |
files | +multiblock/local2globalClosure.m +multiblock/local2globalPenalty.m |
diffstat | 2 files changed, 22 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
diff -r 77aa40da2008 -r c51b3f945c65 +multiblock/local2globalClosure.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/+multiblock/local2globalClosure.m Wed Jul 25 15:24:37 2018 -0700 @@ -0,0 +1,11 @@ + +% Takes the local closure for ice or water and turns it into a closure for the whole system +% local -- The local closure +% div -- block matrix division for the diffOp +% I -- Index of blockmatrix block +function closure = local2globalClosure(local, div, I) + closure_bm = blockmatrix.zero(div); + closure_bm{I,I} = local; + + closure = blockmatrix.toMatrix(closure_bm); +end
diff -r 77aa40da2008 -r c51b3f945c65 +multiblock/local2globalPenalty.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/+multiblock/local2globalPenalty.m Wed Jul 25 15:24:37 2018 -0700 @@ -0,0 +1,11 @@ +% Takes the local penalty for ice or water and turns it into a penalty for the whole system +% local -- The local penalty +% div -- block matrix division for the diffOp +% I -- Index of blockmatrix block +function penalty = local2globalPenalty(local, div, I) + penaltyDiv = {div{1}, size(local,2)}; + penalty_bm = blockmatrix.zero(penaltyDiv); + penalty_bm{I,1} = local; + + penalty = blockmatrix.toMatrix(penalty_bm); +end