Changeset 4037
- Timestamp:
- 06/10/10 19:10:44 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 16 added
- 2 deleted
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/DataSet/DataSet.h
r4034 r4037 92 92 93 93 94 /********************************************************INPUT************************************************/ 94 95 95 /********************************************************INPUTS************************************************/96 96 class Input; 97 97 class Node; 98 #include "./DataSet.h"99 #include "../objects/objects.h"100 98 101 99 class Inputs: public DataSet{ … … 139 137 140 138 139 140 141 141 /********************************************************PARAMETERS************************************************/ 142 142 … … 165 165 }; 166 166 167 167 168 /********************************************************RESULTS************************************************/ 168 169 … … 176 177 ~Results(); 177 178 /*}}}*/ 178 /*methods: {{{1*/ 179 int FindResult(Vec* presult,char* name); 180 int FindResult(void* pvalue, char* name); 179 /*numerics: {{{1*/ 180 Results* SpawnTriaResults(int* indices); 181 Results* SpawnBeamResults(int* indices); 182 Results* SpawnSingResults(int index ); 181 183 /*}}}*/ 182 184 … … 184 186 185 187 188 186 189 #endif -
issm/trunk/src/c/DataSet/Results.cpp
r3956 r4037 31 31 /*}}}*/ 32 32 /*FUNCTION Results::Results(int in_enum){{{1*/ 33 Results::Results(int in_enum): DataSet(in_enum) {33 Results::Results(int in_enum): DataSet(in_enum) { 34 34 //do nothing; 35 35 return; … … 42 42 /*}}}*/ 43 43 44 /*Object m ethods*/45 /*FUNCTION Results:: FindResult(Vec* presult,char* name){{{1*/46 int Results::FindResult(Vec* presult,char* name){44 /*Object management*/ 45 /*FUNCTION Results::SpawnBeamResults{{{1*/ 46 Results* Results::SpawnBeamResults(int* indices){ 47 47 48 /*Go through a dataset, and find a Result* object 49 *whith result name is "name" : */ 50 48 /*Intermediary*/ 51 49 vector<Object*>::iterator object; 52 Result* result=NULL; 50 Result* resultin=NULL; 51 Result* resultout=NULL; 53 52 54 int found=0; 53 /*Output*/ 54 Results* newresults=new Results(); 55 55 56 /*Go through results and call Spawn function*/ 56 57 for ( object=objects.begin() ; object < objects.end(); object++ ){ 57 58 58 /*Find param type objects: */ 59 if((*object)->Enum()==ResultEnum){ 59 /*Create new result*/ 60 resultin=(Result*)(*object); 61 resultout=resultin->SpawnBeamResult(indices); 60 62 61 /*Ok, this object is a result,recover it and ask which name it has: */ 62 result=(Result*)(*object); 63 /*Add result to new results*/ 64 newresults->AddObject(resultout); 65 } 63 66 64 if (strcmp(result->GetFieldName(),name)==0){ 65 /*Ok, this is the one! Recover the value of this result: */ 66 result->GetField(presult); 67 found=1; 68 break; 69 } 70 } 71 } 72 return found; 67 /*Assign output pointer*/ 68 return newresults; 73 69 } 74 70 /*}}}*/ 75 /*FUNCTION Results:: FindResult(void* pvalue, char* name){{{1*/76 int Results::FindResult(void* pvalue, char* name){71 /*FUNCTION Results::SpawnSingResults{{{1*/ 72 Results* Results::SpawnSingResults(int index){ 77 73 78 /*Go through a dataset, and find a Result* object 79 *which field name is "name" : */ 80 74 /*Intermediary*/ 81 75 vector<Object*>::iterator object; 82 Result* result=NULL; 76 Result* resultin=NULL; 77 Result* resultout=NULL; 83 78 84 int found=0; 79 /*Output*/ 80 Results* newresults=new Results(); 85 81 82 /*Go through results and call Spawn function*/ 86 83 for ( object=objects.begin() ; object < objects.end(); object++ ){ 87 84 88 /*Find param type objects: */ 89 if((*object)->Enum()==ResultEnum){ 85 /*Create new result*/ 86 resultin=(Result*)(*object); 87 resultout=resultin->SpawnSingResult(index); 90 88 91 /*Ok, this object is a result, recover it and ask which name it has: */ 92 result=(Result*)(*object); 89 /*Add result to new results*/ 90 newresults->AddObject(resultout); 91 } 93 92 94 if (strcmp(result->GetFieldName(),name)==0){ 95 /*Ok, this is the one! Recover the value of this result: */ 96 double** field=NULL; 97 field=(double**)pvalue; //not very safe, but hey! 98 result->GetField(field); 99 found=1; 100 break; 101 } 102 } 103 } 104 return found; 93 /*Assign output pointer*/ 94 return newresults; 105 95 } 106 96 /*}}}*/ 97 /*FUNCTION Results::SpawnTriaResults{{{1*/ 98 Results* Results::SpawnTriaResults(int* indices){ 99 100 /*Intermediary*/ 101 vector<Object*>::iterator object; 102 Result* resultin=NULL; 103 Result* resultout=NULL; 104 105 /*Output*/ 106 Results* newresults=new Results(); 107 108 /*Go through results and call Spawn function*/ 109 for ( object=objects.begin() ; object < objects.end(); object++ ){ 110 111 /*Create new result*/ 112 resultin=(Result*)(*object); 113 resultout=resultin->SpawnTriaResult(indices); 114 115 /*Add result to new results*/ 116 newresults->AddObject(resultout); 117 } 118 119 /*Assign output pointer*/ 120 return newresults; 121 } 122 /*}}}*/ -
issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
r4034 r4037 235 235 /*}}}*/ 236 236 /*Results{{{1*/ 237 StringResultEnum,238 DoubleVecResultEnum,239 DoubleMatResultEnum,237 DoubleResultEnum, 238 TriaVertexResultEnum, 239 PentaVertexResultEnum, 240 240 /*}}}*/ 241 241 /*Parameters{{{1*/ -
issm/trunk/src/c/Makefile.am
r4031 r4037 103 103 ./objects/Node.h\ 104 104 ./objects/Node.cpp\ 105 ./objects/Results/Result.h\ 106 ./objects/Results/DoubleVecResult.h\ 107 ./objects/Results/DoubleVecResult.cpp\ 108 ./objects/Results/DoubleMatResult.h\ 109 ./objects/Results/DoubleMatResult.cpp\ 110 ./objects/Results/StringResult.h\ 111 ./objects/Results/StringResult.cpp\ 105 ./objects/Results/DoubleResults.h\ 106 ./objects/Results/DoubleResults.cpp\ 107 ./objects/Results/TriaVertexResults.h\ 108 ./objects/Results/TriaVertexResults.cpp\ 109 ./objects/Results/PentaVertexResults.h\ 110 ./objects/Results/PentaVertexResults.cpp\ 112 111 ./objects/Elements/Tria.h\ 113 112 ./objects/Elements/Tria.cpp\ … … 471 470 ./modules/InputToResultx/InputToResultx.cpp\ 472 471 ./modules/InputToResultx/InputToResultx.h\ 473 ./modules/InputToResultx/PatchesSize.cpp\474 ./modules/InputToResultx/InputToPatches.cpp\475 472 ./modules/ExtrudeInputx/ExtrudeInputx.cpp\ 476 473 ./modules/ExtrudeInputx/ExtrudeInputx.h\ … … 574 571 ./objects/Hook.h\ 575 572 ./objects/Hook.cpp\ 576 ./objects/Results/Result.h\ 577 ./objects/Results/DoubleVecResult.h\ 578 ./objects/Results/DoubleVecResult.cpp\ 579 ./objects/Results/DoubleMatResult.h\ 580 ./objects/Results/DoubleMatResult.cpp\ 581 ./objects/Results/StringResult.h\ 582 ./objects/Results/StringResult.cpp\ 573 ./objects/Results/DoubleResults.h\ 574 ./objects/Results/DoubleResults.cpp\ 575 ./objects/Results/TriaVertexResults.h\ 576 ./objects/Results/TriaVertexResults.cpp\ 577 ./objects/Results/PentaVertexResults.h\ 578 ./objects/Results/PentaVertexResults.cpp\ 583 579 ./objects/Elements/Tria.h\ 584 580 ./objects/Elements/Tria.cpp\ … … 935 931 ./modules/InputToResultx/InputToResultx.cpp\ 936 932 ./modules/InputToResultx/InputToResultx.h\ 937 ./modules/InputToResultx/PatchesSize.cpp\938 ./modules/InputToResultx/InputToPatches.cpp\939 933 ./modules/ExtrudeInputx/ExtrudeInputx.cpp\ 940 934 ./modules/ExtrudeInputx/ExtrudeInputx.h\ -
issm/trunk/src/c/modules/UpdateInputsFromSolutionx/UpdateInputsFromSolutionx.cpp
r3969 r4037 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void UpdateInputsFromSolutionx( DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,Vec solution, int analysis_type, int sub_analysis_type ){11 void UpdateInputsFromSolutionx( DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,Vec solution, int analysis_type, int sub_analysis_type,int step=0){ 12 12 13 13 double* serial_solution=NULL; … … 17 17 18 18 /*Call overloaded form of UpdateInputsFromSolutionx: */ 19 UpdateInputsFromSolutionx( elements, nodes, vertices, loads, materials, parameters,serial_solution, analysis_type, sub_analysis_type );19 UpdateInputsFromSolutionx( elements, nodes, vertices, loads, materials, parameters,serial_solution, analysis_type, sub_analysis_type,step); 20 20 21 21 /*Free ressources:*/ … … 44 44 45 45 } 46 47 /*Same routines, with additional timestep argument: */ 48 void UpdateInputsFromSolutionx( DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,Vec solution, int analysis_type, int sub_analysis_type,int timestep){ 49 50 51 double* serial_solution=NULL; 52 53 /*Serialize solution, so that elements can index into it on every CPU: */ 54 VecToMPISerial(&serial_solution,solution); 55 56 /*Call overloaded form of UpdateInputsFromSolutionx: */ 57 UpdateInputsFromSolutionx( elements, nodes, vertices, loads, materials, parameters,serial_solution, analysis_type, sub_analysis_type,int timestep); 58 59 /*Free ressources:*/ 60 xfree((void**)&serial_solution); 61 62 } 63 64 65 66 void UpdateInputsFromSolutionx( DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,double* solution, int analysis_type, int sub_analysis_type,int timestep){ 67 68 /*Intermediary*/ 69 int i; 70 Element* element=NULL; 71 72 /*First, get elements and loads configured: */ 73 elements-> Configure(elements,loads, nodes,vertices, materials,parameters); 74 loads-> Configure(elements,loads, nodes,vertices, materials,parameters); 75 nodes-> Configure(elements,loads, nodes,vertices, materials,parameters); 76 parameters->Configure(elements,loads, nodes,vertices, materials,parameters); 77 78 /*Elements drive the update: */ 79 for (i=0;i<elements->Size();i++){ 80 element=(Element*)elements->GetObjectByOffset(i); 81 element->UpdateInputsFromSolution(solution,analysis_type,sub_analysis_type,timestep); 82 } 83 84 } -
issm/trunk/src/c/modules/UpdateInputsFromSolutionx/UpdateInputsFromSolutionx.h
r3922 r4037 13 13 void UpdateInputsFromSolutionx( DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,double* solution, int analysis_type, int sub_analysis_type); 14 14 15 //with timestep 16 void UpdateInputsFromSolutionx( DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials, Parameters* parameters,Vec solution, int analysis_type, int sub_analysis_type,int timestep); 17 void UpdateInputsFromSolutionx( DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,double* solution, int analysis_type, int sub_analysis_type,int timestep); 18 15 19 #endif /* _UPDATEINPUTSFROMSOLUTIONXX_H */ 16 20 -
issm/trunk/src/c/objects/Elements/Beam.cpp
r4025 r4037 137 137 /*FUNCTION Beam::GetSolutionFromInputs(Vec solution, int analysis_type,int sub_analysis_type);{{{1*/ 138 138 void Beam::GetSolutionFromInputs(Vec solution, int analysis_type,int sub_analysis_type){ 139 ISSMERROR(" not supported yet!"); 140 } 141 /*}}}*/ 142 /*FUNCTION Beam::InputToResult(int enum_type,int step,double time){{{1*/ 143 void Beam::InputToResult(int enum_type,int step,double time){ 139 144 ISSMERROR(" not supported yet!"); 140 145 } -
issm/trunk/src/c/objects/Elements/Beam.h
r4034 r4037 61 61 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 62 62 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 63 64 63 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type); 65 66 void DepthAverageInputAtBase(int enum_type){ISSMERROR("not implemented yet");};64 void DepthAverageInputAtBase(int enum_type){ISSMERROR("not implemented yet");}; 65 void InputToResult(int enum_type,int step,double time); 67 66 /*}}}*/ 68 67 /*numerics: {{{1*/ -
issm/trunk/src/c/objects/Elements/Element.h
r4034 r4037 50 50 virtual void PatchFill(int* pcount, double* patches,int numcols,int max_vertices,int enum_type)=0; 51 51 virtual void Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type)=0; 52 virtual void InputToResult(int enum_type,int step,double time); 52 53 53 54 /*Implementation: */ -
issm/trunk/src/c/objects/Elements/Penta.cpp
r4034 r4037 30 30 31 31 this->inputs=NULL; 32 this->results=NULL; 32 33 this->parameters=NULL; 33 34 } … … 36 37 Penta::~Penta(){ 37 38 delete inputs; 39 delete results; 38 40 this->parameters=NULL; 39 41 xfree((void**)&collapse); … … 77 79 this->parameters=NULL; 78 80 81 /*intialize inputs and results: */ 82 this->inputs=new Inputs(); 83 this->results=new Results(); 84 79 85 //collpase flags 80 86 collapse=(bool*)xcalloc(nummodels,sizeof(bool)); … … 109 115 this->SetHookNodes(penta_node_ids,analysis_counter); this->nodes=NULL; //set hook to nodes, for this analysis type 110 116 111 //intialize inputs, and add as many inputs per element as requested: 112 this->inputs=new Inputs(); 117 //add as many inputs per element as requested: 113 118 if (iomodel->thickness) { 114 119 for(i=0;i<6;i++)nodeinputs[i]=iomodel->thickness[penta_vertex_ids[i]-1]; … … 241 246 penta->inputs=new Inputs(); 242 247 } 248 if(this->results){ 249 penta->results=(Results*)this->results->Copy(); 250 } 251 else{ 252 penta->results=new Results(); 253 } 243 254 /*point parameters: */ 244 255 penta->parameters=this->parameters; … … 319 330 neighbors=NULL; 320 331 321 /*demarshall inputs : */332 /*demarshall inputs and results: */ 322 333 inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset); 334 results=(Results*)DataSetDemarshallRaw(&marshalled_dataset); 323 335 324 336 /*demarshall internal parameters: */ … … 353 365 printf(" inputs\n"); 354 366 inputs->DeepEcho(); 367 printf(" results\n"); 368 results->DeepEcho(); 355 369 printf(" collapse: \n "); 356 370 for(i=0;i<numanalyses;i++)printf("%s|",collapse[i]?"true":"false"); … … 379 393 char* marshalled_inputs=NULL; 380 394 int marshalled_inputs_size; 395 char* marshalled_results=NULL; 396 int marshalled_results_size; 381 397 382 398 /*recover marshalled_dataset: */ … … 399 415 hneighbors.Marshall(&marshalled_dataset); 400 416 401 /*Marshall inputs : */417 /*Marshall inputs and results: */ 402 418 marshalled_inputs_size=inputs->MarshallSize(); 403 419 marshalled_inputs=inputs->Marshall(); … … 405 421 marshalled_dataset+=marshalled_inputs_size; 406 422 423 marshalled_results_size=results->MarshallSize(); 424 marshalled_results=results->Marshall(); 425 memcpy(marshalled_dataset,marshalled_results,marshalled_results_size*sizeof(char)); 426 marshalled_dataset+=marshalled_results_size; 427 407 428 /*marshall internal parameters: */ 408 429 memcpy(marshalled_dataset,collapse,numanalyses*sizeof(bool));marshalled_dataset+=numanalyses*sizeof(bool); … … 411 432 412 433 xfree((void**)&marshalled_inputs); 434 xfree((void**)&marshalled_results); 413 435 414 436 *pmarshalled_dataset=marshalled_dataset; … … 430 452 +hneighbors.MarshallSize() 431 453 +inputs->MarshallSize() 454 +results->MarshallSize() 432 455 +numanalyses*sizeof(bool) 433 456 +sizeof(int); //sizeof(int) for enum type … … 445 468 Parameters* tria_parameters=NULL; 446 469 Inputs* tria_inputs=NULL; 470 Results* tria_results=NULL; 447 471 448 472 indices[0]=g0; … … 452 476 tria_parameters=this->parameters; 453 477 tria_inputs=(Inputs*)this->inputs->SpawnTriaInputs(indices); 478 tria_results=(Results*)this->results->SpawnTriaResults(indices); 454 479 455 480 tria=new Tria(); 456 481 tria->id=this->id; 457 482 tria->inputs=tria_inputs; 483 tria->results=tria_results; 458 484 tria->parameters=tria_parameters; 459 485 … … 478 504 Parameters *beam_parameters = NULL; 479 505 Inputs *beam_inputs = NULL; 506 Results *beam_results = NULL; 480 507 481 508 indices[0]=g0; … … 484 511 beam_parameters=this->parameters; 485 512 beam_inputs=(Inputs*)this->inputs->SpawnBeamInputs(indices); 513 beam_results=(Results*)this->results->SpawnBeamResults(indices); 486 514 487 515 beam=new Beam(); 488 516 beam->id=this->id; 489 517 beam->inputs=beam_inputs; 518 beam->results=beam_results; 490 519 beam->parameters=beam_parameters; 491 520 … … 506 535 Parameters *sing_parameters = NULL; 507 536 Inputs *sing_inputs = NULL; 537 Results *sing_results = NULL; 508 538 509 539 sing_parameters=this->parameters; 510 540 sing_inputs=(Inputs*)this->inputs->SpawnSingInputs(index); 541 sing_results=(Results*)this->results->SpawnSingResults(index); 511 542 512 543 sing=new Sing(); 513 544 sing->id=this->id; 514 545 sing->inputs=sing_inputs; 546 sing->results=sing_results; 515 547 sing->parameters=sing_parameters; 516 548 … … 560 592 /*output error if not found*/ 561 593 ISSMERROR("Node not found in Penta"); 594 } 595 /*}}}*/ 596 /*FUNCTION Penta::InputToResult(int enum_type,int step,double time){{{1*/ 597 void Penta::InputToResult(int enum_type,int step,double time){ 598 599 int i; 600 bool found = false; 601 Input *input = NULL; 602 603 /*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */ 604 for (i=0;i<this->inputs->Size();i++){ 605 input=(Input*)this->inputs->GetObjectByOffset(i); 606 if (input->EnumType()==enum_type){ 607 found=true; 608 break; 609 } 610 } 611 612 /*If we don't find it, no big deal, just don't do the transfer. Otherwise, build a new Result 613 * object out of the input, with the additional step and time information: */ 614 this->results->AddObject(input->SpawnResult(step,time)); 615 562 616 } 563 617 /*}}}*/ -
issm/trunk/src/c/objects/Elements/Penta.h
r4034 r4037 36 36 Parameters *parameters; //pointer to solution parameters 37 37 Inputs *inputs; 38 Results *results; 38 39 39 40 /*internal parameters: */ … … 60 61 int MarshallSize(); 61 62 int MyRank(); 62 void* 63 void* 64 void* 63 void* SpawnSing(int g0); 64 void* SpawnBeam(int g0, int g1); 65 void* SpawnTria(int g0, int g1, int g2); 65 66 void SetClone(int* minranks); 66 67 double* GaussFromNode(Node* node); 68 void InputToResult(int enum_type,int step,double time); 67 69 68 70 /*}}}*/ -
issm/trunk/src/c/objects/Elements/Sing.cpp
r4034 r4037 134 134 /*FUNCTION Sing::GetSolutionFromInputs(Vec solution, int analysis_type,int sub_analysis_type);{{{1*/ 135 135 void Sing::GetSolutionFromInputs(Vec solution, int analysis_type,int sub_analysis_type){ 136 ISSMERROR(" not supported yet!"); 137 } 138 /*}}}*/ 139 /*FUNCTION Sing::InputToResult(int enum_type,int step,double time){{{1*/ 140 void Sing::InputToResult(int enum_type,int step,double time){ 136 141 ISSMERROR(" not supported yet!"); 137 142 } -
issm/trunk/src/c/objects/Elements/Sing.h
r4034 r4037 61 61 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 62 62 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 63 64 63 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type); 65 66 64 void DepthAverageInputAtBase(int enum_type){ISSMERROR("not implemented yet");}; 65 void InputToResult(int enum_type,int step,double time); 67 66 /*}}}*/ 68 67 /*numerics: {{{1*/ -
issm/trunk/src/c/objects/Elements/Tria.cpp
r4034 r4037 28 28 this->inputs=NULL; 29 29 this->parameters=NULL; 30 this->results=NULL; 30 31 } 31 32 /*}}}*/ … … 33 34 Tria::~Tria(){ 34 35 delete inputs; 36 delete results; 35 37 this->parameters=NULL; 36 38 } … … 60 62 this->parameters=NULL; 61 63 64 /*intialize inputs and results: */ 65 this->inputs=new Inputs(); 66 this->results=new Results(); 67 62 68 } 63 69 /*}}}*/ … … 98 104 this->SetHookNodes(tria_node_ids,analysis_counter); this->nodes=NULL; //set hook to nodes, for this analysis type 99 105 100 /*intialize inputs, and add as many inputs per element as requested:*/ 101 this->inputs=new Inputs(); 102 106 /*add as many inputs per element as requested:*/ 103 107 if (iomodel->thickness) { 104 108 for(i=0;i<3;i++)nodeinputs[i]=iomodel->thickness[tria_vertex_ids[i]-1]; … … 224 228 else{ 225 229 tria->inputs=new Inputs(); 230 } 231 if(this->results){ 232 tria->results=(Results*)this->results->Copy(); 233 } 234 else{ 235 tria->results=new Results(); 226 236 } 227 237 /*point parameters: */ … … 299 309 /*demarshall inputs: */ 300 310 inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset); 311 results=(Results*)DataSetDemarshallRaw(&marshalled_dataset); 301 312 302 313 /*parameters: may not exist even yet, so let Configure handle it: */ … … 334 345 if (inputs) inputs->DeepEcho(); 335 346 else printf("inputs=NULL\n"); 347 348 if (results) results->DeepEcho(); 349 else printf("results=NULL\n"); 336 350 337 351 return; … … 352 366 char* marshalled_inputs=NULL; 353 367 int marshalled_inputs_size; 368 char* marshalled_results=NULL; 369 int marshalled_results_size; 354 370 355 371 /*recover marshalled_dataset: */ … … 378 394 marshalled_dataset+=marshalled_inputs_size; 379 395 396 /*Marshall results: */ 397 marshalled_results_size=results->MarshallSize(); 398 marshalled_results=results->Marshall(); 399 memcpy(marshalled_dataset,marshalled_results,marshalled_results_size*sizeof(char)); 400 marshalled_dataset+=marshalled_results_size; 401 380 402 /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/ 381 403 382 404 xfree((void**)&marshalled_inputs); 405 xfree((void**)&marshalled_results); 383 406 384 407 *pmarshalled_dataset=marshalled_dataset; … … 400 423 +hmatpar.MarshallSize() 401 424 +inputs->MarshallSize() 425 +results->MarshallSize() 402 426 +sizeof(int); //sizeof(int) for enum type 403 427 } … … 414 438 Parameters *beam_parameters = NULL; 415 439 Inputs *beam_inputs = NULL; 440 Results *beam_results = NULL; 416 441 417 442 indices[0]=g0; … … 420 445 beam_parameters=this->parameters; 421 446 beam_inputs=(Inputs*)this->inputs->SpawnBeamInputs(indices); 447 beam_results=(Results*)this->results->SpawnBeamResults(indices); 422 448 423 449 beam=new Beam(); 424 450 beam->id=this->id; 425 451 beam->inputs=beam_inputs; 452 beam->results=beam_results; 426 453 beam->parameters=beam_parameters; 427 454 … … 443 470 Parameters *sing_parameters = NULL; 444 471 Inputs *sing_inputs = NULL; 472 Results *sing_results = NULL; 445 473 446 474 sing_parameters=this->parameters; 447 475 sing_inputs=(Inputs*)this->inputs->SpawnSingInputs(index); 476 sing_results=(Results*)this->results->SpawnSingResults(index); 448 477 449 478 sing=new Sing(); 450 479 sing->id=this->id; 451 480 sing->inputs=sing_inputs; 481 sing->results=sing_results; 452 482 sing->parameters=sing_parameters; 453 483 … … 458 488 459 489 return sing; 490 } 491 /*}}}*/ 492 /*FUNCTION Tria::InputToResult(int enum_type,int step,double time){{{1*/ 493 void Tria::InputToResult(int enum_type,int step,double time){ 494 495 int i; 496 bool found = false; 497 Input *input = NULL; 498 499 /*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */ 500 for (i=0;i<this->inputs->Size();i++){ 501 input=(Input*)this->inputs->GetObjectByOffset(i); 502 if (input->EnumType()==enum_type){ 503 found=true; 504 break; 505 } 506 } 507 508 /*If we don't find it, no big deal, just don't do the transfer. Otherwise, build a new Result 509 * object out of the input, with the additional step and time information: */ 510 this->results->AddObject(input->SpawnResult(step,time)); 511 460 512 } 461 513 /*}}}*/ -
issm/trunk/src/c/objects/Elements/Tria.h
r4036 r4037 58 58 void* SpawnSing(int g0); 59 59 void* SpawnBeam(int g0, int g1); 60 void InputToResult(int enum_type,int step,double time); 60 61 /*}}}*/ 61 62 /*FUNCTION element numerical routines {{{1*/ -
issm/trunk/src/c/objects/Inputs/BeamVertexInput.cpp
r3956 r4037 167 167 } 168 168 /*}}}*/ 169 /*FUNCTION BeamVertexInput::SpawnResult{{{1*/ 170 Result* BeamVertexInput::SpawnResult(int step, double time){ 171 172 return new BeamVertexResult(this->enum_type,this->values,step,time); 173 174 } 175 /*}}}*/ 169 176 170 177 /*Object functions*/ -
issm/trunk/src/c/objects/Inputs/BeamVertexInput.h
r3956 r4037 50 50 Input* SpawnBeamInput(int* indices); 51 51 Input* SpawnTriaInput(int* indices); 52 Result* SpawnResult(int step, double time); 53 52 54 /*}}}*/ 53 55 /*numerics: {{{1*/ -
issm/trunk/src/c/objects/Inputs/BoolInput.cpp
r3956 r4037 175 175 } 176 176 /*}}}*/ 177 /*FUNCTION BoolInput::SpawnResult{{{1*/ 178 Result* BoolInput::SpawnResult(int step, double time){ 179 180 return new BoolResult(this->enum_type,this->value,step,time); 181 182 } 183 /*}}}*/ 177 184 178 185 /*Object functions*/ -
issm/trunk/src/c/objects/Inputs/BoolInput.h
r3956 r4037 50 50 Input* SpawnBeamInput(int* indices); 51 51 Input* SpawnTriaInput(int* indices); 52 Result* SpawnResult(int step, double time); 53 52 54 /*}}}*/ 53 55 /*numerics: {{{1*/ -
issm/trunk/src/c/objects/Inputs/DoubleInput.cpp
r3956 r4037 175 175 } 176 176 /*}}}*/ 177 /*FUNCTION DoubleInput::SpawnResult{{{1*/ 178 Result* DoubleInput::SpawnResult(int step, double time){ 179 180 return new DoubleResult(this->enum_type,this->value,step,time); 181 182 } 183 /*}}}*/ 177 184 178 185 /*Object functions*/ -
issm/trunk/src/c/objects/Inputs/DoubleInput.h
r3956 r4037 50 50 Input* SpawnBeamInput(int* indices); 51 51 Input* SpawnTriaInput(int* indices); 52 Result* SpawnResult(int step, double time); 53 52 54 /*}}}*/ 53 55 /*numerics: {{{1*/ -
issm/trunk/src/c/objects/Inputs/Input.h
r3956 r4037 11 11 #include "../Object.h" 12 12 class Node; 13 class Result; 13 14 #include "../Node.h" 14 15 /*}}}*/ … … 44 45 virtual void GetVyStrainRate3dPattyn(double* epsilonvy,double* xyz_list, double* gauss)=0; 45 46 virtual void ChangeEnum(int newenumtype)=0; 47 46 48 virtual Input* SpawnSingInput(int index)=0; 47 49 virtual Input* SpawnBeamInput(int* indices)=0; 48 50 virtual Input* SpawnTriaInput(int* indices)=0; 51 virtual Result* SpawnResult(int step, double time)=0; 49 52 virtual int PatchSize(void)=0; 50 53 virtual void PatchFill(double* patch, int max_vertices,Parameters* parameters)=0; 54 55 51 56 /*}}}*/ 52 57 -
issm/trunk/src/c/objects/Inputs/IntInput.cpp
r3956 r4037 172 172 } 173 173 /*}}}*/ 174 /*FUNCTION IntInput::SpawnResult{{{1*/ 175 Result* IntInput::SpawnResult(int step, double time){ 176 177 return new IntResult(this->enum_type,this->value,step,time); 178 179 } 180 /*}}}*/ 174 181 175 182 /*Object functions*/ -
issm/trunk/src/c/objects/Inputs/IntInput.h
r3956 r4037 50 50 Input* SpawnBeamInput(int* indices); 51 51 Input* SpawnTriaInput(int* indices); 52 Result* SpawnResult(int step, double time); 53 52 54 /*}}}*/ 53 55 /*numerics: {{{1*/ -
issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp
r3956 r4037 197 197 /*Assign output*/ 198 198 return outinput; 199 200 } 201 /*}}}*/ 202 /*FUNCTION PentaVertexInput::SpawnResult{{{1*/ 203 Result* PentaVertexInput::SpawnResult(int step, double time){ 204 205 return new PentaVertexResult(this->enum_type,this->values,step,time); 199 206 200 207 } -
issm/trunk/src/c/objects/Inputs/PentaVertexInput.h
r3956 r4037 49 49 Input* SpawnBeamInput(int* indices); 50 50 Input* SpawnTriaInput(int* indices); 51 Result* SpawnResult(int step, double time); 52 51 53 /*}}}*/ 52 54 /*numerics: {{{1*/ -
issm/trunk/src/c/objects/Inputs/SingVertexInput.cpp
r3956 r4037 158 158 } 159 159 /*}}}*/ 160 /*FUNCTION SingVertexInput::SpawnResult{{{1*/ 161 Result* SingVertexInput::SpawnResult(int step, double time){ 162 163 return new SingVertexResult(this->enum_type,this->value,step,time); 164 165 } 166 /*}}}*/ 160 167 161 168 /*Object functions*/ -
issm/trunk/src/c/objects/Inputs/SingVertexInput.h
r3956 r4037 49 49 Input* SpawnBeamInput(int* indices); 50 50 Input* SpawnTriaInput(int* indices); 51 Result* SpawnResult(int step, double time); 52 51 53 /*}}}*/ 52 54 /*numerics: {{{1*/ -
issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp
r3956 r4037 183 183 /*Assign output*/ 184 184 return outinput; 185 186 } 187 /*}}}*/ 188 /*FUNCTION TriaVertexInput::SpawnResult{{{1*/ 189 Result* TriaVertexInput::SpawnResult(int step, double time){ 190 191 return new TriaVertexResult(this->enum_type,this->values,step,time); 185 192 186 193 } -
issm/trunk/src/c/objects/Inputs/TriaVertexInput.h
r4015 r4037 49 49 Input* SpawnBeamInput(int* indices); 50 50 Input* SpawnTriaInput(int* indices); 51 Result* SpawnResult(int step, double time); 52 51 53 /*}}}*/ 52 54 /*numerics: {{{1*/ -
issm/trunk/src/c/objects/objects.h
r4001 r4037 15 15 #include "./Node.h" 16 16 #include "./NodeSets.h" 17 #include "./Result.h"18 17 #include "./IoModel.h" 19 18 … … 52 51 /*Results: */ 53 52 #include "./Results/Result.h" 54 #include "./Results/ StringResult.h"55 #include "./Results/ DoubleVecResult.h"56 #include "./Results/ DoubleMatResult.h"53 #include "./Results/DoubleResult.h" 54 #include "./Results/TriaVertexResult.h" 55 #include "./Results/PentaVertexResult.h" 57 56 58 57 /*Materials: */ -
issm/trunk/src/c/solutions/bedslope_core.cpp
r4030 r4037 1 1 /*!\file: bedslope_core.cpp 2 * \brief: core of the bedslope solution2 * \brief: core of the slope solution 3 3 */ 4 4 … … 17 17 bool ishutter; 18 18 19 Vec slopex=NULL;20 Vec slopey=NULL;21 22 19 /*Recover some parameters: */ 23 20 femmodel->parameters->FindParam(&verbose,VerboseEnum); … … 27 24 28 25 /*Call on core computations: */ 29 solver_linear( &slopex,femmodel,SlopeComputeAnalysisEnum,BedSlopeXAnalysisEnum);30 solver_linear( &slopey,femmodel,SlopeComputeAnalysisEnum,BedSlopeYAnalysisEnum);26 solver_linear(NULL,femmodel,SlopeComputeAnalysisEnum,BedSlopeXAnalysisEnum); 27 solver_linear(NULL,femmodel,SlopeComputeAnalysisEnum,BedSlopeYAnalysisEnum); 31 28 32 /*Plug solution into inputs: */ 33 UpdateInputsFromSolutionx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,slopex,SlopeComputeAnalysisEnum,BedSlopeXAnalysisEnum); 34 UpdateInputsFromSolutionx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,slopey,SlopeComputeAnalysisEnum,BedSlopeYAnalysisEnum); 35 36 /*extrude if we are in 3D: */ 29 /*extrude inputs if we are in 3D: */ 37 30 if (dim==3){ 38 31 if(verbose)_printf_("%s\n","extruding slope in 3d..."); … … 40 33 InputsExtrudex( femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,BedSlopeYEnum,0); 41 34 } 42 43 /*Free ressources:*/44 VecFree(&slopex);45 VecFree(&slopey);46 35 } -
issm/trunk/src/c/solutions/diagnostic.cpp
r4028 r4037 26 26 bool qmu_analysis=false; 27 27 bool control_analysis=false; 28 bool waitonlock=false; 28 29 29 30 /*FemModel: */ 30 31 FemModel* femmodel=NULL; 31 32 32 /*Results: */33 bool waitonlock=false;34 35 33 /*time*/ 36 34 double start, finish; … … 66 64 fid=pfopen(inputfilename,"rb"); 67 65 68 _printf_("create finite element model , using analyses types statically defined above:\n");66 _printf_("create finite element model:\n"); 69 67 femmodel=new FemModel(fid,solution_type,analyses,5); 70 68 … … 96 94 97 95 _printf_("write results to disk:\n"); 98 OutputResults(femmodel,outputfilename,Diagnostic AnalysisEnum);96 OutputResults(femmodel,outputfilename,DiagnosticSolutionEnum); 99 97 } 100 98 else{ -
issm/trunk/src/c/solutions/diagnostic_core.cpp
r4029 r4037 46 46 47 47 if(verbose)_printf_("%s\n"," computing hutter velocities..."); 48 solver_linear(NULL,femmodel,DiagnosticAnalysisEnum,HutterAnalysisEnum); 48 solver_linear(NULL,femmodel,DiagnosticAnalysisEnum,HutterAnalysisEnum); 49 49 50 50 if (ismacayealpattyn) ResetBoundaryConditions(femmodel,DiagnosticAnalysisEnum,HorizAnalysisEnum); … … 76 76 } 77 77 } 78 79 if(verbose)_printf_("saving results:\n"); 80 InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VxEnum); 81 InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VyEnum); 82 InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum); 83 if(dim==3) InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VxEnum); 84 85 78 86 } -
issm/trunk/src/c/solutions/surfaceslope_core.cpp
r4030 r4037 17 17 bool ishutter; 18 18 19 Vec slopex=NULL;20 Vec slopey=NULL;21 22 19 /*Recover some parameters: */ 23 20 femmodel->parameters->FindParam(&verbose,VerboseEnum); … … 27 24 28 25 /*Call on core computations: */ 29 solver_linear( &slopex,femmodel,SlopeComputeAnalysisEnum,SurfaceSlopeXAnalysisEnum);30 solver_linear( &slopey,femmodel,SlopeComputeAnalysisEnum,SurfaceSlopeYAnalysisEnum);26 solver_linear(NULL,femmodel,SlopeComputeAnalysisEnum,SurfaceSlopeXAnalysisEnum); 27 solver_linear(NULL,femmodel,SlopeComputeAnalysisEnum,SurfaceSlopeYAnalysisEnum); 31 28 32 /*Plug solution into inputs: */ 33 UpdateInputsFromSolutionx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,slopex,SlopeComputeAnalysisEnum,SurfaceSlopeXAnalysisEnum); 34 UpdateInputsFromSolutionx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,slopey,SlopeComputeAnalysisEnum,SurfaceSlopeYAnalysisEnum); 35 36 /*extrude if we are in 3D: */ 29 /*extrude inputs if we are in 3D: */ 37 30 if (dim==3){ 38 31 if(verbose)_printf_("%s\n","extruding slope in 3d..."); … … 40 33 InputsExtrudex( femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,SurfaceSlopeYEnum,0); 41 34 } 42 43 /*Free ressources:*/44 VecFree(&slopex);45 VecFree(&slopey);46 35 } -
issm/trunk/src/c/solutions/thermal.cpp
r3938 r4037 27 27 char* lockname=NULL; 28 28 bool qmu_analysis=false; 29 int numberofnodes;30 29 bool waitonlock=false; 31 30 32 /*Model: */ 33 Model* model=NULL; 34 35 /*Results: */ 36 Results* results=NULL; 31 /*FemModel: */ 32 FemModel* femmodel=NULL; 37 33 38 Param* param=NULL;39 double dt;40 double yts;41 42 34 /*time*/ 43 35 double start, finish; 44 36 double start_core, finish_core; 45 37 double start_init, finish_init; 46 38 39 int analyses[2]={ThermalAnalysisEnum,MeltingAnalysisEnum}; 40 int solution_type=ThermalSolutionEnum; 41 47 42 MODULEBOOT(); 48 43 … … 59 54 MPI_Comm_size(MPI_COMM_WORLD,&num_procs); 60 55 56 _printf_("recover , input file name and output file name:\n"); 61 57 inputfilename=argv[2]; 62 58 outputfilename=argv[3]; 63 59 lockname=argv[4]; 64 60 61 /*Initialize femmodel structure: */ 62 MPI_Barrier(MPI_COMM_WORLD); start_init=MPI_Wtime(); 63 65 64 /*Open handle to data on disk: */ 66 65 fid=pfopen(inputfilename,"rb"); 67 66 68 /*Initialize model structure: */ 69 MPI_Barrier(MPI_COMM_WORLD); start_init=MPI_Wtime(); 70 model=new Model(); 67 _printf_("create finite element model:\n"); 68 femmodel=new FemModel(fid,solution_type,analyses,2); 71 69 72 _printf_("read and create thermal finite element model:\n"); 73 model->AddFormulation(fid,ThermalAnalysisEnum); 74 _printf_("read and create melting finite element model:\n"); 75 model->AddFormulation(fid,MeltingAnalysisEnum); 76 77 /*recover parameters: */ 78 model->FindParam(&waitonlock,WaitOnLockEnum); 79 model->FindParam(&qmu_analysis,QmuAnalysisEnum); 70 /*get parameters: */ 71 femmodel->parameters->FindParam(&qmu_analysis,QmuAnalysisEnum); 72 femmodel->parameters->FindParam(&waitonlock,WaitOnLockEnum); 80 73 81 74 MPI_Barrier(MPI_COMM_WORLD); finish_init=MPI_Wtime(); … … 87 80 _printf_("call computational core:\n"); 88 81 MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( ); 89 results=thermal_core(model);82 thermal_core(femmodel); 90 83 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 84 85 86 _printf_("write results to disk:\n"); 87 OutputResults(femmodel,outputfilename,ThermalSolutionEnum); 91 88 92 _printf_("write results to disk:\n");93 OutputResults(results,outputfilename);94 89 } 95 90 else{ 91 96 92 /*run qmu analysis: */ 97 93 _printf_("calling qmu analysis on thermal core:\n"); … … 112 108 113 109 /*Free ressources */ 114 delete model; 115 delete results; 110 delete femmodel; 116 111 117 112 /*Get finish time and close*/ -
issm/trunk/src/c/solutions/thermal_core.cpp
r3941 r4037 9 9 #include "./solutions.h" 10 10 #include "../modules/modules.h" 11 #include "../include/include.h" 11 12 12 Results* thermal_core(Model*model){13 void thermal_core(FemModel* femmodel){ 13 14 14 extern int my_rank;15 15 int i; 16 16 17 /*fem models: */18 FemModel* fem_t=NULL;19 FemModel* fem_m=NULL;20 21 /*output: */22 Results* results=NULL;23 Result* result=NULL;24 25 /*solutions vectors: */26 Vec* t_g=NULL;27 Vec* m_g=NULL;28 double* time=NULL;29 double* t_g_serial=NULL;30 double* m_g_serial=NULL;31 32 17 /*intermediary*/ 33 Vec Vect=NULL; 34 Vec Vecm=NULL; 35 36 /*flags: */ 37 int verbose=0; 38 int numberofdofspernode; 39 int numberofnodes; 18 double time; 19 int verbose; 40 20 int nsteps; 41 21 double ndt; 42 22 double dt; 43 44 int sub_analysis_type;45 23 double melting_offset; 46 24 47 //initialize results 48 results=new Results(); 25 //first recover parameters common to all solutions 26 femmodel->parameters->FindParam(&verbose,VerboseEnum); 27 femmodel->parameters->FindParam(&ndt,NdtEnum); 28 femmodel->parameters->FindParam(&dt,DtEnum); 49 29 50 /*recover fem models: */ 51 fem_t=model->GetFormulation(ThermalAnalysisEnum); 52 fem_m=model->GetFormulation(MeltingAnalysisEnum); 30 /*Compute number of time steps: */ 31 if((dt==0)|| (ndt==0)){ 32 dt=0; 33 nsteps=1; 34 } 35 else nsteps=(int)(ndt/dt); 53 36 54 //first recover parameters common to all solutions 55 fem_t->parameters->FindParam(&numberofnodes,NumberOfNodesEnum); 56 fem_t->parameters->FindParam(&sub_analysis_type,SubAnalysisTypeEnum); 57 fem_t->parameters->FindParam(&verbose,VerboseEnum); 58 fem_t->parameters->FindParam(&ndt,NdtEnum); 59 fem_t->parameters->FindParam(&dt,DtEnum); 60 61 if(dt==0){ 62 63 time=(double*)xmalloc(sizeof(double)); 64 time[0]=0; 65 66 /*allocate t_g and m_g arrays: */ 67 t_g=(Vec*)xmalloc(sizeof(Vec)); 68 m_g=(Vec*)xmalloc(sizeof(Vec)); 37 /*Loop through time: */ 38 for(i=0;i<nsteps;i++){ 39 40 if(verbose)_printf_("time step: %i/%i\n",i+1,nsteps); 41 time=(i+1)*dt; 69 42 70 43 if(verbose)_printf_("computing temperatures:\n"); 71 thermal_core_nonlinear(&t_g[0],&melting_offset,fem_t,ThermalAnalysisEnum,NoneAnalysisEnum); 72 model->UpdateInputsFromVector(t_g[0],TemperatureEnum,VertexEnum); 73 model->UpdateInputsFromConstant(melting_offset,MeltingOffsetEnum); 74 44 solver_thermal_nonlinear(NULL,NULL,femmodel,ThermalAnalysisEnum,NoneAnalysisEnum); 45 75 46 if(verbose)_printf_("computing melting:\n"); 76 diagnostic_core_linear(&m_g[0],fem_m,MeltingAnalysisEnum,NoneAnalysisEnum); 47 solver_linear(NULL,femmodel,MeltingAnalysisEnum,NoneAnalysisEnum); 48 49 if(verbose)_printf_("saving results:\n"); 50 InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,TemperatureEnum,i,time); 51 InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,MeltingRateEnum,i,time); 52 77 53 } 78 else{79 80 nsteps=(int)(ndt/dt);81 time=(double*)xmalloc((nsteps)*sizeof(double));82 83 /*allocate t_g and m_g arrays: */84 t_g=(Vec*)xmalloc((nsteps)*sizeof(Vec));85 m_g=(Vec*)xmalloc((nsteps)*sizeof(Vec));86 87 for(i=0;i<nsteps;i++){88 if(verbose)_printf_("time step: %i/%i\n",i+1,nsteps);89 time[i]=(i+1)*dt;90 91 if(verbose)_printf_("computing temperatures:\n");92 thermal_core_nonlinear(&t_g[i],&melting_offset,fem_t,ThermalAnalysisEnum,NoneAnalysisEnum);93 94 if(verbose)_printf_("computing melting:\n");95 model->UpdateInputsFromVector(t_g[i],TemperatureEnum,VertexEnum);96 model->UpdateInputsFromConstant(melting_offset,MeltingOffsetEnum);97 diagnostic_core_linear(&m_g[i],fem_m,MeltingAnalysisEnum,NoneAnalysisEnum);98 }99 }100 101 /*Plug results into output dataset: */102 if(dt==0){103 InputToResultx(&result,fem_t->elements,fem_t->nodes,fem_t->vertices, fem_t->loads, fem_t->materials,fem_t->parameters,TemperatureEnum,results->Size()+1,0,1); results->AddObject(result);104 InputToResultx(&result,fem_m->elements,fem_m->nodes,fem_m->vertices, fem_m->loads, fem_m->materials,fem_m->parameters,MeltingRateEnum,results->Size()+1,0,1); results->AddObject(result);105 106 /*free ressource*/107 Vect=t_g[0]; Vecm=m_g[0];108 VecFree(&Vect); VecFree(&Vecm);109 }110 else{111 for(i=0;i<nsteps;i++){112 /*To be moved inside the loop!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/113 InputToResultx(&result,fem_t->elements,fem_t->nodes,fem_t->vertices, fem_t->loads, fem_t->materials,fem_t->parameters,TemperatureEnum,results->Size()+1,time[i],i+1); results->AddObject(result);114 InputToResultx(&result,fem_m->elements,fem_m->nodes,fem_m->vertices, fem_m->loads, fem_m->materials,fem_m->parameters,MeltingRateEnum,results->Size()+1,time[i],i+1); results->AddObject(result);115 116 /*free ressource*/117 Vect=t_g[i]; Vecm=m_g[i];118 VecFree(&Vect); VecFree(&Vecm);119 }120 }121 /*Add analysis_type to results: */122 results->AddObject(new StringResult(results->Size()+1,AnalysisTypeEnum,0,1,EnumAsString(ThermalAnalysisEnum)));123 124 /*free ressource*/125 xfree((void**)&t_g);126 xfree((void**)&m_g);127 xfree((void**)&time);128 129 //return:130 return results;131 132 54 }
Note:
See TracChangeset
for help on using the changeset viewer.