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
Line 
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
12results=struct();
13
14%Read fields until the end of the file.
15result=ReadData(fid);
16while ~isempty(result),
17
18 %Get time and step
19 results(result.step).step=result.step;
20 results(result.step).time=result.time;
21
22 %Add result
23 if (length(results)>=result.step & isfield(results,result.fieldname) & ~strcmp(result.fieldname,'SolutionType')),
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
28
29 %read next result
30 result=ReadData(fid);
31
32end
33
34%process patch if necessary
35results=MatlabProcessPatch(results);
36
37fclose(fid);
Note: See TracBrowser for help on using the repository browser.