Changeset 19860 for issm/trunk-jpl/src/m/classes/mask.m
- Timestamp:
- 12/05/15 22:58:08 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/mask.m
r19607 r19860 46 46 47 47 md = checkfield(md,'fieldname','mask.groundedice_levelset','size',[md.mesh.numberofvertices 1]); 48 md = checkfield(md,'fieldname','mask.ice_levelset' ,'size',[md.mesh.numberofvertices 1]);48 md = checkfield(md,'fieldname','mask.ice_levelset','forcing',1); 49 49 isice=(md.mask.ice_levelset<=0); 50 50 if sum(isice)==0, … … 56 56 icefront=sum(md.mask.ice_levelset(md.mesh.elements)==0,2); 57 57 if (max(icefront)==3 & strcmp(elementtype(md.mesh),'Tria')) | (max(icefront==6) & strcmp(elementtype(md.mesh),'Penta')), 58 if strcmp(elementtype(md.mesh),'Tria'), 59 numberemptyelements=length(find(icefront==3)); 60 elseif strcmp(elementtype(md.mesh),'Penta') 61 numberemptyelements=length(find(icefront==6)); 62 end 63 error([' ' num2str(numberemptyelements) ' have all nodes on ice front, change md.mask.ice_levelset to fix it']) 58 error('At least one element has all nodes on ice front, change md.mask.ice_levelset to fix it') 64 59 end 65 60 end % }}} … … 72 67 function marshall(self,md,fid) % {{{ 73 68 WriteData(fid,'object',self,'fieldname','groundedice_levelset','format','DoubleMat','mattype',1); 74 WriteData(fid,'object',self,'fieldname','ice_levelset','format','DoubleMat','mattype',1 );69 WriteData(fid,'object',self,'fieldname','ice_levelset','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1); 75 70 76 71 % get mask of vertices of elements with ice 77 isice=md.mask.ice_levelset<=0.; 78 vlist = zeros(md.mesh.numberofvertices,1); 79 if md.mesh.numberofelements==1, 80 pos=find(sum(isice(md.mesh.elements),1)>0); 72 if size(md.mask.ice_levelset,1)==md.mesh.numberofvertices, 73 isice=md.mask.ice_levelset<=0.; 74 vlist = zeros(md.mesh.numberofvertices,1); 75 pos=find(sum(isice(md.mesh.elements),2)>0); 76 vlist(md.mesh.elements(pos,:))=1; 77 WriteData(fid,'data',vlist,'enum',IceMaskNodeActivationEnum(),'format','DoubleMat','mattype',1); 81 78 else 79 isice=md.mask.ice_levelset(1:end-1,1)<=0.; 80 vlist = zeros(md.mesh.numberofvertices,1); 82 81 pos=find(sum(isice(md.mesh.elements),2)>0); 82 vlist(md.mesh.elements(pos,:))=1; 83 WriteData(fid,'data',vlist,'enum',IceMaskNodeActivationEnum(),'format','DoubleMat','mattype',1); 84 save temp vlist; 83 85 end 84 vlist(md.mesh.elements(pos,:))=1;85 WriteData(fid,'data',vlist,'enum',IceMaskNodeActivationEnum(),'format','DoubleMat','mattype',1);86 86 87 87 end % }}}
Note:
See TracChangeset
for help on using the changeset viewer.