Mercurial > repos > public > sbplib
comparison +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 |
comparison
equal
deleted
inserted
replaced
| 1189:6cb03209f0a7 | 1190:79618b58b0a0 |
|---|---|
| 1 function [D_f, closures, penalties] = constructFluxDiffOps(scheme, g, order, schemeParams, opSet, BCs) | |
| 2 diffOp = scheme(g, order, schemeParams{:}, opSet); | |
| 3 if ~isa(diffOp.D, 'function_handle') | |
| 4 D_f = @(v) diffOp.D*v; | |
| 5 else | |
| 6 D_f = diffOp.D; | |
| 7 end | |
| 8 penalties = cell(size(BCs)); | |
| 9 closures = cell(size(BCs)); | |
| 10 for i = 1:size(BCs,1) | |
| 11 for j = 1:size(BCs,2) | |
| 12 [closures{i,j}, penalties{i,j}] = diffOp.boundary_condition(BCs{i,j}.boundary, BCs{i,j}.type); | |
| 13 end | |
| 14 end | |
| 15 end |
