Changeset 1102


Ignore:
Timestamp:
06/25/09 17:35:45 (15 years ago)
Author:
Mathieu Morlighem
Message:

better error message of parameterize

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

Legend:

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

    r27 r1102  
    3535catch me,
    3636        system('rm TemporaryParameterFile.m');
     37
     38        %remove last error misleading
    3739        me2=struct('message',me.message,'stack',me.stack);
     40        me2.stack(end)=[];
     41
     42        %rename parameter file
    3843        for i=1:length(me2.stack)
    3944                if (length(me2.stack(i).file)>=24 & strcmp(me2.stack(i).file(end-23:end),'TemporaryParameterFile.m'))
     
    4449                end
    4550        end
     51
     52        %throw error message
    4653        rethrow(me2);
    4754end
  • issm/trunk/src/m/classes/public/thicknessevolution.m

    r1097 r1102  
    1010
    1111if (length(md.vx)~=md.numberofgrids)|(length(md.vy)~=md.numberofgrids)
    12         error('thicknessevolution error message: velocity empty')
     12        error(['thicknessevolution error message: vx and vy should have a length of ' num2str(md.numberofgrids)])
    1313end
    1414
    1515%load some variables (it is much faster if the variab;es are loaded from md once for all)
    1616numberofelements=md.numberofelements;
    17 H=md.thickness;
    18 vx=md.vx;
    19 vy=md.vy;
     17H=averaging(md,md.thickness,3);
     18vx=averaging(md,md.vx,3);
     19vy=averaging(md,md.vy,3);
    2020index=md.elements;
    2121x=md.x; y=md.y;
     
    3939
    4040%compute dhdt=div(Hu)
    41 Hvx=H.*vx; Hvy=H.*vy;
    42 dhdt=-sum(Hvx(index).*alpha,2)-sum(Hvy(index).*beta,2);
     41dhdt=(vx(index)*summation).*sum( H(index).*alpha,2) + (vy(index)*summation).*sum(H(index).*beta,2) ...
     42        + ( H(index)*summation).*sum(vx(index).*alpha,2) + ( H(index)*summation).*sum(vy(index).*beta,2);
     43dhdt=-dhdt;
Note: See TracChangeset for help on using the changeset viewer.