comparison +multiblock/DiffOp.m @ 344:61b75d6d4899 feature/beams

Added get method for boundary operators on multiblock DiffOp
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 14 Nov 2016 14:54:53 -0800
parents ac30761d7bdb
children 33b2ef863519
comparison
equal deleted inserted replaced
343:ac30761d7bdb 344:61b75d6d4899
106 % Splits a matrix operator into a cell-matrix of matrix operators for 106 % Splits a matrix operator into a cell-matrix of matrix operators for
107 % each grid. 107 % each grid.
108 ops = sparse2cell(op, obj.NNN); 108 ops = sparse2cell(op, obj.NNN);
109 end 109 end
110 110
111 function op = getBoundaryOperator(obj, op, boundary)
112 if iscell(boundary)
113 localOpName = [op '_' boundary{2}];
114 blockId = boundary{1};
115 localOp = obj.diffOps{blockId}.(localOpName);
116
117 div = {obj.blockmatrixDiv{1}, size(localOp,2)};
118 blockOp = blockmatrix.zero(div);
119 blockOp{blockId,1} = localOp;
120 op = blockmatrix.toMatrix(blockOp);
121 return
122 else
123 % Boundary är en sträng med en boundary group i.
124 end
125 end
126
111 % Creates the closure and penalty matrix for a given boundary condition, 127 % Creates the closure and penalty matrix for a given boundary condition,
112 % boundary -- the name of the boundary on the form [id][name] where 128 % boundary -- the name of the boundary on the form [id][name] where
113 % id is the number of a block and name is the name of a 129 % id is the number of a block and name is the name of a
114 % boundary of that block example: 1s or 3w 130 % boundary of that block example: 1s or 3w
115 function [closure, penalty] = boundary_condition(obj, boundary, type) 131 function [closure, penalty] = boundary_condition(obj, boundary, type)