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

Last change on this file since 17848 was 17848, checked in by seroussi, 11 years ago

CHG: trying to reduce weekly runs

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