Index: /issm/trunk/src/m/classes/@model/model.m
===================================================================
--- /issm/trunk/src/m/classes/@model/model.m	(revision 3993)
+++ /issm/trunk/src/m/classes/@model/model.m	(revision 3994)
@@ -23,5 +23,5 @@
 	%Mesh
 	md.bamg=NaN;
-	md.type='';
+	md.dim=0;
 	md.numberofelements=0;
 	md.numberofgrids=0;
Index: /issm/trunk/src/m/classes/public/DepthAverage.m
===================================================================
--- /issm/trunk/src/m/classes/public/DepthAverage.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/DepthAverage.m	(revision 3994)
@@ -9,5 +9,5 @@
 
 %check that the model given in input is 3d
-if ~strcmpi(md.type,'3d');
+if ~md.dim==3;
 	error('DepthAverage error message: the model given in input must be 3d')
 end
Index: /issm/trunk/src/m/classes/public/PropagateFlagsUntilDistance.m
===================================================================
--- /issm/trunk/src/m/classes/public/PropagateFlagsUntilDistance.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/PropagateFlagsUntilDistance.m	(revision 3994)
@@ -12,5 +12,5 @@
 
 %make 3d work in 2d: 
-if strcmpi(md.type,'3d'),
+if md.dim==3,
 	md.x=md.x2d;
 	md.y=md.y2d;
Index: /issm/trunk/src/m/classes/public/SectionValues.m
===================================================================
--- /issm/trunk/src/m/classes/public/SectionValues.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/SectionValues.m	(revision 3994)
@@ -30,5 +30,5 @@
 	error('SectionValues error message: wrong resolution type. Resolution must be an array [horizontal_resolution vertical_resolution]')
 end
-if strcmpi(md.type,'3d')
+if md.dim==3
 	if (length(resolution)==2 & isnumeric(resolution(2)))
 		res_v=resolution(2);
@@ -79,5 +79,5 @@
 
 %New mesh and Data interpolation
-if strcmpi(md.type,'2d')
+if (md.dim==2)
 
 	%Interpolation of data on specified points
Index: /issm/trunk/src/m/classes/public/averaging.m
===================================================================
--- /issm/trunk/src/m/classes/public/averaging.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/averaging.m	(revision 3994)
@@ -31,5 +31,5 @@
 %build some variables
 line=index(:);
-if strcmpi(md.type,'3d')
+if md.dim==3
 	rep=6;
 	areas=GetAreas(index,md.x,md.y,md.z);
Index: /issm/trunk/src/m/classes/public/balvel.m
===================================================================
--- /issm/trunk/src/m/classes/public/balvel.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/balvel.m	(revision 3994)
@@ -8,5 +8,5 @@
 %      [velx,vely,vel]=balvel(md)
 
-if ~strcmpi(md.type,'2d'),
+if md.dim~=2,
 	error('Only 2d meshes are allowed to compute velocity balances');
 end
