source: issm/trunk/src/m/model/parseresultsfromdisk.m@ 6440

Last change on this file since 6440 was 6440, checked in by Mathieu Morlighem, 14 years ago

Do not concatenate Solutiontype

File size: 916 bytes
RevLine 
[1]1function results=parseresultsfromdisk(filename)
2%PARSERESULTSFROMDISK - ...
3%
4% Usage:
5% results=parseresultsfromdisk(filename)
6
7%Open file
8fid=fopen(filename,'rb');
9if(fid==-1),
10 error(['loadresultsfromdisk error message: could not open ',filename,' for binary reading']);
11end
[643]12results=struct();
[1]13
14%Read fields until the end of the file.
[672]15result=ReadData(fid);
16while ~isempty(result),
[1]17
[4319]18 %Get time and step
19 results(result.step).step=result.step;
20 results(result.step).time=result.time;
[4240]21
[4319]22 %Add result
[6440]23 if (length(results)>=result.step & isfield(results,result.fieldname) & ~strcmp(result.fieldname,'SolutionType')),
[6389]24 results(result.step).(result.fieldname)=[ results(result.step).(result.fieldname); result.field];
25 else
26 results(result.step).(result.fieldname)=result.field;
27 end
[4319]28
[4240]29 %read next result
[1]30 result=ReadData(fid);
[672]31
[1]32end
[1591]33
[4319]34%process patch if necessary
[4439]35results=MatlabProcessPatch(results);
[4319]36
[1591]37fclose(fid);
Note: See TracBrowser for help on using the repository browser.