Mercurial > repos > public > sbplib
comparison +scheme/bcSetup.m @ 868:57760d7088ad bcSetupExperiment
Merge with feature/grids
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 27 Jul 2018 10:39:12 -0700 |
parents | d634d4deb263 5cf9fdf4c98f |
children | d356f1a22d4f |
comparison
equal
deleted
inserted
replaced
867:d634d4deb263 | 868:57760d7088ad |
---|---|
26 % Collect closures, penalties and data | 26 % Collect closures, penalties and data |
27 for i = 1:length(bcs) | 27 for i = 1:length(bcs) |
28 [localClosure, penalty] = diffOp.boundary_condition(bcs{i}.boundary, bcs{i}.type); | 28 [localClosure, penalty] = diffOp.boundary_condition(bcs{i}.boundary, bcs{i}.type); |
29 closure = closure + localClosure; | 29 closure = closure + localClosure; |
30 | 30 |
31 [ok, isSym, data] = parseData(bcs{i}, penalty, diffOp.grid) | 31 [ok, isSym, data] = parseData(bcs{i}, penalty, diffOp.grid); |
32 | 32 |
33 if ~ok | 33 if ~ok |
34 % There was no data | 34 % There was no data |
35 continue | 35 continue |
36 end | 36 end |
37 | 37 |
38 if isSym | 38 if isSym |
39 symbolicData{end+1} = data; | |
40 else | |
39 gridData{end+1} = data; | 41 gridData{end+1} = data; |
40 else | |
41 symbolicData{end+1} = data; | |
42 end | 42 end |
43 end | 43 end |
44 | 44 |
45 % Setup penalty function | 45 % Setup penalty function |
46 O = spzeros(size(diffOp),1); | 46 O = spzeros(size(diffOp),1); |
81 | 81 |
82 if ~isa(bcs{i}.data, 'function_handle') | 82 if ~isa(bcs{i}.data, 'function_handle') |
83 error('bcs{%d}.data should be a function of time or a function of time and space',i); | 83 error('bcs{%d}.data should be a function of time or a function of time and space',i); |
84 end | 84 end |
85 | 85 |
86 b = diffOp.grid.getBoundary(bc.boundart); | 86 b = diffOp.grid.getBoundary(bcs{i}.boundary); |
87 | 87 |
88 dim = size(b,2); | 88 dim = size(b,2); |
89 | 89 |
90 if nargin(bc.data) == 1 | 90 if nargin(bcs{i}.data) == 1 |
91 % Grid data (only function of time) | 91 % Grid data (only function of time) |
92 assertSize(bc.data(0), 1, size(b)); | 92 assertSize(bcs{i}.data(0), 1, size(b)); |
93 elseif nargin(bc.data) ~= 1+dim | 93 elseif nargin(bcs{i}.data) ~= 1+dim |
94 error('sbplib:scheme:bcSetup:DataWrongNumberOfArguments', 'bcs{%d}.data has the wrong number of input arguments. Must be either only time or time and space.', i); | 94 error('sbplib:scheme:bcSetup:DataWrongNumberOfArguments', 'bcs{%d}.data has the wrong number of input arguments. Must be either only time or time and space.', i); |
95 end | 95 end |
96 end | 96 end |
97 end | 97 end |
98 | 98 |