Mercurial > repos > public > sbplib
comparison +scheme/LaplaceCurvilinear.m @ 910:b9c98661ff5d feature/utux2D
Change the name of the last interface method argument from type to opts in all schemes.
author | Martin Almquist <malmquist@stanford.edu> |
---|---|
date | Fri, 23 Nov 2018 20:39:40 -0800 |
parents | 0499239496cf |
children | 19c05eefc8c6 |
comparison
equal
deleted
inserted
replaced
909:ab1759166a8c | 910:b9c98661ff5d |
---|---|
271 otherwise | 271 otherwise |
272 error('No such boundary condition: type = %s',type); | 272 error('No such boundary condition: type = %s',type); |
273 end | 273 end |
274 end | 274 end |
275 | 275 |
276 % type Struct that specifies the interface coupling. | 276 % opts Struct that specifies the interface coupling. |
277 % Fields: | 277 % Fields: |
278 % -- tuning: penalty strength, defaults to 1.2 | 278 % -- tuning: penalty strength, defaults to 1.2 |
279 % -- interpolation: struct of interpolation operators (empty for conforming grids) | 279 % -- interpolation: struct of interpolation operators (empty for conforming grids) |
280 function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type) | 280 function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,opts) |
281 if isempty(type) | 281 if isempty(opts) |
282 [closure, penalty] = interfaceStandard(obj,boundary,neighbour_scheme,neighbour_boundary); | 282 [closure, penalty] = interfaceStandard(obj,boundary,neighbour_scheme,neighbour_boundary); |
283 else | 283 else |
284 assertType(type, 'struct'); | 284 assertType(opts, 'struct'); |
285 if isfield(type, 'I_local2neighbor') | 285 if isfield(opts, 'I_local2neighbor') |
286 [closure, penalty] = interfaceNonConforming(obj,boundary,neighbour_scheme,neighbour_boundary,type); | 286 [closure, penalty] = interfaceNonConforming(obj,boundary,neighbour_scheme,neighbour_boundary,opts); |
287 else | 287 else |
288 [closure, penalty] = interfaceStandard(obj,boundary,neighbour_scheme,neighbour_boundary,type); | 288 [closure, penalty] = interfaceStandard(obj,boundary,neighbour_scheme,neighbour_boundary,opts); |
289 end | 289 end |
290 end | 290 end |
291 end | 291 end |
292 | 292 |
293 function [closure, penalty] = interfaceStandard(obj,boundary,neighbour_scheme,neighbour_boundary,type) | 293 function [closure, penalty] = interfaceStandard(obj,boundary,neighbour_scheme,neighbour_boundary,opts) |
294 | 294 |
295 default_arg('type', struct); | 295 default_arg('opts', struct); |
296 default_field(type, 'tuning', 1.2); | 296 default_field(opts, 'tuning', 1.2); |
297 tuning = type.tuning; | 297 tuning = opts.tuning; |
298 | 298 |
299 % u denotes the solution in the own domain | 299 % u denotes the solution in the own domain |
300 % v denotes the solution in the neighbour domain | 300 % v denotes the solution in the neighbour domain |
301 [e_u, d_u, gamm_u, H_b_u, I_u] = obj.get_boundary_ops(boundary); | 301 [e_u, d_u, gamm_u, H_b_u, I_u] = obj.get_boundary_ops(boundary); |
302 [e_v, d_v, gamm_v, H_b_v, I_v] = neighbour_scheme.get_boundary_ops(neighbour_boundary); | 302 [e_v, d_v, gamm_v, H_b_v, I_v] = neighbour_scheme.get_boundary_ops(neighbour_boundary); |
321 | 321 |
322 closure = obj.a*obj.Hi*( tau*e_u' + sig*d_u'); | 322 closure = obj.a*obj.Hi*( tau*e_u' + sig*d_u'); |
323 penalty = obj.a*obj.Hi*(-tau*e_v' + sig*d_v'); | 323 penalty = obj.a*obj.Hi*(-tau*e_v' + sig*d_v'); |
324 end | 324 end |
325 | 325 |
326 function [closure, penalty] = interfaceNonConforming(obj,boundary,neighbour_scheme,neighbour_boundary,type) | 326 function [closure, penalty] = interfaceNonConforming(obj,boundary,neighbour_scheme,neighbour_boundary,opts) |
327 | 327 |
328 default_field(type, 'tuning', 1.2); | 328 default_field(opts, 'tuning', 1.2); |
329 tuning = type.tuning; | 329 tuning = opts.tuning; |
330 | 330 |
331 % u denotes the solution in the own domain | 331 % u denotes the solution in the own domain |
332 % v denotes the solution in the neighbour domain | 332 % v denotes the solution in the neighbour domain |
333 I_u2v_good = type.I_local2neighbor.good; | 333 I_u2v_good = opts.I_local2neighbor.good; |
334 I_u2v_bad = type.I_local2neighbor.bad; | 334 I_u2v_bad = opts.I_local2neighbor.bad; |
335 I_v2u_good = type.I_neighbor2local.good; | 335 I_v2u_good = opts.I_neighbor2local.good; |
336 I_v2u_bad = type.I_neighbor2local.bad; | 336 I_v2u_bad = opts.I_neighbor2local.bad; |
337 | 337 |
338 [e_u, d_u, gamm_u, H_b_u, I_u] = obj.get_boundary_ops(boundary); | 338 [e_u, d_u, gamm_u, H_b_u, I_u] = obj.get_boundary_ops(boundary); |
339 [e_v, d_v, gamm_v, H_b_v, I_v] = neighbour_scheme.get_boundary_ops(neighbour_boundary); | 339 [e_v, d_v, gamm_v, H_b_v, I_v] = neighbour_scheme.get_boundary_ops(neighbour_boundary); |
340 Hi = obj.Hi; | 340 Hi = obj.Hi; |
341 a = obj.a; | 341 a = obj.a; |