Mercurial > repos > public > sbplib
comparison +scheme/LaplaceCurvilinear.m @ 592:4422c4476650 feature/utux2D
Merge with feature/grids
author | Martin Almquist <martin.almquist@it.uu.se> |
---|---|
date | Mon, 11 Sep 2017 14:17:15 +0200 |
parents | 33b962620e24 |
children | 07f8311374c6 |
comparison
equal
deleted
inserted
replaced
591:39554f2de783 | 592:4422c4476650 |
---|---|
5 | 5 |
6 grid | 6 grid |
7 | 7 |
8 order % Order accuracy for the approximation | 8 order % Order accuracy for the approximation |
9 | 9 |
10 D % non-stabalized scheme operator | 10 a,b % Parameters of the operator |
11 M % Derivative norm | 11 |
12 a,b | 12 |
13 % Inner products and operators for physical coordinates | |
14 D % Laplace operator | |
15 H, Hi % Inner product | |
16 e_w, e_e, e_s, e_n | |
17 d_w, d_e, d_s, d_n % Normal derivatives at the boundary | |
18 H_w, H_e, H_s, H_n % Boundary inner products | |
19 Dx, Dy % Physical derivatives | |
20 M % Gradient inner product | |
21 | |
22 % Metric coefficients | |
13 J, Ji | 23 J, Ji |
14 a11, a12, a22 | 24 a11, a12, a22 |
15 | 25 x_u |
16 H % Discrete norm | 26 x_v |
17 Hi | 27 y_u |
28 y_v | |
29 | |
30 % Inner product and operators for logical coordinates | |
18 H_u, H_v % Norms in the x and y directions | 31 H_u, H_v % Norms in the x and y directions |
32 Hi_u, Hi_v | |
19 Hu,Hv % Kroneckerd norms. 1'*Hx*v corresponds to integration in the x dir. | 33 Hu,Hv % Kroneckerd norms. 1'*Hx*v corresponds to integration in the x dir. |
20 Hi_u, Hi_v | |
21 Hiu, Hiv | 34 Hiu, Hiv |
22 e_w, e_e, e_s, e_n | |
23 du_w, dv_w | 35 du_w, dv_w |
24 du_e, dv_e | 36 du_e, dv_e |
25 du_s, dv_s | 37 du_s, dv_s |
26 du_n, dv_n | 38 du_n, dv_n |
27 gamm_u, gamm_v | 39 gamm_u, gamm_v |
28 lambda | 40 lambda |
29 | |
30 Dx, Dy % Physical derivatives | |
31 | |
32 x_u | |
33 x_v | |
34 y_u | |
35 y_v | |
36 end | 41 end |
37 | 42 |
38 methods | 43 methods |
39 % Implements a*div(b*grad(u)) as a SBP scheme | 44 % Implements a*div(b*grad(u)) as a SBP scheme |
45 % TODO: Implement proper H, it should be the real physical quadrature, the logic quadrature may be but in a separate variable (H_logic?) | |
46 | |
40 function obj = LaplaceCurvilinear(g ,order, a, b, opSet) | 47 function obj = LaplaceCurvilinear(g ,order, a, b, opSet) |
41 default_arg('opSet',@sbp.D2Variable); | 48 default_arg('opSet',@sbp.D2Variable); |
42 default_arg('a', 1); | 49 default_arg('a', 1); |
43 default_arg('b', 1); | 50 default_arg('b', 1); |
44 | 51 |
45 | |
46 if b ~=1 | 52 if b ~=1 |
47 error('Not implemented yet') | 53 error('Not implemented yet') |
48 end | 54 end |
49 | 55 |
50 assert(isa(g, 'grid.Curvilinear')) | 56 assert(isa(g, 'grid.Curvilinear')) |
56 | 62 |
57 h = g.scaling(); | 63 h = g.scaling(); |
58 h_u = h(1); | 64 h_u = h(1); |
59 h_v = h(2); | 65 h_v = h(2); |
60 | 66 |
61 % Operators | 67 |
68 % 1D operators | |
62 ops_u = opSet(m_u, {0, 1}, order); | 69 ops_u = opSet(m_u, {0, 1}, order); |
63 ops_v = opSet(m_v, {0, 1}, order); | 70 ops_v = opSet(m_v, {0, 1}, order); |
64 | 71 |
65 I_u = speye(m_u); | 72 I_u = speye(m_u); |
66 I_v = speye(m_v); | 73 I_v = speye(m_v); |
81 e_l_v = ops_v.e_l; | 88 e_l_v = ops_v.e_l; |
82 e_r_v = ops_v.e_r; | 89 e_r_v = ops_v.e_r; |
83 d1_l_v = ops_v.d1_l; | 90 d1_l_v = ops_v.d1_l; |
84 d1_r_v = ops_v.d1_r; | 91 d1_r_v = ops_v.d1_r; |
85 | 92 |
93 | |
94 % Logical operators | |
86 Du = kr(D1_u,I_v); | 95 Du = kr(D1_u,I_v); |
87 Dv = kr(I_u,D1_v); | 96 Dv = kr(I_u,D1_v); |
88 | 97 obj.Hu = kr(H_u,I_v); |
89 % Metric derivatives | 98 obj.Hv = kr(I_u,H_v); |
99 obj.Hiu = kr(Hi_u,I_v); | |
100 obj.Hiv = kr(I_u,Hi_v); | |
101 | |
102 e_w = kr(e_l_u,I_v); | |
103 e_e = kr(e_r_u,I_v); | |
104 e_s = kr(I_u,e_l_v); | |
105 e_n = kr(I_u,e_r_v); | |
106 obj.du_w = kr(d1_l_u,I_v); | |
107 obj.dv_w = (e_w'*Dv)'; | |
108 obj.du_e = kr(d1_r_u,I_v); | |
109 obj.dv_e = (e_e'*Dv)'; | |
110 obj.du_s = (e_s'*Du)'; | |
111 obj.dv_s = kr(I_u,d1_l_v); | |
112 obj.du_n = (e_n'*Du)'; | |
113 obj.dv_n = kr(I_u,d1_r_v); | |
114 | |
115 | |
116 % Metric coefficients | |
90 coords = g.points(); | 117 coords = g.points(); |
91 x = coords(:,1); | 118 x = coords(:,1); |
92 y = coords(:,2); | 119 y = coords(:,2); |
93 | 120 |
94 x_u = Du*x; | 121 x_u = Du*x; |
100 a11 = 1./J .* (x_v.^2 + y_v.^2); | 127 a11 = 1./J .* (x_v.^2 + y_v.^2); |
101 a12 = -1./J .* (x_u.*x_v + y_u.*y_v); | 128 a12 = -1./J .* (x_u.*x_v + y_u.*y_v); |
102 a22 = 1./J .* (x_u.^2 + y_u.^2); | 129 a22 = 1./J .* (x_u.^2 + y_u.^2); |
103 lambda = 1/2 * (a11 + a22 - sqrt((a11-a22).^2 + 4*a12.^2)); | 130 lambda = 1/2 * (a11 + a22 - sqrt((a11-a22).^2 + 4*a12.^2)); |
104 | 131 |
132 obj.x_u = x_u; | |
133 obj.x_v = x_v; | |
134 obj.y_u = y_u; | |
135 obj.y_v = y_v; | |
136 | |
137 | |
105 % Assemble full operators | 138 % Assemble full operators |
106 L_12 = spdiags(a12, 0, m_tot, m_tot); | 139 L_12 = spdiag(a12); |
107 Duv = Du*L_12*Dv; | 140 Duv = Du*L_12*Dv; |
108 Dvu = Dv*L_12*Du; | 141 Dvu = Dv*L_12*Du; |
109 | 142 |
110 Duu = sparse(m_tot); | 143 Duu = sparse(m_tot); |
111 Dvv = sparse(m_tot); | 144 Dvv = sparse(m_tot); |
121 D = D2_v(a22(ind(i,:))); | 154 D = D2_v(a22(ind(i,:))); |
122 p = ind(i,:); | 155 p = ind(i,:); |
123 Dvv(p,p) = D; | 156 Dvv(p,p) = D; |
124 end | 157 end |
125 | 158 |
126 obj.H = kr(H_u,H_v); | 159 |
127 obj.Hi = kr(Hi_u,Hi_v); | 160 % Physical operators |
128 obj.Hu = kr(H_u,I_v); | 161 obj.J = spdiag(J); |
129 obj.Hv = kr(I_u,H_v); | 162 obj.Ji = spdiag(1./J); |
130 obj.Hiu = kr(Hi_u,I_v); | 163 |
131 obj.Hiv = kr(I_u,Hi_v); | 164 obj.D = obj.Ji*a*(Duu + Duv + Dvu + Dvv); |
132 | 165 obj.H = obj.J*kr(H_u,H_v); |
133 obj.e_w = kr(e_l_u,I_v); | 166 obj.Hi = obj.Ji*kr(Hi_u,Hi_v); |
134 obj.e_e = kr(e_r_u,I_v); | 167 |
135 obj.e_s = kr(I_u,e_l_v); | 168 obj.e_w = e_w; |
136 obj.e_n = kr(I_u,e_r_v); | 169 obj.e_e = e_e; |
137 obj.du_w = kr(d1_l_u,I_v); | 170 obj.e_s = e_s; |
138 obj.dv_w = (obj.e_w'*Dv)'; | 171 obj.e_n = e_n; |
139 obj.du_e = kr(d1_r_u,I_v); | 172 |
140 obj.dv_e = (obj.e_e'*Dv)'; | 173 %% normal derivatives |
141 obj.du_s = (obj.e_s'*Du)'; | 174 I_w = ind(1,:); |
142 obj.dv_s = kr(I_u,d1_l_v); | 175 I_e = ind(end,:); |
143 obj.du_n = (obj.e_n'*Du)'; | 176 I_s = ind(:,1); |
144 obj.dv_n = kr(I_u,d1_r_v); | 177 I_n = ind(:,end); |
145 | 178 |
146 obj.x_u = x_u; | 179 a11_w = spdiag(a11(I_w)); |
147 obj.x_v = x_v; | 180 a12_w = spdiag(a12(I_w)); |
148 obj.y_u = y_u; | 181 a11_e = spdiag(a11(I_e)); |
149 obj.y_v = y_v; | 182 a12_e = spdiag(a12(I_e)); |
150 | 183 a22_s = spdiag(a22(I_s)); |
184 a12_s = spdiag(a12(I_s)); | |
185 a22_n = spdiag(a22(I_n)); | |
186 a12_n = spdiag(a12(I_n)); | |
187 | |
188 s_w = sqrt((e_w'*x_v).^2 + (e_w'*y_v).^2); | |
189 s_e = sqrt((e_e'*x_v).^2 + (e_e'*y_v).^2); | |
190 s_s = sqrt((e_s'*x_u).^2 + (e_s'*y_u).^2); | |
191 s_n = sqrt((e_n'*x_u).^2 + (e_n'*y_u).^2); | |
192 | |
193 obj.d_w = -1*(spdiag(1./s_w)*(a11_w*obj.du_w' + a12_w*obj.dv_w'))'; | |
194 obj.d_e = (spdiag(1./s_e)*(a11_e*obj.du_e' + a12_e*obj.dv_e'))'; | |
195 obj.d_s = -1*(spdiag(1./s_s)*(a22_s*obj.dv_s' + a12_s*obj.du_s'))'; | |
196 obj.d_n = (spdiag(1./s_n)*(a22_n*obj.dv_n' + a12_n*obj.du_n'))'; | |
197 | |
198 obj.Dx = spdiag( y_v./J)*Du + spdiag(-y_u./J)*Dv; | |
199 obj.Dy = spdiag(-x_v./J)*Du + spdiag( x_u./J)*Dv; | |
200 | |
201 %% Boundary inner products | |
202 obj.H_w = H_v*spdiag(s_w); | |
203 obj.H_e = H_v*spdiag(s_e); | |
204 obj.H_s = H_u*spdiag(s_s); | |
205 obj.H_n = H_u*spdiag(s_n); | |
206 | |
207 % Misc. | |
151 obj.m = m; | 208 obj.m = m; |
152 obj.h = [h_u h_v]; | 209 obj.h = [h_u h_v]; |
153 obj.order = order; | 210 obj.order = order; |
154 obj.grid = g; | 211 obj.grid = g; |
155 | 212 |
156 obj.a = a; | 213 obj.a = a; |
157 obj.b = b; | 214 obj.b = b; |
158 obj.J = spdiags(J, 0, m_tot, m_tot); | |
159 obj.Ji = spdiags(1./J, 0, m_tot, m_tot); | |
160 obj.a11 = a11; | 215 obj.a11 = a11; |
161 obj.a12 = a12; | 216 obj.a12 = a12; |
162 obj.a22 = a22; | 217 obj.a22 = a22; |
163 obj.D = obj.Ji*a*(Duu + Duv + Dvu + Dvv); | |
164 obj.lambda = lambda; | 218 obj.lambda = lambda; |
165 | |
166 obj.Dx = spdiag( y_v./J)*Du + spdiag(-y_u./J)*Dv; | |
167 obj.Dy = spdiag(-x_v./J)*Du + spdiag( x_u./J)*Dv; | |
168 | 219 |
169 obj.gamm_u = h_u*ops_u.borrowing.M.d1; | 220 obj.gamm_u = h_u*ops_u.borrowing.M.d1; |
170 obj.gamm_v = h_v*ops_v.borrowing.M.d1; | 221 obj.gamm_v = h_v*ops_v.borrowing.M.d1; |
171 end | 222 end |
172 | 223 |
180 % neighbour_boundary is a string specifying which boundary to interface to. | 231 % neighbour_boundary is a string specifying which boundary to interface to. |
181 function [closure, penalty] = boundary_condition(obj, boundary, type, parameter) | 232 function [closure, penalty] = boundary_condition(obj, boundary, type, parameter) |
182 default_arg('type','neumann'); | 233 default_arg('type','neumann'); |
183 default_arg('parameter', []); | 234 default_arg('parameter', []); |
184 | 235 |
185 [e, d_n, d_t, coeff_n, coeff_t, s, gamm, halfnorm_inv , ~, ~, ~, scale_factor] = obj.get_boundary_ops(boundary); | 236 [e, d, gamm, H_b, ~] = obj.get_boundary_ops(boundary); |
186 switch type | 237 switch type |
187 % Dirichlet boundary condition | 238 % Dirichlet boundary condition |
188 case {'D','d','dirichlet'} | 239 case {'D','d','dirichlet'} |
189 % v denotes the solution in the neighbour domain | |
190 tuning = 1.2; | 240 tuning = 1.2; |
191 % tuning = 20.2; | 241 % tuning = 20.2; |
192 [e, d_n, d_t, coeff_n, coeff_t, s, gamm, halfnorm_inv_n, halfnorm_inv_t, halfnorm_t] = obj.get_boundary_ops(boundary); | 242 |
193 | 243 b1 = gamm*obj.lambda./obj.a11.^2; |
194 a_n = spdiag(coeff_n); | 244 b2 = gamm*obj.lambda./obj.a22.^2; |
195 a_t = spdiag(coeff_t); | 245 |
196 | 246 tau1 = tuning * spdiag(-1./b1 - 1./b2); |
197 F = (s * a_n * d_n' + s * a_t*d_t')'; | 247 tau2 = 1; |
198 | 248 |
199 u = obj; | 249 tau = (tau1*e + tau2*d)*H_b; |
200 | 250 |
201 b1 = gamm*u.lambda./u.a11.^2; | 251 closure = obj.a*obj.Hi*tau*e'; |
202 b2 = gamm*u.lambda./u.a22.^2; | 252 penalty = -obj.a*obj.Hi*tau; |
203 | |
204 tau = -1./b1 - 1./b2; | |
205 tau = tuning * spdiag(tau); | |
206 sig1 = 1; | |
207 | |
208 penalty_parameter_1 = halfnorm_inv_n*(tau + sig1*halfnorm_inv_t*F*e'*halfnorm_t)*e; | |
209 | |
210 closure = obj.Ji*obj.a * penalty_parameter_1*e'; | |
211 penalty = -obj.Ji*obj.a * penalty_parameter_1; | |
212 | 253 |
213 | 254 |
214 % Neumann boundary condition | 255 % Neumann boundary condition |
215 case {'N','n','neumann'} | 256 case {'N','n','neumann'} |
216 a_n = spdiags(coeff_n,0,length(coeff_n),length(coeff_n)); | 257 tau1 = -1; |
217 a_t = spdiags(coeff_t,0,length(coeff_t),length(coeff_t)); | |
218 d = (a_n * d_n' + a_t*d_t')'; | |
219 | |
220 tau1 = -s; | |
221 tau2 = 0; | 258 tau2 = 0; |
222 tau = obj.a * obj.Ji*(tau1*e + tau2*d); | 259 tau = (tau1*e + tau2*d)*H_b; |
223 | 260 |
224 closure = halfnorm_inv*tau*d'; | 261 closure = obj.a*obj.Hi*tau*d'; |
225 penalty = -halfnorm_inv*tau; | 262 penalty = -obj.a*obj.Hi*tau; |
226 | 263 |
227 % Characteristic boundary condition | |
228 case {'characteristic', 'char', 'c'} | |
229 default_arg('parameter', 1); | |
230 beta = parameter; | |
231 | |
232 a_n = spdiags(coeff_n,0,length(coeff_n),length(coeff_n)); | |
233 a_t = spdiags(coeff_t,0,length(coeff_t),length(coeff_t)); | |
234 d = s*(a_n * d_n' + a_t*d_t')'; % outward facing normal derivative | |
235 | |
236 tau = -obj.a * 1/beta*obj.Ji*e; | |
237 | |
238 closure{1} = halfnorm_inv*tau*spdiag(scale_factor)*e'; | |
239 closure{2} = halfnorm_inv*tau*beta*d'; | |
240 penalty = -halfnorm_inv*tau; | |
241 | 264 |
242 % Unknown, boundary condition | 265 % Unknown, boundary condition |
243 otherwise | 266 otherwise |
244 error('No such boundary condition: type = %s',type); | 267 error('No such boundary condition: type = %s',type); |
245 end | 268 end |
248 function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary) | 271 function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary) |
249 % u denotes the solution in the own domain | 272 % u denotes the solution in the own domain |
250 % v denotes the solution in the neighbour domain | 273 % v denotes the solution in the neighbour domain |
251 tuning = 1.2; | 274 tuning = 1.2; |
252 % tuning = 20.2; | 275 % tuning = 20.2; |
253 [e_u, d_n_u, d_t_u, coeff_n_u, coeff_t_u, s_u, gamm_u, halfnorm_inv_u_n, halfnorm_inv_u_t, halfnorm_u_t, I_u] = obj.get_boundary_ops(boundary); | 276 [e_u, d_u, gamm_u, H_b_u, I_u] = obj.get_boundary_ops(boundary); |
254 [e_v, d_n_v, d_t_v, coeff_n_v, coeff_t_v, s_v, gamm_v, halfnorm_inv_v_n, halfnorm_inv_v_t, halfnorm_v_t, I_v] = neighbour_scheme.get_boundary_ops(neighbour_boundary); | 277 [e_v, d_v, gamm_v, H_b_v, I_v] = neighbour_scheme.get_boundary_ops(neighbour_boundary); |
255 | |
256 a_n_u = spdiag(coeff_n_u); | |
257 a_t_u = spdiag(coeff_t_u); | |
258 a_n_v = spdiag(coeff_n_v); | |
259 a_t_v = spdiag(coeff_t_v); | |
260 | |
261 F_u = (s_u * a_n_u * d_n_u' + s_u * a_t_u*d_t_u')'; | |
262 F_v = (s_v * a_n_v * d_n_v' + s_v * a_t_v*d_t_v')'; | |
263 | 278 |
264 u = obj; | 279 u = obj; |
265 v = neighbour_scheme; | 280 v = neighbour_scheme; |
266 | 281 |
267 b1_u = gamm_u*u.lambda(I_u)./u.a11(I_u).^2; | 282 b1_u = gamm_u*u.lambda(I_u)./u.a11(I_u).^2; |
268 b2_u = gamm_u*u.lambda(I_u)./u.a22(I_u).^2; | 283 b2_u = gamm_u*u.lambda(I_u)./u.a22(I_u).^2; |
269 b1_v = gamm_v*v.lambda(I_v)./v.a11(I_v).^2; | 284 b1_v = gamm_v*v.lambda(I_v)./v.a11(I_v).^2; |
270 b2_v = gamm_v*v.lambda(I_v)./v.a22(I_v).^2; | 285 b2_v = gamm_v*v.lambda(I_v)./v.a22(I_v).^2; |
271 | 286 |
272 tau = -1./(4*b1_u) -1./(4*b1_v) -1./(4*b2_u) -1./(4*b2_v); | 287 tau1 = -1./(4*b1_u) -1./(4*b1_v) -1./(4*b2_u) -1./(4*b2_v); |
273 tau = tuning * spdiag(tau); | 288 tau1 = tuning * spdiag(tau1); |
274 sig1 = 1/2; | 289 tau2 = 1/2; |
275 sig2 = -1/2; | 290 |
276 | 291 sig1 = -1/2; |
277 penalty_parameter_1 = halfnorm_inv_u_n*(e_u*tau + sig1*halfnorm_inv_u_t*F_u*e_u'*halfnorm_u_t*e_u); | 292 sig2 = 0; |
278 penalty_parameter_2 = halfnorm_inv_u_n * sig2 * e_u; | 293 |
279 | 294 tau = (e_u*tau1 + tau2*d_u)*H_b_u; |
280 | 295 sig = (sig1*e_u + sig2*d_u)*H_b_u; |
281 closure = obj.Ji*obj.a * ( penalty_parameter_1*e_u' + penalty_parameter_2*F_u'); | 296 |
282 penalty = obj.Ji*obj.a * (-penalty_parameter_1*e_v' + penalty_parameter_2*F_v'); | 297 closure = obj.a*obj.Hi*( tau*e_u' + sig*d_u'); |
298 penalty = obj.a*obj.Hi*(-tau*e_v' + sig*d_v'); | |
283 end | 299 end |
284 | 300 |
285 % Ruturns the boundary ops and sign for the boundary specified by the string boundary. | 301 % Ruturns the boundary ops and sign for the boundary specified by the string boundary. |
286 % The right boundary is considered the positive boundary | 302 % The right boundary is considered the positive boundary |
287 % | 303 % |
288 % I -- the indecies of the boundary points in the grid matrix | 304 % I -- the indecies of the boundary points in the grid matrix |
289 function [e, d_n, d_t, coeff_n, coeff_t, s, gamm, halfnorm_inv_n, halfnorm_inv_t, halfnorm_t, I, scale_factor] = get_boundary_ops(obj, boundary) | 305 function [e, d, gamm, H_b, I] = get_boundary_ops(obj, boundary) |
290 | 306 |
291 % gridMatrix = zeros(obj.m(2),obj.m(1)); | 307 % gridMatrix = zeros(obj.m(2),obj.m(1)); |
292 % gridMatrix(:) = 1:numel(gridMatrix); | 308 % gridMatrix(:) = 1:numel(gridMatrix); |
293 | 309 |
294 ind = grid.funcToMatrix(obj.grid, 1:prod(obj.m)); | 310 ind = grid.funcToMatrix(obj.grid, 1:prod(obj.m)); |
295 | 311 |
296 switch boundary | 312 switch boundary |
297 case 'w' | 313 case 'w' |
298 e = obj.e_w; | 314 e = obj.e_w; |
299 d_n = obj.du_w; | 315 d = obj.d_w; |
300 d_t = obj.dv_w; | 316 H_b = obj.H_w; |
301 s = -1; | |
302 | |
303 I = ind(1,:); | 317 I = ind(1,:); |
304 coeff_n = obj.a11(I); | |
305 coeff_t = obj.a12(I); | |
306 scale_factor = sqrt(obj.x_v(I).^2 + obj.y_v(I).^2); | |
307 case 'e' | 318 case 'e' |
308 e = obj.e_e; | 319 e = obj.e_e; |
309 d_n = obj.du_e; | 320 d = obj.d_e; |
310 d_t = obj.dv_e; | 321 H_b = obj.H_e; |
311 s = 1; | |
312 | |
313 I = ind(end,:); | 322 I = ind(end,:); |
314 coeff_n = obj.a11(I); | |
315 coeff_t = obj.a12(I); | |
316 scale_factor = sqrt(obj.x_v(I).^2 + obj.y_v(I).^2); | |
317 case 's' | 323 case 's' |
318 e = obj.e_s; | 324 e = obj.e_s; |
319 d_n = obj.dv_s; | 325 d = obj.d_s; |
320 d_t = obj.du_s; | 326 H_b = obj.H_s; |
321 s = -1; | |
322 | |
323 I = ind(:,1)'; | 327 I = ind(:,1)'; |
324 coeff_n = obj.a22(I); | |
325 coeff_t = obj.a12(I); | |
326 scale_factor = sqrt(obj.x_u(I).^2 + obj.y_u(I).^2); | |
327 case 'n' | 328 case 'n' |
328 e = obj.e_n; | 329 e = obj.e_n; |
329 d_n = obj.dv_n; | 330 d = obj.d_n; |
330 d_t = obj.du_n; | 331 H_b = obj.H_n; |
331 s = 1; | |
332 | |
333 I = ind(:,end)'; | 332 I = ind(:,end)'; |
334 coeff_n = obj.a22(I); | |
335 coeff_t = obj.a12(I); | |
336 scale_factor = sqrt(obj.x_u(I).^2 + obj.y_u(I).^2); | |
337 otherwise | 333 otherwise |
338 error('No such boundary: boundary = %s',boundary); | 334 error('No such boundary: boundary = %s',boundary); |
339 end | 335 end |
340 | 336 |
341 switch boundary | 337 switch boundary |
342 case {'w','e'} | 338 case {'w','e'} |
343 halfnorm_inv_n = obj.Hiu; | |
344 halfnorm_inv_t = obj.Hiv; | |
345 halfnorm_t = obj.Hv; | |
346 gamm = obj.gamm_u; | 339 gamm = obj.gamm_u; |
347 case {'s','n'} | 340 case {'s','n'} |
348 halfnorm_inv_n = obj.Hiv; | |
349 halfnorm_inv_t = obj.Hiu; | |
350 halfnorm_t = obj.Hu; | |
351 gamm = obj.gamm_v; | 341 gamm = obj.gamm_v; |
352 end | 342 end |
353 end | 343 end |
354 | 344 |
355 function N = size(obj) | 345 function N = size(obj) |
356 N = prod(obj.m); | 346 N = prod(obj.m); |
357 end | 347 end |
358 | |
359 | |
360 end | 348 end |
361 end | 349 end |