Mercurial > repos > public > sbplib
annotate +multiblock/local2globalClosure.m @ 1198:2924b3a9b921 feature/d2_compatible
Add OpSet for fully compatible D2Variable, created from regular D2Variable by replacing d1 by first row of D1. Formal reduction by one order of accuracy at the boundary point.
author | Martin Almquist <malmquist@stanford.edu> |
---|---|
date | Fri, 16 Aug 2019 14:30:28 -0700 |
parents | ba10f24bf476 |
children |
rev | line source |
---|---|
899
ba10f24bf476
Fix the documentation of functions
Jonatan Werpers <jonatan@werpers.com>
parents:
864
diff
changeset
|
1 % Takes the block-local closures and turns it into a global closure |
864
c51b3f945c65
Add functions for taking local closures and penalties global
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
2 % local -- The local closure |
c51b3f945c65
Add functions for taking local closures and penalties global
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
3 % div -- block matrix division for the diffOp |
c51b3f945c65
Add functions for taking local closures and penalties global
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
4 % I -- Index of blockmatrix block |
c51b3f945c65
Add functions for taking local closures and penalties global
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
5 function closure = local2globalClosure(local, div, I) |
c51b3f945c65
Add functions for taking local closures and penalties global
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
6 closure_bm = blockmatrix.zero(div); |
c51b3f945c65
Add functions for taking local closures and penalties global
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
7 closure_bm{I,I} = local; |
c51b3f945c65
Add functions for taking local closures and penalties global
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
8 |
c51b3f945c65
Add functions for taking local closures and penalties global
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
9 closure = blockmatrix.toMatrix(closure_bm); |
c51b3f945c65
Add functions for taking local closures and penalties global
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
10 end |