Changeset 4321
- Timestamp:
- 06/29/10 15:26:41 (15 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/OutputResultsx/MatlabWriteResults.cpp
r4314 r4321 28 28 mwSize nsteps; 29 29 mwSize step; 30 const char** fnames=NULL;31 int * enums=NULL;32 int baseenum;33 mwSize 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; 35 35 36 36 /*How many time steps do we have? : */ … … 66 66 for(i=0;i<maxfields;i++)if(enums[i]>0)nfields++; 67 67 68 /*Add 1 field for time: */69 nfields ++;68 /*Add 2 fields for time and step: */ 69 nfields=nfields+2; 70 70 71 71 /*Fill the names of the structure field: */ … … 78 78 } 79 79 } 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"; 82 83 83 84 /*Initialize structure: */ … … 85 86 86 87 /*Fill each field: */ 87 for(i=0;i<nfields- 1;i++){ //do not include the last one used for time88 for(i=0;i<nfields-2;i++){ //do not include the last one used for time 88 89 ExternalResult* result=(ExternalResult*)results->GetObjectByOffset(i); 89 90 result->SetMatlabField(dataref); -
issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.cpp
r4245 r4321 22 22 #endif 23 23 24 int 24 int solutiontype; 25 25 26 26 /*First, configure elements*/ -
issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.cpp
r4248 r4321 190 190 191 191 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)); 193 194 } 194 195 #endif -
issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.cpp
r4248 r4321 185 185 name=this->GetResultName(); 186 186 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)); 188 189 189 190 } -
issm/trunk/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp
r4312 r4321 244 244 /*set tranpose matrix inside the dataref structure: */ 245 245 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)); 249 248 250 249 } -
issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp
r4308 r4321 226 226 227 227 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)); 230 230 231 231 } -
issm/trunk/src/c/objects/ExternalResults/IntExternalResult.cpp
r4315 r4321 190 190 191 191 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)); 193 194 194 195 } -
issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.cpp
r4248 r4321 259 259 260 260 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)); 262 263 263 264 } -
issm/trunk/src/c/objects/ExternalResults/StringExternalResult.cpp
r4248 r4321 202 202 203 203 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)); 205 206 206 207 } -
issm/trunk/src/m/classes/@model/model.m
r4161 r4321 232 232 md.inputfilename=''; 233 233 md.outputfilename=''; 234 md.results= NaN;234 md.results=struct(); 235 235 md.vx=NaN; 236 236 md.vy=NaN; -
issm/trunk/src/m/classes/@model/setdefaultparameters.m
r4318 r4321 262 262 %Ice solver: 'general' for Matlab's default solver (or 'lu' or 'sholesky') 263 263 md.solver_type='general'; 264 265 %results266 md.results.diagnostic=[];267 md.results.steadystate=[];268 md.results.prognostic=[]; -
issm/trunk/src/m/classes/public/solve.m
r4292 r4321 104 104 %Check result is consistent 105 105 displaystring(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 end106 %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 109 109 110 110 %convert analysis type to string finally -
issm/trunk/src/m/solutions/diagnostic.m
r4294 r4321 35 35 36 36 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); 38 39 else 39 40 %launch dakota driver for diagnostic core solution
Note:
See TracChangeset
for help on using the changeset viewer.