Index: /issm/trunk/src/m/classes/public/mesh/meshyams.m
===================================================================
--- /issm/trunk/src/m/classes/public/mesh/meshyams.m	(revision 2395)
+++ /issm/trunk/src/m/classes/public/mesh/meshyams.m	(revision 2396)
@@ -22,20 +22,33 @@
 
 %recover options
-yamsoptions=optionlist2cell(varargin{:});
-
-%add default options
-yamsoptions=process_mesh_options(yamsoptions);
+options=pairoptions(varargin{:});
+options=deleteduplicates(options,1);
+if ~exist(options,'domainoutline'),
+	error('meshyams error message: no ''domainoutline'' was provided');
+end
+if ~exist(options,'velocities'),
+	error('meshyams error message: no ''velocities'' was provided');
+end
 
 %recover some fields
 disp('MeshYams Options:')
-domainoutline=yamsoptions.domainoutline;   disp(sprintf('   %-15s: ''%s''','DomainOutline',domainoutline));
-groundeddomain=yamsoptions.groundeddomain; disp(sprintf('   %-15s: ''%s''','GroundedDomain',groundeddomain));
-velocities=yamsoptions.velocities;         disp(sprintf('   %-15s: ''%s''','Velocities',velocities));
-resolution=yamsoptions.resolution;         disp(sprintf('   %-15s: %f','Resolution',resolution));
-gradation=yamsoptions.gradation;
-nsteps=yamsoptions.nsteps;                 disp(sprintf('   %-15s: %i','nsteps',nsteps));
-epsilon=yamsoptions.epsilon;               disp(sprintf('   %-15s: %f','epsilon',epsilon));
-hmin=yamsoptions.hmin;                     disp(sprintf('   %-15s: %f','hmin',hmin));
-hmax=yamsoptions.hmax;                     disp(sprintf('   %-15s: %f\n','hmax',hmax));
+domainoutline=getfieldvalue(options,'domainoutline');
+disp(sprintf('   %-15s: ''%s''','DomainOutline',domainoutline));
+groundeddomain=getfieldvalue(options,'groundeddomain','N/A');
+disp(sprintf('   %-15s: ''%s''','GroundedDomain',groundeddomain));
+velocities=getfieldvalue(options,'velocities');
+disp(sprintf('   %-15s: ''%s''','Velocities',velocities));
+resolution=getfieldvalue(options,'resolution',5000);
+disp(sprintf('   %-15s: %f','Resolution',resolution));
+nsteps=getfieldvalue(options,'nsteps',6);
+disp(sprintf('   %-15s: %i','nsteps',nsteps));
+gradation=getfieldvalue(options,'gradation',2*ones(nsteps,1));
+disp(sprintf('   %-15s: %g','gradation',gradation(1)));
+epsilon=getfieldvalue(options,'epsilon',3);
+disp(sprintf('   %-15s: %f','epsilon',epsilon));
+hmin=getfieldvalue(options,'hmin',500);
+disp(sprintf('   %-15s: %f','hmin',hmin));
+hmax=getfieldvalue(options,'hmax',150*10^3);
+disp(sprintf('   %-15s: %f\n','hmax',hmax));
 
 %mesh with initial resolution
