comparison +scheme/LaplaceCurvilinear.m @ 1045:dc1bcbef2a86 feature/getBoundaryOp

Remove ability to get several boundary ops at the same time from a few of the schemes While it can be handy the code for the getBoundaryOp methods get needlessly cluttered
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 22 Jan 2019 17:12:22 +0100
parents 8d73fcdb07a5
children 19ed046aec52
comparison
equal deleted inserted replaced
1044:5afc774fb7c4 1045:dc1bcbef2a86
343 tuning = type.tuning; 343 tuning = type.tuning;
344 344
345 345
346 % u denotes the solution in the own domain 346 % u denotes the solution in the own domain
347 % v denotes the solution in the neighbour domain 347 % v denotes the solution in the neighbour domain
348 [e_u, d_u] = obj.getBoundaryOperator({'e', 'd'}, boundary); 348 e_u = obj.getBoundaryOperator('e', boundary);
349 H_b_u = obj.getBoundaryQuadrature(boundary); 349 d_u = obj.getBoundaryOperator('d', boundary);
350 I_u = obj.getBoundaryIndices(boundary); 350 H_b_u = obj.getBoundaryQuadrature(boundary);
351 I_u = obj.getBoundaryIndices(boundary);
351 gamm_u = obj.getBoundaryBorrowing(boundary); 352 gamm_u = obj.getBoundaryBorrowing(boundary);
352 353
353 [e_v, d_v] = neighbour_scheme.getBoundaryOperator({'e', 'd'}, neighbour_boundary); 354 e_v = neighbour_scheme.getBoundaryOperator('e', neighbour_boundary);
354 H_b_v = neighbour_scheme.getBoundaryQuadrature(neighbour_boundary); 355 d_v = neighbour_scheme.getBoundaryOperator('d', neighbour_boundary);
355 I_v = neighbour_scheme.getBoundaryIndices(neighbour_boundary); 356 H_b_v = neighbour_scheme.getBoundaryQuadrature(neighbour_boundary);
357 I_v = neighbour_scheme.getBoundaryIndices(neighbour_boundary);
356 gamm_v = neighbour_scheme.getBoundaryBorrowing(neighbour_boundary); 358 gamm_v = neighbour_scheme.getBoundaryBorrowing(neighbour_boundary);
357 359
358 360
359 % Find the number of grid points along the interface 361 % Find the number of grid points along the interface
360 m_u = size(e_u, 2); 362 m_u = size(e_u, 2);
394 -a*1/2*Hi*e_u*H_b_u*Iv2u.bad*d_v'; 396 -a*1/2*Hi*e_u*H_b_u*Iv2u.bad*d_v';
395 397
396 end 398 end
397 399
398 % Returns the boundary operator op for the boundary specified by the string boundary. 400 % Returns the boundary operator op for the boundary specified by the string boundary.
399 % op -- string or a cell array of strings 401 % op -- string
400 % boundary -- string 402 % boundary -- string
401 function varargout = getBoundaryOperator(obj, op, boundary) 403 function o = getBoundaryOperator(obj, op, boundary)
402 assertIsMember(boundary, {'w', 'e', 's', 'n'}) 404 assertIsMember(boundary, {'w', 'e', 's', 'n'})
403 405
404 if ~iscell(op) 406 switch op
405 op = {op};
406 end
407
408 for i = 1:numel(op)
409 switch op{i}
410 case 'e' 407 case 'e'
411 switch boundary 408 switch boundary
412 case 'w' 409 case 'w'
413 e = obj.e_w; 410 e = obj.e_w;
414 case 'e' 411 case 'e'
416 case 's' 413 case 's'
417 e = obj.e_s; 414 e = obj.e_s;
418 case 'n' 415 case 'n'
419 e = obj.e_n; 416 e = obj.e_n;
420 end 417 end
421 varargout{i} = e; 418 o = e;
422 419
423 case 'd' 420 case 'd'
424 switch boundary 421 switch boundary
425 case 'w' 422 case 'w'
426 d = obj.d_w; 423 d = obj.d_w;
429 case 's' 426 case 's'
430 d = obj.d_s; 427 d = obj.d_s;
431 case 'n' 428 case 'n'
432 d = obj.d_n; 429 d = obj.d_n;
433 end 430 end
434 varargout{i} = d; 431 o = d;
435 end
436 end 432 end
437 end 433 end
438 434
439 % Returns square boundary quadrature matrix, of dimension 435 % Returns square boundary quadrature matrix, of dimension
440 % corresponding to the number of boundary points 436 % corresponding to the number of boundary points