comparison +multiblock/DiffOp.m @ 868:57760d7088ad bcSetupExperiment

Merge with feature/grids
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 27 Jul 2018 10:39:12 -0700
parents 1cc5a0d26453 5cf9fdf4c98f
children 386ef449df51 21394c78c72e
comparison
equal deleted inserted replaced
867:d634d4deb263 868:57760d7088ad
51 end 51 end
52 obj.H = blockmatrix.toMatrix(H); 52 obj.H = blockmatrix.toMatrix(H);
53 53
54 54
55 % Build the differentiation matrix 55 % Build the differentiation matrix
56 obj.blockmatrixDiv = {g.Ns, g.Ns}; 56 Ns = zeros(nBlocks,1);
57 for i = 1:nBlocks
58 Ns(i) = length(obj.diffOps{i}.D);
59 end
60 obj.blockmatrixDiv = {Ns, Ns};
57 D = blockmatrix.zero(obj.blockmatrixDiv); 61 D = blockmatrix.zero(obj.blockmatrixDiv);
58 for i = 1:nBlocks 62 for i = 1:nBlocks
59 D{i,i} = obj.diffOps{i}.D; 63 D{i,i} = obj.diffOps{i}.D;
60 end 64 end
61 65
115 end 119 end
116 end 120 end
117 121
118 function ops = splitOp(obj, op) 122 function ops = splitOp(obj, op)
119 % Splits a matrix operator into a cell-matrix of matrix operators for 123 % Splits a matrix operator into a cell-matrix of matrix operators for
120 % each g. 124 % each grid.
121 ops = sparse2cell(op, obj.NNN); 125 ops = sparse2cell(op, obj.NNN);
122 end 126 end
123 127
124 % Get a boundary operator specified by opName for the given boundary/BoundaryGroup 128 % Get a boundary operator specified by opName for the given boundary/BoundaryGroup
125 function op = getBoundaryOperator(obj, opName, boundary) 129 function op = getBoundaryOperator(obj, opName, boundary)