Index: sm/trunk/src/m/classes/public/mesh/process_mesh_options.m
===================================================================
--- /issm/trunk/src/m/classes/public/mesh/process_mesh_options.m	(revision 2395)
+++ 	(revision )
@@ -1,125 +1,0 @@
-function outoptions=process_mesh_options(options)
-%DEFAULT_MESH_OPTIONS - set up default options for mesh phase
-%
-%   Usage:
-%      options=process_mesh_options(options)
-%
-%   See also: MESH,MESHYAMS,RECOVER_OPTIONS
-
-%domainoutline: check on this option, error out otherwise
-found=0;
-for i=1:size(options,1),
-	if strcmpi(options{i,1},'domainoutline'),
-		if exist(options{i,2}),
-			domainoutline=options{i,2};
-			found=1;
-		else
-			error(['process_mesh_options error message: domain outline file ' options{i,2} ' not found!']);
-		end
-	end
-end
-if ~found,
-	error('process_mesh_options error message: no ''domainoutline'' was provided');
-end
-
-%velocities: check on this option, error out otherwise
-found=0;
-for i=1:size(options,1),
-	if strcmpi(options{i,1},'velocities'),
-		if exist(options{i,2}),
-			velocities=options{i,2};
-			found=1;
-		else
-			error(['process_mesh_options error message: velocities file ' options{i,2} ' not found!']);
-		end
-	end
-end
-if ~found,
-	error('process_mesh_options error message: no ''velocities'' was provided');
-end
-
-%groundeddomain: check on this option, error out otherwise
-found=0;
-for i=1:size(options,1),
-	if strcmpi(options{i,1},'groundeddomain'),
-		if exist(options{i,2}),
-			groundeddomain=options{i,2};
-			found=1;
-		else
-			error(['process_mesh_options error message: grounded domain file ' options{i,2} ' not found!']);
-		end
-	end
-end
-if ~found,
-	groundeddomain='N/A';
-end
-
-%nsteps
-found=0;
-for i=1:size(options,1),
-	if strcmpi(options{i,1},'nsteps'),
-		nsteps=options{i,2};
-		found=1;
-	end
-end
-if ~found, nsteps=6;end
-
-%resolution
-found=0;
-for i=1:size(options,1),
-	if strcmpi(options{i,1},'resolution'),
-		resolution=options{i,2};
-		found=1;
-	end
-end
-if ~found, resolution=5000;end
-
-%hmin
-found=0;
-for i=1:size(options,1),
-	if strcmpi(options{i,1},'hmin'),
-		hmin=options{i,2};
-		found=1;
-	end
-end
-if ~found, hmin=300;end
-
-%hmax
-found=0;
-for i=1:size(options,1),
-	if strcmpi(options{i,1},'hmax'),
-		hmax=options{i,2};
-		found=1;
-	end
-end
-if ~found, hmax=150*10^3;end
-
-%epsilon
-found=0;
-for i=1:size(options,1),
-	if strcmpi(options{i,1},'epsilon'),
-		epsilon=options{i,2};
-		found=1;
-	end
-end
-if ~found, epsilon=3;end
-
-%gradation
-found=0;
-for i=1:size(options,1),
-	if strcmpi(options{i,1},'gradation'),
-		gradation=options{i,2};
-		found=1;
-	end
-end
-if ~found, 
-	gradation=[1.5*ones(2,1);3*ones(nsteps,1)];
-	gradation(nsteps+1:end)=[];
-end
-
-if length(gradation)~=nsteps
-	error(['process_mesh_options error message: gradation should have the same length as nsteps (' num2str(nsteps) ')']);
-end
-
-%output options
-outoptions=struct('domainoutline',domainoutline,'velocities',velocities,'groundeddomain',groundeddomain,'nsteps',nsteps,'resolution',resolution,'hmin',hmin,'hmax',hmax,'epsilon',epsilon,'gradation',gradation);
Index: sm/trunk/src/m/classes/public/mesh/recover_mesh_options.m
===================================================================
--- /issm/trunk/src/m/classes/public/mesh/recover_mesh_options.m	(revision 2395)
+++ 	(revision )
@@ -1,22 +1,0 @@
-function options=recover_mesh_options(md,varargin)
-%RECOVER_mesh_OPTIONS - recover solution options
-%
-%   Usage:
-%      options=recover_mesh_options(md,varargin);
-%
-%   See also: mesh
-
-%initialize options.
-options=cell(0,2);
-
-%make sure length(varargin) is even, ie options come in pairs.
-if mod(length(varargin),2),
-	error('recover_mesh_options error message: an even number of options is necessary');
-end
-
-%go through varargin, extract options 
-for i=1:length(varargin)/2,
-
-	options(end+1,:)={varargin{2*i-1} varargin{2*i}};
-
-end
