[9640] | 1 | function 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
|
---|
| 17 | if ((nargin~=3) | (nargout~=1)),
|
---|
[9640] | 18 | help mask
|
---|
| 19 | error('mask error message');
|
---|
[1] | 20 | end
|
---|
| 21 |
|
---|
| 22 | %Get assigned fields
|
---|
[9734] | 23 | x=md.mesh.x;
|
---|
| 24 | y=md.mesh.y;
|
---|
[9733] | 25 | elements=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] | 28 | elementonfloatingice=FlagElements(md,floatingicename);
|
---|
| 29 | elementongroundedice=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] | 33 | elementonfloatingice=double((elementonfloatingice & ~elementongroundedice));
|
---|
| 34 | elementongroundedice=double(~elementonfloatingice);
|
---|
[7314] | 35 |
|
---|
[9640] | 36 | %the order here is important. we choose vertexongroundedice as default on the grounding line.
|
---|
[9725] | 37 | vertexonfloatingice=zeros(md.mesh.numberofvertices,1);
|
---|
| 38 | vertexongroundedice=zeros(md.mesh.numberofvertices,1);
|
---|
[9733] | 39 | vertexongroundedice(md.mesh.elements(find(elementongroundedice),:))=1;
|
---|
[9640] | 40 | vertexonfloatingice(find(~vertexongroundedice))=1;
|
---|
[7314] | 41 | %}}}
|
---|
| 42 |
|
---|
[1] | 43 | %Return:
|
---|
[9640] | 44 | md.mask.elementonfloatingice=elementonfloatingice;
|
---|
| 45 | md.mask.vertexonfloatingice=vertexonfloatingice;
|
---|
| 46 | md.mask.elementongroundedice=elementongroundedice;
|
---|
| 47 | md.mask.vertexongroundedice=vertexongroundedice;
|
---|
[9725] | 48 | md.mask.vertexonwater=zeros(md.mesh.numberofvertices,1);
|
---|
| 49 | md.mask.elementonwater=zeros(md.mesh.numberofelements,1);
|
---|
[15595] | 50 | md.mask.icelevelset=ones(md.mesh.numberofvertices,1);
|
---|