BuildAdaptedMesh

PURPOSE ^

BUILDADAPTEDMESH - Build model of Antarctica by refining according to observed velocity error estimator

SYNOPSIS ^

function md=BuildAdaptedMesh

DESCRIPTION ^

BUILDADAPTEDMESH - Build model of Antarctica by refining according to observed velocity error estimator

   Usage:
      md=BuildAdaptedMesh

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function md=BuildAdaptedMesh
0002 %BUILDADAPTEDMESH - Build model of Antarctica by refining according to observed velocity error estimator
0003 %
0004 %   Usage:
0005 %      md=BuildAdaptedMesh
0006 
0007 nsteps=1;
0008 resolution=50000;
0009 scaling=1.2;
0010 epsilon=.5;
0011 
0012 velpath='/proj/ice/larour/Glaciology/Model_Data/RignotAntarcticaVel1km/RignotAntVel';
0013 %velpath='/proj/ice/larour/Glaciology/Model_Data/BamberAntarcticaVel1km/velocity';
0014 %velpath='/proj/ice/larour/Glaciology/Model_Data/mosaicAnt1km_ramp_ers_alos/RignotAntVel';
0015 
0016 domainoutline='DomainOutline.exp';
0017 groundingline='GroundingLine.exp';
0018 icestreams='Icestream.exp';
0019 parameterfile='Basins.par';
0020 
0021 %clear data
0022 clear md
0023 
0024 %build new model
0025 md=model;
0026 
0027 %mesh with initial resolution
0028 md=mesh(md,domainoutline,resolution);
0029 disp(['First mesh, number of elements: ' num2str(md.numberofelements)]);
0030 
0031 %load velocities
0032 eval(['load ' velpath]);
0033 
0034 %start mesh adaptation
0035 for i=1:nsteps,
0036     disp(['Iteration #' num2str(i) '/' num2str(nsteps)]);
0037 
0038     %interpolate velocities onto mesh
0039     disp('   interpolating velocities');
0040     md.vx_obs=DataInterp(x_m,y_m,vx*md.yts,md.x,md.y);
0041     md.vy_obs=DataInterp(x_m,y_m,vy*md.yts,md.x,md.y);
0042     md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
0043 
0044     %adapt according to velocities
0045     disp('   adapting');
0046     md=meshadaptation(md,md.vel_obs,scaling,epsilon);
0047 end
0048     
0049 disp(['Final mesh, number of elements: ' num2str(md.numberofelements)]);
0050 
0051 md.vx_obs=DataInterp(x_m,y_m,vx*md.yts,md.x,md.y);
0052 md.vy_obs=DataInterp(x_m,y_m,vy*md.yts,md.x,md.y);
0053 md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
0054 return;
0055 
0056 %parameterize model
0057 disp('Parameterizing');
0058 md=geography(md,groundingline,icestreams);
0059 md=parameterize(md,parameterfile);
0060 
0061 %md.vx_obs=DataInterp(x_m,y_m,vx*md.yts,md.x,md.y);
0062 %md.vy_obs=DataInterp(x_m,y_m,vy*md.yts,md.x,md.y);
0063 %md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
0064 %return;

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003