Changeset 4276


Ignore:
Timestamp:
06/28/10 15:43:22 (15 years ago)
Author:
seroussi
Message:

improved process patch for transient models

Location:
issm/trunk/src/m/classes/public
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/public/ProcessPatch.m

    r4240 r4276  
    77%Get number of fields;
    88fields=unique(Patch(:,1));
     9steps=unique(Patch(:,2));
    910
    10 %parse fields
    11 for i=1:length(fields),
     11%parse steps
     12for j=1:length(steps),
    1213
    13         %get name
    14         fieldname=EnumAsString(fields(i));
     14        posstep=find(Patch(:,2)==steps(j));
     15       
     16        %Take all the lines of the Patch for this timestep
     17        temporarypatch=Patch(posstep,:);
     18        time=temporarypatch(1,3);
     19        step=temporarypatch(1,2);
    1520
    16         %get line positions
    17         pos=find(Patch(:,1)==fields(i));
     21        %parse fields
     22        for i=1:length(fields),
    1823
    19         %Fill Result structure
    20         %structure(step).(fieldname).steps=Patch(pos,2);
    21         %structure(step).(fieldname).time=Patch(pos,3);
    22         structure(step).(fieldname).element=Patch(pos,4);
    23         structure(step).(fieldname).interpolation=Patch(pos,5);
    24         structure(step).(fieldname).index=Patch(pos,6:8);
    25         structure(step).(fieldname).value=Patch(pos,9:end);
     24                %get name
     25                fieldname=EnumAsString(fields(i));
    2626
     27                %get line positions
     28                pos=find(temporarypatch(:,1)==fields(i));
     29
     30                %Fill Result structure
     31                structure(step).(fieldname).steps=step;
     32                structure(step).(fieldname).time=time;
     33                structure(step).(fieldname).element=temporarypatch(pos,4);
     34                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);
     37
     38        end
    2739end
    28 
  • issm/trunk/src/m/classes/public/parseresultsfromdisk.m

    r4240 r4276  
    1616while ~isempty(result),
    1717
    18         %Get time and step
    19         results(result.step).step=result.step;
    20         results(result.step).time=result.time;
    21 
    2218        %process patch if necessary
    2319        if strcmpi(result.fieldname,'Patch'),
    2420                results=ProcessPatch(results,result.step,result.field);
    2521        else
     22                %Get time and step
     23                results(result.step).step=result.step;
     24                results(result.step).time=result.time;
    2625                results(result.step).(result.fieldname)=result.field;
    2726        end
Note: See TracChangeset for help on using the changeset viewer.