-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdefault_term_diff.m
42 lines (38 loc) · 1.14 KB
/
default_term_diff.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
% Second order term handled via LDG method for stability, i.e., split the
% second order system into two first order equations, i.e., terms like ...
%
% g1(x) d/dx g2(x) df(x)/dx
%
% are split into
%
% g1(x) dq(x)/dx ... eq1
%
% and
%
% q = g2(x) df(x)/dx ... eq2
term_diff.type = 'diff';
term_diff.TD = 0;
term_diff.dat = [];
term_diff.name = 'diff';
% eq1 : g1 * dq/dx
term_diff.G1 = @(x,p,t,dat) x*0+1;
term_diff.LF1 = -1; % upwind left
term_diff.BCL1 = 'N';
term_diff.BCR1 = 'N';
for d=1:num_dimensions % BC variation in all dimensions
term_diff.BCL1_fList{d} = @(x,p,t) x.*0;
term_diff.BCR1_fList{d} = @(x,p,t) x.*0;
end
term_diff.BCL1_fList{num_dimensions+1} = @(t,p) 1; % time variation
term_diff.BCR1_fList{num_dimensions+1} = @(t,p) 1;
% eq2 : g2 * df/dx
term_diff.G2 = @(x,p,t,dat) x*0+1;
term_diff.LF2 = +1; % upwind right
term_diff.BCL2 = 'D';
term_diff.BCR2 = 'D';
for d=1:num_dimensions % BC variation in all dimensions
term_diff.BCL2_fList{d} = @(x,p,t) x.*0;
term_diff.BCR2_fList{d} = @(x,p,t) x.*0;
end
term_diff.BCL2_fList{num_dimensions+1} = @(t,p) 1; % time variation
term_diff.BCR2_fList{num_dimensions+1} = @(t,p) 1;