Changeset 3935
- Timestamp:
- 05/25/10 08:17:56 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/DataSet/DataSet.h
r3887 r3935 133 133 Input* GetInput(int enum_name); 134 134 Inputs* SpawnTriaInputs(int* indices); 135 Inputs* SpawnBeamInputs(int* indices); 135 136 136 137 void GetParameterValue(bool* pvalue,int enum_type); -
issm/trunk/src/c/DataSet/Inputs.cpp
r3869 r3935 576 576 } 577 577 /*}}}*/ 578 /*FUNCTION Inputs::SpawnBeamInputs{{{1*/ 579 Inputs* Inputs::SpawnBeamInputs(int* indices){ 580 581 /*Intermediary*/ 582 vector<Object*>::iterator object; 583 Input* inputin=NULL; 584 Input* inputout=NULL; 585 586 /*Output*/ 587 Inputs* newinputs=new Inputs(); 588 589 /*Go through inputs and call Spawn function*/ 590 for ( object=objects.begin() ; object < objects.end(); object++ ){ 591 592 /*Create new input*/ 593 inputin=(Input*)(*object); 594 inputout=inputin->SpawnBeamInput(indices); 595 596 /*Add input to new inputs*/ 597 newinputs->AddObject(inputout); 598 } 599 600 /*Assign output pointer*/ 601 return newinputs; 602 } 603 /*}}}*/ 578 604 /*FUNCTION Inputs::SpawnTriaInputs{{{1*/ 579 605 Inputs* Inputs::SpawnTriaInputs(int* indices){ -
issm/trunk/src/c/objects/Elements/Penta.cpp
r3887 r3935 459 459 460 460 return tria; 461 } 462 /*}}}*/ 463 /*FUNCTION Penta::SpawnBeam {{{1*/ 464 void* Penta::SpawnBeam(int g0, int g1){ 465 466 /*out of grids g0,g1 and g2 from Penta, build a beam element: */ 467 Beam* beam=NULL; 468 int indices[2]; 469 int zero=0; 470 Hook *beam_hnodes = NULL; 471 Hook *beam_hmatice = NULL; 472 Hook *beam_hmatpar = NULL; 473 Parameters *beam_parameters = NULL; 474 Inputs *beam_inputs = NULL; 475 476 indices[0]=g0; 477 indices[1]=g1; 478 479 beam_hnodes =this->hnodes.Spawn(indices,2); 480 beam_hmatice=this->hmatice.Spawn(&zero,1); 481 beam_hmatpar=this->hmatpar.Spawn(&zero,1); 482 beam_parameters=this->parameters; 483 beam_inputs=(Inputs*)this->inputs->SpawnBeamInputs(indices); 484 485 beam=new Beam(); 486 beam->id=this->id; 487 beam->inputs=beam_inputs; 488 beam->parameters=beam_parameters; 489 490 /*now deal with hooks and objects: */ 491 beam->hnodes.copy(beam_hnodes); 492 beam->hmatice.copy(beam_hmatice); 493 beam->hmatpar.copy(beam_hmatpar); 494 495 /*recover objects: */ 496 //beam->nodes=(Node**)beam->hnodes.deliverp(); 497 //beam->matice=(Matice*)beam->hmatice.delivers(); 498 //beam->matpar=(Matpar*)beam->hmatpar.delivers(); 499 500 delete beam_hnodes; 501 delete beam_hmatice; 502 delete beam_hmatpar; 503 504 return beam; 461 505 } 462 506 /*}}}*/ -
issm/trunk/src/c/objects/Elements/Penta.h
r3887 r3935 56 56 int MarshallSize(); 57 57 int MyRank(); 58 void* SpawnBeam(int g0, int g1); 58 59 void* SpawnTria(int g0, int g1, int g2); 59 60 void SetClone(int* minranks); -
issm/trunk/src/c/objects/Inputs/BeamVertexInput.cpp
r3928 r3935 130 130 } 131 131 /*}}}*/ 132 /*FUNCTION BeamVertexInput::SpawnBeamInput{{{1*/ 133 Input* BeamVertexInput::SpawnBeamInput(int* indices){ 134 135 /*output*/ 136 BeamVertexInput* outinput=NULL; 137 138 /*Create new Beam input (copy of current input)*/ 139 outinput=new BeamVertexInput(this->enum_type,&this->values[0]); 140 141 /*Assign output*/ 142 return outinput; 143 144 } 145 /*}}}*/ 132 146 /*FUNCTION BeamVertexInput::SpawnTriaInput{{{1*/ 133 147 Input* BeamVertexInput::SpawnTriaInput(int* indices){ -
issm/trunk/src/c/objects/Inputs/BeamVertexInput.h
r3855 r3935 47 47 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 48 48 49 Input* SpawnBeamInput(int* indices); 49 50 Input* SpawnTriaInput(int* indices); 50 51 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/BoolInput.cpp
r3847 r3935 129 129 } 130 130 /*}}}*/ 131 /*FUNCTION BoolInput::SpawnBeamInput{{{1*/ 132 Input* BoolInput::SpawnBeamInput(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 /*FUNCTION BoolInput::SpawnTriaInput{{{1*/ 132 147 Input* BoolInput::SpawnTriaInput(int* indices){ -
issm/trunk/src/c/objects/Inputs/BoolInput.h
r3855 r3935 47 47 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 48 48 49 Input* SpawnBeamInput(int* indices); 49 50 Input* SpawnTriaInput(int* indices); 50 51 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/DoubleInput.cpp
r3860 r3935 129 129 } 130 130 /*}}}*/ 131 /*FUNCTION DoubleInput::Spawn TriaInput{{{1*/132 Input* DoubleInput::Spawn TriaInput(int* indices){131 /*FUNCTION DoubleInput::SpawnBeamInput{{{1*/ 132 Input* DoubleInput::SpawnBeamInput(int* indices){ 133 133 134 134 /*output*/ … … 144 144 } 145 145 /*}}}*/ 146 /*FUNCTION DoubleInput::SpawnTriaInput{{{1*/ 147 Input* DoubleInput::SpawnTriaInput(int* indices){ 148 149 /*output*/ 150 DoubleInput* outinput=new DoubleInput(); 151 152 /*only copy current value*/ 153 outinput->enum_type=this->enum_type; 154 outinput->value=this->value; 155 156 /*Assign output*/ 157 return outinput; 158 159 } 160 /*}}}*/ 146 161 147 162 /*Object functions*/ -
issm/trunk/src/c/objects/Inputs/DoubleInput.h
r3855 r3935 47 47 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 48 48 49 Input* SpawnBeamInput(int* indices); 49 50 Input* SpawnTriaInput(int* indices); 50 51 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/Input.h
r3855 r3935 44 44 virtual void GetVyStrainRate3dPattyn(double* epsilonvy,double* xyz_list, double* gauss)=0; 45 45 virtual void ChangeEnum(int newenumtype)=0; 46 virtual Input* SpawnBeamInput(int* indices)=0; 46 47 virtual Input* SpawnTriaInput(int* indices)=0; 47 48 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/IntInput.cpp
r3847 r3935 129 129 } 130 130 /*}}}*/ 131 /*FUNCTION IntInput::SpawnBeamInput{{{1*/ 132 Input* IntInput::SpawnBeamInput(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 /*FUNCTION IntInput::SpawnTriaInput{{{1*/ 132 146 Input* IntInput::SpawnTriaInput(int* indices){ -
issm/trunk/src/c/objects/Inputs/IntInput.h
r3855 r3935 47 47 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 48 48 49 Input* SpawnBeamInput(int* indices); 49 50 Input* SpawnTriaInput(int* indices); 50 51 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp
r3875 r3935 132 132 extern int my_rank; 133 133 return my_rank; 134 } 135 /*}}}*/ 136 /*FUNCTION PentaVertexInput::SpawnBeamInput{{{1*/ 137 Input* PentaVertexInput::SpawnBeamInput(int* indices){ 138 139 /*output*/ 140 BeamVertexInput* outinput=NULL; 141 double newvalues[2]; 142 143 /*Loop over the new indices*/ 144 for(int i=0;i<2;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 Beam input*/ 154 outinput=new BeamVertexInput(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
r3855 r3935 46 46 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 47 47 48 Input* SpawnBeamInput(int* indices); 48 49 Input* SpawnTriaInput(int* indices); 49 50 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/SingVertexInput.cpp
r3920 r3935 129 129 } 130 130 /*}}}*/ 131 /*FUNCTION SingVertexInput::SpawnBeamInput{{{1*/ 132 Input* SingVertexInput::SpawnBeamInput(int* indices){ 133 134 ISSMERROR("Cannot spaw a Beam from a Sing"); 135 136 } 137 /*}}}*/ 131 138 /*FUNCTION SingVertexInput::SpawnTriaInput{{{1*/ 132 139 Input* SingVertexInput::SpawnTriaInput(int* indices){ -
issm/trunk/src/c/objects/Inputs/SingVertexInput.h
r3855 r3935 46 46 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 47 47 48 Input* SpawnBeamInput(int* indices); 48 49 Input* SpawnTriaInput(int* indices); 49 50 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp
r3855 r3935 131 131 } 132 132 /*}}}*/ 133 /*FUNCTION BeamVertexInput::SpawnBeamInput{{{1*/ 134 Input* TriaVertexInput::SpawnBeamInput(int* indices){ 135 136 /*output*/ 137 BeamVertexInput* outinput=NULL; 138 double newvalues[2]; 139 140 /*Loop over the new indices*/ 141 for(int i=0;i<2;i++){ 142 143 /*Check index value*/ 144 ISSMASSERT(indices[i]>=0 && indices[i]<3); 145 146 /*Assign value to new input*/ 147 newvalues[i]=this->values[indices[i]]; 148 } 149 150 /*Create new Beam input*/ 151 outinput=new BeamVertexInput(this->enum_type,&newvalues[0]); 152 153 /*Assign output*/ 154 return outinput; 155 156 } 157 /*}}}*/ 133 158 /*FUNCTION TriaVertexInput::SpawnTriaInput{{{1*/ 134 159 Input* TriaVertexInput::SpawnTriaInput(int* indices){ … … 142 167 /*Assign output*/ 143 168 return outinput; 144 145 169 146 170 } -
issm/trunk/src/c/objects/Inputs/TriaVertexInput.h
r3855 r3935 47 47 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 48 48 49 Input* SpawnBeamInput(int* indices); 49 50 Input* SpawnTriaInput(int* indices); 50 51 /*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.