diff +multiblock/DiffOp.m @ 534:55a7777dfcd0 feature/boundaryGroup

Implement boundary_condition for boundary groups
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 03 Aug 2017 18:07:27 +0200
parents 06d1606d6977
children b0386d2c180d
line wrap: on
line diff
--- a/+multiblock/DiffOp.m	Thu Aug 03 17:45:06 2017 +0200
+++ b/+multiblock/DiffOp.m	Thu Aug 03 18:07:27 2017 +0200
@@ -151,9 +151,16 @@
         function [closure, penalty] = boundary_condition(obj, boundary, type)
             switch class(boundary)
                 case 'cell'
-                    [closure, penalty] = singleBoundaryCondition(obj, boundary, type);
+                    [closure, penalty] = obj.singleBoundaryCondition(boundary, type);
                 case 'multiblock.BoundaryGroup'
-                    error('not implemented')
+                    [n,m] = size(obj.D);
+                    closure = sparse(n,m);
+                    penalty = [];
+                    for i = 1:length(boundary)
+                        [closurePart, penaltyPart] = obj.boundary_condition(boundary{i}, type);
+                        closure = closure + closurePart;
+                        penalty = [penalty, penaltyPart];
+                    end
                 otherwise
                     error('Unknown boundary indentifier')
             end