Mercurial > repos > public > sbplib
annotate +rv/+diffops/constructFluxDiffOps.m @ 1190:79618b58b0a0 feature/rv
Refactor constructDiffops and remove closures from some of the diffops used to compute the residual.
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Mon, 08 Jul 2019 15:12:19 +0200 |
parents | +rv/+diffops/constructFluxDiffOp.m@65a577db5ca0 |
children |
rev | line source |
---|---|
1190
79618b58b0a0
Refactor constructDiffops and remove closures from some of the diffops used to compute the residual.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
1163
diff
changeset
|
1 function [D_f, closures, penalties] = constructFluxDiffOps(scheme, g, order, schemeParams, opSet, BCs) |
1163
65a577db5ca0
Move all functions in constructDiffOps to subpackage and refactor
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff
changeset
|
2 diffOp = scheme(g, order, schemeParams{:}, opSet); |
65a577db5ca0
Move all functions in constructDiffOps to subpackage and refactor
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff
changeset
|
3 if ~isa(diffOp.D, 'function_handle') |
1190
79618b58b0a0
Refactor constructDiffops and remove closures from some of the diffops used to compute the residual.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
1163
diff
changeset
|
4 D_f = @(v) diffOp.D*v; |
1163
65a577db5ca0
Move all functions in constructDiffOps to subpackage and refactor
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff
changeset
|
5 else |
1190
79618b58b0a0
Refactor constructDiffops and remove closures from some of the diffops used to compute the residual.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
1163
diff
changeset
|
6 D_f = diffOp.D; |
79618b58b0a0
Refactor constructDiffops and remove closures from some of the diffops used to compute the residual.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
1163
diff
changeset
|
7 end |
79618b58b0a0
Refactor constructDiffops and remove closures from some of the diffops used to compute the residual.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
1163
diff
changeset
|
8 penalties = cell(size(BCs)); |
79618b58b0a0
Refactor constructDiffops and remove closures from some of the diffops used to compute the residual.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
1163
diff
changeset
|
9 closures = cell(size(BCs)); |
79618b58b0a0
Refactor constructDiffops and remove closures from some of the diffops used to compute the residual.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
1163
diff
changeset
|
10 for i = 1:size(BCs,1) |
79618b58b0a0
Refactor constructDiffops and remove closures from some of the diffops used to compute the residual.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
1163
diff
changeset
|
11 for j = 1:size(BCs,2) |
79618b58b0a0
Refactor constructDiffops and remove closures from some of the diffops used to compute the residual.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
1163
diff
changeset
|
12 [closures{i,j}, penalties{i,j}] = diffOp.boundary_condition(BCs{i,j}.boundary, BCs{i,j}.type); |
79618b58b0a0
Refactor constructDiffops and remove closures from some of the diffops used to compute the residual.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
1163
diff
changeset
|
13 end |
1163
65a577db5ca0
Move all functions in constructDiffOps to subpackage and refactor
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff
changeset
|
14 end |
65a577db5ca0
Move all functions in constructDiffOps to subpackage and refactor
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff
changeset
|
15 end |