Index: /issm/trunk/src/m/classes/model/model.m
===================================================================
--- /issm/trunk/src/m/classes/model/model.m	(revision 9563)
+++ /issm/trunk/src/m/classes/model/model.m	(revision 9564)
@@ -8,6 +8,10 @@
 		 % {{{1
 		 %Careful here: no other class should be used as default value this is a bug of matlab
-		 %in what follows, any field is defined according to the following convention: 
-		 %field={defaultvalue,marshall?,data type,matrix type}
+		 cluster = modelfield('default',0,'marshall',false);
+		 verbose = modelfield('default',0,'marshall',true,'preprocess','marshallverbose','format','Integer');
+		 results = modelfield('default',0,'marshall',false);
+		 solver  = modelfield('default',0,'marshall',false);
+
+		 %FIXME: all other fields should belong to other classes
 
 		 %Model general information
@@ -195,5 +199,4 @@
 		 requested_outputs               = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',3);
 		 %Debugging
-		 verbose                        = modelfield('default',0,'marshall',true,'preprocess','marshallverbose','format','Integer');
 		 mem_debug                      = modelfield('default',0,'marshall',false);
 		 gprof                          = modelfield('default',0,'marshall',false);
@@ -201,5 +204,4 @@
 		 output_frequency               = modelfield('default',0,'marshall',true,'format','Integer');
 		 results_on_vertices            = modelfield('default',0,'marshall',true,'format','Boolean');
-		 results                        = modelfield('default',struct(),'marshall',false);
 		 vx                             = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
 		 vy                             = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
@@ -223,5 +225,4 @@
 		 
 		 %Parallelisation
-		 cluster       = modelfield('default',NaN,'marshall',false);
 		 outlog        = modelfield('default','','marshall',false);
 		 errlog        = modelfield('default','','marshall',false);
@@ -230,7 +231,4 @@
 		 %dummy
 		 dummy = modelfield('default',NaN,'marshall',false);
-
-		 %PETSc and MATLAB solver string
-		 petscoptions  = modelfield('default',NaN,'marshall',false);
 
 		 %Analysis
@@ -534,4 +532,11 @@
 			 end
 
+			 %initialize subclasses
+			 md.cluster=none;
+			 md.solver=solver;
+			 md.solver=addoptions(md.solver,DiagnosticVertAnalysisEnum,mumpsoptions);
+			 md.results=struct();
+
+
 			 %Materials parameters
 
@@ -712,5 +717,4 @@
 
 			 %cluster set as none for serial
-			 md.cluster=none;
 
 			 %this option can be activated to load automatically the results
@@ -727,7 +731,4 @@
 			 md.hydro_kn=0;
 
-			 %set petsc options for different analysis
-			 md.petscoptions=petscoptions;
-			 md.petscoptions=addoptions(md.petscoptions,DiagnosticVertAnalysisEnum,mumpsoptions);
 
 			 %Rheology law: what is the temperature dependence of B with T
Index: sm/trunk/src/m/classes/petscoptions.m
===================================================================
--- /issm/trunk/src/m/classes/petscoptions.m	(revision 9563)
+++ 	(revision )
@@ -1,46 +1,0 @@
-%PETSCOPTIONS class definition
-%
-%   Usage:
-%      options=petscoptions();
-
-classdef petscoptions
-    properties (SetAccess=public) 
-		 % {{{1
-		 options={NoneAnalysisEnum,mumpsoptions};
-		 %used when marshalling
-		 %}}}
-	 end
-	 methods
-		 function disp(o) % {{{1
-			 %  display the object
-			 disp(sprintf('class ''%s'' object ''%s'' = \n',class(o),inputname(1)));
-			 %  display the options
-			 for i=1:size(o.options,1),
-				 analysis=o.options{i,1};
-				 ioptions=o.options{i,2};
-				 string=petscoptiontostring(ioptions);
-				 disp(sprintf('   %s -> ''%s''',EnumToString(analysis),string));
-			 end
-			 disp(sprintf('\n'));
-		 end
-		 %}}}
-		 function o=addoptions(o,analysis,solveroptions) % {{{1
-			 %first, find out if analysis has already been supplied
-			 found=0;
-			 for i=1:size(o.options,1),
-				 inanalysis=o.options{i,1};
-				 if inanalysis==analysis,
-					 found=1;
-					 o.options{i,1}=analysis;
-					 o.options{i,2}=solveroptions;
-					 break;
-				 end
-			 end
-			 if ~found,
-				 o.options{end+1,1}=analysis;
-				 o.options{end,2}=solveroptions;
-			 end
-		 end
-		 %}}}
-	end
-end
Index: /issm/trunk/src/m/classes/solver.m
===================================================================
--- /issm/trunk/src/m/classes/solver.m	(revision 9564)
+++ /issm/trunk/src/m/classes/solver.m	(revision 9564)
@@ -0,0 +1,119 @@
+%SOLVER class definition
+%
+%   Usage:
+%      obj=solver();
+
+classdef solver
+    properties (SetAccess=public) 
+		 options={NoneAnalysisEnum,mumpsoptions};
+	 end
+	 methods
+		 function disp(obj) % {{{1
+			 %  display the object
+			 disp(sprintf('class ''%s'' object ''%s'' = \n',class(o),inputname(1)));
+			 %  display the options
+			 for i=1:size(obj.options,1),
+				 analysis=obj.options{i,1};
+				 ioptions=obj.options{i,2};
+				 string=PetscString(ioptions);
+				 disp(sprintf('   %s -> ''%s''',EnumToString(analysis),string));
+			 end
+			 disp(sprintf('\n'));
+		 end
+		 %}}}
+		 function obj=addoptions(obj,analysis,solveroptions) % {{{1
+			 %first, find out if analysis has already been supplied
+			 found=false;
+			 for i=1:size(obj.options,1),
+				 inanalysis=obj.options{i,1};
+				 if inanalysis==analysis,
+					 found=true;
+					 obj.options{i,1}=analysis;
+					 obj.options{i,2}=solveroptions;
+					 break;
+				 end
+			 end
+			 if ~found,
+				 obj.options{end+1,1}=analysis;
+				 obj.options{end,2}=solveroptions;
+			 end
+		 end
+		 %}}}
+		 function PetscFile(solver,filename) % {{{
+			 %PETSCFILE - build petsc file
+			 %
+			 %   Build a Petsc compatible options file, from the solver model field  + return options string
+			 %
+			 %   Usage:     PetscFile(solver,filename);
+
+			 %open file for writing
+			 fid=fopen(filename,'w');
+			 if fid==-1,
+				 error(['PetscFile error: could not open ' filename ' for writing']);
+			 end
+
+			 %write header
+			 fprintf(fid,'%s%s%s\n','%Petsc options file: ',filename,' written from Matlab solver array');
+
+			 %start writing options
+			 for i=1:size(solver.options,1),
+				 analysis=solver.options{i,1};
+				 options=solver.options{i,2};
+
+				 %first write analysis:
+				 fprintf(fid,'\n+%s\n',EnumToString(analysis)); %append a + to recognize it's an analysis enum
+
+				 %now, write options
+				 for j=1:size(options,2),
+					 option=options{j};
+					 if isempty(option),
+						 %do nothing
+					 elseif length(option)==1,
+						 %this option has only one argument
+						 fprintf(fid,'-%s\n',option{1});
+					 elseif length(option)==2,
+						 %option with value. value can be string or scalar
+						 if isscalar(option{2}),
+							 fprintf(fid,'-%s %g\n',option{1},option{2});
+						 elseif ischar(option{2}),
+							 fprintf(fid,'-%s %s\n',option{1},option{2});
+						 else
+							 error(['PetscFile error: option #' num2str(j) ' is not well formatted']);
+						 end
+					 else 
+						 error(['PetscFile error: option #' num2str(j) ' is not well formatted']);
+					 end
+				 end
+			 end
+
+			 fclose(fid);
+		 end %}}}
+		 function string=PetscString(solver) % {{{
+
+			 %initialize string: 
+			 string='';
+
+			 %start writing options
+			 for i=1:length(solver),
+				 option=solver{i};
+				 if isempty(option),
+					 %do nothing
+				 elseif length(option)==1,
+					 %this option has only one argument
+					 string=[string ' -' option{1}];
+				 elseif length(option)==2,
+					 %option with value. value can be string or scalar
+					 if isscalar(option{2}),
+						 string=[string ' -' option{1} ' ' num2str(option{2})];
+					 elseif ischar(option{2}),
+						 string=[string ' -' option{1} ' ' option{2}];
+					 else
+						 error(['PetscString error: option #' num2str(i) ' is not well formatted']);
+					 end
+				 else 
+					 error(['PetscString error: option #' num2str(i) ' is not well formatted']);
+				 end
+			 end
+		 end % }}}
+	 end
+ end
Index: sm/trunk/src/m/enum/EpsvelEnum.m
===================================================================
--- /issm/trunk/src/m/enum/EpsvelEnum.m	(revision 9563)
+++ 	(revision )
@@ -1,11 +1,0 @@
-function macro=EpsvelEnum()
-%EPSVELENUM - Enum of Epsvel
-%
-%   WARNING: DO NOT MODIFY THIS FILE
-%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
-%            Please read src/c/EnumDefinitions/README for more information
-%
-%   Usage:
-%      macro=EpsvelEnum()
-
-macro=StringToEnum('Epsvel');
Index: sm/trunk/src/m/enum/MeanvelEnum.m
===================================================================
--- /issm/trunk/src/m/enum/MeanvelEnum.m	(revision 9563)
+++ 	(revision )
@@ -1,11 +1,0 @@
-function macro=MeanvelEnum()
-%MEANVELENUM - Enum of Meanvel
-%
-%   WARNING: DO NOT MODIFY THIS FILE
-%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
-%            Please read src/c/EnumDefinitions/README for more information
-%
-%   Usage:
-%      macro=MeanvelEnum()
-
-macro=StringToEnum('Meanvel');
Index: sm/trunk/src/m/model/PetscOptions2PetscFile.m
===================================================================
--- /issm/trunk/src/m/model/PetscOptions2PetscFile.m	(revision 9563)
+++ 	(revision )
@@ -1,49 +1,0 @@
-function PetscOptions2PetscFile(petscoptions,filename)
-%PETSCOPTIONS2PETSCFILE: build a Petsc compatible options file, from the petscoptions model field  + return options string
-%
-% Usage:     PetscOptions2PetscFile(petscoptions,filename);
-%
-% Example:   PetscOptions2PetscFile(md.petscoptions,'petsc.rc');
-%
-
-%open file for writing
-fid=fopen(filename,'w');
-if fid==-1,
-	error(['PetscOptions2PetscFile error: could not open ' filename ' for writing']);
-end
-
-%write header
-fprintf(fid,'%s%s%s\n','%Petsc options file: ',filename,' written from Matlab petscoptions array');
-
-%start writing options
-for i=1:size(petscoptions.options,1),
-	analysis=petscoptions.options{i,1};
-	options=petscoptions.options{i,2};
-
-	%first write analysis:
-	fprintf(fid,'\n+%s\n',EnumToString(analysis)); %append a + to recognize it's an analysis enum
-
-	%now, write options
-	for j=1:size(options,2),
-		option=options{j};
-		if isempty(option),
-			%do nothing
-		elseif length(option)==1,
-			%this option has only one argument
-			fprintf(fid,'-%s\n',option{1});
-		elseif length(option)==2,
-			%option with value. value can be string or scalar
-			if isscalar(option{2}),
-				fprintf(fid,'-%s %g\n',option{1},option{2});
-			elseif ischar(option{2}),
-				fprintf(fid,'-%s %s\n',option{1},option{2});
-			else
-				error(['PetscOptions2PetscFile error: option #' num2str(j) ' is not well formatted']);
-			end
-		else 
-			error(['PetscOptions2PetscFile error: option #' num2str(j) ' is not well formatted']);
-		end
-	end
-end
-
-fclose(fid);
Index: /issm/trunk/src/m/model/display/displayparallel.m
===================================================================
--- /issm/trunk/src/m/model/display/displayparallel.m	(revision 9563)
+++ /issm/trunk/src/m/model/display/displayparallel.m	(revision 9564)
@@ -14,4 +14,2 @@
 fielddisplay(md,'alloc_cleanup','allocation cleanup before starting a job, default 1');
 fielddisplay(md,'waitonlock','maximum number of minutes to wait for batch results, or return 0');
-disp('petsc options:');
-disp(md.petscoptions)
Index: sm/trunk/src/m/model/petscoptiontostring.m
===================================================================
--- /issm/trunk/src/m/model/petscoptiontostring.m	(revision 9563)
+++ 	(revision )
@@ -1,30 +1,0 @@
-function petscstring=petscoptiontostring(petscoptions)
-%PETSCOPTIONTOSTRING: build a Petsc compatible options string
-%
-% Usage:     petscstring=PetscOptions2PetscRc(petscoptions);
-%
-
-%initialize petscstring: 
-petscstring='';
-
-%start writing options
-for i=1:length(petscoptions),
-	option=petscoptions{i};
-	if isempty(option),
-		%do nothing
-	elseif length(option)==1,
-		%this option has only one argument
-		petscstring=[petscstring ' -' option{1}];
-	elseif length(option)==2,
-		%option with value. value can be string or scalar
-		if isscalar(option{2}),
-			petscstring=[petscstring ' -' option{1} ' ' num2str(option{2})];
-		elseif ischar(option{2}),
-			petscstring=[petscstring ' -' option{1} ' ' option{2}];
-		else
-			error(['PetscOptions2PetscRc error: option #' num2str(i) ' is not well formatted']);
-		end
-	else 
-		error(['PetscOptions2PetscRc error: option #' num2str(i) ' is not well formatted']);
-	end
-end
Index: /issm/trunk/src/m/model/solve.m
===================================================================
--- /issm/trunk/src/m/model/solve.m	(revision 9563)
+++ /issm/trunk/src/m/model/solve.m	(revision 9564)
@@ -61,5 +61,5 @@
 
 %write a template file for issm to use, in parallel
-PetscOptions2PetscFile(md.petscoptions,[md.name '.petsc']);
+PetscFile(md.solver,[md.name '.petsc']);
 
 %If running in parallel, we have a different way of launching the solution
Index: sm/trunk/src/m/model/solvers/solversettosor.m
===================================================================
--- /issm/trunk/src/m/model/solvers/solversettosor.m	(revision 9563)
+++ 	(revision )
@@ -1,7 +1,0 @@
-function md=solversettosor(md)
-%SOLVERSETTOSOR - associate solver sor to the model
-%
-%   Usage:
-%      md=solversettosor(md)
-
-md.petscoptions={{'mat_type','aij'},{'ksp_type','cg'},{'pc_type','sor'},{'pc_sor_omega',1.1},{pc_sor_its',2}};
