source: issm/trunk-jpl/src/m/parameterization/setmask.m@ 15749

Last change on this file since 15749 was 15749, checked in by Mathieu Morlighem, 12 years ago

CHG: removing elements and vertices on water, which is now included in icelevelset

File size: 2.0 KB
Line 
1function md=setmask(md,floatingicename,groundedicename)
2%SETMASK - establish boundaries between grounded and floating ice.
3%
4% By default, ice is considered grounded. The contour floatingicename defines nodes
5% for which ice is floating. The contour groundedicename defines nodes inside an floatingice,
6% that are grounded (ie: ice rises, islands, etc ...)
7% All input files are in the Argus format (extension .exp).
8%
9% Usage:
10% md=setmask(md,floatingicename,groundedicename)
11%
12% Examples:
13% md=setmask(md,'all','');
14% md=setmask(md,'Iceshelves.exp','Islands.exp');
15
16%some checks on list of arguments
17if ((nargin~=3) | (nargout~=1)),
18 help mask
19 error('mask error message');
20end
21
22%Get assigned fields
23x=md.mesh.x;
24y=md.mesh.y;
25elements=md.mesh.elements;
26
27%Assign elementonfloatingice, elementongroundedice, vertexongroundedice and vertexonfloatingice. Only change at your own peril! This is synchronized heavily with the GroundingLineMigration module. {{{
28elementonfloatingice=FlagElements(md,floatingicename);
29elementongroundedice=FlagElements(md,groundedicename);
30
31%Because groundedice nodes and elements can be included into an floatingice, we need to update. Remember, all the previous
32%arrays come from domain outlines that can intersect one another:
33elementonfloatingice=double((elementonfloatingice & ~elementongroundedice));
34elementongroundedice=double(~elementonfloatingice);
35
36%the order here is important. we choose vertexongroundedice as default on the grounding line.
37vertexonfloatingice=zeros(md.mesh.numberofvertices,1);
38vertexongroundedice=zeros(md.mesh.numberofvertices,1);
39vertexongroundedice(md.mesh.elements(find(elementongroundedice),:))=1;
40vertexonfloatingice(find(~vertexongroundedice))=1;
41%}}}
42
43%Return:
44md.mask.elementonfloatingice=elementonfloatingice;
45md.mask.vertexonfloatingice=vertexonfloatingice;
46md.mask.elementongroundedice=elementongroundedice;
47md.mask.vertexongroundedice=vertexongroundedice;
48md.mask.icelevelset=ones(md.mesh.numberofvertices,1);
Note: See TracBrowser for help on using the repository browser.