Mercurial > repos > public > sbplib
diff +multiblock/DiffOp.m @ 955:92c3c170e90b
Merged in feature/utux2D (pull request #11)
Feature/utux2D
Approved-by: Jonatan Werpers <jonatan.werpers@it.uu.se>
Approved-by: Martin Almquist <malmquist@stanford.edu>
Approved-by: Vidar Stiernström <vidar.stiernstrom@it.uu.se>
author | Jonatan Werpers <jonatan.werpers@it.uu.se> |
---|---|
date | Mon, 10 Dec 2018 08:29:41 +0000 |
parents | 21394c78c72e |
children | a4ad90b37998 a3accd2f1283 |
line wrap: on
line diff
--- a/+multiblock/DiffOp.m Fri Dec 07 16:10:58 2018 +0100 +++ b/+multiblock/DiffOp.m Mon Dec 10 08:29:41 2018 +0000 @@ -10,7 +10,7 @@ end methods - function obj = DiffOp(doHand, g, order, doParam) + function obj = DiffOp(doHand, g, order, doParam, intfTypes) % doHand -- may either be a function handle or a cell array of % function handles for each grid. The function handle(s) % should be on the form do = doHand(grid, order, ...) @@ -24,14 +24,17 @@ % corresponding function handle as extra parameters: % doHand(..., doParam{i}{:}) Otherwise doParam is sent as % extra parameters to all doHand: doHand(..., doParam{:}) + % + % intfTypes (optional) -- nBlocks x nBlocks cell array of types for + % every interface. default_arg('doParam', []) + default_arg('intfTypes', cell(g.nBlocks(), g.nBlocks()) ); [getHand, getParam] = parseInput(doHand, g, doParam); + obj.order = order; nBlocks = g.nBlocks(); - obj.order = order; - % Create the diffOps for each block obj.diffOps = cell(1, nBlocks); for i = 1:nBlocks @@ -70,12 +73,11 @@ continue end - - [ii, ij] = obj.diffOps{i}.interface(intf{1}, obj.diffOps{j}, intf{2}); + [ii, ij] = obj.diffOps{i}.interface(intf{1}, obj.diffOps{j}, intf{2}, intfTypes{i,j}); D{i,i} = D{i,i} + ii; D{i,j} = D{i,j} + ij; - [jj, ji] = obj.diffOps{j}.interface(intf{2}, obj.diffOps{i}, intf{1}); + [jj, ji] = obj.diffOps{j}.interface(intf{2}, obj.diffOps{i}, intf{1}, intfTypes{i,j}); D{j,j} = D{j,j} + jj; D{j,i} = D{j,i} + ji; end