Index: /issm/trunk-jpl/src/m/classes/solver.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/solver.m	(revision 11869)
+++ /issm/trunk-jpl/src/m/classes/solver.m	(revision 11870)
@@ -4,7 +4,8 @@
 %      obj=solver();
 
-classdef solver
+classdef solver < dynamicprops
     properties (SetAccess=public) 
-		 options=cell(0,0);
+		 NoneAnalysis
+		 %The other properties are dynamic
 	 end
 	 methods
@@ -21,7 +22,7 @@
 			 %MUMPS is the default solver
 			 if ismumps,
-				 obj.options={'NoneAnalysis',mumpsoptions};
+				 obj.NoneAnalysis=mumpsoptions;
 			 else
-				 obj.options={'NoneAnalysis',iluasmoptions};
+				 obj.NoneAnalysis=iluasmoptions;
 			 end
 
@@ -32,35 +33,22 @@
 			 analysis=EnumToString(analysis);
 
-			 %first, find out if analysis has already been supplied
-			 found=false;
-			 for i=1:size(obj.options,1),
-				 inanalysis=obj.options{i,1};
-				 if strcmp(inanalysis,analysis),
-					 found=true;
-					 obj.options{i,1} = analysis;
-					 obj.options{i,2} = solveroptions;
-					 break;
-				 end
+			 %Create dynamic property if property does not exist yet
+			 if ~ismember(analysis,properties(obj)),
+				 obj.addprop(analysis);
 			 end
 
-			 if ~found,
-				 obj.options{end+1,1}= analysis;
-				 obj.options{end,2}  = solveroptions;
-			 end
+			 %Add solver options to analysis
+			 obj.(analysis) = solveroptions;
 		 end
 		 %}}}
 		 function checkconsistency(obj,md,solution,analyses) % {{{
-			 for i=1:size(obj.options,1),
-				 if ~ischar(obj.options{i,1}),
-					 checkmessage('solver is not well formatted: Analyses are not strings');
-				 end
-			 end
+			 %Nothing checked
 		 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);
+		 %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
@@ -74,7 +62,8 @@
 
 			 %start writing options
-			 for i=1:size(solver.options,1),
-				 analysis=solver.options{i,1};
-				 options=solver.options{i,2};
+			 analyses=properties(solver);
+			 for i=1:numel(analyses),
+				 analysis=analyses{i};
+				 options=solver.(analysis);
 
 				 %first write analysis:
@@ -106,37 +95,4 @@
 			 fclose(fid);
 		 end %}}}
-		 function disp(obj) % {{{1
-			disp(sprintf('   solver parameters:'));
-
-			for i=1:size(obj.options,1),
-				analysis=obj.options{i,1};
-				ioptions=obj.options{i,2};
-
-				string='';
-				for i=1:length(ioptions),
-					option=ioptions{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
-
-				disp(sprintf('   %s -> ''%s''',analysis,string));
-			end
-		 end
-		 %}}}
 	 end
  end
