comparison +multiblock/DiffOp.m @ 928:1c61d8fa9903 feature/utux2D

Replace opts by type everywhere
author Martin Almquist <malmquist@stanford.edu>
date Mon, 03 Dec 2018 15:01:24 -0800
parents d232483eb72f
children 21394c78c72e
comparison
equal deleted inserted replaced
927:4291731570bb 928:1c61d8fa9903
8 8
9 blockmatrixDiv 9 blockmatrixDiv
10 end 10 end
11 11
12 methods 12 methods
13 function obj = DiffOp(doHand, grid, order, doParam, intfOpts) 13 function obj = DiffOp(doHand, grid, order, doParam, intfTypes)
14 % doHand -- may either be a function handle or a cell array of 14 % doHand -- may either be a function handle or a cell array of
15 % function handles for each grid. The function handle(s) 15 % function handles for each grid. The function handle(s)
16 % should be on the form do = doHand(grid, order, ...) 16 % should be on the form do = doHand(grid, order, ...)
17 % Additional parameters for each doHand may be provided in 17 % Additional parameters for each doHand may be provided in
18 % the doParam input. 18 % the doParam input.
23 % to the number of blocks then each element is sent to the 23 % to the number of blocks then each element is sent to the
24 % corresponding function handle as extra parameters: 24 % corresponding function handle as extra parameters:
25 % doHand(..., doParam{i}{:}) Otherwise doParam is sent as 25 % doHand(..., doParam{i}{:}) Otherwise doParam is sent as
26 % extra parameters to all doHand: doHand(..., doParam{:}) 26 % extra parameters to all doHand: doHand(..., doParam{:})
27 % 27 %
28 % intfOpts (optional) -- nBlocks x nBlocks cell array of options for 28 % intfTypes (optional) -- nBlocks x nBlocks cell array of types for
29 % every interface. 29 % every interface.
30 default_arg('doParam', []) 30 default_arg('doParam', [])
31 default_arg('intfOpts', cell(grid.nBlocks(), grid.nBlocks()) ); 31 default_arg('intfTypes', cell(grid.nBlocks(), grid.nBlocks()) );
32 32
33 [getHand, getParam] = parseInput(doHand, grid, doParam); 33 [getHand, getParam] = parseInput(doHand, grid, doParam);
34 34
35 obj.order = order; 35 obj.order = order;
36 nBlocks = grid.nBlocks(); 36 nBlocks = grid.nBlocks();
67 intf = grid.connections{i,j}; 67 intf = grid.connections{i,j};
68 if isempty(intf) 68 if isempty(intf)
69 continue 69 continue
70 end 70 end
71 71
72 [ii, ij] = obj.diffOps{i}.interface(intf{1}, obj.diffOps{j}, intf{2}, intfOpts{i,j}); 72 [ii, ij] = obj.diffOps{i}.interface(intf{1}, obj.diffOps{j}, intf{2}, intfTypes{i,j});
73 D{i,i} = D{i,i} + ii; 73 D{i,i} = D{i,i} + ii;
74 D{i,j} = D{i,j} + ij; 74 D{i,j} = D{i,j} + ij;
75 75
76 [jj, ji] = obj.diffOps{j}.interface(intf{2}, obj.diffOps{i}, intf{1}, intfOpts{i,j}); 76 [jj, ji] = obj.diffOps{j}.interface(intf{2}, obj.diffOps{i}, intf{1}, intfTypes{i,j});
77 D{j,j} = D{j,j} + jj; 77 D{j,j} = D{j,j} + jj;
78 D{j,i} = D{j,i} + ji; 78 D{j,i} = D{j,i} + ji;
79 end 79 end
80 end 80 end
81 obj.D = blockmatrix.toMatrix(D); 81 obj.D = blockmatrix.toMatrix(D);