comparison +scheme/Elastic2dVariable.m @ 1058:84933722ec0e feature/poroelastic

Remove superfluous method get_boundary_number in Elastic2dVariable
author Martin Almquist <malmquist@stanford.edu>
date Fri, 25 Jan 2019 16:35:53 -0800
parents ff274c7404cc
children d8ab528f10f6
comparison
equal deleted inserted replaced
1057:ff274c7404cc 1058:84933722ec0e
358 type = bc{2}; 358 type = bc{2};
359 if ischar(comp) 359 if ischar(comp)
360 comp = obj.getComponent(comp, boundary); 360 comp = obj.getComponent(comp, boundary);
361 end 361 end
362 362
363 % j is the coordinate direction of the boundary
364 j = obj.get_boundary_number(boundary);
365 e = obj.getBoundaryOperator('e', boundary); 363 e = obj.getBoundaryOperator('e', boundary);
366 T = obj.getBoundaryOperator('T', boundary); 364 T = obj.getBoundaryOperator('T', boundary);
367 tau = obj.getBoundaryOperator('tau', boundary); 365 tau = obj.getBoundaryOperator('tau', boundary);
368 H_gamma = obj.getBoundaryOperator('H', boundary); 366 H_gamma = obj.getBoundaryOperator('H', boundary);
369 367
375 373
376 dim = obj.dim; 374 dim = obj.dim;
377 m_tot = obj.grid.N(); 375 m_tot = obj.grid.N();
378 376
379 % Preallocate 377 % Preallocate
378 [~, col] = size(tau{comp});
380 closure = sparse(dim*m_tot, dim*m_tot); 379 closure = sparse(dim*m_tot, dim*m_tot);
381 penalty = sparse(dim*m_tot, m_tot/obj.m(j)); 380 penalty = sparse(dim*m_tot, col);
382 381
383 k = comp; 382 k = comp;
384 switch type 383 switch type
385 384
386 % Dirichlet boundary condition 385 % Dirichlet boundary condition
463 462
464 end 463 end
465 464
466 function [closure, penalty] = interfaceNonConforming(obj,boundary,neighbour_scheme,neighbour_boundary,type) 465 function [closure, penalty] = interfaceNonConforming(obj,boundary,neighbour_scheme,neighbour_boundary,type)
467 error('Non-conforming interfaces not implemented yet.'); 466 error('Non-conforming interfaces not implemented yet.');
468 end
469
470 % Returns the coordinate number and outward normal component for the boundary specified by the string boundary.
471 function [j, nj] = get_boundary_number(obj, boundary)
472
473 switch boundary
474 case {'w','W','west','West', 'e', 'E', 'east', 'East'}
475 j = 1;
476 case {'s','S','south','South', 'n', 'N', 'north', 'North'}
477 j = 2;
478 otherwise
479 error('No such boundary: boundary = %s',boundary);
480 end
481
482 switch boundary
483 case {'w','W','west','West','s','S','south','South'}
484 nj = -1;
485 case {'e', 'E', 'east', 'East','n', 'N', 'north', 'North'}
486 nj = 1;
487 end
488 end 467 end
489 468
490 % Returns the component number that is the tangential/normal component 469 % Returns the component number that is the tangential/normal component
491 % at the specified boundary 470 % at the specified boundary
492 function comp = getComponent(obj, comp_str, boundary) 471 function comp = getComponent(obj, comp_str, boundary)