changeset 346:33b2ef863519 feature/beams

Allowed muliple closure BCs in multiblock.DiffOp.
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 16 Nov 2016 16:15:53 -0800
parents 7b5ef8b89268
children 85c2fe06d551
files +multiblock/DiffOp.m
diffstat 1 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
diff -r 7b5ef8b89268 -r 33b2ef863519 +multiblock/DiffOp.m
--- a/+multiblock/DiffOp.m	Wed Nov 16 15:39:16 2016 -0800
+++ b/+multiblock/DiffOp.m	Wed Nov 16 16:15:53 2016 -0800
@@ -125,9 +125,9 @@
         end
 
         % Creates the closure and penalty matrix for a given boundary condition,
-        %    boundary -- the name of the boundary on the form [id][name] where
+        %    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
-        %                boundary of that block example: 1s or 3w
+        %                boundary of that block example: {1,'s'} or {3,'w'}
         function [closure, penalty] = boundary_condition(obj, boundary, type)
             I = boundary{1};
             name = boundary{2};
@@ -137,9 +137,17 @@
 
             % Expand to matrix for full domain.
             div = obj.blockmatrixDiv;
-            closure = blockmatrix.zero(div);
-            closure{I,I} = blockClosure;
-            closure = blockmatrix.toMatrix(closure);
+            if ~iscell(blockClosure)
+                temp = blockmatrix.zero(div);
+                temp{I,I} = blockClosure;
+                closure = blockmatrix.toMatrix(temp);
+            else
+                for i = 1:length(blockClosure)
+                    temp = blockmatrix.zero(div);
+                    temp{I,I} = blockClosure{i};
+                    closure{i} = blockmatrix.toMatrix(temp);
+                end
+            end
 
             div{2} = size(blockPenalty, 2); % Penalty is a column vector
             if ~iscell(blockPenalty)