Changeset 19343


Ignore:
Timestamp:
05/07/15 16:36:26 (10 years ago)
Author:
Eric.Larour
Message:

CHG: trying to address the issue of time steps being recorded in the results.
If step=0, we are running everything except a transient . Only one step, time =0.
If step=-1, we are a result that belongs nowhere (for ex: solutoin type), plug it in step=1, time=0;
If step>0, legitimate transient step.

Location:
issm/trunk-jpl/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/modules/OutputResultsx/OutputResultsx.cpp

    r17055 r19343  
    4242                femmodel->parameters->FindParam(&solutiontype,SolutionTypeEnum);
    4343                EnumToStringx(&solutiontypestring,solutiontype);
    44                 femmodel->results->AddResult(new GenericExternalResult<char*>(femmodel->results->Size()+1,SolutionTypeEnum,solutiontypestring,1));
     44                femmodel->results->AddResult(new GenericExternalResult<char*>(femmodel->results->Size()+1,SolutionTypeEnum,solutiontypestring,-1));
    4545                xDelete<char>(solutiontypestring);
    4646        }
  • issm/trunk-jpl/src/m/solve/parseresultsfromdisk.m

    r19326 r19343  
    2828result  = ReadData(fid);
    2929if isempty(result), error(['no results found in binary file ' filename]); end
     30check_nomoresteps=0;
    3031counter = 1;
    3132step    = result.step;
    3233while ~isempty(result),
     34
     35        if check_nomoresteps,
     36                %check that the new result does not add a step, which would be an error:
     37                if result.step>=1,
     38                        error('parsing results for a steady-state core, which incorporates transient results!');
     39                end
     40        end
    3341
    3442        %Check step, increase counter if this is a new step
     
    3947
    4048        %Add result
    41         if(result.step==1),
     49        if(result.step==-1),
     50                %specialty case, put this result at the beginning of the structure
     51                index = 1;
     52                result.step=0;
     53        elseif(result.step==0),
     54                %if we have a step = 0, this is a steady state solutoin, don't expect more steps.
     55                index = 1;
     56                check_nomoresteps=1;
     57        elseif(result.step==1),
    4258                index = 1;
    4359        else
Note: See TracChangeset for help on using the changeset viewer.