Changeset 642


Ignore:
Timestamp:
05/29/09 11:05:33 (15 years ago)
Author:
jschierm
Message:

Addition of parameter study output file parsing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/solutions/dakota/dakota_out_parse.m

    r456 r642  
    7171    case {'nond_local_reliability'}
    7272        [dresp]=nond_locrel(fidi);
    73 %     case {'dace','fsu_quasi_mc','fsu_cvt'}
    74 %     case {'vector_parameter_study','list_parameter_study',...
    75 %             'centered parameter_study','multidim_parameter_study'}
     73     case {'dace','fsu_quasi_mc','fsu_cvt'}
     74        [dresp]=param_any(fidi);
     75     case {'vector_parameter_study','list_parameter_study',...
     76             'centered_parameter_study','multidim_parameter_study'}
     77        [dresp]=param_any(fidi);
    7678    otherwise
    7779        error('Unrecognized  method ''%s'' in file %s.',...
     
    735737end
    736738
     739%%  function to parse any parameter study output file
     740
     741function [dresp]=param_any(fidi)
     742
     743%%  search through the file to find the Dakota output data
     744
     745[fline]=findline(fidi,'<<<<< Iterator');
     746if ~ischar(fline)
     747    return
     748end
     749display(['  ' deblank(fline)]);
     750
     751%  loop through the file to find the number of function evaluations
     752
     753[nfeval]=nfeval_read(fidi);
     754
     755%  loop through the file to find the volumetric uniformity measures
     756
     757[dresp]=vum_read(fidi,struct([]));
     758
     759end
     760
     761%%  function to find and read the volumetric uniformity measures
     762
     763function [dresp]=vum_read(fidi,dresp)
     764
     765[fline]=findline(fidi,'The following lists volumetric uniformity measures');
     766if ~ischar(fline)
     767    return
     768end
     769dresp(end+1).vum=[];
     770
     771display('Reading measures for volumetric uniformity.');
     772
     773fline=fgetl(fidi);
     774fline=fgetl(fidi);
     775
     776while ischar(fline) && ~isempty(fline)
     777        [ntokens,tokens]=fltokens(fline);
     778    switch lower(tokens{1}{1})
     779        case 'chi'
     780            dresp.vum.chi=tokens{1}{4};
     781        case 'd'
     782            dresp.vum.d  =tokens{1}{4};
     783        case 'h'
     784            dresp.vum.h  =tokens{1}{4};
     785        case 'tau'
     786            dresp.vum.tau=tokens{1}{4};
     787    end
     788    fline=fgetl(fidi);
     789end
     790
     791end
     792
    737793%%  function to find a file line starting with a specified string
    738794
Note: See TracChangeset for help on using the changeset viewer.