Changeset 11425 for issm/trunk-jpl-damage/src/m/classes/solver.m
- Timestamp:
- 02/14/12 09:27:32 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl-damage/src/m/classes/solver.m
r11417 r11425 6 6 classdef solver 7 7 properties (SetAccess=public) 8 options= cell(0,0);8 options={NoneAnalysisEnum,mumpsoptions}; 9 9 end 10 10 methods … … 26 26 function obj = setdefaultparameters(obj) % {{{ 27 27 28 %MUMPS is the default solver29 obj.options={'NoneAnalysis',mumpsoptions};30 31 28 end % }}} 32 function obj = addoptions(obj,analysis,solveroptions) % {{{1 33 34 %Convert analysis from enum to string 35 analysis=EnumToString(analysis); 36 29 function obj=addoptions(obj,analysis,solveroptions) % {{{1 37 30 %first, find out if analysis has already been supplied 38 31 found=false; 39 32 for i=1:size(obj.options,1), 40 33 inanalysis=obj.options{i,1}; 41 if strcmp(inanalysis,analysis),34 if inanalysis==analysis, 42 35 found=true; 43 obj.options{i,1} =analysis;44 obj.options{i,2} =solveroptions;36 obj.options{i,1}=analysis; 37 obj.options{i,2}=solveroptions; 45 38 break; 46 39 end 47 40 end 48 49 41 if ~found, 50 obj.options{end+1,1}= 51 obj.options{end,2} =solveroptions;42 obj.options{end+1,1}=analysis; 43 obj.options{end,2}=solveroptions; 52 44 end 53 45 end 54 46 %}}} 55 47 function checkconsistency(obj,md,solution,analyses) % {{{ 56 for i=1:size(obj.options,1), 57 if ~ischar(obj.options{i,1}), 58 checkmessage('solver is not well formatted: Analyses are not strings'); 59 end 60 end 48 61 49 end % }}} 62 50 function PetscFile(solver,filename) % {{{ … … 82 70 83 71 %first write analysis: 84 fprintf(fid,'\n+%s\n', analysis); %append a + to recognize it's an analysis enum72 fprintf(fid,'\n+%s\n',EnumToString(analysis)); %append a + to recognize it's an analysis enum 85 73 86 74 %now, write options … … 138 126 end 139 127 140 disp(sprintf(' %s -> ''%s''', analysis,string));128 disp(sprintf(' %s -> ''%s''',EnumToString(analysis),string)); 141 129 end 142 130 end
Note:
See TracChangeset
for help on using the changeset viewer.