Changeset 3847
- Timestamp:
- 05/19/10 14:14:22 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/DataSet/DataSet.cpp
r3821 r3847 364 364 365 365 return dataset; 366 }367 /*}}}*/368 /*FUNCTION DataSet::Spawn{{{1*/369 DataSet* DataSet::Spawn(int* indices, int num){370 ISSMERROR(" not supported yet!");371 366 } 372 367 /*}}}*/ -
issm/trunk/src/c/DataSet/DataSet.h
r3830 r3847 101 101 void UpdateVertexPositions(double* thickness,double* bed); 102 102 void OutputRifts(Vec riftproperties); 103 DataSet* Spawn(int* indices, int num);104 103 /*}}}*/ 105 104 … … 129 128 /*numerics: {{{1*/ 130 129 int AddInput(Input* in_input); 130 Inputs* SpawnTriaInputs(int* indices); 131 131 132 132 void GetParameterValue(bool* pvalue,int enum_type); -
issm/trunk/src/c/DataSet/Inputs.cpp
r3830 r3847 413 413 } 414 414 /*}}}*/ 415 /*FUNCTION Inputs::SpawnTriaInputs{{{1*/ 416 Inputs* Inputs::SpawnTriaInputs(int* indices){ 417 418 /*Intermediary*/ 419 vector<Object*>::iterator object; 420 Input* inputin=NULL; 421 Input* inputout=NULL; 422 423 /*Output*/ 424 Inputs* newinputs=new Inputs(); 425 426 /*Go through inputs and call Spawn function*/ 427 for ( object=objects.begin() ; object < objects.end(); object++ ){ 428 429 /*Create new input*/ 430 inputin=(Input*)(*object); 431 inputout=inputin->SpawnTriaInput(indices); 432 433 /*Add input to new inputs*/ 434 newinputs->AddObject(inputout); 435 } 436 437 /*Assign output pointer*/ 438 return newinputs; 439 } 440 /*}}}*/ -
issm/trunk/src/c/objects/Elements/Beam.cpp
r3821 r3847 375 375 /*}}}*/ 376 376 /*FUNCTION Beam::CreateKMatrix{{{1*/ 377 378 377 void Beam::CreateKMatrix(Mat Kgg,int analysis_type,int sub_analysis_type){ 379 378 -
issm/trunk/src/c/objects/Elements/Penta.cpp
r3840 r3847 392 392 tria_hmatpar=this->hmatpar.Spawn(&zero,1); 393 393 tria_parameters=this->parameters; 394 tria_inputs=(Inputs*)this->inputs->Spawn (indices,3);394 tria_inputs=(Inputs*)this->inputs->SpawnTriaInputs(indices); 395 395 396 396 tria=new Tria(); … … 412 412 delete tria_hmatice; 413 413 delete tria_hmatpar; 414 delete tria_inputs;415 414 416 415 return tria; … … 817 816 /*}}}*/ 818 817 /*FUNCTION CreateKMatrix {{{1*/ 819 820 818 void Penta::CreateKMatrix(Mat Kgg,int analysis_type,int sub_analysis_type){ 819 820 /*if debugging mode, check that all pointers exist*/ 821 ISSMASSERT(this->nodes && this->matice && this->matpar && this->neighbors && this->parameters && this->inputs); 821 822 822 823 /*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */ … … 933 934 /*FUNCTION CreateKMatrixDiagnosticHoriz {{{1*/ 934 935 void Penta::CreateKMatrixDiagnosticHoriz( Mat Kgg, int analysis_type,int sub_analysis_type){ 935 936 936 937 937 /* local declarations */ … … 1880 1880 /*FUNCTION CreatePVector {{{1*/ 1881 1881 void Penta::CreatePVector(Vec pg, int analysis_type,int sub_analysis_type){ 1882 1883 /*if debugging mode, check that all pointers exist*/ 1884 ISSMASSERT(this->nodes && this->matice && this->matpar && this->neighbors && this->parameters && this->inputs); 1882 1885 1883 1886 /*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */ -
issm/trunk/src/c/objects/Elements/Tria.cpp
r3840 r3847 273 273 printf("Tria:\n"); 274 274 printf(" id: %i\n",id); 275 nodes[0]->DeepEcho(); 276 nodes[1]->DeepEcho(); 277 nodes[2]->DeepEcho(); 278 matice->DeepEcho(); 279 matpar->DeepEcho(); 275 if(nodes){ 276 nodes[0]->DeepEcho(); 277 nodes[1]->DeepEcho(); 278 nodes[2]->DeepEcho(); 279 } 280 else printf("nodes = NULL\n"); 281 282 if (matice) matice->DeepEcho(); 283 else printf("matice = NULL\n"); 284 285 if (matpar) matpar->DeepEcho(); 286 else printf("matpar = NULL\n"); 287 280 288 printf(" parameters\n"); 281 parameters->DeepEcho(); 289 if (parameters) parameters->DeepEcho(); 290 else printf("parameters = NULL\n"); 291 282 292 printf(" inputs\n"); 283 inputs->DeepEcho(); 293 if (inputs) inputs->DeepEcho(); 294 else printf("inputs=NULL\n"); 284 295 285 296 return; … … 696 707 /*}}}*/ 697 708 /*FUNCTION Tria::CreateKMatrix {{{1*/ 698 699 709 void Tria::CreateKMatrix(Mat Kgg,int analysis_type,int sub_analysis_type){ 710 711 /*if debugging mode, check that all pointers exist*/ 712 ISSMASSERT(this->nodes && this->matice && this->matpar && this->parameters && this->inputs); 700 713 701 714 /*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */ … … 2081 2094 void Tria::CreatePVector(Vec pg,int analysis_type,int sub_analysis_type){ 2082 2095 2096 /*if debugging mode, check that all pointers exist*/ 2097 ISSMASSERT(this->nodes && this->matice && this->matpar && this->parameters && this->inputs); 2098 2083 2099 /*Just branch to the correct load generator, according to the type of analysis we are carrying out: */ 2084 2100 if (analysis_type==ControlAnalysisEnum){ -
issm/trunk/src/c/objects/Inputs/BeamVertexInput.cpp
r3830 r3847 49 49 50 50 printf("BeamVertexInput:\n"); 51 printf(" enum: %i \n",this->enum_type);52 printf(" %g|%g\n",this->values[0],this->values[1]);51 printf(" enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type)); 52 printf(" values: [%g %g]\n",this->values[0],this->values[1]); 53 53 } 54 54 /*}}}*/ … … 130 130 } 131 131 /*}}}*/ 132 /*FUNCTION BeamVertexInput::SpawnTriaInput{{{1*/ 133 Input* BeamVertexInput::SpawnTriaInput(int* indices){ 134 135 ISSMERROR("Cannot spaw a Tria from a Beam"); 136 137 } 138 /*}}}*/ 132 139 133 140 /*Object functions*/ -
issm/trunk/src/c/objects/Inputs/BeamVertexInput.h
r3830 r3847 38 38 Object* copy(); 39 39 int EnumType(); 40 void 41 void 42 void 43 void 44 void 45 void 40 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 41 void UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");} 42 void UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");} 43 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 44 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 45 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 46 46 47 void 47 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 48 48 49 49 Input* SpawnTriaInput(int* indices); 50 50 /*}}}*/ 51 51 /*numerics: {{{1*/ -
issm/trunk/src/c/objects/Inputs/BoolInput.cpp
r3808 r3847 48 48 49 49 printf("BoolInput:\n"); 50 printf(" enum: %i \n",this->enum_type);51 printf(" %s\n",value?"true":"false");50 printf(" enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type)); 51 printf(" value: %s\n",value?"true":"false"); 52 52 } 53 53 /*}}}*/ … … 129 129 } 130 130 /*}}}*/ 131 /*FUNCTION BoolInput::SpawnTriaInput{{{1*/ 132 Input* BoolInput::SpawnTriaInput(int* indices){ 133 134 /*output*/ 135 BoolInput* outinput=new BoolInput(); 136 137 /*only copy current value*/ 138 outinput->enum_type=this->enum_type; 139 outinput->value=this->value; 140 141 /*Assign output*/ 142 return outinput; 143 144 } 145 /*}}}*/ 131 146 132 147 /*Object functions*/ -
issm/trunk/src/c/objects/Inputs/BoolInput.h
r3830 r3847 47 47 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 48 48 49 49 Input* SpawnTriaInput(int* indices); 50 50 /*}}}*/ 51 51 /*numerics: {{{1*/ -
issm/trunk/src/c/objects/Inputs/DoubleInput.cpp
r3808 r3847 48 48 49 49 printf("DoubleInput:\n"); 50 printf(" enum: %i \n",this->enum_type);51 printf(" %g\n",this->value);50 printf(" enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type)); 51 printf(" value: %g\n",this->value); 52 52 } 53 53 /*}}}*/ … … 129 129 } 130 130 /*}}}*/ 131 /*FUNCTION DoubleInput::SpawnTriaInput{{{1*/ 132 Input* DoubleInput::SpawnTriaInput(int* indices){ 133 134 /*output*/ 135 DoubleInput* outinput=new DoubleInput(); 136 137 /*only copy current value*/ 138 outinput->enum_type=this->enum_type; 139 outinput->value=this->value; 140 141 /*Assign output*/ 142 return outinput; 143 144 } 145 /*}}}*/ 131 146 132 147 /*Object functions*/ -
issm/trunk/src/c/objects/Inputs/DoubleInput.h
r3830 r3847 47 47 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 48 48 49 49 Input* SpawnTriaInput(int* indices); 50 50 /*}}}*/ 51 51 /*numerics: {{{1*/ -
issm/trunk/src/c/objects/Inputs/Input.h
r3830 r3847 42 42 virtual void GetVzStrainRate3d(double* epsilonvz,double* xyz_list, double* gauss,int formulation_enum=StokesFormulationEnum)=0; 43 43 virtual void ChangeEnum(int newenumtype)=0; 44 virtual Input* SpawnTriaInput(int* indices)=0; 44 45 /*}}}*/ 45 46 -
issm/trunk/src/c/objects/Inputs/IntInput.cpp
r3808 r3847 48 48 49 49 printf("IntInput:\n"); 50 printf(" enum: %i \n",this->enum_type);51 printf(" %i\n",this->value);50 printf(" enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type)); 51 printf(" value: %i\n",this->value); 52 52 } 53 53 /*}}}*/ … … 129 129 } 130 130 /*}}}*/ 131 /*FUNCTION IntInput::SpawnTriaInput{{{1*/ 132 Input* IntInput::SpawnTriaInput(int* indices){ 133 134 /*output*/ 135 IntInput* outinput=new IntInput(); 136 137 /*only copy current value*/ 138 outinput->enum_type=this->enum_type; 139 outinput->value=this->value; 140 141 /*Assign output*/ 142 return outinput; 143 } 144 /*}}}*/ 131 145 132 146 /*Object functions*/ -
issm/trunk/src/c/objects/Inputs/IntInput.h
r3830 r3847 47 47 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 48 48 49 49 Input* SpawnTriaInput(int* indices); 50 50 /*}}}*/ 51 51 /*numerics: {{{1*/ -
issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp
r3840 r3847 23 23 } 24 24 /*}}}*/ 25 /*FUNCTION PentaVertexInput::PentaVertexInput( double* values){{{1*/25 /*FUNCTION PentaVertexInput::PentaVertexInput(int in_enum_type,double* values){{{1*/ 26 26 PentaVertexInput::PentaVertexInput(int in_enum_type,double* in_values){ 27 27 … … 53 53 54 54 printf("PentaVertexInput:\n"); 55 printf(" enum: %i \n",this->enum_type);56 printf(" %g|%g|%g|%g|%g|%g\n",this->values[0],this->values[1],this->values[2],this->values[3],this->values[4],this->values[5]);55 printf(" enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type)); 56 printf(" values: [%g %g %g %g %g %g]\n",this->values[0],this->values[1],this->values[2],this->values[3],this->values[4],this->values[5]); 57 57 } 58 58 /*}}}*/ … … 132 132 extern int my_rank; 133 133 return my_rank; 134 } 135 /*}}}*/ 136 /*FUNCTION PentaVertexInput::SpawnTriaInput{{{1*/ 137 Input* PentaVertexInput::SpawnTriaInput(int* indices){ 138 139 /*output*/ 140 TriaVertexInput* outinput=NULL; 141 double newvalues[3]; 142 143 /*Loop over the new indices*/ 144 for(int i=0;i<3;i++){ 145 146 /*Check index value*/ 147 ISSMASSERT(indices[i]>=0 && indices[i]<6); 148 149 /*Assign value to new input*/ 150 newvalues[i]=this->values[indices[i]]; 151 } 152 153 /*Create new Tria input*/ 154 outinput=new TriaVertexInput(this->enum_type,&newvalues[0]); 155 156 /*Assign output*/ 157 return outinput; 158 134 159 } 135 160 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/PentaVertexInput.h
r3840 r3847 46 46 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 47 47 48 48 Input* SpawnTriaInput(int* indices); 49 49 /*}}}*/ 50 50 /*numerics: {{{1*/ -
issm/trunk/src/c/objects/Inputs/SingVertexInput.cpp
r3830 r3847 48 48 49 49 printf("SingVertexInput:\n"); 50 printf(" enum: %i \n",this->enum_type);51 printf(" %g\n",this->value);50 printf(" enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type)); 51 printf(" value: %g\n",this->value); 52 52 } 53 53 /*}}}*/ … … 129 129 } 130 130 /*}}}*/ 131 /*FUNCTION SingVertexInput::SpawnTriaInput{{{1*/ 132 Input* SingVertexInput::SpawnTriaInput(int* indices){ 133 134 ISSMERROR("Cannot spaw a Tria from a Sing"); 135 136 } 137 /*}}}*/ 131 138 132 139 /*Object functions*/ -
issm/trunk/src/c/objects/Inputs/SingVertexInput.h
r3830 r3847 46 46 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 47 47 48 48 Input* SpawnTriaInput(int* indices); 49 49 /*}}}*/ 50 50 /*numerics: {{{1*/ -
issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp
r3840 r3847 23 23 } 24 24 /*}}}*/ 25 /*FUNCTION TriaVertexInput::TriaVertexInput( double* values){{{1*/25 /*FUNCTION TriaVertexInput::TriaVertexInput(int in_enum_type,double* values){{{1*/ 26 26 TriaVertexInput::TriaVertexInput(int in_enum_type,double* in_values){ 27 27 … … 50 50 51 51 printf("TriaVertexInput:\n"); 52 printf(" enum: %i \n",this->enum_type);53 printf(" %g|%g|%g\n",this->values[0],this->values[1],this->values[2]);52 printf(" enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type)); 53 printf(" values: [%g %g %g]\n",this->values[0],this->values[1],this->values[2]); 54 54 } 55 55 /*}}}*/ … … 129 129 extern int my_rank; 130 130 return my_rank; 131 } 132 /*}}}*/ 133 /*FUNCTION TriaVertexInput::SpawnTriaInput{{{1*/ 134 Input* TriaVertexInput::SpawnTriaInput(int* indices){ 135 136 /*output*/ 137 TriaVertexInput* outinput=NULL; 138 139 /*Create new Tria input (copy of current input)*/ 140 outinput=new TriaVertexInput(this->enum_type,&this->values[0]); 141 142 /*Assign output*/ 143 return outinput; 144 145 131 146 } 132 147 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/TriaVertexInput.h
r3830 r3847 47 47 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 48 48 49 49 Input* SpawnTriaInput(int* indices); 50 50 /*}}}*/ 51 51 /*numerics: {{{1*/
Note:
See TracChangeset
for help on using the changeset viewer.