source: issm/trunk/src/m/contrib/morlighem/massbalance/outflow.m@ 20500

Last change on this file since 20500 was 20500, checked in by Mathieu Morlighem, 9 years ago

merged trunk-jpl and trunk for revision 20497

File size: 436 bytes
Line 
1function flag=outflow(md)
2%OUTFLOW - flag nodes on outflux boundary
3%
4% Usage:
5% flag=outflow(md);
6
7A=md.mesh.segments(:,1);
8B=md.mesh.segments(:,2);
9Nx=-(md.mesh.y(A)-md.mesh.y(B));
10Ny= md.mesh.x(A)-md.mesh.x(B);
11Vx=(md.initialization.vx(A)+md.initialization.vx(B))/2;
12Vy=(md.initialization.vy(A)+md.initialization.vy(B))/2;
13
14%dot product
15VdotN=Vx.*Nx+Vy.*Ny;
16
17flag=zeros(md.mesh.numberofvertices,1);
18flag(A(find(VdotN>0)))=1;
Note: See TracBrowser for help on using the repository browser.