Mercurial > repos > public > sbplib
comparison +multiblock/DiffOp.m @ 884:7d4f57725192 feature/poroelastic
Add a getBoundaryOperator method in multiblock.DiffOp that uses the the diffop get_boundary_operator method rather than its properties. Werpers might not like this.
author | Martin Almquist <malmquist@stanford.edu> |
---|---|
date | Fri, 02 Nov 2018 10:47:03 -0700 |
parents | 5cf9fdf4c98f |
children | 386ef449df51 72cd29107a9a |
comparison
equal
deleted
inserted
replaced
883:76efb6a7b466 | 884:7d4f57725192 |
---|---|
146 otherwise | 146 otherwise |
147 error('Unknown boundary indentifier') | 147 error('Unknown boundary indentifier') |
148 end | 148 end |
149 end | 149 end |
150 | 150 |
151 % Get a boundary operator specified by opName for the given boundary/BoundaryGroup | |
152 function op = getBoundaryOperatorWrapper(obj, opName, boundary) | |
153 switch class(boundary) | |
154 case 'cell' | |
155 blockId = boundary{1}; | |
156 localOp = obj.diffOps{blockId}.get_boundary_operator(opName, boundary{2}); | |
157 | |
158 div = {obj.blockmatrixDiv{1}, size(localOp,2)}; | |
159 blockOp = blockmatrix.zero(div); | |
160 blockOp{blockId,1} = localOp; | |
161 op = blockmatrix.toMatrix(blockOp); | |
162 return | |
163 case 'multiblock.BoundaryGroup' | |
164 op = sparse(size(obj.D,1),0); | |
165 for i = 1:length(boundary) | |
166 op = [op, obj.getBoundaryOperatorWrapper(opName, boundary{i})]; | |
167 end | |
168 otherwise | |
169 error('Unknown boundary indentifier') | |
170 end | |
171 end | |
172 | |
151 function op = getBoundaryQuadrature(obj, boundary) | 173 function op = getBoundaryQuadrature(obj, boundary) |
152 opName = 'H'; | 174 opName = 'H'; |
153 switch class(boundary) | 175 switch class(boundary) |
154 case 'cell' | 176 case 'cell' |
155 localOpName = [opName '_' boundary{2}]; | 177 localOpName = [opName '_' boundary{2}]; |