time | calls | line |
---|
| | 1 | function [Masku, Maskv] = maskuv(Mask)
|
| | 2 | % [Masku Maskv] = maskuv(Mask)
|
| | 3 | % This function creates the u and v masks for a staggered grid
|
| | 4 | %
|
| | 5 | % INPUTS:
|
| | 6 | % Mask: The tracer mask matrix (also the Pressure mask matrix)
|
| | 7 | % Different boundary conditions are marked with positive
|
| | 8 | % integers, and interior points have to be zero.
|
| | 9 | % e.g. Mask = zeros(5,5);Mask(3,3)=1;Mask(2,4)=2;
|
| | 10 | % Created 2 different boundaries.
|
| | 11 | % NOTE: Masks will require some fixing if two different boundaries
|
| | 12 | % are specified next to each other.
|
| | 13 | % OUTPUTS:
|
| | 14 | % Masku: Mask matrix for the u velocity
|
| | 15 | % Maskv: Mask matrix for the v velocity
|
| | 16 | %
|
| | 17 | % Written by: Matt Ueckermann for MIT course 2.29
|
| | 18 |
|
< 0.01 | 1 | 19 | Masku = max(Mask(:,1:end-1), Mask(:,2:end));
|
| 1 | 20 | Maskv = max(Mask(1:end-1,:), Mask(2:end,:));
|