Changeset 21769


Ignore:
Timestamp:
06/28/17 09:31:22 (8 years ago)
Author:
Mathieu Morlighem
Message:

CHG: optionnaly provide step numer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/miscellaneous/transientrestart.m

    r20519 r21769  
    1 function md = transientrestart(md)
     1function md = transientrestart(md,step)
    22%TRANSIENTRESTART - reinitialize model from last transient step
    33%
    44%   Usage:
    55%      md = transientrestart(md)
     6%      md = transientrestart(md,step)
     7%
     8%   By default, transientrestart will use the last step provided in md.results.TransientSolution
    69
    710%Get result and save it again
    8 results = md.results.TransientSolution(end);
     11if nargin==1,
     12        step = numel(md.results.TransientSolution(end));
     13end
     14if step<1,
     15        error('step needs to be >0');
     16elseif step>numel(md.results.TransientSolution)
     17        error(['md.results.TransientSolution has only ' num2str(numel(md.results.TransientSolution)) ' steps']);
     18end
     19results = md.results.TransientSolution(step);
    920
    1021newname = ['TransientSolution' num2str(numel(fields(md.results))+1)];
Note: See TracChangeset for help on using the changeset viewer.