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

Last change on this file since 17610 was 17610, checked in by Mathieu Morlighem, 11 years ago

NEW: renamed onbed -> onbase

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