comparison +scheme/bcSetup.m @ 812:6b83dcb46f54 feature/grids

Merge with feature/poroelastic
author Martin Almquist <malmquist@stanford.edu>
date Fri, 27 Jul 2018 10:31:51 -0700
parents 5cf9fdf4c98f
children 006defd0247b 57760d7088ad
comparison
equal deleted inserted replaced
798:e76321b89c1e 812:6b83dcb46f54
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);
70 70
71 if ~isa(bcs{i}.data, 'function_handle') 71 if ~isa(bcs{i}.data, 'function_handle')
72 error('bcs{%d}.data should be a function of time or a function of time and space',i); 72 error('bcs{%d}.data should be a function of time or a function of time and space',i);
73 end 73 end
74 74
75 b = diffOp.grid.getBoundary(bc.boundart); 75 b = diffOp.grid.getBoundary(bcs{i}.boundary);
76 76
77 dim = size(b,2); 77 dim = size(b,2);
78 78
79 if nargin(bc.data) == 1 79 if nargin(bcs{i}.data) == 1
80 % Grid data (only function of time) 80 % Grid data (only function of time)
81 assertSize(bc.data(0), 1, size(b)); 81 assertSize(bcs{i}.data(0), 1, size(b));
82 elseif nargin(bc.data) ~= 1+dim 82 elseif nargin(bcs{i}.data) ~= 1+dim
83 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); 83 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);
84 end 84 end
85 end 85 end
86 end 86 end
87 87