Changeset 2312
- Timestamp:
- 09/24/09 10:55:15 (15 years ago)
- Location:
- issm/trunk/src/c/ModelProcessorx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp
r2212 r2312 23 23 int numberofdofspernode; 24 24 int dim; 25 25 char** parameteroutput=NULL; 26 char* descriptor=NULL; 27 char* tag=NULL; 28 #ifdef _SERIAL_ 29 mxArray* pfield=NULL; 30 mxArray* pfield2=NULL; 31 #endif 26 32 27 33 /*Initialize dataset: */ … … 218 224 xfree((void**)&iomodel->riftinfo); 219 225 226 227 /*parameteroutput: */ 228 count++; 229 param= new Param(count,"numoutput",INTEGER); 230 param->SetInteger(iomodel->numoutput); 231 parameters->AddObject(param); 232 233 if(iomodel->numoutput){ 234 parameteroutput=(char**)xmalloc(iomodel->numoutput*sizeof(char*)); 235 236 #ifdef _SERIAL_ 237 pfield=mxGetField(iomodel_handle,0,"parameteroutput"); 238 for(i=0;i<iomodel->numoutput;i++){ 239 pfield2=mxGetCell(pfield,i); 240 FetchData((void**)&descriptor,NULL,NULL,pfield2,"String",NULL); 241 parameteroutput[i]=descriptor; 242 } 243 #else 244 tag=(char*)xmalloc((strlen("parameteroutput_i")+1)*sizeof(char)); 245 for(i=0;i<iomodel->numoutput;i++){ 246 sprintf(tag,"%s%i","parameteroutput_",i); 247 IoModelFetchData((void**)&descriptor,NULL,NULL,iomodel_handle,tag,"String",NULL); 248 parameteroutput[i]=descriptor; 249 } 250 #endif 251 252 /*Ok, we have all the parameter output descriptors. Build a parameter with it: */ 253 count++; 254 param= new Param(count,"parameteroutput",STRINGARRAY); 255 param->SetStringArray(parameteroutput,iomodel->numoutput); 256 parameters->AddObject(param); 257 } 258 220 259 /*All our datasets are already ordered by ids. Set presort flag so that later on, when sorting is requested on these 221 260 * datasets, it will not be redone: */ 222 261 parameters->Presort(); 223 262 263 /*Free data: */ 264 xfree((void**)&tag); 265 for(i=0;i<iomodel->numoutput;i++){ 266 char* descriptor=parameteroutput[i]; 267 xfree((void**)&descriptor); 268 } 269 xfree((void**)¶meteroutput); 270 271 224 272 /*Assign output pointer: */ 225 273 *pparameters=parameters; -
issm/trunk/src/c/ModelProcessorx/IoModel.cpp
r2268 r2312 160 160 /*!basal: */ 161 161 iomodel->accumulation=NULL; 162 163 /*parameter output: */ 164 iomodel->numoutput=0; 162 165 163 166 /*elements type: */ … … 368 371 IoModelFetchData((void**)&iomodel->qmu_npart,NULL,NULL,iomodel_handle,"npart","Integer",NULL); 369 372 } 373 374 /*parameter output : */ 375 IoModelFetchData((void**)&iomodel->numoutput,NULL,NULL,iomodel_handle,"numoutput","Integer",NULL); 370 376 371 377 /*Assign output pointers: */ -
issm/trunk/src/c/ModelProcessorx/IoModel.h
r2268 r2312 157 157 double* accumulation; 158 158 159 /*parameter output: */ 160 int numoutput; 159 161 160 162 /*exterior data: */
Note:
See TracChangeset
for help on using the changeset viewer.