diff +multiblock/DiffOp.m @ 764:e05465aa2e25 feature/grids

Add methods for getting boundary quadratures from multiblock.DiffOP
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 20 Jun 2018 13:00:01 +0200
parents 89e14a85a2d0
children 5cf9fdf4c98f 517d6019d63c
line wrap: on
line diff
--- a/+multiblock/DiffOp.m	Wed Jun 20 12:59:07 2018 +0200
+++ b/+multiblock/DiffOp.m	Wed Jun 20 13:00:01 2018 +0200
@@ -144,6 +144,27 @@
             end
         end
 
+        function op = getBoundaryQuadrature(obj, boundary)
+            opName = 'H';
+            switch class(boundary)
+                case 'cell'
+                    localOpName = [opName '_' boundary{2}];
+                    blockId = boundary{1};
+                    op = obj.diffOps{blockId}.(localOpName);
+
+                    return
+                case 'multiblock.BoundaryGroup'
+                    N = length(boundary);
+                    H_bm = cell(N,N);
+                    for i = 1:N
+                        H_bm{i,i} = obj.getBoundaryQuadrature(boundary{i});
+                    end
+                    op = blockmatrix.toMatrix(H_bm);
+                otherwise
+                    error('Unknown boundary indentifier')
+            end
+        end
+
         % Creates the closure and penalty matrix for a given boundary condition,
         %    boundary -- the name of the boundary on the form {id,name} where
         %                id is the number of a block and name is the name of a