Mercurial > repos > public > sbplib
comparison +scheme/Utux2d.m @ 1019:f029b97dbc72 feature/advectionRV
Support upwind opSet in Utux2d
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Fri, 14 Dec 2018 18:30:27 +0100 |
parents | cab047de7f5d |
children | cc61dde120cd |
comparison
equal
deleted
inserted
replaced
1018:eca4d9df9365 | 1019:f029b97dbc72 |
---|---|
13 H_x, H_y % Norms in the x and y directions | 13 H_x, H_y % Norms in the x and y directions |
14 Hi, Hx, Hy, Hxi, Hyi % Kroneckered norms | 14 Hi, Hx, Hy, Hxi, Hyi % Kroneckered norms |
15 | 15 |
16 % Derivatives | 16 % Derivatives |
17 Dx, Dy | 17 Dx, Dy |
18 | |
19 % Dissipation Operators | |
20 DissOpx, DissOpy | |
18 | 21 |
19 % Boundary operators | 22 % Boundary operators |
20 e_w, e_e, e_s, e_n | 23 e_w, e_e, e_s, e_n |
21 | 24 |
22 D % Total discrete operator | 25 D % Total discrete operator |
67 obj.Hy = kron(Ix,Hy); | 70 obj.Hy = kron(Ix,Hy); |
68 obj.Hxi = kron(Hxi,Iy); | 71 obj.Hxi = kron(Hxi,Iy); |
69 obj.Hyi = kron(Ix,Hyi); | 72 obj.Hyi = kron(Ix,Hyi); |
70 | 73 |
71 % Derivatives | 74 % Derivatives |
72 Dx = ops_x.D1; | 75 if (isequal(opSet,@sbp.D1Upwind)) |
73 Dy = ops_y.D1; | 76 Dx = (ops_x.Dp + ops_x.Dm)/2; |
74 obj.Dx = kron(Dx,Iy); | 77 Dy = (ops_y.Dp + ops_y.Dm)/2; |
75 obj.Dy = kron(Ix,Dy); | 78 DissOpx = (ops_x.Dm - ops_x.Dp)/2; |
79 DissOpy = (ops_y.Dm - ops_y.Dp)/2; | |
80 obj.Dx = kron(Dx,Iy); | |
81 obj.Dy = kron(Ix,Dy); | |
82 obj.DissOpx = kron(DissOpx,Iy); | |
83 obj.DissOpy = kron(Ix,DissOpy); | |
84 else | |
85 Dx = ops_x.D1; | |
86 Dy = ops_y.D1; | |
87 obj.Dx = kron(Dx,Iy); | |
88 obj.Dy = kron(Ix,Dy); | |
89 end | |
76 | 90 |
77 % Boundary operators | 91 % Boundary operators |
78 obj.e_w = kr(ops_x.e_l, Iy); | 92 obj.e_w = kr(ops_x.e_l, Iy); |
79 obj.e_e = kr(ops_x.e_r, Iy); | 93 obj.e_e = kr(ops_x.e_r, Iy); |
80 obj.e_s = kr(Ix, ops_y.e_l); | 94 obj.e_s = kr(Ix, ops_y.e_l); |
83 obj.m = m; | 97 obj.m = m; |
84 obj.h = [ops_x.h ops_y.h]; | 98 obj.h = [ops_x.h ops_y.h]; |
85 obj.order = order; | 99 obj.order = order; |
86 obj.a = a; | 100 obj.a = a; |
87 obj.D = -(a{1}*obj.Dx + a{2}*obj.Dy); | 101 obj.D = -(a{1}*obj.Dx + a{2}*obj.Dy); |
88 | |
89 end | 102 end |
90 % Closure functions return the opertors applied to the own domain to close the boundary | 103 % Closure functions return the opertors applied to the own domain to close the boundary |
91 % Penalty functions return the opertors to force the solution. In the case of an interface it returns the operator applied to the other doamin. | 104 % Penalty functions return the opertors to force the solution. In the case of an interface it returns the operator applied to the other doamin. |
92 % boundary is a string specifying the boundary e.g. 'l','r' or 'e','w','n','s'. | 105 % boundary is a string specifying the boundary e.g. 'l','r' or 'e','w','n','s'. |
93 % type is a string specifying the type of boundary condition if there are several. | 106 % type is a string specifying the type of boundary condition if there are several. |