Mercurial > repos > public > sbplib
changeset 76:5c569cbef49e
Added more input parameter handling and fixed some bugs.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Mon, 23 Nov 2015 17:49:34 +0100 |
parents | ef5c9870f386 |
children | 0b07ff8a0a12 |
files | +multiblock/stitchSchemes.m |
diffstat | 1 files changed, 14 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/+multiblock/stitchSchemes.m Mon Nov 23 17:32:56 2015 +0100 +++ b/+multiblock/stitchSchemes.m Mon Nov 23 17:49:34 2015 +0100 @@ -9,16 +9,27 @@ % each field with a parameter array that is sent to schm.boundary_condition % % Output parameters are cell arrays and cell matrices. +% +% Ex: [schms, D, H] = stitchSchemes(schmHand, order, schmParam, blocks, ms, conn, bound) function [schms, D, H] = stitchSchemes(schmHand, order, schmParam, blocks, ms, conn, bound) + default_arg('schmParam',[]); n_blocks = numel(blocks); % Creating Schemes for i = 1:n_blocks - if ~iscell(schmParam{i}) + if isempty(schmParam); + schms{i} = schmHand(ms{i},blocks{i},order,[]); + elseif ~iscell(schmParam) param = schmParam(i); + schms{i} = schmHand(ms{i},blocks{i},order,param); else param = schmParam{i}; + if iscell(param) + schms{i} = schmHand(ms{i},blocks{i},order,param{:}); + else + schms{i} = schmHand(ms{i},blocks{i},order,param); + end end % class(schmParam) @@ -27,7 +38,7 @@ % class(schmParam{i}) % class(ms) - schms{i} = schmHand(ms{i},blocks{i},order,param{:}); + end @@ -37,10 +48,6 @@ H{i,i} = schms{i}.H; end - - - - %% Total system matrix % Differentiation terms @@ -75,7 +82,7 @@ continue end - [uu,uv,vv,vu] = noname.Scheme.interface_coupling(schms{i},intf{1},schms{j},intf{2}); + [uu,uv,vv,vu] = schms{i}.interface_coupling(schms{i},intf{1},schms{j},intf{2}); D{i,i} = D{i,i} + uu; D{i,j} = uv; D{j,j} = D{j,j} + vv;