Changeset 4319


Ignore:
Timestamp:
06/29/10 15:10:11 (15 years ago)
Author:
Mathieu Morlighem
Message:

Fixed ProcessPatch for variable nodes and vertices

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);
     1function structure=ProcessPatch(structure);
    22%PROCESSPATCH - create a structure from a patch
    33%
    44%   Usage:
    5 %      Result=ProcessPatch(Patch);
     5%      Result=ProcessPatch(Result);
     6
     7%Get out if no Patch
     8if (~isfield(structure,'Patch')),
     9        return;
     10else
     11        Patch=structure(1).Patch;
     12        numvertices=structure(1).PatchVertices;
     13end
    614
    715%Get number of fields;
     
    3341                structure(step).(fieldname).element=temporarypatch(pos,4);
    3442                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);
    3745
    3846        end
    3947end
     48
     49%remove fields
     50structure=rmfield(structure,'Patch');
     51structure=rmfield(structure,'PatchVertices');
     52structure=rmfield(structure,'PatchNodes');
  • issm/trunk/src/m/classes/public/parseresultsfromdisk.m

    r4276 r4319  
    1616while ~isempty(result),
    1717
    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;
    2724
    2825        %read next result
     
    3128end
    3229
     30%process patch if necessary
     31results=ProcessPatch(results);
     32
    3333fclose(fid);
Note: See TracChangeset for help on using the changeset viewer.