source: issm/trunk-jpl/examples/IceflowModels/eismint.m@ 21153

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

CHG: minor fixing syntax

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1md=model();
2
3%Create mesh with roundmesh
4md=roundmesh(md,750000,30000);
5
6%Set mask
7md=setmask(md,'','');
8
9%Parameterize model
10md=parameterize(md,'EISMINT.par');
11
12%We extrude the model to have a 3d model
13md=extrude(md,10,1.);
14
15%Set ice flow approximation
16md=setflowequation(md,'SIA','all');
17
18%Create boundary conditions: zero velocity on the bed
19pos=find(md.mesh.vertexonbase);
20md.stressbalance.spcvx(pos)=0;
21md.stressbalance.spcvy(pos)=0;
22md.stressbalance.spcvz(pos)=0;
23
24%Go Solve
25md.cluster=generic('np',2);
26md.verbose.convergence=1;
27md=solve(md,'Stressbalance');
28vel=DepthAverage(md,sqrt(md.results.StressbalanceSolution.Vx.^2+md.results.StressbalanceSolution.Vy.^2));
29
30%Calculate analytical velocity
31constant=0.3;
32vx_obs=constant/2*md.mesh.x.*(md.geometry.thickness).^-1;
33vy_obs=constant/2*md.mesh.y.*(md.geometry.thickness).^-1;
34vel_obs=sqrt(vx_obs.^2+vy_obs.^2);
35vel_obs=project2d(md,vel_obs,1);
36
37plotmodel(md,...
38 'data',vel ,'view',2,'caxis',[0 200],'title','Modelled velocity',...
39 'data',vel_obs,'view',2,'caxis',[0 200],'title','Analytical velocity',...
40 'data',abs(vel-vel_obs)./(vel_obs+eps)*100,'caxis',[0 30],'view',2,'title','Relative misfit (%)');
41
42subplot(2,2,4)
43hold on;
44plot(sqrt((md.mesh.x2d).^2+(md.mesh.y2d).^2),vel,'r.');
45plot(sqrt((md.mesh.x2d).^2+(md.mesh.y2d).^2),vel_obs,'b.');
46title('Analytical vs calculated velocity');
47xlabel('distance to the center of the ice sheet (m)');
48ylabel('velocity (m/yr)');
49legend('calculated velocity','exact velocity');
50axis([0 750000 0 200]);
51hold off;
Note: See TracBrowser for help on using the repository browser.