Changeset 3938
- Timestamp:
- 05/25/10 10:31:51 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 18 added
- 2 deleted
- 62 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/DataSet/DataSet.cpp
r3887 r3938 436 436 } 437 437 return; 438 }439 /*}}}*/440 /*FUNCTION DataSet::FindResult(Vec* presult,char* name){{{1*/441 int DataSet::FindResult(Vec* presult,char* name){442 443 /*Go through a dataset, and find a Result* object444 *whith result name is "name" : */445 446 vector<Object*>::iterator object;447 Result* result=NULL;448 449 int found=0;450 451 for ( object=objects.begin() ; object < objects.end(); object++ ){452 453 /*Find param type objects: */454 if((*object)->Enum()==ResultEnum){455 456 /*Ok, this object is a result,recover it and ask which name it has: */457 result=(Result*)(*object);458 459 if (strcmp(result->GetFieldName(),name)==0){460 /*Ok, this is the one! Recover the value of this result: */461 result->GetField(presult);462 found=1;463 break;464 }465 }466 }467 return found;468 }469 /*}}}*/470 /*FUNCTION DataSet::FindResult(void* pvalue, char* name){{{1*/471 int DataSet::FindResult(void* pvalue, char* name){472 473 /*Go through a dataset, and find a Result* object474 *which field name is "name" : */475 476 vector<Object*>::iterator object;477 Result* result=NULL;478 479 int found=0;480 481 for ( object=objects.begin() ; object < objects.end(); object++ ){482 483 /*Find param type objects: */484 if((*object)->Enum()==ResultEnum){485 486 /*Ok, this object is a result, recover it and ask which name it has: */487 result=(Result*)(*object);488 489 if (strcmp(result->GetFieldName(),name)==0){490 /*Ok, this is the one! Recover the value of this result: */491 double** field=NULL;492 field=(double**)pvalue; //not very safe, but hey!493 result->GetField(field);494 found=1;495 break;496 }497 }498 }499 return found;500 438 } 501 439 /*}}}*/ -
issm/trunk/src/c/DataSet/DataSet.h
r3935 r3938 51 51 int Size(); 52 52 53 int FindResult(Vec* presult,char* name);54 53 Object* FindParamObject(char* name); 55 54 void Ranks(int* ranks); … … 99 98 void ComputePressure(Vec p_g,int analysis_type,int sub_analysis_type); 100 99 void ComputeStrainRate(Vec eps,int analysis_type,int sub_analysis_type); 101 int FindResult(void* pvalue, char* name);102 100 void FieldExtrude(Vec field,double* field_serial,char* field_name, int collapse); 103 101 void InputToResult(Mat* psolution,int enum_type); … … 153 151 154 152 void ChangeEnum(int enumtype,int new_enumtype); 153 void PatchSize(int* ppatch_numrows,int* pnumcols, int enum_type); 154 void PatchFill(int* pcount, double* patches,int patch_numcols,Parameters* parameters); 155 155 156 /*}}}*/ 156 157 … … 184 185 }; 185 186 187 /********************************************************RESULTS************************************************/ 188 189 class Results: public DataSet{ 190 191 public: 192 193 /*constructors, destructors: {{{1*/ 194 Results(); 195 Results(int enum_type); 196 ~Results(); 197 /*}}}*/ 198 /*methods: {{{1*/ 199 int FindResult(Vec* presult,char* name); 200 int FindResult(void* pvalue, char* name); 201 /*}}}*/ 202 203 }; 204 186 205 187 206 #endif -
issm/trunk/src/c/DataSet/Inputs.cpp
r3935 r3938 628 628 } 629 629 /*}}}*/ 630 /*FUNCTION Inputs::PatchSize(int* ppatch_numrows,int* pnumcols, int enum_type);{{{1*/ 631 void Inputs::PatchSize(int* ppatch_numrows,int* pnumcols, int enum_type){ 632 633 int i; 634 635 vector<Object*>::iterator object; 636 Input* input=NULL; 637 bool found=false; 638 639 int patch_numrows=0; 640 int numcols=0; 641 642 /*First, recover the counter patch_numrows: */ 643 patch_numrows=*ppatch_numrows; 644 645 /*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */ 646 for ( object=objects.begin() ; object < objects.end(); object++ ){ 647 648 input=(Input*)(*object); 649 if (input->EnumType()==enum_type){ 650 found=true; 651 break; 652 } 653 } 654 655 if (!found){ 656 /*Ok, the input looked for does not exist. No problem. Just return a patch size of 0, and do 657 * not increment the counter: */ 658 numcols=0; 659 } 660 else{ 661 /*We found the input, get it to tell us the size of the patch information it returns, and increment 662 * the counter: */ 663 patch_numrows++; 664 numcols=input->PatchSize(); 665 } 666 667 /*Assign output pointers:*/ 668 *ppatch_numrows=patch_numrows; 669 *pnumcols=numcols; 670 671 } 672 /*}}}*/ 673 /*FUNCTION Inputs::PatchFill(int* pcount, double* patches,int patch_numcols);{{{1*/ 674 void Inputs::PatchFill(int* pcount, double* patches,int patch_numcols,Parameters* parameters){ 675 676 int i; 677 678 vector<Object*>::iterator object; 679 Input* input=NULL; 680 bool found=false; 681 682 int count=0; 683 684 /*First, recover the counter patch_numrows: */ 685 count=*pcount; 686 687 /*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */ 688 for ( object=objects.begin() ; object < objects.end(); object++ ){ 689 690 input=(Input*)(*object); 691 if (input->EnumType()==enum_type){ 692 found=true; 693 break; 694 } 695 } 696 697 if (!found){ 698 /*Ok, the input looked for does not exist. No problem. Just return :*/ 699 } 700 else{ 701 /*We found the input, get it to fill the patch, at the right position in the patches matrix: */ 702 input->PatchFill(patches+patch_numcols*count,parameters); 703 count++; 704 } 705 706 /*Assign output pointers:*/ 707 *pcount=count; 708 } 709 /*}}}*/ -
issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
r3826 r3938 221 221 /*}}}*/ 222 222 /*Element types{{{1*/ 223 P0Enum, 223 224 P1Enum, 225 /*}}}*/ 226 /*Results{{{1*/ 227 StringResultEnum, 228 DoubleVecResultEnum, 229 DoubleMatResultEnum, 224 230 /*}}}*/ 225 231 /*Parameters{{{1*/ -
issm/trunk/src/c/Makefile.am
r3931 r3938 105 105 ./objects/Node.h\ 106 106 ./objects/Node.cpp\ 107 ./objects/Result.h\ 108 ./objects/Result.cpp\ 107 ./objects/Results/Result.h\ 108 ./objects/Results/DoubleVecResult.h\ 109 ./objects/Results/DoubleVecResult.cpp\ 110 ./objects/Results/DoubleMatResult.h\ 111 ./objects/Results/DoubleMatResult.cpp\ 112 ./objects/Results/StringResult.h\ 113 ./objects/Results/StringResult.cpp\ 109 114 ./objects/Elements/Tria.h\ 110 115 ./objects/Elements/Tria.cpp\ … … 114 119 ./objects/Elements/TriaRef.cpp\ 115 120 ./objects/Inputs/Input.h\ 121 ./objects/Inputs/InputLocal.h\ 116 122 ./objects/Inputs/TriaVertexInput.h\ 117 123 ./objects/Inputs/TriaVertexInput.cpp\ … … 128 134 ./objects/Inputs/DoubleInput.h\ 129 135 ./objects/Inputs/DoubleInput.cpp\ 136 ./objects/Inputs/ProcessResults.cpp\ 130 137 ./objects/Elements/Sing.h\ 131 138 ./objects/Elements/Sing.cpp\ … … 179 186 ./DataSet/Parameters.cpp\ 180 187 ./DataSet/Inputs.cpp\ 188 ./DataSet/Results.cpp\ 181 189 ./shared/shared.h\ 182 190 ./shared/Alloc/alloc.h\ … … 447 455 ./modules/InputToResultx/InputToResultx.cpp\ 448 456 ./modules/InputToResultx/InputToResultx.h\ 457 ./modules/InputToResultx/PatchesSize.cpp\ 458 ./modules/InputToResultx/InputToPatches.cpp\ 449 459 ./modules/ExtrudeInputx/ExtrudeInputx.cpp\ 450 460 ./modules/ExtrudeInputx/ExtrudeInputx.h\ … … 550 560 ./objects/Hook.h\ 551 561 ./objects/Hook.cpp\ 552 ./objects/Result.h\ 553 ./objects/Result.cpp\ 562 ./objects/Results/Result.h\ 563 ./objects/Results/DoubleVecResult.h\ 564 ./objects/Results/DoubleVecResult.cpp\ 565 ./objects/Results/DoubleMatResult.h\ 566 ./objects/Results/DoubleMatResult.cpp\ 567 ./objects/Results/StringResult.h\ 568 ./objects/Results/StringResult.cpp\ 554 569 ./objects/Elements/Tria.h\ 555 570 ./objects/Elements/Tria.cpp\ … … 559 574 ./objects/Elements/TriaRef.cpp\ 560 575 ./objects/Inputs/Input.h\ 576 ./objects/Inputs/InputLocal.h\ 561 577 ./objects/Inputs/TriaVertexInput.h\ 562 578 ./objects/Inputs/TriaVertexInput.cpp\ … … 573 589 ./objects/Inputs/DoubleInput.h\ 574 590 ./objects/Inputs/DoubleInput.cpp\ 591 ./objects/Inputs/ProcessResults.cpp\ 575 592 ./objects/Elements/Sing.h\ 576 593 ./objects/Elements/Sing.cpp\ … … 624 641 ./DataSet/Parameters.cpp\ 625 642 ./DataSet/Inputs.cpp\ 643 ./DataSet/Results.cpp\ 626 644 ./shared/shared.h\ 627 645 ./shared/Threads/issm_threads.h\ … … 779 797 ./modules/Dofx/Dofx.h\ 780 798 ./modules/Dofx/Dofx.cpp\ 799 ./modules/OutputResultsx/OutputResultsx.h\ 800 ./modules/OutputResultsx/OutputResultsx.cpp\ 781 801 ./modules/Dux/Dux.h\ 782 802 ./modules/Dux/Dux.cpp\ … … 882 902 ./modules/InputToResultx/InputToResultx.cpp\ 883 903 ./modules/InputToResultx/InputToResultx.h\ 904 ./modules/InputToResultx/PatchesSize.cpp\ 905 ./modules/InputToResultx/InputToPatches.cpp\ 884 906 ./modules/ExtrudeInputx/ExtrudeInputx.cpp\ 885 907 ./modules/ExtrudeInputx/ExtrudeInputx.h\ … … 898 920 ./solutions/objectivefunctionC.cpp\ 899 921 ./solutions/gradjcompute_core.cpp\ 900 ./solutions/ProcessResults.cpp\901 922 ./solutions/prognostic_core.cpp\ 902 923 ./solutions/prognostic2_core.cpp\ … … 910 931 ./solutions/transient_core_3d.cpp\ 911 932 ./solutions/steadystate_core.cpp\ 912 ./solutions/OutputResults.cpp\913 933 ./modules/Bamgx/Bamgx.cpp\ 914 934 ./modules/Bamgx/Bamgx.h\ -
issm/trunk/src/c/modules/InputToResultx/InputToResultx.cpp
r3913 r3938 13 13 void InputToResultx(Result** presult,DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials,Parameters* parameters,int enum_type,int id, double time, int step){ 14 14 15 int i,j,count; 16 17 /*output: */ 18 Result* result=NULL; 19 15 20 /*Intermediary output vector*/ 16 Mat solution=NULL;17 Result* result=NULL;21 double* patches=NULL; //build a matrix of patch information, corresponding to the input with name enum_type 22 int patch_numrows,patch_numcols; 18 23 19 24 /*First, get elements*/ 20 25 elements->Configure(elements,loads, nodes,vertices, materials,parameters); 21 26 22 /* Then extrude vertically the new inputs*/23 elements->InputToResult(&solution,enum_type);27 /*Figure out size of patches matrix: */ 28 PatchesSize(elements,&patch_numrows, &patch_numcols,enum_type); 24 29 25 /*Create Result and clean up*/ 26 /*Mat support in result to be added!!!!!!*/ 27 //result=new Result(id,time,step,enum_type,solution); 28 MatFree(&solution); 30 /*Allocate matrix: */ 31 patches=(double*)xmalloc(patch_numrows*patch_numcols*sizeof(double)); 32 33 /*Fill patches with NaN, default value: */ 34 for(i=0;i<patch_numrows;i++){ 35 for(j=0;j<patch_numcols;j++){ 36 *(patches+patch_numcols*i+j)=NAN; 37 } 38 } 39 40 /*Now, go through elements, their inputs with the correct enum_type, and fill the patches: */ 41 InputToPatches(elements,patches,patch_numrows,patch_numcols); 42 43 /*Create result object embedding patches: */ 44 result=new DoubleMatResult(id,enum_type,time,step,patches,patch_numrows,patch_numcols); 29 45 30 46 /*Assign output pointer*/ -
issm/trunk/src/c/modules/InputToResultx/InputToResultx.h
r3913 r3938 8 8 #include "../../DataSet/DataSet.h" 9 9 10 /* local prototypes: */10 /* global prototype: */ 11 11 void InputToResultx(Result** presult,DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials,Parameters* parameters,int enum_type,int id, double time, int step); 12 12 13 /* local prototypes: */ 14 void PatchesSize(DataSet* elements,int* ppatch_numrows, int* ppatch_numcols,int enum_type); 15 void InputToPatches(DataSet* elements,double* patches,int patch_numrows,int patch_numcols); 16 13 17 #endif /* _INPUTTORESULTX_H */ 14 -
issm/trunk/src/c/modules/Qmux/DakotaResponses.cpp
r3913 r3938 17 17 #include "../modules.h" 18 18 19 void DakotaResponses(double* responses,char** responses_descriptors,int numresponses,Model* model, DataSet* results,DataSet* processed_results,int analysis_type,int sub_analysis_type){19 void DakotaResponses(double* responses,char** responses_descriptors,int numresponses,Model* model,Results* results,Results* processed_results,int analysis_type,int sub_analysis_type){ 20 20 21 21 int i,j; -
issm/trunk/src/c/modules/Qmux/SpawnCoreParallel.cpp
r3913 r3938 39 39 40 40 /*output from core solutions: */ 41 DataSet* results=NULL;42 DataSet* processed_results=NULL;41 Results* results=NULL; 42 Results* processed_results=NULL; 43 43 44 44 char** responses_descriptors=NULL; … … 123 123 else ISSMERROR("%s%i%s%i%s"," analysis_type ",analysis_type," and sub_analysis_type ",sub_analysis_type," not supported yet!"); 124 124 125 126 127 /*Now process the outputs, before computing the dakota responses: */128 if(verbose)_printf_("process results:\n");129 130 ProcessResults(&processed_results,results,model,analysis_type);131 132 125 /*compute responses on cpu 0: dummy for now! */ 133 126 if(verbose)_printf_("compute dakota responses:\n"); -
issm/trunk/src/c/modules/modules.h
r3909 r3938 64 64 #include "./InputToResultx/InputToResultx.h" 65 65 #include "./GetSolutionFromInputsx/GetSolutionFromInputsx.h" 66 #include "./OutputResultsx/OutputResultsx.h" 66 67 #endif -
issm/trunk/src/c/objects/Elements/Beam.cpp
r3928 r3938 808 808 } 809 809 /*}}}*/ 810 /*FUNCTION Beam::PatchSize(int* ppatch_numrows,int* pnumcols, int enum_type){{{1*/ 811 void Beam::PatchSize(int* ppatch_numrows,int* pnumcols, int enum_type){ 812 this->inputs->PatchSize(ppatch_numrows,pnumcols,enum_type); 813 } 814 /*}}}*/ 815 /*FUNCTION Beam::PatchFill(int* pcount, double* patches,int patch_numcols);{{{1*/ 816 void Beam::PatchFill(int* pcount, double* patches,int patch_numcols){ 817 this->inputs->PatchFill(pcount,patches,patch_numcols,this->parameters); 818 } 819 /*}}}*/ -
issm/trunk/src/c/objects/Elements/Beam.h
r3928 r3938 79 79 void ComputeStrainRate(Vec eps,int analysis_type,int sub_analysis_type); 80 80 void GetNodes(void** vpnodes); 81 void PatchSize(int* ppatch_numrows,int* pnumcols, int enum_type); 82 void PatchFill(int* pcount, double* patches,int patch_numcols); 83 81 84 /*}}}*/ 82 85 /*not implemented: {{{1*/ -
issm/trunk/src/c/objects/Elements/Element.h
r3887 r3938 47 47 virtual void ComputeStrainRate(Vec eps, int analysis_type,int sub_analysis_type)=0; 48 48 virtual double MassFlux(double* segment,double* ug)=0; 49 virtual void PatchSize(int* ppatch_numrows,int* pnumcols, int enum_type)=0; 50 virtual void PatchFill(int* pcount, double* patches,int patch_numcols)=0; 49 51 50 52 /*Implementation: */ -
issm/trunk/src/c/objects/Elements/Penta.cpp
r3936 r3938 4693 4693 } 4694 4694 /*}}}*/ 4695 /*FUNCTION Penta::PatchSize(int* ppatch_numrows,int* pnumcols, int enum_type){{{1*/ 4696 void Penta::PatchSize(int* ppatch_numrows,int* pnumcols, int enum_type){ 4697 this->inputs->PatchSize(ppatch_numrows,pnumcols,enum_type); 4698 } 4699 /*}}}*/ 4700 /*FUNCTION Penta::PatchFill(int* pcount, double* patches,int patch_numcols);{{{1*/ 4701 void Penta::PatchFill(int* pcount, double* patches,int patch_numcols){ 4702 this->inputs->PatchFill(pcount,patches,patch_numcols,this->parameters); 4703 } 4704 /*}}}*/ -
issm/trunk/src/c/objects/Elements/Penta.h
r3936 r3938 143 143 void GetPhi(double* phi, double* epsilon, double viscosity); 144 144 double MassFlux(double* segment,double* ug); 145 void PatchSize(int* ppatch_numrows,int* pnumcols, int enum_type); 146 void PatchFill(int* pcount, double* patches,int patch_numcols); 145 147 146 148 /*updates: */ … … 160 162 void UpdateInputsFromConstant(int constant, int name); 161 163 void UpdateInputsFromConstant(bool constant, int name); 164 165 162 166 /*}}}*/ 163 167 -
issm/trunk/src/c/objects/Elements/Sing.cpp
r3928 r3938 595 595 } 596 596 /*}}}*/ 597 /*FUNCTION Sing::PatchSize(int* ppatch_numrows,int* pnumcols, int enum_type){{{1*/ 598 void Sing::PatchSize(int* ppatch_numrows,int* pnumcols, int enum_type){ 599 this->inputs->PatchSize(ppatch_numrows,pnumcols,enum_type); 600 } 601 /*}}}*/ 602 /*FUNCTION Sing::PatchFill(int* pcount, double* patches,int patch_numcols);{{{1*/ 603 void Sing::PatchFill(int* pcount, double* patches,int patch_numcols){ 604 this->inputs->PatchFill(pcount,patches,patch_numcols,this->parameters); 605 } 606 /*}}}*/ -
issm/trunk/src/c/objects/Elements/Sing.h
r3920 r3938 78 78 void ComputeStrainRate(Vec eps,int analysis_type,int sub_analysis_type); 79 79 void GetNodes(void** vpnodes); 80 void PatchSize(int* ppatch_numrows,int* pnumcols, int enum_type); 81 void PatchFill(int* pcount, double* patches,int patch_numcols); 82 80 83 /*}}}*/ 81 84 /*not implemented: {{{1*/ -
issm/trunk/src/c/objects/Elements/Tria.cpp
r3920 r3938 4747 4747 } 4748 4748 /*}}}*/ 4749 /*FUNCTION Tria::PatchSize(int* ppatch_numrows,int* pnumcols, int enum_type){{{1*/ 4750 void Tria::PatchSize(int* ppatch_numrows,int* pnumcols, int enum_type){ 4751 this->inputs->PatchSize(ppatch_numrows,pnumcols,enum_type); 4752 } 4753 /*}}}*/ 4754 /*FUNCTION Tria::PatchFill(int* pcount, double* patches,int patch_numcols);{{{1*/ 4755 void Tria::PatchFill(int* pcount, double* patches,int patch_numcols){ 4756 this->inputs->PatchFill(pcount,patches,patch_numcols,this->parameters); 4757 } 4758 /*}}}*/ -
issm/trunk/src/c/objects/Elements/Tria.h
r3920 r3938 118 118 double GetArea(void); 119 119 double GetAreaCoordinate(double x, double y, int which_one); 120 void PatchSize(int* ppatch_numrows,int* pnumcols, int enum_type); 121 void PatchFill(int* pcount, double* patches,int patch_numcols); 122 120 123 /*}}}*/ 121 124 /*FUNCTION updates{{{1*/ -
issm/trunk/src/c/objects/Inputs/BeamVertexInput.cpp
r3935 r3938 11 11 #include "stdio.h" 12 12 #include <string.h> 13 #include "./InputLocal.h" 13 14 #include "../objects.h" 14 15 #include "../../EnumDefinitions/EnumDefinitions.h" … … 205 206 } 206 207 /*}}}*/ 208 /*FUNCTION BeamVertexInput::PatchSize(void);{{{1*/ 209 int BeamVertexInput::PatchSize(void){ 210 return 2; 211 } 212 /*}}}*/ 213 /*FUNCTION BeamVertexInput::PatchFill(double* patches);{{{1*/ 214 void BeamVertexInput::PatchFill(double* patches,Parameters* parameters){ 215 patches[0]=values[0]; 216 patches[1]=values[1]; 217 218 /*Now, post-processing: */ 219 ProcessResults(patches,2,this->enum_type,parameters); 220 221 } 222 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/BeamVertexInput.h
r3935 r3938 72 72 void GetVyStrainRate3dPattyn(double* epsilonvy,double* xyz_list, double* gauss){ISSMERROR("not implemented yet");}; 73 73 void ChangeEnum(int newenumtype); 74 int PatchSize(void); 75 void PatchFill(double* patches,Parameters* parameters); 74 76 /*}}}*/ 75 77 -
issm/trunk/src/c/objects/Inputs/BoolInput.cpp
r3935 r3938 11 11 #include "stdio.h" 12 12 #include <string.h> 13 #include "./InputLocal.h" 13 14 #include "../objects.h" 14 15 #include "../../EnumDefinitions/EnumDefinitions.h" … … 195 196 } 196 197 /*}}}*/ 198 /*FUNCTION BoolInput::PatchSize(void);{{{1*/ 199 int BoolInput::PatchSize(void){ 200 return 1; 201 } 202 /*}}}*/ 203 /*FUNCTION BoolInput::PatchFill(double* patches);{{{1*/ 204 void BoolInput::PatchFill(double* patches,Parameters* parameters){ 205 patches[0]=(double)value; 206 207 /*Now, post-processing: */ 208 ProcessResults(patches,1,this->enum_type,parameters); 209 } 210 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/BoolInput.h
r3935 r3938 72 72 void GetVyStrainRate3dPattyn(double* epsilonvy,double* xyz_list, double* gauss){ISSMERROR("not implemented yet");}; 73 73 void ChangeEnum(int newenumtype); 74 int PatchSize(void); 75 void PatchFill(double* patches,Parameters* parameters); 74 76 /*}}}*/ 75 77 -
issm/trunk/src/c/objects/Inputs/DoubleInput.cpp
r3935 r3938 11 11 #include "stdio.h" 12 12 #include <string.h> 13 #include "./InputLocal.h" 13 14 #include "../objects.h" 14 15 #include "../../EnumDefinitions/EnumDefinitions.h" … … 205 206 } 206 207 /*}}}*/ 208 /*FUNCTION DoubleInput::PatchSize(void);{{{1*/ 209 int DoubleInput::PatchSize(void){ 210 return 1; 211 } 212 /*}}}*/ 213 /*FUNCTION DoubleInput::PatchFill(double* patches);{{{1*/ 214 void DoubleInput::PatchFill(double* patches,Parameters* parameters){ 215 patches[0]=value; 216 217 /*Now, post-processing: */ 218 ProcessResults(patches,1,this->enum_type,parameters); 219 } 220 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/DoubleInput.h
r3935 r3938 72 72 void GetVyStrainRate3dPattyn(double* epsilonvy,double* xyz_list, double* gauss){ISSMERROR("not implemented yet");}; 73 73 void ChangeEnum(int newenumtype); 74 int PatchSize(void); 75 void PatchFill(double* patches,Parameters* parameters); 74 76 /*}}}*/ 75 77 -
issm/trunk/src/c/objects/Inputs/Input.h
r3935 r3938 46 46 virtual Input* SpawnBeamInput(int* indices)=0; 47 47 virtual Input* SpawnTriaInput(int* indices)=0; 48 virtual int PatchSize(void)=0; 49 virtual void PatchFill(double* patches,Parameters* parameters)=0; 48 50 /*}}}*/ 49 51 -
issm/trunk/src/c/objects/Inputs/IntInput.cpp
r3935 r3938 11 11 #include "stdio.h" 12 12 #include <string.h> 13 #include "./InputLocal.h" 13 14 #include "../objects.h" 14 15 #include "../../EnumDefinitions/EnumDefinitions.h" … … 193 194 } 194 195 /*}}}*/ 196 /*FUNCTION IntInput::PatchSize(void);{{{1*/ 197 int IntInput::PatchSize(void){ 198 return 1; 199 } 200 /*}}}*/ 201 /*FUNCTION IntInput::PatchFill(double* patches);{{{1*/ 202 void IntInput::PatchFill(double* patches,Parameters* parameters){ 203 patches[0]=(double)value; 204 205 /*Now, post-processing: */ 206 ProcessResults(patches,1,this->enum_type,parameters); 207 208 } 209 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/IntInput.h
r3935 r3938 72 72 void GetVyStrainRate3dPattyn(double* epsilonvy,double* xyz_list, double* gauss){ISSMERROR("not implemented yet");}; 73 73 void ChangeEnum(int newenumtype); 74 int PatchSize(void); 75 void PatchFill(double* patches,Parameters* parameters); 74 76 /*}}}*/ 75 77 -
issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp
r3935 r3938 11 11 #include "stdio.h" 12 12 #include <string.h> 13 #include "./InputLocal.h" 13 14 #include "../objects.h" 14 15 #include "../../EnumDefinitions/EnumDefinitions.h" … … 854 855 } 855 856 /*}}}*/ 857 /*FUNCTION PentaVertexInput::PatchSize(void);{{{1*/ 858 int PentaVertexInput::PatchSize(void){ 859 return 6; 860 } 861 /*}}}*/ 862 /*FUNCTION PentaVertexInput::PatchFill(double* patches);{{{1*/ 863 void PentaVertexInput::PatchFill(double* patches,Parameters* parameters){ 864 865 patches[0]=values[0]; 866 patches[1]=values[1]; 867 patches[2]=values[2]; 868 patches[3]=values[3]; 869 patches[4]=values[4]; 870 patches[5]=values[5]; 871 872 /*Now, post-processing: */ 873 ProcessResults(patches,6,this->enum_type,parameters); 874 875 } 876 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/PentaVertexInput.h
r3935 r3938 81 81 void GetBPattyn(double* B, double* xyz_list, double* gauss_coord); 82 82 void GetBStokes(double* B, double* xyz_list, double* gauss_coord); 83 int PatchSize(void); 84 void PatchFill(double* patches,Parameters* parameters); 83 85 /*}}}*/ 84 86 -
issm/trunk/src/c/objects/Inputs/SingVertexInput.cpp
r3935 r3938 11 11 #include "stdio.h" 12 12 #include <string.h> 13 #include "./InputLocal.h" 13 14 #include "../objects.h" 14 15 #include "../../EnumDefinitions/EnumDefinitions.h" … … 184 185 } 185 186 /*}}}*/ 187 /*FUNCTION SingVertexInput::PatchSize(void);{{{1*/ 188 int SingVertexInput::PatchSize(void){ 189 return 1; 190 } 191 /*}}}*/ 192 /*FUNCTION SingVertexInput::PatchFill(double* patches);{{{1*/ 193 void SingVertexInput::PatchFill(double* patches,Parameters* parameters){ 194 patches[0]=value; 195 196 /*Now, post-processing: */ 197 ProcessResults(patches,1,this->enum_type,parameters); 198 199 } 200 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/SingVertexInput.h
r3935 r3938 71 71 void GetVyStrainRate3dPattyn(double* epsilonvy,double* xyz_list, double* gauss){ISSMERROR("not implemented yet");}; 72 72 void ChangeEnum(int newenumtype); 73 int PatchSize(void); 74 void PatchFill(double* patches,Parameters* parameters); 73 75 /*}}}*/ 74 76 -
issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp
r3935 r3938 11 11 #include "stdio.h" 12 12 #include <string.h> 13 #include "./InputLocal.h" 13 14 #include "../objects.h" 14 15 #include "../../EnumDefinitions/EnumDefinitions.h" … … 428 429 } 429 430 /*}}}*/ 431 /*FUNCTION TriaVertexInput::PatchSize(void);{{{1*/ 432 int TriaVertexInput::PatchSize(void){ 433 return 3; 434 } 435 /*}}}*/ 436 /*FUNCTION TriaVertexInput::PatchFill(double* patches);{{{1*/ 437 void TriaVertexInput::PatchFill(double* patches,Parameters* parameters){ 438 439 patches[0]=values[0]; 440 patches[1]=values[1]; 441 patches[2]=values[2]; 442 443 /*Now, post-processing: */ 444 ProcessResults(patches,3,this->enum_type,parameters); 445 446 447 } 448 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/TriaVertexInput.h
r3935 r3938 79 79 void GetJacobian(double* J, double* xyz_list,double* gauss); 80 80 void GetJacobianInvert(double* Jinv, double* xyz_list,double* gauss); 81 int PatchSize(void); 82 void PatchFill(double* patches,Parameters* parameters); 81 83 /*}}}*/ 82 84 -
issm/trunk/src/c/objects/objects.h
r3913 r3938 51 51 #include "./Inputs/SingVertexInput.h" 52 52 #include "./Inputs/TriaVertexInput.h" 53 54 /*Results: */ 55 #include "./Results/Result.h" 56 #include "./Results/StringResult.h" 57 #include "./Results/DoubleVecResult.h" 58 #include "./Results/DoubleMatResult.h" 53 59 54 60 /*Materials: */ -
issm/trunk/src/c/solutions/ControlRestart.cpp
r3913 r3938 13 13 14 14 /*output: */ 15 DataSet* temporary_results=NULL; 16 DataSet* results=NULL; 17 Result* result=NULL; 15 Results* results=NULL; 18 16 char* outputfilename=NULL; 19 17 … … 29 27 /*Plug COPYS of the results into output dataset: 30 28 * only the pointer is given to temporary_results and at the 31 * end of ProcessResults the pointer is deleted. That would29 * end of ProcessResultsx the pointer is deleted. That would 32 30 * destroy param_g*/ 33 31 … … 35 33 for(i=0;i<numberofnodes;i++) param_g_copy[i]=param_g[i]; 36 34 37 temporary_results=new DataSet(ResultsEnum); 38 result=new Result(temporary_results->Size()+1,0,1,"param_g",param_g_copy,numberofnodes); 39 temporary_results->AddObject(result); 40 41 result=new Result(temporary_results->Size()+1,0,1,"analysis_type",EnumAsString(DiagnosticAnalysisEnum)); 42 temporary_results->AddObject(result); 43 44 //process results 45 ProcessResults(&results,temporary_results,model,ControlAnalysisEnum); 35 results=new Results(); 36 results->AddObject(new Result(results->Size()+1,0,1,"param_g",param_g_copy,numberofnodes)); 37 results->AddObject(new StringResult(results->Size()+1,AnalysisTypeEnum,0,1,EnumAsString(DiagnosticAnalysisEnum))); 46 38 47 39 //Write results on disk … … 49 41 50 42 /*Free ressources:*/ 51 delete temporary_results;52 43 delete results; 53 44 xfree((void**)&outputfilename); -
issm/trunk/src/c/solutions/balancedthickness.cpp
r3913 r3938 33 33 34 34 /*Results: */ 35 DataSet* results=NULL; 36 DataSet* processedresults=NULL; 37 Result* result=NULL; 38 35 Results* results=NULL; 39 36 Param* param=NULL; 40 37 … … 105 102 } 106 103 107 _printf_("process results:\n");108 ProcessResults(&processedresults,results,model,BalancedthicknessAnalysisEnum);109 110 104 _printf_("write results to disk:\n"); 111 OutputResults( processedresults,outputfilename);105 OutputResults(results,outputfilename); 112 106 113 107 if (waitonlock>0){ … … 117 111 118 112 /*Free ressources:*/ 119 delete processedresults;120 113 delete results; 121 114 delete model; -
issm/trunk/src/c/solutions/balancedthickness2.cpp
r3913 r3938 33 33 34 34 /*Results: */ 35 DataSet* results=NULL; 36 DataSet* processedresults=NULL; 35 Results* results=NULL; 37 36 Result* result=NULL; 38 37 … … 105 104 } 106 105 107 _printf_("process results:\n");108 ProcessResults(&processedresults,results,model,Balancedthickness2AnalysisEnum);109 110 106 _printf_("write results to disk:\n"); 111 OutputResults( processedresults,outputfilename);107 OutputResults(results,outputfilename); 112 108 113 109 if (waitonlock>0){ … … 117 113 118 114 /*Free ressources:*/ 119 delete processedresults;120 115 delete results; 121 116 delete model; -
issm/trunk/src/c/solutions/balancedthickness2_core.cpp
r3913 r3938 11 11 #include "../modules/modules.h" 12 12 13 DataSet* balancedthickness2_core(Model* model){13 Results* balancedthickness2_core(Model* model){ 14 14 15 15 extern int my_rank; 16 16 17 17 /*output: */ 18 Result* result=NULL; 19 DataSet* results=NULL; 18 Results* results=NULL; 20 19 21 20 /*intermediary: */ … … 37 36 38 37 //initialize results: 39 results=new DataSet(ResultsEnum);38 results=new Results(); 40 39 41 40 fem_p=model->GetFormulation(Balancedthickness2AnalysisEnum); … … 68 67 69 68 /*Plug results into output dataset: */ 70 result=new Result(results->Size()+1,0,1,"h_g",h_g); 71 results->AddObject(result); 69 results->AddObject(new Result(results->Size()+1,0,1,"h_g",h_g)); 72 70 73 71 /*Add analysis_type to results: */ 74 result=new Result(results->Size()+1,0,1,"analysis_type","balancedthickness2"); 75 results->AddObject(result); 72 results->AddObject(new StringResult(results->Size()+1,AnalysisTypeEnum,0,1,EnumAsString(Balancedthickness2AnalysisEnum))); 76 73 77 74 /*Free ressources:*/ -
issm/trunk/src/c/solutions/balancedthickness_core.cpp
r3913 r3938 11 11 #include "../modules/modules.h" 12 12 13 DataSet* balancedthickness_core(Model* model){13 Results* balancedthickness_core(Model* model){ 14 14 15 15 extern int my_rank; 16 16 17 17 /*output: */ 18 Result* result=NULL; 19 DataSet* results=NULL; 18 Results* results=NULL; 20 19 21 20 /*intermediary: */ … … 35 34 36 35 //initialize results: 37 results=new DataSet(ResultsEnum);36 results=new Results(); 38 37 39 38 /*recover fem model: */ … … 58 57 59 58 /*Plug results into output dataset: */ 60 result=new Result(results->Size()+1,0,1,"h_g",h_g); 61 results->AddObject(result); 59 results->AddObject(new Result(results->Size()+1,0,1,"h_g",h_g)); 62 60 63 61 /*Add analysis_type to results: */ 64 result=new Result(results->Size()+1,0,1,"analysis_type","balancedthickness"); 65 results->AddObject(result); 62 results->AddObject(new StringResult(results->Size()+1,AnalysisTypeEnum,0,1,EnumAsString(BalancedthicknessAnalysisEnum))); 66 63 67 64 /*Free ressources:*/ -
issm/trunk/src/c/solutions/balancedvelocities.cpp
r3913 r3938 32 32 33 33 /*Results: */ 34 DataSet* results=NULL; 35 DataSet* processedresults=NULL; 34 Results* results=NULL; 36 35 Result* result=NULL; 37 36 Param* param=NULL; … … 103 102 } 104 103 105 _printf_("process results:\n");106 ProcessResults(&processedresults,results,model,BalancedvelocitiesAnalysisEnum);107 108 104 _printf_("write results to disk:\n"); 109 OutputResults( processedresults,outputfilename);105 OutputResults(results,outputfilename); 110 106 111 107 if (waitonlock>0){ … … 115 111 116 112 /*Free ressources:*/ 117 delete processedresults;118 113 delete results; 119 114 delete model; -
issm/trunk/src/c/solutions/balancedvelocities_core.cpp
r3913 r3938 10 10 #include "../modules/modules.h" 11 11 12 DataSet* balancedvelocities_core(Model* model){12 Results* balancedvelocities_core(Model* model){ 13 13 14 14 extern int my_rank; 15 15 16 16 /*output: */ 17 Result* result=NULL; 18 DataSet* results=NULL; 17 Results* results=NULL; 19 18 20 19 /*intermediary: */ … … 34 33 35 34 //initialize results: 36 results=new DataSet(ResultsEnum);35 results=new Results(); 37 36 38 37 /*recover fem model: */ … … 57 56 58 57 /*Plug results into output dataset: */ 59 result=new Result(results->Size()+1,0,1,"v_g",v_g); 60 results->AddObject(result); 58 results->AddObject(new Result(results->Size()+1,0,1,"v_g",v_g)); 61 59 62 60 /*Add analysis_type to results: */ 63 result=new Result(results->Size()+1,0,1,"analysis_type","balancedvelocities"); 64 results->AddObject(result); 61 results->AddObject(new StringResult(results->Size()+1,AnalysisTypeEnum,0,1,EnumAsString(BalancedvelocitiesAnalysisEnum))); 65 62 66 63 /*Free ressources:*/ -
issm/trunk/src/c/solutions/control_core.cpp
r3913 r3938 7 7 #include "../EnumDefinitions/EnumDefinitions.h" 8 8 9 DataSet* control_core(Model* model){9 Results* control_core(Model* model){ 10 10 11 11 extern int my_rank; … … 15 15 16 16 /*output: */ 17 DataSet* results=NULL; 18 Result* result=NULL; 17 Results* results=NULL; 19 18 20 19 /*Intermediary: */ 21 DataSet* diagnostic_results=NULL;22 DataSet* gradjcompute_results=NULL;23 DataSet* steadystate_results=NULL;20 Results* diagnostic_results=NULL; 21 Results* gradjcompute_results=NULL; 22 Results* steadystate_results=NULL; 24 23 Vec u_g=NULL; 25 24 Vec t_g=NULL; … … 57 56 58 57 //initialize results 59 results=new DataSet(ResultsEnum);58 results=new Results(); 60 59 61 60 /*Process models*/ … … 110 109 111 110 /*Plug results into output dataset: */ 112 result=new Result(results->Size()+1,0,1,"grad_g",grad_g); 113 results->AddObject(result); 114 115 result=new Result(results->Size()+1,0,1,"analysis_type",EnumAsString(analysis_type)); 116 results->AddObject(result); 111 results->AddObject(new Result(results->Size()+1,0,1,"grad_g",grad_g)); 112 results->AddObject(new Result(results->Size()+1,0,1,"analysis_type",EnumAsString(analysis_type))); 117 113 118 114 /*Free ressources: */ … … 219 215 220 216 /*Plug results into output dataset: */ 221 result=new Result(results->Size()+1,0,1,"u_g",u_g); 222 results->AddObject(result); 223 result=new Result(results->Size()+1,0,1,"param_g",param_g,numberofnodes); 224 results->AddObject(result); 225 result=new Result(results->Size()+1,0,1,"J",J,nsteps); 226 results->AddObject(result); 217 results->AddObject(new Result(results->Size()+1,0,1,"u_g",u_g)); 218 results->AddObject(new Result(results->Size()+1,0,1,"param_g",param_g,numberofnodes)); 219 results->AddObject(new Result(results->Size()+1,0,1,"J",J,nsteps)); 227 220 if (control_steady){ 228 result=new Result(results->Size()+1,0,1,"t_g",t_g); 229 results->AddObject(result); 230 result=new Result(results->Size()+1,0,1,"m_g",m_g); 231 results->AddObject(result); 221 results->AddObject(new Result(results->Size()+1,0,1,"t_g",t_g)); 222 results->AddObject(new Result(results->Size()+1,0,1,"m_g",m_g)); 232 223 } 233 224 234 225 /*Add analysis_type and control_type to results: */ 235 result=new Result(results->Size()+1,0,1,"analysis_type",EnumAsString(analysis_type)); 236 results->AddObject(result); 237 result=new Result(results->Size()+1,0,1,"control_type",EnumAsString(control_type)); 238 results->AddObject(result); 239 226 results->AddObject(new StringResult(results->Size()+1,AnalysisTypeEnum,0,1,EnumAsString(analysis_type))); 227 results->AddObject(new StringResult(results->Size()+1,ControlTypeEnum,0,1,EnumAsString(control_type))); 240 228 241 229 /*Free ressources: */ -
issm/trunk/src/c/solutions/diagnostic.cpp
r3913 r3938 31 31 32 32 /*Results: */ 33 DataSet* results=NULL; 34 DataSet* processed_results=NULL; 35 Result* result=NULL; 33 Results* results=NULL; 36 34 37 35 bool waitonlock=false; … … 100 98 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 101 99 102 _printf_("process results:\n");103 ProcessResults(&processed_results,results,model,DiagnosticAnalysisEnum);104 100 } 105 101 else{ … … 110 106 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 111 107 112 _printf_("process results:\n");113 ProcessResults(&processed_results,results,model,ControlAnalysisEnum);114 108 } 115 109 116 110 _printf_("write results to disk:\n"); 117 OutputResults( processed_results,outputfilename);111 OutputResults(results,outputfilename); 118 112 } 119 113 else{ … … 138 132 delete model; 139 133 delete results; 140 delete processed_results;141 134 142 135 /*Get finish time and close*/ -
issm/trunk/src/c/solutions/diagnostic_core.cpp
r3922 r3938 11 11 #include "../include/include.h" 12 12 13 DataSet* diagnostic_core(Model* model){13 Results* diagnostic_core(Model* model){ 14 14 15 15 extern int my_rank; … … 24 24 25 25 /*output: */ 26 DataSet* results=NULL;27 Result* result=NULL;26 Results* results=NULL; 27 Result* result=NULL; 28 28 29 29 /*solutions: */ … … 68 68 69 69 //initialize results 70 results=new DataSet(ResultsEnum);70 results=new Results(); 71 71 72 72 //first recover parameters common to all solutions … … 180 180 181 181 /*Plug results into output dataset: */ 182 result=new Result(results->Size()+1,0,1,"u_g",ug); 183 results->AddObject(result); 184 result=new Result(results->Size()+1,0,1,"p_g",pg); 185 results->AddObject(result); 186 result=new Result(results->Size()+1,0,1,"analysis_type",EnumAsString(DiagnosticAnalysisEnum)); 187 results->AddObject(result); 182 if(dim==2){ 183 if(ismacayealpattyn){ 184 InputToResultx(&result,fem_dh->elements,fem_dh->nodes,fem_dh->vertices, fem_dh->loads, fem_dh->materials,fem_dh->parameters,VxEnum,results->Size()+1,0,1); results->AddObject(result); 185 InputToResultx(&result,fem_dh->elements,fem_dh->nodes,fem_dh->vertices, fem_dh->loads, fem_dh->materials,fem_dh->parameters,VyEnum,results->Size()+1,0,1); results->AddObject(result); 186 InputToResultx(&result,fem_dh->elements,fem_dh->nodes,fem_dh->vertices, fem_dh->loads, fem_dh->materials,fem_dh->parameters,PressureEnum,results->Size()+1,0,1); results->AddObject(result); 187 } 188 else{ 189 InputToResultx(&result,fem_dhu->elements,fem_dhu->nodes,fem_dhu->vertices, fem_dhu->loads, fem_dhu->materials,fem_dhu->parameters,VxEnum,results->Size()+1,0,1); results->AddObject(result); 190 InputToResultx(&result,fem_dhu->elements,fem_dhu->nodes,fem_dhu->vertices, fem_dhu->loads, fem_dhu->materials,fem_dhu->parameters,VyEnum,results->Size()+1,0,1); results->AddObject(result); 191 InputToResultx(&result,fem_dhu->elements,fem_dhu->nodes,fem_dhu->vertices, fem_dhu->loads, fem_dhu->materials,fem_dhu->parameters,PressureEnum,results->Size()+1,0,1); results->AddObject(result); 192 } 193 } 194 else{ 195 if(isstokes){ 196 InputToResultx(&result,fem_ds->elements,fem_ds->nodes,fem_ds->vertices, fem_ds->loads, fem_ds->materials,fem_ds->parameters,VxEnum,results->Size()+1,0,1); results->AddObject(result); 197 InputToResultx(&result,fem_ds->elements,fem_ds->nodes,fem_ds->vertices, fem_ds->loads, fem_ds->materials,fem_ds->parameters,VyEnum,results->Size()+1,0,1); results->AddObject(result); 198 InputToResultx(&result,fem_ds->elements,fem_ds->nodes,fem_ds->vertices, fem_ds->loads, fem_ds->materials,fem_ds->parameters,VzEnum,results->Size()+1,0,1); results->AddObject(result); 199 InputToResultx(&result,fem_ds->elements,fem_ds->nodes,fem_ds->vertices, fem_ds->loads, fem_ds->materials,fem_ds->parameters,PressureEnum,results->Size()+1,0,1); results->AddObject(result); 200 } 201 else{ 202 if(ismacayealpattyn){ 203 InputToResultx(&result,fem_dh->elements,fem_dh->nodes,fem_dh->vertices, fem_dh->loads, fem_dh->materials,fem_dh->parameters,VxEnum,results->Size()+1,0,1); results->AddObject(result); 204 InputToResultx(&result,fem_dh->elements,fem_dh->nodes,fem_dh->vertices, fem_dh->loads, fem_dh->materials,fem_dh->parameters,VyEnum,results->Size()+1,0,1); results->AddObject(result); 205 InputToResultx(&result,fem_dh->elements,fem_dh->nodes,fem_dh->vertices, fem_dh->loads, fem_dh->materials,fem_dh->parameters,VzEnum,results->Size()+1,0,1); results->AddObject(result); 206 InputToResultx(&result,fem_dh->elements,fem_dh->nodes,fem_dh->vertices, fem_dh->loads, fem_dh->materials,fem_dh->parameters,PressureEnum,results->Size()+1,0,1); results->AddObject(result); 207 } 208 else{ 209 InputToResultx(&result,fem_dhu->elements,fem_dhu->nodes,fem_dhu->vertices, fem_dhu->loads, fem_dhu->materials,fem_dhu->parameters,VxEnum,results->Size()+1,0,1); results->AddObject(result); 210 InputToResultx(&result,fem_dhu->elements,fem_dhu->nodes,fem_dhu->vertices, fem_dhu->loads, fem_dhu->materials,fem_dhu->parameters,VyEnum,results->Size()+1,0,1); results->AddObject(result); 211 InputToResultx(&result,fem_dhu->elements,fem_dhu->nodes,fem_dhu->vertices, fem_dhu->loads, fem_dhu->materials,fem_dhu->parameters,VzEnum,results->Size()+1,0,1); results->AddObject(result); 212 InputToResultx(&result,fem_dhu->elements,fem_dhu->nodes,fem_dhu->vertices, fem_dhu->loads, fem_dhu->materials,fem_dhu->parameters,PressureEnum,results->Size()+1,0,1); results->AddObject(result); 213 } 214 215 } 216 } 217 218 results->AddObject(new StringResult(results->Size()+1,AnalysisTypeEnum,0,1,EnumAsString(DiagnosticAnalysisEnum))); 188 219 189 220 /*output if we have rifts: */ 190 221 if(numrifts){ 191 222 OutputRiftsx( &riftproperties,fem_dh->loads,numrifts); 192 result=new Result(results->Size()+1,0,1,"riftproperties",riftproperties); 193 results->AddObject(result); 223 results->AddObject(new Result(results->Size()+1,0,1,"riftproperties",riftproperties)); 194 224 } 195 225 -
issm/trunk/src/c/solutions/gradjcompute_core.cpp
r3913 r3938 13 13 #endif 14 14 15 DataSet* gradjcompute_core(Model* model){15 Results* gradjcompute_core(Model* model){ 16 16 17 17 18 18 /*intermediary: */ 19 19 FemModel* femmodel=NULL; 20 DataSet* diagnostic_results=NULL;20 Results* diagnostic_results=NULL; 21 21 int analysis_type; 22 22 int sub_analysis_type; … … 45 45 46 46 /*output: */ 47 DataSet* results=NULL; 48 Result* result=NULL; 47 Results* results=NULL; 49 48 50 49 /*flags: */ … … 54 53 55 54 //initialize results 56 results=new DataSet(ResultsEnum);55 results=new Results(); 57 56 58 57 /*some parameters:*/ … … 118 117 119 118 /*Plug results into output dataset: */ 120 result=new Result(results->Size()+1,0,1,"grad_g",grad_g); 121 results->AddObject(result); 122 result=new Result(results->Size()+1,0,1,"analysis_type",EnumAsString(GradientAnalysisEnum)); 123 results->AddObject(result); 119 results->AddObject(new Result(results->Size()+1,0,1,"grad_g",grad_g)); 120 results->AddObject(new StringResult(results->Size()+1,AnalysisTypeEnum,0,1,EnumAsString(GradientAnalysisEnum))); 124 121 125 122 /*Free ressources:*/ -
issm/trunk/src/c/solutions/objectivefunctionC.cpp
r3922 r3938 23 23 Model* model=NULL; 24 24 FemModel* femmodel=NULL; 25 DataSet* diagnostic_results=NULL;25 Results* diagnostic_results=NULL; 26 26 double* param_g=NULL; 27 27 double* grad_g=NULL; … … 51 51 int dt=0; 52 52 int isstokes=0; 53 DataSet* results_steadystate=NULL;53 Results* results_steadystate=NULL; 54 54 int dofs01[2]={0,1}; 55 55 double* dofset=NULL; -
issm/trunk/src/c/solutions/prognostic.cpp
r3913 r3938 32 32 33 33 /*Results: */ 34 DataSet* results=NULL; 35 DataSet* processedresults=NULL; 36 Result* result=NULL; 34 Results* results=NULL; 37 35 38 36 Param* param=NULL; … … 103 101 104 102 105 _printf_("process results:\n");106 ProcessResults(&processedresults,results,model,PrognosticAnalysisEnum);107 108 103 _printf_("write results to disk:\n"); 109 OutputResults( processedresults,outputfilename);104 OutputResults(results,outputfilename); 110 105 111 106 if (waitonlock>0){ … … 115 110 116 111 /*Free ressources:*/ 117 delete processedresults;118 112 delete results; 119 113 delete model; -
issm/trunk/src/c/solutions/prognostic2.cpp
r3913 r3938 32 32 33 33 /*Results: */ 34 DataSet* results=NULL; 35 DataSet* processedresults=NULL; 36 Result* result=NULL; 34 Results* results=NULL; 37 35 38 36 Param* param=NULL; … … 103 101 } 104 102 105 _printf_("process results:\n");106 ProcessResults(&processedresults,results,model,Prognostic2AnalysisEnum);107 108 103 _printf_("write results to disk:\n"); 109 OutputResults( processedresults,outputfilename);104 OutputResults(results,outputfilename); 110 105 111 106 if (waitonlock>0){ … … 115 110 116 111 /*Free ressources:*/ 117 delete processedresults;118 112 delete results; 119 113 delete model; -
issm/trunk/src/c/solutions/prognostic2_core.cpp
r3913 r3938 10 10 #include "../modules/modules.h" 11 11 12 DataSet* prognostic2_core(Model* model){12 Results* prognostic2_core(Model* model){ 13 13 14 14 extern int my_rank; 15 15 16 16 /*output: */ 17 Result* result=NULL; 18 DataSet* results=NULL; 17 Results* results=NULL; 19 18 20 19 /*intermediary: */ … … 36 35 37 36 //initialize results: 38 results=new DataSet(ResultsEnum);37 results=new Results(); 39 38 40 39 /*recover fem model: */ … … 60 59 61 60 /*Plug results into output dataset: */ 62 result=new Result(results->Size()+1,0,1,"h_g",h_g); 63 results->AddObject(result); 61 results->AddObject(new Result(results->Size()+1,0,1,"h_g",h_g)); 64 62 65 63 /*Free ressources:*/ … … 69 67 70 68 /*Add analysis_type to results: */ 71 result=new Result(results->Size()+1,0,1,"analysis_type",EnumAsString(Prognostic2AnalysisEnum)); 72 results->AddObject(result); 69 results->AddObject(new StringResult(results->Size()+1,AnalysisTypeEnum,0,1,EnumAsString(Prognostic2AnalysisEnum))); 73 70 74 71 /*return: */ -
issm/trunk/src/c/solutions/prognostic_core.cpp
r3922 r3938 10 10 #include "../modules/modules.h" 11 11 12 DataSet* prognostic_core(Model* model){12 Results* prognostic_core(Model* model){ 13 13 14 14 extern int my_rank; 15 15 16 16 /*output: */ 17 DataSet* results=NULL;18 Result* result=NULL;17 Results* results=NULL; 18 Result* result=NULL; 19 19 20 20 /*solutions: */ … … 28 28 29 29 //initialize results 30 results=new DataSet(ResultsEnum);30 results=new Results(); 31 31 32 32 /*recover fem model: */ … … 54 54 55 55 /*Add analysis_type to results: */ 56 result=new Result(results->Size()+1,0,1,"analysis_type",EnumAsString(PrognosticAnalysisEnum)); 57 results->AddObject(result); 56 results->AddObject(new StringResult(results->Size()+1,AnalysisTypeEnum,0,1,EnumAsString(PrognosticAnalysisEnum))); 58 57 59 58 /*Free ressources:*/ -
issm/trunk/src/c/solutions/slopecompute.cpp
r3895 r3938 14 14 #include "../EnumDefinitions/EnumDefinitions.h" 15 15 #include "../include/include.h" 16 #include "../modules/modules.h" 16 17 #include "./solutions.h" 17 18 … … 30 31 31 32 /*Results: */ 32 DataSet* results=NULL; 33 DataSet* processedresults=NULL; 34 Result* result=NULL; 33 Results* results=NULL; 35 34 36 35 Param* param=NULL; … … 84 83 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 85 84 86 _printf_("process results:\n");87 ProcessResults(&processedresults,results,model,SlopecomputeAnalysisEnum);88 89 85 _printf_("write results to disk:\n"); 90 OutputResults( processedresults,outputfilename);86 OutputResults(results,outputfilename); 91 87 92 88 if (waitonlock>0){ … … 96 92 97 93 /*Free ressources:*/ 98 delete processedresults;99 94 delete results; 100 95 delete model; -
issm/trunk/src/c/solutions/slopecompute_core.cpp
r3913 r3938 10 10 #include "../modules/modules.h" 11 11 12 DataSet* slopecompute_core(Model* model){12 Results* slopecompute_core(Model* model){ 13 13 14 14 extern int my_rank; 15 15 16 16 /*output: */ 17 DataSet* results=NULL; 18 Result* result=NULL; 17 Results* results=NULL; 19 18 20 19 /*solutions: */ … … 32 31 33 32 //initialize results 34 results=new DataSet(ResultsEnum);33 results=new Results(); 35 34 36 35 /*recover fem model: */ … … 51 50 52 51 /*Plug results into output dataset: */ 53 result=new Result(results->Size()+1,0,1,"sx_g",sx_g); 54 results->AddObject(result); 55 result=new Result(results->Size()+1,0,1,"sy_g",sy_g); 56 results->AddObject(result); 57 result=new Result(results->Size()+1,0,1,"analysis_type",EnumAsString(SlopecomputeAnalysisEnum)); 58 results->AddObject(result); 52 results->AddObject(new Result(results->Size()+1,0,1,"sx_g",sx_g)); 53 results->AddObject(new Result(results->Size()+1,0,1,"sy_g",sy_g)); 54 results->AddObject(new StringResult(results->Size()+1,AnalysisTypeEnum,0,1,EnumAsString(SlopecomputeAnalysisEnum))); 59 55 60 56 -
issm/trunk/src/c/solutions/solutions.h
r3895 r3938 13 13 14 14 /*cores: */ 15 DataSet* gradjcompute_core(Model* model);16 DataSet* diagnostic_core(Model* model);17 DataSet* prognostic_core(Model* model);18 DataSet* prognostic2_core(Model* model);19 DataSet* balancedthickness_core(Model* model);20 DataSet* balancedthickness2_core(Model* model);21 DataSet* balancedvelocities_core(Model* model);22 DataSet* slopecompute_core(Model* model);23 DataSet* control_core(Model* model);24 DataSet* steadystate_core(Model* model);25 DataSet* transient_core(Model* model);26 DataSet* transient_core_2d(Model* model);27 DataSet* transient_core_3d(Model* model);28 DataSet* thermal_core(Model* model);15 Results* gradjcompute_core(Model* model); 16 Results* diagnostic_core(Model* model); 17 Results* prognostic_core(Model* model); 18 Results* prognostic2_core(Model* model); 19 Results* balancedthickness_core(Model* model); 20 Results* balancedthickness2_core(Model* model); 21 Results* balancedvelocities_core(Model* model); 22 Results* slopecompute_core(Model* model); 23 Results* control_core(Model* model); 24 Results* steadystate_core(Model* model); 25 Results* transient_core(Model* model); 26 Results* transient_core_2d(Model* model); 27 Results* transient_core_3d(Model* model); 28 Results* thermal_core(Model* model); 29 29 30 30 /*computational cores: */ … … 51 51 52 52 //int ParameterUpdate(double* search_vector,int step, WorkspaceParams* workspaceparams,BatchParams* batchparams); 53 void OutputResults(DataSet* results,char* filename);54 53 void WriteLockFile(char* filename); 55 54 … … 59 58 void CreateFemModel(FemModel* femmodel,ConstDataHandle MODEL,int analysis_type,int sub_analysis_type); 60 59 //int BatchDebug(Mat* Kgg,Vec* pg,FemModel* femmodel,char* filename); 61 void ProcessResults(DataSet** pnewresults, DataSet* results,Model* model,int analysis_type);62 60 63 61 #endif -
issm/trunk/src/c/solutions/steadystate.cpp
r3913 r3938 35 35 36 36 /*Results: */ 37 DataSet* results=NULL; 38 DataSet* processed_results=NULL; 39 Result* result=NULL; 37 Results* results=NULL; 40 38 41 39 bool waitonlock=false; … … 118 116 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 119 117 120 _printf_("process results:\n");121 ProcessResults(&processed_results,results,model,SteadystateAnalysisEnum);122 118 } 123 119 else{ … … 135 131 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 136 132 137 _printf_("process results:\n");138 ProcessResults(&processed_results,results,model,ControlAnalysisEnum);139 133 } 140 134 141 135 _printf_("write results to disk:\n"); 142 OutputResults( processed_results,outputfilename);136 OutputResults(results,outputfilename); 143 137 } 144 138 else{ … … 166 160 delete model; 167 161 delete results; 168 delete processed_results;169 162 170 163 /*Get finish time and close*/ -
issm/trunk/src/c/solutions/steadystate_core.cpp
r3913 r3938 10 10 #include "../modules/modules.h" 11 11 12 DataSet* steadystate_core(Model* model){12 Results* steadystate_core(Model* model){ 13 13 14 14 extern int my_rank; … … 24 24 25 25 /*output: */ 26 Result* result=NULL; 27 DataSet* results=NULL; 28 DataSet* results_thermal=NULL; 29 DataSet* results_diagnostic=NULL; 26 Results* results=NULL; 27 Results* results_thermal=NULL; 28 Results* results_diagnostic=NULL; 30 29 31 30 /*solutions: */ … … 128 127 129 128 /*Plug results into output dataset: */ 130 result=new Result(results->Size()+1,0,1,"u_g",u_g); 131 results->AddObject(result); 132 result=new Result(results->Size()+1,0,1,"p_g",p_g); 133 results->AddObject(result); 134 result=new Result(results->Size()+1,0,1,"t_g",t_g); 135 results->AddObject(result); 136 result=new Result(results->Size()+1,0,1,"m_g",m_g); 137 results->AddObject(result); 138 result=new Result(results->Size()+1,0,1,"analysis_type",EnumAsString(SteadyAnalysisEnum)); 139 results->AddObject(result); 129 results->AddObject(new Result(results->Size()+1,0,1,"u_g",u_g)); 130 results->AddObject(new Result(results->Size()+1,0,1,"p_g",p_g)); 131 results->AddObject(new Result(results->Size()+1,0,1,"t_g",t_g)); 132 results->AddObject(new Result(results->Size()+1,0,1,"m_g",m_g)); 133 results->AddObject(new StringResult(results->Size()+1,AnalysisTypeEnum,0,1,EnumAsString(SteadyAnalysisEnum))); 140 134 141 135 -
issm/trunk/src/c/solutions/thermal.cpp
r3913 r3938 34 34 35 35 /*Results: */ 36 DataSet* results=NULL; 37 DataSet* processed_results=NULL; 38 Result* result=NULL; 36 Results* results=NULL; 39 37 40 38 Param* param=NULL; … … 92 90 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 93 91 94 _printf_("process results:\n");95 ProcessResults(&processed_results,results,model,ThermalAnalysisEnum);96 97 92 _printf_("write results to disk:\n"); 98 OutputResults( processed_results,outputfilename);93 OutputResults(results,outputfilename); 99 94 } 100 95 else{ … … 119 114 delete model; 120 115 delete results; 121 delete processed_results;122 116 123 117 /*Get finish time and close*/ -
issm/trunk/src/c/solutions/thermal_core.cpp
r3922 r3938 10 10 #include "../modules/modules.h" 11 11 12 DataSet* thermal_core(Model* model){12 Results* thermal_core(Model* model){ 13 13 14 14 extern int my_rank; … … 20 20 21 21 /*output: */ 22 DataSet* results=NULL; 23 Result* result=NULL; 22 Results* results=NULL; 24 23 25 24 /*solutions vectors: */ … … 46 45 47 46 //initialize results 48 results=new DataSet(ResultsEnum);47 results=new Results(); 49 48 50 49 /*recover fem models: */ … … 101 100 /*Plug results into output dataset: */ 102 101 if(dt==0){ 103 result=new Result(results->Size()+1,0,1,"t_g",t_g[0]); 104 results->AddObject(result); 105 106 result=new Result(results->Size()+1,0,1,"m_g",m_g[0]); 107 results->AddObject(result); 102 results->AddObject(new Result(results->Size()+1,0,1,"t_g",t_g[0])); 103 results->AddObject(new Result(results->Size()+1,0,1,"m_g",m_g[0])); 108 104 109 105 /*free ressource*/ … … 113 109 else{ 114 110 for(i=0;i<nsteps;i++){ 115 result=new Result(results->Size()+1,time[i],i+1,"t_g",t_g[i]); 116 results->AddObject(result); 117 118 result=new Result(results->Size()+1,time[i],i+1,"m_g",m_g[i]); 119 results->AddObject(result); 111 results->AddObject(new Result(results->Size()+1,time[i],i+1,"t_g",t_g[i])); 112 results->AddObject(new Result(results->Size()+1,time[i],i+1,"m_g",m_g[i])); 120 113 121 114 /*free ressource*/ … … 125 118 } 126 119 /*Add analysis_type to results: */ 127 result=new Result(results->Size()+1,0,1,"analysis_type",EnumAsString(ThermalAnalysisEnum)); 128 results->AddObject(result); 120 results->AddObject(new StringResult(results->Size()+1,AnalysisTypeEnum,0,1,EnumAsString(ThermalAnalysisEnum))); 129 121 130 122 /*free ressource*/ -
issm/trunk/src/c/solutions/transient.cpp
r3913 r3938 33 33 34 34 /*Results: */ 35 DataSet* results=NULL; 36 DataSet* processed_results=NULL; 37 Result* result=NULL; 35 Results* results=NULL; 38 36 39 37 Param* param=NULL; … … 113 111 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 114 112 115 _printf_("process results:\n");116 ProcessResults(&processed_results,results,model,TransientAnalysisEnum);117 118 113 _printf_("write results to disk:\n"); 119 OutputResults( processed_results,outputfilename);114 OutputResults(results,outputfilename); 120 115 } 121 116 else{ … … 139 134 /*Free ressources:*/ 140 135 delete results; 141 delete processed_results;142 136 delete model; 143 137 -
issm/trunk/src/c/solutions/transient_core.cpp
r3913 r3938 10 10 #include "../modules/modules.h" 11 11 12 DataSet* transient_core(Model* model){12 Results* transient_core(Model* model){ 13 13 14 14 int dim=-1; 15 DataSet* results=NULL;15 Results* results=NULL; 16 16 17 17 //first recover parameters common to all solutions -
issm/trunk/src/c/solutions/transient_core_2d.cpp
r3913 r3938 10 10 #include "../modules/modules.h" 11 11 12 DataSet* transient_core_2d(Model* model){12 Results* transient_core_2d(Model* model){ 13 13 14 14 extern int my_rank; … … 23 23 24 24 /*output: */ 25 DataSet* results=NULL; 26 Result* result=NULL; 25 Results* results=NULL; 27 26 28 27 /*solutions: */ … … 45 44 double finaltime; 46 45 double dt; 47 DataSet* diagnostic_results=NULL;48 DataSet* prognostic_results=NULL;46 Results* diagnostic_results=NULL; 47 Results* prognostic_results=NULL; 49 48 50 49 … … 60 59 61 60 //initialize results 62 results=new DataSet(ResultsEnum);61 results=new Results(); 63 62 64 63 /*recover fem models: */ … … 121 120 122 121 //plug into results. 123 result =new Result(results->Size()+1,time,step,"u_g",u_g); results->AddObject(result);124 result =new Result(results->Size()+1,time,step,"p_g",p_g); results->AddObject(result);125 result =new Result(results->Size()+1,time,step,"h_g",h_g); results->AddObject(result);126 result =new Result(results->Size()+1,time,step,"s_g",s_g); results->AddObject(result);127 result =new Result(results->Size()+1,time,step,"b_g",b_g); results->AddObject(result);122 results->AddObject(new Result(results->Size()+1,time,step,"u_g",u_g)); 123 results->AddObject(new Result(results->Size()+1,time,step,"p_g",p_g)); 124 results->AddObject(new Result(results->Size()+1,time,step,"h_g",h_g)); 125 results->AddObject(new Result(results->Size()+1,time,step,"s_g",s_g)); 126 results->AddObject(new Result(results->Size()+1,time,step,"b_g",b_g)); 128 127 129 128 //update inputs … … 139 138 140 139 /*Add analysis_type to results: */ 141 result=new Result(results->Size()+1,0,1,"analysis_type",EnumAsString(TransientAnalysisEnum)); 142 results->AddObject(result); 140 results->AddObject(new StringResult(results->Size()+1,AnalysisTypeEnum,0,1,EnumAsString(TransientAnalysisEnum))); 143 141 144 142 /*Free ressources:*/ -
issm/trunk/src/c/solutions/transient_core_3d.cpp
r3913 r3938 10 10 #include "../modules/modules.h" 11 11 12 DataSet* transient_core_3d(Model* model){12 Results* transient_core_3d(Model* model){ 13 13 14 14 extern int my_rank; … … 25 25 26 26 /*output: */ 27 DataSet* results=NULL; 28 Result* result=NULL; 27 Results* results=NULL; 29 28 30 29 /*solutions: */ … … 50 49 double finaltime; 51 50 double dt; 52 DataSet* diagnostic_results=NULL;53 DataSet* prognostic_results=NULL;51 Results* diagnostic_results=NULL; 52 Results* prognostic_results=NULL; 54 53 55 54 … … 65 64 66 65 //initialize results 67 results=new DataSet(ResultsEnum);66 results=new Results(); 68 67 69 68 /*recover fem models: */ … … 149 148 150 149 //plug into results. 151 result =new Result(results->Size()+1,time,step,"u_g",u_g); results->AddObject(result);152 result =new Result(results->Size()+1,time,step,"p_g",p_g); results->AddObject(result);153 result =new Result(results->Size()+1,time,step,"h_g",h_g); results->AddObject(result);154 result =new Result(results->Size()+1,time,step,"s_g",s_g); results->AddObject(result);155 result =new Result(results->Size()+1,time,step,"b_g",b_g); results->AddObject(result);156 result =new Result(results->Size()+1,time,step,"t_g",t_g); results->AddObject(result);157 result =new Result(results->Size()+1,time,step,"m_g",m_g); results->AddObject(result);150 results->AddObject(new Result(results->Size()+1,time,step,"u_g",u_g)); 151 results->AddObject(new Result(results->Size()+1,time,step,"p_g",p_g)); 152 results->AddObject(new Result(results->Size()+1,time,step,"h_g",h_g)); 153 results->AddObject(new Result(results->Size()+1,time,step,"s_g",s_g)); 154 results->AddObject(new Result(results->Size()+1,time,step,"b_g",b_g)); 155 results->AddObject(new Result(results->Size()+1,time,step,"t_g",t_g)); 156 results->AddObject(new Result(results->Size()+1,time,step,"m_g",m_g)); 158 157 159 158 //update inputs … … 175 174 _printf_("%s"," saving temporary results..."); 176 175 177 DataSet* processed_results=NULL;178 176 char* outputfilename=NULL; 179 177 180 178 model->FindParam(&outputfilename,OutputFileNameEnum); 181 ProcessResults(&processed_results,results,model,TransientAnalysisEnum); 182 OutputResults(processed_results,outputfilename); 183 184 delete processed_results; 179 OutputResults(results,outputfilename); 180 185 181 xfree((void**)&outputfilename); 186 182 … … 190 186 191 187 /*Add analysis_type to results: */ 192 result=new Result(results->Size()+1,0,1,"analysis_type",EnumAsString(TransientAnalysisEnum)); 193 results->AddObject(result); 188 results->AddObject(new StringResult(results->Size()+1,AnalysisTypeEnum,0,1,EnumAsString(TransientAnalysisEnum))); 194 189 195 190
Note:
See TracChangeset
for help on using the changeset viewer.