source: issm/trunk-jpl/test/NightlyRun/test1102.m@ 21056

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

CHG: do not request solution in solution string

File size: 5.7 KB
RevLine 
[19049]1%Test Name: ISMIPAFS
[14134]2%This test is a test from the ISMP-HOM Intercomparison project.
[5049]3%Pattyn and Payne 2006
[5606]4printingflag=false;
[5049]5
[17848]6%L_list={5000.,10000.,20000.,40000.,80000.,160000.};
7L_list={80000.};
[5049]8results={};
[5606]9minvx=[];
10maxvx=[];
[5049]11
12for i=1:length(L_list),
13 L=L_list{i};
14 nx=20; %numberof nodes in x direction
15 ny=20;
[13663]16 md=model();
[5049]17 md=squaremesh(md,L,L,nx,ny);
[9641]18 md=setmask(md,'',''); %ice sheet test
[5606]19
20% %Find elements at the corner and extract model
[14134]21% posnodes=find((md.mesh.x==0. | md.mesh.x==max(md.mesh.x)) & (md.mesh.y==0. | md.mesh.y==max(md.mesh.y)));
[9733]22% [a,b]=find(ismember(md.mesh.elements,posnodes));
[9725]23% elements=ones(md.mesh.numberofelements,1);
[5606]24% elements(a)=0;
25% md=modelextract(md,elements);
26
[5049]27 md=parameterize(md,'../Par/ISMIPA.par');
[13671]28 md=extrude(md,10,1.);
[15565]29 md=setflowequation(md,'FS','all');
[5049]30
31 %Create dirichlet on the bed only
[17610]32 pos=find(md.mesh.vertexonbase);
[15771]33 md.stressbalance.spcvx(pos)=0.;
34 md.stressbalance.spcvy(pos)=0.;
35 md.stressbalance.spcvz(pos)=0.;
[5049]36
[14134]37% %Create MPCs to have periodic boundary conditions
38% posx=find(md.mesh.x==0.);
39% posx2=find(md.mesh.x==max(md.mesh.x));
[17610]40% posx=find(md.mesh.x==0. & md.mesh.y~=0. & md.mesh.y~=max(md.mesh.y) & ~md.mesh.vertexonbase);
41% posx2=find(md.mesh.x==max(md.mesh.x) & md.mesh.y~=0. & md.mesh.y~=max(md.mesh.y) & ~md.mesh.vertexonbase);
[5049]42
[17610]43% posy=find(md.mesh.y==0. & md.mesh.x~=0. & md.mesh.x~=max(md.mesh.x) & ~md.mesh.vertexonbase); %Don't take the same nodes two times
44% posy2=find(md.mesh.y==max(md.mesh.y) & md.mesh.x~=0. & md.mesh.x~=max(md.mesh.x) & ~md.mesh.vertexonbase);
[5049]45
[15771]46% md.stressbalance.vertex_pairing=[posx,posx2;posy,posy2];
[5049]47
[15771]48 %Compute the stressbalance
49 md.stressbalance.abstol=NaN;
50 md.stressbalance.reltol=NaN;
51 md.stressbalance.restol=1.;
[8630]52 md.cluster=generic('name',oshostname(),'np',8);
[21056]53 md=solve(md,'Stressbalance');
[5049]54
55 %Plot the results and save them
[15771]56 vx=(md.results.StressbalanceSolution.Vx);
57 vy=(md.results.StressbalanceSolution.Vy);
58 vz=(md.results.StressbalanceSolution.Vz);
59 pressure=(md.results.StressbalanceSolution.Pressure);
60 results{i}=md.results.StressbalanceSolution;
[9725]61 minvx(i)=min(vx(end-md.mesh.numberofvertices2d+1:end));
62 maxvx(i)=max(vx(end-md.mesh.numberofvertices2d+1:end));
[5049]63
[5606]64 %Now plot vx, vy, vz and vx on a cross section
[9725]65 plotmodel(md,'data',vx,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km','figure',2)
[14134]66 if printingflag,
[5606]67 set(gcf,'Color','w')
[15565]68 printmodel(['ismipaFSvx' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
69 system(['mv ismipaFSvx' num2str(L) '.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestA']);
[5606]70 end
[9725]71 plotmodel(md,'data',vy,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km','figure',3)
[14134]72 if printingflag,
[5606]73 set(gcf,'Color','w')
[15565]74 printmodel(['ismipaFSvy' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
75 system(['mv ismipaFSvy' num2str(L) '.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestA']);
[5606]76 end
[9725]77 plotmodel(md,'data',vz,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km','figure',4)
[14134]78 if printingflag,
[5606]79 set(gcf,'Color','w')
[15565]80 printmodel(['ismipaFSvz' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
81 system(['mv ismipaFSvz' num2str(L) '.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestA']);
[5606]82 end
[5049]83
[14134]84 if(L==5000.),
[9725]85 plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP5000.exp','layer',md.mesh.numberoflayers,...
[5606]86 'resolution',[10 10],'ylim',[10 18],'xlim',[0 5000],'title','','xlabel','')
[14134]87 elseif(L==10000.),
[9725]88 plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP10000.exp','layer',md.mesh.numberoflayers,...
[5606]89 'resolution',[10 10],'ylim',[10 30],'xlim',[0 10000],'title','','xlabel','')
[14134]90 elseif(L==20000.),
[9725]91 plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP20000.exp','layer',md.mesh.numberoflayers,...
[5606]92 'resolution',[10 10],'ylim',[0 50],'xlim',[0 20000],'title','','xlabel','')
[14134]93 elseif(L==40000.),
[9725]94 plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP40000.exp','layer',md.mesh.numberoflayers,...
[5606]95 'resolution',[10 10],'ylim',[0 80],'xlim',[0 40000],'title','','xlabel','')
[14134]96 elseif(L==80000.),
[9725]97 plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP80000.exp','layer',md.mesh.numberoflayers,...
[5606]98 'resolution',[10 10],'ylim',[0 100],'xlim',[0 80000],'title','','xlabel','')
[14134]99 elseif(L==160000.),
[9725]100 plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP160000.exp','layer',md.mesh.numberoflayers,...
[5606]101 'resolution',[10 10],'ylim',[0 120],'xlim',[0 160000],'title','','xlabel','')
102 end
[14134]103 if printingflag,
[5606]104 set(gcf,'Color','w')
[15565]105 printmodel(['ismipaFSvxsec' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
106 system(['mv ismipaFSvxsec' num2str(L) '.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestA']);
[5606]107 end
[5049]108end
[5098]109
[5606]110%Now plot the min and max values of vx for each size of the square
111plot([5 10 20 40 80 160],minvx);ylim([0 18])
[14134]112if printingflag,
[5606]113 set(gcf,'Color','w')
[15565]114 printmodel('ismipaFSminvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
115 system(['mv ismipaFSminvx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestA']);
[5606]116end
117plot([5 10 20 40 80 160],maxvx);ylim([0 120])
[14134]118if printingflag,
[5606]119 set(gcf,'Color','w')
[15565]120 printmodel('ismipaFSmaxvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
121 system(['mv ismipaFSmaxvx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestA']);
[5606]122end
[14134]123
[5098]124%Fields and tolerances to track changes
125field_names ={...
[17848]126 'Vx80km','Vy80km','Vz80km'
[14134]127};
[5098]128field_tolerances={...
[8384]129 1e-12,1e-11,1e-12,...
[5098]130};
131field_values={};
[17848]132for i=1:1,
[5098]133 result=results{i};
134 field_values={field_values{:},...
[10976]135 (result.Vx),...
136 (result.Vy),...
137 (result.Vz),...
[5098]138 };
139end
Note: See TracBrowser for help on using the repository browser.