Changeset 4321


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

Fixed diagnostic output results serial

Location:
issm/trunk/src
Files:
13 edited

Legend:

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

    r4314 r4321  
    2828        mwSize nsteps;
    2929        mwSize step;
    30         const   char**  fnames=NULL;
    31         int*    enums=NULL;
    32         int     baseenum;
    33         mwSize          onebyone[2] = {1,1};
    34         mwSize          ndim=2;
     30        const char **fnames      = NULL;
     31        int         *enums       = NULL;
     32        int          baseenum;
     33        mwSize       onebyone[2] = {1,1};
     34        mwSize       ndim        = 2;
    3535
    3636        /*How many time steps do we have? : */
     
    6666        for(i=0;i<maxfields;i++)if(enums[i]>0)nfields++;
    6767
    68         /*Add 1 field for time: */
    69         nfields++;
     68        /*Add 2 fields for time and step: */
     69        nfields=nfields+2;
    7070       
    7171        /*Fill the names of the structure field: */
     
    7878                }
    7979        }
    80         /*don't forget the extra field "time":*/
    81         fnames[nfields-1]=EnumAsString(TimeEnum);
     80        /*don't forget the extra fields "time" and "step":*/
     81        fnames[nfields-2]="time";
     82        fnames[nfields-1]="step";
    8283
    8384        /*Initialize structure: */
     
    8586
    8687        /*Fill each field: */
    87         for(i=0;i<nfields-1;i++){ //do not include the last one used for time
     88        for(i=0;i<nfields-2;i++){ //do not include the last one used for time
    8889                ExternalResult* result=(ExternalResult*)results->GetObjectByOffset(i);
    8990                result->SetMatlabField(dataref);
  • issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.cpp

    r4245 r4321  
    2222#endif
    2323
    24         int         solutiontype;
     24        int  solutiontype;
    2525       
    2626        /*First, configure elements*/
  • issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.cpp

    r4248 r4321  
    190190       
    191191        mxSetField( dataref, this->step-1, name,mxCreateDoubleScalar((double)value));
    192         mxSetField( dataref, this->step-1, EnumAsString(TimeEnum),mxCreateDoubleScalar((double)this->time));
     192        mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
     193        mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
    193194}
    194195#endif
  • issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.cpp

    r4248 r4321  
    185185        name=this->GetResultName();
    186186        mxSetField( dataref,this->step-1, name,mxCreateDoubleScalar(value));
    187         mxSetField( dataref,this->step-1, EnumAsString(TimeEnum),mxCreateDoubleScalar((double)this->time));
     187        mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
     188        mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
    188189
    189190}
  • issm/trunk/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp

    r4312 r4321  
    244244        /*set tranpose matrix inside the dataref structure: */
    245245        mxSetField( dataref, this->step-1, name,pfield2);
    246         mxSetField( dataref, this->step-1, EnumAsString(TimeEnum),mxCreateDoubleScalar((double)this->time));
    247 
    248 
     246        mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
     247        mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
    249248
    250249}
  • issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp

    r4308 r4321  
    226226
    227227        mxSetField( dataref, this->step-1, name,pfield);
    228         mxSetField( dataref, this->step-1, EnumAsString(TimeEnum),mxCreateDoubleScalar((double)this->time));
    229 
     228        mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
     229        mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
    230230
    231231}
  • issm/trunk/src/c/objects/ExternalResults/IntExternalResult.cpp

    r4315 r4321  
    190190
    191191        mxSetField( dataref, this->step-1, name,mxCreateDoubleScalar(value));
    192         mxSetField( dataref, this->step-1, EnumAsString(TimeEnum),mxCreateDoubleScalar((double)this->time));
     192        mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
     193        mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
    193194
    194195}
  • issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.cpp

    r4248 r4321  
    259259       
    260260        mxSetField( dataref, this->step-1, name, pfield);
    261         mxSetField( dataref, this->step-1, EnumAsString(TimeEnum),mxCreateDoubleScalar((double)this->time));
     261        mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
     262        mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
    262263
    263264}
  • issm/trunk/src/c/objects/ExternalResults/StringExternalResult.cpp

    r4248 r4321  
    202202
    203203        mxSetField( dataref, this->step-1, name, mxCreateString(value));
    204         mxSetField( dataref, this->step-1, EnumAsString(TimeEnum),mxCreateDoubleScalar((double)this->time));
     204        mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
     205        mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
    205206
    206207}
  • issm/trunk/src/m/classes/@model/model.m

    r4161 r4321  
    232232        md.inputfilename='';
    233233        md.outputfilename='';
    234         md.results=NaN;
     234        md.results=struct();
    235235        md.vx=NaN;
    236236        md.vy=NaN;
  • issm/trunk/src/m/classes/@model/setdefaultparameters.m

    r4318 r4321  
    262262%Ice solver: 'general' for Matlab's default solver (or 'lu' or 'sholesky')
    263263md.solver_type='general';
    264 
    265 %results
    266 md.results.diagnostic=[];
    267 md.results.steadystate=[];
    268 md.results.prognostic=[];
  • issm/trunk/src/m/classes/public/solve.m

    r4292 r4321  
    104104%Check result is consistent
    105105displaystring(md.verbose,'%s\n','checking result consistency');
    106 if ~isresultconsistent(md,options.analysis_type),
    107         disp('!! results not consistent correct the model !!') %it would be very cruel to put an error, it would kill the computed results (even if not consistent...)
    108 end
     106%if ~isresultconsistent(md,options.analysis_type),
     107%       disp('!! results not consistent correct the model !!') %it would be very cruel to put an error, it would kill the computed results (even if not consistent...)
     108%end
    109109
    110110%convert analysis type to string finally
  • issm/trunk/src/m/solutions/diagnostic.m

    r4294 r4321  
    3535               
    3636                displaystring(verbose,'%s',['write results']);
    37                 md.results.diagnostic=OutputResults(femmodel.elements, femmodel.nodes , femmodel.vertices , femmodel.loads , femmodel.materials, femmodel.parameters, femmodel.results);
     37                results=OutputResults(femmodel.elements, femmodel.nodes , femmodel.vertices , femmodel.loads , femmodel.materials, femmodel.parameters, femmodel.results);
     38                md.results.(EnumAsString(solution_type))=ProcessPatch(results);
    3839        else
    3940                %launch dakota driver for diagnostic core solution
Note: See TracChangeset for help on using the changeset viewer.