Index: /issm/trunk/src/m/classes/public/bamg.m
===================================================================
--- /issm/trunk/src/m/classes/public/bamg.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/bamg.m	(revision 3994)
@@ -247,5 +247,5 @@
 
 % Bamg Mesh parameters {{{1
-if (~exist(options,'domain') & md.numberofgrids~=0 & strcmpi(md.type,'2d')),
+if (~exist(options,'domain') & md.numberofgrids~=0 & md.dim==2),
 
 	if isstruct(md.bamg),
@@ -313,5 +313,5 @@
 
 %Fill in rest of fields:
-md.type='2d';
+md.dim=2;
 md.numberofelements=size(md.elements,1);
 md.numberofgrids=length(md.x);
Index: /issm/trunk/src/m/classes/public/collapse.m
===================================================================
--- /issm/trunk/src/m/classes/public/collapse.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/collapse.m	(revision 3994)
@@ -12,5 +12,5 @@
 
 %Check that the model is really a 3d model
-if ~strcmpi(md.type,'3d'),
+if ~md.dim==3,
 	error('collapse error message: only 3d mesh can be collapsed')
 end
@@ -118,3 +118,3 @@
 
 %Update mesh type
-md.type='2d';
+md.dim=2;
Index: /issm/trunk/src/m/classes/public/display/displaymesh.m
===================================================================
--- /issm/trunk/src/m/classes/public/display/displaymesh.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/display/displaymesh.m	(revision 3994)
@@ -11,5 +11,5 @@
 disp(sprintf('   Mesh:')); 
 
-if strcmpi(md.type,'3d'),
+if md.dim==3,
 
 	disp(sprintf('\n      Elements and nodes of the original 2d mesh:'));
Index: /issm/trunk/src/m/classes/public/extrude.m
===================================================================
--- /issm/trunk/src/m/classes/public/extrude.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/extrude.m	(revision 3994)
@@ -123,5 +123,5 @@
 
 %Update mesh type
-md.type='3d';
+md.dim=3;
 
 %Build global 3d mesh 
Index: /issm/trunk/src/m/classes/public/ismodelselfconsistent.m
===================================================================
--- /issm/trunk/src/m/classes/public/ismodelselfconsistent.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/ismodelselfconsistent.m	(revision 3994)
@@ -23,5 +23,5 @@
 
 	%recursive call to ismodelselfconsistent
-	if strcmpi(md.type,'2d'),
+	if (md.dim==2),
 		analysis=[DiagnosticAnalysisEnum PrognosticAnalysisEnum];
 	else
@@ -58,5 +58,5 @@
 	error(['model not consistent: types of elements have not been set properly, run setelementstype first'])
 end
-if strcmpi(md.type,'2d'),
+if (md.dim==2),
 	if (ismember(PattynFormulationEnum,md.elements_type(:,1)) |  ismember(StokesFormulationEnum,md.elements_type(:,2))),
 		error(['model not consistent: for a 2d model, only MacAyeal''s and Hutter''s elements are allowed']);
@@ -74,8 +74,8 @@
 
 %ICEFRONT
-if strcmpi(md.type,'2d'),
+if (md.dim==2),
 	fields={'pressureload'};
 	checksize(md,fields,[NaN 4]);
-elseif strcmpi(md.type,'3d'),
+elseif md.dim==3,
 	fields={'pressureload'};
 	checksize(md,fields,[NaN 6]);
@@ -86,5 +86,5 @@
 %ELEMENTS
 fields={'elements'};
-if strcmpi(md.type,'2d'),
+if (md.dim==2),
 	checksize(md,fields,[md.numberofelements 3]);
 else
@@ -129,5 +129,5 @@
 %RIFTS
 if md.numrifts,
-	if ~strcmpi(md.type,'2d'),
+	if ~(md.dim==2),
 		error(['model not consistent: models with rifts are only supported in 2d for now!']);
 	end
@@ -158,10 +158,10 @@
 
 %CONNECTIVITY
-if strcmpi(md.type,'2d'),
+if (md.dim==2),
 	if md.connectivity<9, 
 		error('model not consistent: connectivity should be at least 9 for 2d models');
 	end
 end
-if strcmpi(md.type,'3d'),
+if md.dim==3,
 	if md.connectivity<24, 
 		error('model not consistent: connectivity should be at least 24 for 3d models');
@@ -224,5 +224,5 @@
 
 	%CHECK THAT WE ARE NOT FULLY CONSTRAINED
-	if strcmpi(md.type,'2d'),
+	if (md.dim==2),
 		if isempty(find(~md.spcvelocity(:,1:2))),
 			error(['model not consistent: model ' md.name ' is totally constrained, no need to solve!']);
@@ -264,5 +264,5 @@
 
 	%CHECK THAT WE ARE NOT FULLY CONSTRAINED
-	if strcmpi(md.type,'2d'),
+	if (md.dim==2),
 		if isempty(find(~md.spcthickness(:,1))),
 			error(['model not consistent: model ' md.name ' is totally constrained for prognostic, no need to solve!']);
@@ -291,5 +291,5 @@
 
 	%dim: 
-	if strcmpi(md.type,'2d'),
+	if (md.dim==2),
 		error(['model not consistent: for a steadystate computation, model needs to be 3d']);
 	end
@@ -300,13 +300,11 @@
 
 	%EXTRUSION
-	if strcmp(md.type,'2d'),
+	if (md.dim==2),
 		error(['model not consistent: for a ' md.analysis_type ' computation, the model must be 3d, extrude it first!'])
 	end
 
 	%CHECK THAT WE ARE NOT FULLY CONSTRAINED
-	if strcmpi(md.type,'2d'),
-		if isempty(find(~md.spctemperature(:,1))),
-			error(['model not consistent: model ' md.name ' is totally constrained for temperature, no need to solve!']);
-		end
+	if isempty(find(~md.spctemperature(:,1))),
+		error(['model not consistent: model ' md.name ' is totally constrained for temperature, no need to solve!']);
 	end
 
Index: /issm/trunk/src/m/classes/public/isresultconsistent.m
===================================================================
--- /issm/trunk/src/m/classes/public/isresultconsistent.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/isresultconsistent.m	(revision 3994)
@@ -28,5 +28,5 @@
 if analysis_type==DiagnosticAnalysisEnum() & md.control_analysis==0,
 
-	if strcmpi(md.type,'3d')
+	if (md.dim==3)
 		fields1={'results.DiagnosticAnalysis.vx','results.DiagnosticAnalysis.vy','results.DiagnosticAnalysis.vz','results.DiagnosticAnalysis.vel'};
 		fields2={'results.DiagnosticAnalysis.vel'};
@@ -158,5 +158,5 @@
 	for iter=1:length(md.results.TransientAnalysis)
 
-		if strcmpi(md.type,'3d'),
+		if (md.dim==3),
 			fields1={['results.TransientAnalysis(' num2str(iter) ').vx'],['results.TransientAnalysis(' num2str(iter) ').vy'],...
 				['results.TransientAnalysis(' num2str(iter) ').vz'],['results.TransientAnalysis(' num2str(iter) ').vel'],...
@@ -195,5 +195,5 @@
 
 		%check melting (<=0 via penalties)
-		if strcmpi(md.type,'3d'),
+		if (md.dim==3),
 			if any(abs(md.results.TransientAnalysis(iter).melting(md.numberofgrids2d+1:end))>tolerance)
 				disp(['''thermal'' result not consistent: increase penalty_melting (negative melting)']);
Index: /issm/trunk/src/m/classes/public/marshall.m
===================================================================
--- /issm/trunk/src/m/classes/public/marshall.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/marshall.m	(revision 3994)
@@ -24,5 +24,5 @@
 WriteData(fid,md.analysis_type','Integer','analysis_type');
 WriteData(fid,md.sub_analysis_type','Integer','sub_analysis_type');
-WriteData(fid,md.type,'String','type');
+WriteData(fid,md.dim,'Integer','dim');
 WriteData(fid,md.numberofgrids,'Integer','numberofgrids');
 WriteData(fid,md.numberofelements,'Integer','numberofelements');
@@ -35,5 +35,5 @@
 WriteData(fid,md.gridonmacayeal,'Mat','gridonmacayeal');
 
-if strcmpi(md.type,'3d'),
+if md.dim==3,
 	WriteData(fid,md.numberofelements2d,'Integer','numberofelements2d');
 	WriteData(fid,md.numberofgrids2d,'Integer','numberofgrids2d');
Index: /issm/trunk/src/m/classes/public/mechanicalproperties.m
===================================================================
--- /issm/trunk/src/m/classes/public/mechanicalproperties.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/mechanicalproperties.m	(revision 3994)
@@ -17,5 +17,5 @@
 	error(['the input velocity should be of size ' num2str(md.numberofgrids) '!'])
 end
-if ~strcmpi(md.type,'2d')
+if ~(md.dim==2)
 	error('only 2d model supported yet');
 end
Index: /issm/trunk/src/m/classes/public/mesh/mesh.m
===================================================================
--- /issm/trunk/src/m/classes/public/mesh/mesh.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/mesh/mesh.m	(revision 3994)
@@ -91,5 +91,5 @@
 
 %type of model
-md.type='2d';
+md.dim=2;
 	
 %augment counter  keeping track of what has been done to this model
Index: /issm/trunk/src/m/classes/public/mesh/meshadaptation.m
===================================================================
--- /issm/trunk/src/m/classes/public/mesh/meshadaptation.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/mesh/meshadaptation.m	(revision 3994)
@@ -14,5 +14,5 @@
 
 %some checks
-if ~strcmpi(md.type,'2d')
+if ~(md.dim==2)
 	error('meshadaptation error message: adaptation for 3d meshes not implemented yet')
 end
Index: /issm/trunk/src/m/classes/public/mesh/meshconvert.m
===================================================================
--- /issm/trunk/src/m/classes/public/mesh/meshconvert.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/mesh/meshconvert.m	(revision 3994)
@@ -36,5 +36,5 @@
 
 %Fill in rest of fields:
-md.type='2d';
+md.dim=2;
 md.numberofelements=size(md.elements,1);
 md.numberofgrids=length(md.x);
Index: /issm/trunk/src/m/classes/public/mesh/meshnodensity.m
===================================================================
--- /issm/trunk/src/m/classes/public/mesh/meshnodensity.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/mesh/meshnodensity.m	(revision 3994)
@@ -77,5 +77,5 @@
 
 %type of model
-md.type='2d';
+md.dim=2;
 	
 %augment counter  keeping track of what has been done to this model
Index: /issm/trunk/src/m/classes/public/mesh/meshrefine.m
===================================================================
--- /issm/trunk/src/m/classes/public/mesh/meshrefine.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/mesh/meshrefine.m	(revision 3994)
@@ -34,5 +34,5 @@
 
 %type of model
-md.type='2d';
+md.dim=2;
 	
 %augment counter  keeping track of what has been done to this model
Index: /issm/trunk/src/m/classes/public/mesh/reorder.m
===================================================================
--- /issm/trunk/src/m/classes/public/mesh/reorder.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/mesh/reorder.m	(revision 3994)
@@ -9,5 +9,5 @@
 	error('reorder error message: no existing mesh, exiting...')
 end
-if strcmpi(md.type,'3d'),
+if md.dim==3,
 	error('reorder error message: 3d models not supported yet, exiting...')
 end
Index: /issm/trunk/src/m/classes/public/mesh/rifts/meshaddrifts.m
===================================================================
--- /issm/trunk/src/m/classes/public/mesh/rifts/meshaddrifts.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/mesh/rifts/meshaddrifts.m	(revision 3994)
@@ -91,5 +91,5 @@
 
 %type of model
-md.type='2d';
+md.dim=2;
 	
 %augment counter  keeping track of what has been done to this model
Index: /issm/trunk/src/m/classes/public/modelsextract.m
===================================================================
--- /issm/trunk/src/m/classes/public/modelsextract.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/modelsextract.m	(revision 3994)
@@ -21,5 +21,5 @@
 
 %2D or 3D?
-if strcmpi(md.type,'3d'),
+if md.dim==3,
 	numberofelements=md.numberofelements2d; %this will be forgotten when we get out.
 	flags=project2d(md,flags,1);
@@ -73,5 +73,5 @@
 for i=1:size(flag_list,1),
 	disp(['   ' num2str(i) '/' num2str(size(flag_list,1))]);
-	if strcmpi(md.type,'3d'),
+	if md.dim==3,
 		flags2d=flag_list{i};
 		realflags=project3d(md,flags2d,'element');
Index: /issm/trunk/src/m/classes/public/plot/applyoptions.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/applyoptions.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/plot/applyoptions.m	(revision 3994)
@@ -43,5 +43,5 @@
 
 %view 
-if strcmpi(md.type,'3d') & ~exist(options,'layer'),
+if md.dim==3 & ~exist(options,'layer'),
 	view(getfieldvalue(options,'view',3));
 else
@@ -61,5 +61,5 @@
 	eval(['axis ' getfieldvalue(options,'axis')]);
 else
-	if (strcmpi(md.type,'2d') | exist(options,'layer')),
+	if ((md.dim==2) | exist(options,'layer')),
 		axis tight equal;
 	else
Index: /issm/trunk/src/m/classes/public/plot/plot_basaldrag.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_basaldrag.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/plot/plot_basaldrag.m	(revision 3994)
@@ -9,5 +9,5 @@
 
 %check layer
-if strcmpi(md.type,'3d')
+if md.dim==3,
 	if getfieldvalue(options,'layer',1)~=1;
 		disp('plot_basaldrag warning: basal drag is displayed in the lower layer')
Index: /issm/trunk/src/m/classes/public/plot/plot_penalties.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_penalties.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/plot/plot_penalties.m	(revision 3994)
@@ -21,5 +21,5 @@
 end
 
-if ~strcmpi(md.type,'3d'),
+if ~md.dim==3,
 	error('no penalties to plot for ''2d'' model');
 elseif isempty(md.penalties),
Index: /issm/trunk/src/m/classes/public/plot/plot_pressureload.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_pressureload.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/plot/plot_pressureload.m	(revision 3994)
@@ -14,5 +14,5 @@
 pressureload=md.pressureload;
 
-if strcmpi(md.type,'2d'),
+if (md.dim==2),
 
 	%plot mesh
Index: /issm/trunk/src/m/classes/public/plot/plot_section.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_section.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/plot/plot_section.m	(revision 3994)
@@ -26,5 +26,5 @@
 %replug x and y onto model so that SectionValue treats the problem correctly
 if exist(options,'layer')
-	md.x=md.x2d; md.y=md.y2d; md.elements=md.elements2d; md.type='2d';
+	md.x=md.x2d; md.y=md.y2d; md.elements=md.elements2d; md.dim=2;
 end
 
@@ -165,12 +165,12 @@
 %apply options
 options=addfielddefault(options,'title','Section value');
-if strcmpi(md.type,'2d')
+if (md.dim==2)
 	options=addfielddefault(options,'colorbar',0);
 end
-if (strcmpi(md.type,'2d') | getfieldvalue(options,'view')==2 )
+if ((md.dim==2) | getfieldvalue(options,'view')==2 )
 	options=addfielddefault(options,'xlabel','Curvilinear coordinate');
 	options=addfielddefault(options,'axis','auto');
 end
-if (strcmpi(md.type,'3d') & getfieldvalue(options,'view')==2 )
+if (md.dim==3 & getfieldvalue(options,'view')==2 )
 	options=addfielddefault(options,'ylabel','z');
 end
Index: /issm/trunk/src/m/classes/public/plot/plot_segments.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_segments.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/plot/plot_segments.m	(revision 3994)
@@ -14,5 +14,5 @@
 segments=md.segments;
 
-if strcmpi(md.type,'2d'),
+if (md.dim==2),
 	%plot mesh
 	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
Index: /issm/trunk/src/m/classes/public/plot/plot_tensor_components.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_tensor_components.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/plot/plot_tensor_components.m	(revision 3994)
@@ -10,9 +10,9 @@
 upperplots=fix((i-1)/width);
 if upperplots==0, leftplots=i-1; else leftplots=i-width*upperplots-1; end
-if strcmpi(md.type,'2d')%3 components -> 3 indexes
+if (md.dim==2)%3 components -> 3 indexes
 	index1=4*width*upperplots+2*leftplots+1;
 	index2=index1+1;
 	index3=index1+width*2;
-elseif strcmpi(md.type,'3d')%6 components -> 6 indexes
+elseif md.dim==3%6 components -> 6 indexes
 	index1=3*3*width*upperplots+3*leftplots+1;
 	index2=index1+1;
@@ -28,5 +28,5 @@
 [tensor.yy isongrid isquiver]=processdata(md,tensor.yy,options);
 [tensor.xy isongrid isquiver]=processdata(md,tensor.xy,options);
-if  strcmpi(md.type,'3d')
+if  md.dim==3
 	[tensor.xz isongrid isquiver]=processdata(md,tensor.xz,options);
 	[tensor.yz isongrid isquiver]=processdata(md,tensor.yz,options);
@@ -34,5 +34,5 @@
 end
 
-if (strcmpi(md.type,'2d')),
+if ((md.dim==2)),
 	subplot(2*width,2*width,index1),
 	plot_unit(x,y,z,elements,tensor.xx,isongrid,is2d,isquiver,options)
Index: /issm/trunk/src/m/classes/public/plot/plot_tensor_principal.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_tensor_principal.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/plot/plot_tensor_principal.m	(revision 3994)
@@ -10,5 +10,5 @@
 upperplots=fix((i-1)/width);
 if upperplots==0, leftplots=i-1; else leftplots=i-width*upperplots-1; end
-if strcmpi(md.type,'2d')%3 components -> 3 indexes
+if (md.dim==2)%3 components -> 3 indexes
 	index1=4*width*upperplots+2*leftplots+1;
 	index2=index1+1;
@@ -16,5 +16,5 @@
 	index4=index3+1;
 	newwidth=2*width;
-elseif strcmpi(md.type,'3d')%6 components -> 6 indexes
+elseif md.dim==3%6 components -> 6 indexes
 	index1=3*3*width*upperplots+3*leftplots+1;
 	index2=index1+1;
@@ -31,5 +31,5 @@
 type2=[type 'axis2'];
 plot_tensor_principalaxis(md,options,newwidth,index2,tensor,type2,plot_options);
-if  strcmpi(md.type,'3d')
+if  md.dim==3
 	type3=[type 'axis3'];
 	plot_tensor_principalaxis(md,options,newwidth,index3,tensor,type3,plot_options);
@@ -40,9 +40,9 @@
 [tensor.principalvalue1 isongrid isquiver]=processdata(md,tensor.principalvalue1,options);
 [tensor.principalvalue2 isongrid isquiver]=processdata(md,tensor.principalvalue2,options);
-if  strcmpi(md.type,'3d')
+if  md.dim==3
 	[tensor.principalvalue3 isongrid isquiver]=processdata(md,tensor.principalvalue3,options);
 end
 
-if (strcmpi(md.type,'2d')),
+if ((md.dim==2)),
 	subplot(2*width,2*width,index3)
 	plot_unit(x,y,z,elements,tensor.principalvalue1,isongrid,is2d,isquiver,options)
Index: /issm/trunk/src/m/classes/public/plot/plot_tensor_principalaxis.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_tensor_principalaxis.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/plot/plot_tensor_principalaxis.m	(revision 3994)
@@ -13,5 +13,5 @@
 [x y z elements is2d]=processmesh(md,options);
 
-if (strcmpi(md.type,'2d')),
+if ((md.dim==2)),
 	eval(['Vx=tensor.principalaxis' type(end) '(:,1); Vy=tensor.principalaxis' type(end) '(:,2);'])
 	eval(['value=tensor.principalvalue' type(end) ';']);
@@ -33,5 +33,5 @@
 
 %plot quivers
-if strcmpi(md.type,'2d'),
+if (md.dim==2),
 
 	%density
Index: /issm/trunk/src/m/classes/public/plot/plot_transient_results.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/plot_transient_results.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/plot/plot_transient_results.m	(revision 3994)
@@ -41,5 +41,5 @@
 clear string;
 
-if strcmpi(md.type,'3d'),
+if md.dim==3,
 	string='plotmodel(md';
 	for i=1:length(md.results.transient),
@@ -67,5 +67,5 @@
 clear string;
 
-if strcmpi(md.type,'3d'),
+if md.dim==3,
 	string='plotmodel(md';
 	for i=2:length(md.results.transient),
Index: /issm/trunk/src/m/classes/public/plot/processdata.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/processdata.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/plot/processdata.m	(revision 3994)
@@ -25,5 +25,5 @@
 
 %check length
-if datasize(1)~=md.numberofgrids & datasize(1)~=md.numberofelements & datasize(1)~=md.numberofgrids*6 & (strcmpi(md.type,'3d') & ~(datasize(1)==md.numberofelements2d | datasize(1)==md.numberofgrids2d))
+if datasize(1)~=md.numberofgrids & datasize(1)~=md.numberofelements & datasize(1)~=md.numberofgrids*6 & (md.dim==3 & ~(datasize(1)==md.numberofelements2d | datasize(1)==md.numberofgrids2d))
 	error('plotmodel error message: data not supported yet');
 end
@@ -34,5 +34,5 @@
 
 	%check number of columns, add zeros if necessary,
-	if (strcmpi(md.type,'3d'))
+	if (md.dim==3)
 		if datasize(2)==2,
 			data=[data, zeros(datasize(1),1)];
@@ -40,5 +40,5 @@
 			error('plotmodel error message: data provided should have 2 or 3 columns for quiver plot, and 1 for regular plot');
 		end
-	elseif (strcmpi(md.type,'2d') & datasize(2)~=2),
+	elseif ((md.dim==2) & datasize(2)~=2),
 		error('plotmodel error message: data provided should have 2 columns for quiver plot, and 1 for regular plot');
 	end
@@ -59,5 +59,5 @@
 
 %treat the case datasize(1)=grids2d
-if (strcmpi(md.type,'3d') & datasize(1)==md.numberofgrids2d),
+if (md.dim==3 & datasize(1)==md.numberofgrids2d),
 	data=project3d(md,data,'node');
 	datasize(1)=md.numberofgrids;
@@ -66,5 +66,5 @@
 
 %treat the case datasize(1)=grids2d
-if (strcmpi(md.type,'3d') & datasize(1)==md.numberofelements2d),
+if (md.dim==3 & datasize(1)==md.numberofelements2d),
 	data=project3d(md,data,'element');
 	datasize(1)=md.numberofelements;
Index: /issm/trunk/src/m/classes/public/plot/processmesh.m
===================================================================
--- /issm/trunk/src/m/classes/public/plot/processmesh.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/plot/processmesh.m	(revision 3994)
@@ -24,5 +24,5 @@
 
 %is it a 2d plot?
-if strcmpi(md.type,'2d');
+if (md.dim==2);
 	is2d=1;
 else
Index: /issm/trunk/src/m/classes/public/setelementstype.m
===================================================================
--- /issm/trunk/src/m/classes/public/setelementstype.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/setelementstype.m	(revision 3994)
@@ -51,5 +51,5 @@
 
 %Check that no pattyn or stokes for 2d mesh
-if strcmpi(md.type,'2d'),
+if (md.dim==2),
 	if any(stokesflag | pattynflag)
 		error('setelementstype error message: stokes and pattyn elements no allowed in 2d mesh, extrude it first')
Index: /issm/trunk/src/m/classes/public/slope.m
===================================================================
--- /issm/trunk/src/m/classes/public/slope.m	(revision 3993)
+++ /issm/trunk/src/m/classes/public/slope.m	(revision 3994)
@@ -6,5 +6,5 @@
 
 %load some variables (it is much faster if the variab;es are loaded from md once for all) 
-if strcmpi(md.type,'2d'),
+if (md.dim==2),
 	numberofelements=md.numberofelements;
 	numberofgrids=md.numberofgrids;
@@ -26,5 +26,5 @@
 s=sqrt(sx.^2+sy.^2);
 
-if strcmpi(md.type,'3d'),
+if md.dim==3,
 	sx=project3d(md,sx,'element');
 	sy=project3d(md,sy,'element');
Index: /issm/trunk/src/m/solutions/jpl/transient.m
===================================================================
--- /issm/trunk/src/m/solutions/jpl/transient.m	(revision 3993)
+++ /issm/trunk/src/m/solutions/jpl/transient.m	(revision 3994)
@@ -8,5 +8,5 @@
 t1=clock;
 
-if strcmpi(md.type,'2d'),
+if (md.dim==2),
 	md=transient2d(md);
 else
Index: /issm/trunk/src/m/utils/BC/SetIceSheetBC.m
===================================================================
--- /issm/trunk/src/m/utils/BC/SetIceSheetBC.m	(revision 3993)
+++ /issm/trunk/src/m/utils/BC/SetIceSheetBC.m	(revision 3994)
@@ -21,5 +21,5 @@
 
 %segment on neumann (Ice Front) -> none
-if strcmpi(md.type,'2d')
+if (md.dim==2)
 	md.pressureload=zeros(0,4);
 else
Index: /issm/trunk/src/m/utils/BC/SetIceShelfBC.m
===================================================================
--- /issm/trunk/src/m/utils/BC/SetIceShelfBC.m	(revision 3993)
+++ /issm/trunk/src/m/utils/BC/SetIceShelfBC.m	(revision 3994)
@@ -35,7 +35,7 @@
 %segment on Neumann (Ice Front)
 pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
-if strcmpi(md.type,'2d')
+if (md.dim==2)
 	pressureload=md.segments(pos,:);
-elseif strcmpi(md.type,'3d')
+elseif md.dim==3
 	pressureload_layer1=[md.segments(pos,1:2)  md.segments(pos,2)+md.numberofgrids2d  md.segments(pos,1)+md.numberofgrids2d  md.segments(pos,3)];
 	pressureload=[];
Index: /issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m
===================================================================
--- /issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m	(revision 3993)
+++ /issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m	(revision 3994)
@@ -46,7 +46,7 @@
 %segment on Neumann (Ice Front)
 pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
-if strcmpi(md.type,'2d')
+if (md.dim==2)
 	pressureload=md.segments(pos,:);
-elseif strcmpi(md.type,'3d')
+elseif md.dim==3
 	pressureload_layer1=[md.segments(pos,1:2)  md.segments(pos,2)+md.numberofgrids2d  md.segments(pos,1)+md.numberofgrids2d  md.segments(pos,3)];
 	pressureload=[];
Index: /issm/trunk/src/m/utils/Mesh/argusmesh.m
===================================================================
--- /issm/trunk/src/m/utils/Mesh/argusmesh.m	(revision 3993)
+++ /issm/trunk/src/m/utils/Mesh/argusmesh.m	(revision 3994)
@@ -88,5 +88,5 @@
 md.elementonsurface=ones(md.numberofelements,1);
 md.counter=1;
-md.type='2d';
+md.dim=2;
 md.riftoutline='';
 md.domainoutline=['' infile ''];
Index: /issm/trunk/src/m/utils/Mesh/squaremesh.m
===================================================================
--- /issm/trunk/src/m/utils/Mesh/squaremesh.m	(revision 3993)
+++ /issm/trunk/src/m/utils/Mesh/squaremesh.m	(revision 3994)
@@ -73,5 +73,5 @@
 
 %plug other field
-md.type='2d';
+md.dim=2;
 md.counter=1;
 md.riftoutline='';
Index: /issm/trunk/src/m/utils/Nightly/testsgetfields.m
===================================================================
--- /issm/trunk/src/m/utils/Nightly/testsgetfields.m	(revision 3993)
+++ /issm/trunk/src/m/utils/Nightly/testsgetfields.m	(revision 3994)
@@ -27,5 +27,5 @@
 		fields={'dakota.importancefactors'};
 	else
-		if strcmpi(md.type,'3d')
+		if md.dim==3
 			fields={'DiagnosticAnalysis.vy','DiagnosticAnalysis.vz'};
 		else
@@ -44,5 +44,5 @@
 
 elseif (analysis_type==TransientAnalysisEnum), 
-	if strcmpi(md.type,'3d')
+	if md.dim==3
 		fields={'TransientAnalysis(end).vel','TransientAnalysis(end).pressure','TransientAnalysis(end).temperature','TransientAnalysis(end).melting','TransientAnalysis(end).thickness','TransientAnalysis(end).surface','TransientAnalysis(end).bed'};
 	else
Index: /issm/trunk/src/m/utils/Nightly/testsgettolerance.m
===================================================================
--- /issm/trunk/src/m/utils/Nightly/testsgettolerance.m	(revision 3993)
+++ /issm/trunk/src/m/utils/Nightly/testsgettolerance.m	(revision 3994)
@@ -35,5 +35,5 @@
 
 	elseif (analysis_type==TransientAnalysisEnum),
-		if strcmpi(md.type,'2d'),
+		if (md.dim==2),
 			tolerance=10^-11;
 		else
