Changeset 8791
- Timestamp:
- 07/05/11 13:23:33 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Inputs/TransientInput.cpp
r8762 r8791 21 21 /*FUNCTION TransientInput::TransientInput(){{{1*/ 22 22 TransientInput::TransientInput(){ 23 enum_type=NoneEnum; 23 24 enum_type=UNDEF; 24 25 inputs=NULL; 25 numtimesteps=0;26 parameters=NULL;27 t imesteps=NULL;28 return; 26 this->numtimesteps=0; 27 this->parameters=NULL; 28 this->timesteps=NULL; 29 29 30 } 30 31 /*}}}*/ … … 46 47 TransientInput::~TransientInput(){ 47 48 xfree((void**)&this->timesteps); 49 this->timesteps=NULL; 48 50 this->numtimesteps=0; 49 51 parameters=NULL; … … 198 200 output->enum_type=this->enum_type; 199 201 output->numtimesteps=this->numtimesteps; 202 output->timesteps=(double*)xmalloc(this->numtimesteps*sizeof(double)); 200 203 memcpy(output->timesteps,this->timesteps,this->numtimesteps*sizeof(double)); 201 204 output->inputs=(Inputs*)this->inputs->Copy(); … … 224 227 outinput=new TransientInput(); 225 228 outinput->enum_type=this->enum_type; 229 outinput->numtimesteps=this->numtimesteps; 230 outinput->timesteps=(double*)xmalloc(this->numtimesteps*sizeof(double)); 231 memcpy(outinput->timesteps,this->timesteps,this->numtimesteps*sizeof(double)); 226 232 outinput->inputs=(Inputs*)this->inputs->SpawnTriaInputs(indices); 233 outinput->parameters=this->parameters; 227 234 228 235 /*Assign output*/ … … 242 249 elementresult=input->SpawnResult(step,time); 243 250 244 xfree((void**)&input);251 delete input; 245 252 246 253 return elementresult; … … 255 262 256 263 /*First, recover current time from parameters: */ 257 parameters->FindParam(&time,TimeEnum);264 this->parameters->FindParam(&time,TimeEnum); 258 265 259 266 /*Retrieve interpolated values for this time step: */ … … 263 270 input->GetParameterValue(pvalue,gauss); 264 271 265 xfree((void**)&input);272 delete input; 266 273 267 274 } … … 281 288 input->GetParameterDerivativeValue(p,xyz_list,gauss); 282 289 283 xfree((void**)&input); 290 delete input; 291 284 292 } 285 293 /*}}}*/ … … 303 311 input->GetParameterAverage(pvalue); 304 312 305 xfree((void**)&input);313 delete input; 306 314 307 315 } … … 323 331 input->SquareMin(psquaremin,process_units,parameters); 324 332 325 xfree((void**)&input);333 delete input; 326 334 327 335 } … … 342 350 infnorm=input->InfinityNorm(); 343 351 344 xfree((void**)&input);352 delete input; 345 353 346 354 } … … 361 369 max=input->Max(); 362 370 363 xfree((void**)&input);371 delete input; 364 372 365 373 return max; … … 381 389 maxabs=input->MaxAbs(); 382 390 383 xfree((void**)&input);391 delete input; 384 392 385 393 return maxabs; 394 386 395 } 387 396 /*}}}*/ … … 401 410 min=input->Min(); 402 411 403 xfree((void**)&input);412 delete input; 404 413 405 414 return min; 415 406 416 } 407 417 /*}}}*/ … … 421 431 minabs=input->MinAbs(); 422 432 423 xfree((void**)&input);433 delete input; 424 434 425 435 return minabs; … … 440 450 input->GetVectorFromInputs(vector,doflist); 441 451 442 xfree((void**)&input);452 delete input; 443 453 444 454 } /*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.