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