Changeset 4319
- Timestamp:
- 06/29/10 15:10:11 (15 years ago)
- Location:
- issm/trunk/src/m/classes/public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/classes/public/ProcessPatch.m
r4276 r4319 1 function structure=ProcessPatch(structure ,step,Patch);1 function structure=ProcessPatch(structure); 2 2 %PROCESSPATCH - create a structure from a patch 3 3 % 4 4 % Usage: 5 % Result=ProcessPatch(Patch); 5 % Result=ProcessPatch(Result); 6 7 %Get out if no Patch 8 if (~isfield(structure,'Patch')), 9 return; 10 else 11 Patch=structure(1).Patch; 12 numvertices=structure(1).PatchVertices; 13 end 6 14 7 15 %Get number of fields; … … 33 41 structure(step).(fieldname).element=temporarypatch(pos,4); 34 42 structure(step).(fieldname).interpolation=temporarypatch(pos,5); 35 structure(step).(fieldname).index=temporarypatch(pos,6: 8);36 structure(step).(fieldname).value=temporarypatch(pos, 9:end);43 structure(step).(fieldname).index=temporarypatch(pos,6:5+numvertices); 44 structure(step).(fieldname).value=temporarypatch(pos,6+numvertices:end); 37 45 38 46 end 39 47 end 48 49 %remove fields 50 structure=rmfield(structure,'Patch'); 51 structure=rmfield(structure,'PatchVertices'); 52 structure=rmfield(structure,'PatchNodes'); -
issm/trunk/src/m/classes/public/parseresultsfromdisk.m
r4276 r4319 16 16 while ~isempty(result), 17 17 18 %process patch if necessary 19 if strcmpi(result.fieldname,'Patch'), 20 results=ProcessPatch(results,result.step,result.field); 21 else 22 %Get time and step 23 results(result.step).step=result.step; 24 results(result.step).time=result.time; 25 results(result.step).(result.fieldname)=result.field; 26 end 18 %Get time and step 19 results(result.step).step=result.step; 20 results(result.step).time=result.time; 21 22 %Add result 23 results(result.step).(result.fieldname)=result.field; 27 24 28 25 %read next result … … 31 28 end 32 29 30 %process patch if necessary 31 results=ProcessPatch(results); 32 33 33 fclose(fid);
Note:
See TracChangeset
for help on using the changeset viewer.