Changeset 15737
- Timestamp:
- 08/07/13 10:02:53 (12 years ago)
- Location:
- issm/trunk-jpl/src/c/classes
- Files:
-
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/ElementResults/BoolElementResult.cpp
r15128 r15737 75 75 } 76 76 /*}}}*/ 77 /*FUNCTION BoolElementResult::SpawnTriaElementResult{{{*/78 ElementResult* BoolElementResult::SpawnTriaElementResult(int* indices){79 80 /*output*/81 BoolElementResult* outresult=new BoolElementResult();82 83 /*copy fields: */84 outresult->enum_type=this->enum_type;85 outresult->value=this->value;86 outresult->time=this->time;87 outresult->step=this->step;88 89 /*Assign output*/90 return outresult;91 92 }93 /*}}}*/94 77 /*FUNCTION BoolElementResult::NumberOfNodalValues{{{*/ 95 78 int BoolElementResult::NumberOfNodalValues(void){ -
issm/trunk-jpl/src/c/classes/ElementResults/BoolElementResult.h
r15128 r15737 34 34 /*}}}*/ 35 35 /*ElementResult virtual functions definitions: {{{*/ 36 ElementResult* SpawnTriaElementResult(int* indices);37 36 IssmDouble GetTime(void){return time;}; 38 37 int GetStep(void){return step;}; -
issm/trunk-jpl/src/c/classes/ElementResults/DoubleElementResult.cpp
r15128 r15737 75 75 } 76 76 /*}}}*/ 77 /*FUNCTION DoubleElementResult::SpawnTriaElementResult{{{*/78 ElementResult* DoubleElementResult::SpawnTriaElementResult(int* indices){79 80 /*output*/81 DoubleElementResult* outresult=new DoubleElementResult();82 83 /*copy fields: */84 outresult->enum_type=this->enum_type;85 outresult->value=this->value;86 outresult->time=this->time;87 outresult->step=this->step;88 89 /*Assign output*/90 return outresult;91 92 }93 /*}}}*/94 77 /*FUNCTION DoubleElementResult::NumberOfNodalValues{{{*/ 95 78 int DoubleElementResult::NumberOfNodalValues(void){ -
issm/trunk-jpl/src/c/classes/ElementResults/DoubleElementResult.h
r15128 r15737 14 14 15 15 private: 16 int enum_type;16 int enum_type; 17 17 IssmDouble value; 18 int step;18 int step; 19 19 IssmDouble time; 20 20 21 21 public: 22 22 23 /*DoubleElementResult constructors, destructors: {{{*/23 /*DoubleElementResult constructors, destructors:*/ 24 24 DoubleElementResult(); 25 25 DoubleElementResult(int enum_type,IssmDouble value,int step,IssmDouble time); 26 26 ~DoubleElementResult(); 27 /*}}}*/ 28 /*Object virtual functions definitions: {{{*/29 void Echo();30 void DeepEcho();31 int Id();32 int ObjectEnum();27 28 /*Object virtual functions definitions:*/ 29 void Echo(); 30 void DeepEcho(); 31 int Id(); 32 int ObjectEnum(); 33 33 Object* copy(); 34 /*}}}*/ 34 35 35 /*ElementResult virtual functions definitions: {{{*/ 36 ElementResult* SpawnTriaElementResult(int* indices);37 36 IssmDouble GetTime(void){return time;}; 38 37 int GetStep(void){return step;}; 39 38 int NumberOfNodalValues(void); 40 39 void PatchFill(int row, Patch* patch); 41 /*}}}*/ 42 /*DoubleElementResult management : {{{*/43 int 40 41 /*DoubleElementResult management*/ 42 int InstanceEnum(); 44 43 void GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs); 45 44 void GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof); 46 /*}}}*/47 45 }; 48 46 #endif /* _DOUBLEELEMENTRESULT_H */ -
issm/trunk-jpl/src/c/classes/ElementResults/ElementResult.h
r15128 r15737 15 15 public: 16 16 17 virtual ~ElementResult(){}; 18 virtual ElementResult* SpawnTriaElementResult(int* indices)=0; 19 virtual IssmDouble GetTime(void)=0; 20 virtual int GetStep(void)=0; 21 virtual int NumberOfNodalValues(void)=0; 22 virtual void PatchFill(int row, Patch* patch)=0; 23 virtual int InstanceEnum()=0; 24 virtual void GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdof)=0; 25 virtual void GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof)=0; 17 virtual ~ElementResult(){}; 18 virtual IssmDouble GetTime(void) = 0; 19 virtual int GetStep(void) = 0; 20 virtual int NumberOfNodalValues(void) = 0; 21 virtual void PatchFill(int row, Patch *patch)=0; 22 virtual int InstanceEnum() = 0; 23 virtual void GetVectorFromResults(Vector <IssmDouble> *vector,int*doflist,int*connectivitylist,int numdof)=0; 24 virtual void GetElementVectorFromResults(Vector <IssmDouble> *vector,int dof)=0; 26 25 27 26 }; -
issm/trunk-jpl/src/c/classes/ElementResults/PentaP1ElementResult.cpp
r15128 r15737 78 78 } 79 79 /*}}}*/ 80 /*FUNCTION PentaP1ElementResult::SpawnTriaElementResult{{{*/81 ElementResult* PentaP1ElementResult::SpawnTriaElementResult(int* indices){82 83 /*output*/84 TriaP1ElementResult* outresult=NULL;85 IssmDouble newvalues[3];86 87 /*Loop over the new indices*/88 for(int i=0;i<3;i++){89 90 /*Check index value*/91 _assert_(indices[i]>=0 && indices[i]<6);92 93 /*Assign value to new result*/94 newvalues[i]=this->values[indices[i]];95 }96 97 /*Create new Tria result*/98 outresult=new TriaP1ElementResult(this->enum_type,&newvalues[0],this->step,this->time);99 100 /*Assign output*/101 return outresult;102 103 }104 /*}}}*/105 80 /*FUNCTION PentaP1ElementResult::NumberOfNodalValues{{{*/ 106 81 int PentaP1ElementResult::NumberOfNodalValues(void){ -
issm/trunk-jpl/src/c/classes/ElementResults/PentaP1ElementResult.h
r15128 r15737 33 33 /*}}}*/ 34 34 /*ElementResult virtual functions definitions: {{{*/ 35 ElementResult* SpawnTriaElementResult(int* indices);36 35 IssmDouble GetTime(void){return time;}; 37 36 int GetStep(void){return step;}; -
issm/trunk-jpl/src/c/classes/ElementResults/TriaP1ElementResult.cpp
r15377 r15737 77 77 } 78 78 /*}}}*/ 79 /*FUNCTION TriaP1ElementResult::SpawnTriaElementResult{{{*/80 ElementResult* TriaP1ElementResult::SpawnTriaElementResult(int* indices){81 82 /*output*/83 TriaP1ElementResult* outresult=NULL;84 85 /*Create new Tria result (copy of current result)*/86 outresult=new TriaP1ElementResult(this->enum_type,&this->values[0],this->step,this->time);87 88 /*Assign output*/89 return outresult;90 91 }92 /*}}}*/93 79 /*FUNCTION TriaP1ElementResult::NumberOfNodalValues{{{*/ 94 80 int TriaP1ElementResult::NumberOfNodalValues(void){ -
issm/trunk-jpl/src/c/classes/ElementResults/TriaP1ElementResult.h
r15128 r15737 32 32 /*}}}*/ 33 33 /*ElementResult virtual functions definitions: {{{*/ 34 ElementResult* SpawnTriaElementResult(int* indices);35 34 IssmDouble GetTime(void){return time;}; 36 35 int GetStep(void){return step;}; -
issm/trunk-jpl/src/c/classes/Elements/ElementHook.cpp
r15450 r15737 89 89 /*}}}*/ 90 90 /*FUNCTION ElementHook::SpawnTriaHook{{{*/ 91 void ElementHook::SpawnTriaHook(ElementHook* triahook,int * indices){91 void ElementHook::SpawnTriaHook(ElementHook* triahook,int location){ 92 92 93 int i; 94 int zero=0; 93 /*Create arrow of indices depending on location (0=base 1=surface)*/ 94 int indices[3]; 95 switch(location){ 96 case 0: 97 indices[0] = 0; 98 indices[1] = 1; 99 indices[2] = 2; 100 break; 101 case 1: 102 indices[0] = 3; 103 indices[1] = 4; 104 indices[2] = 5; 105 break; 106 default: 107 _error_("case "<<location<<" not supported"); 108 } 95 109 96 110 triahook->numanalyses=this->numanalyses; 111 112 /*Spawn nodes hook*/ 97 113 triahook->hnodes=new Hook*[this->numanalyses]; 98 99 for(i=0;i<this->numanalyses;i++){ 114 for(int i=0;i<this->numanalyses;i++){ 100 115 /*Do not do anything if Hook is empty*/ 101 116 if (!this->hnodes[i] || this->hnodes[i]->GetNum()==0){ … … 103 118 } 104 119 else{ 105 /*Else, spawn Hook*/106 120 triahook->hnodes[i]=this->hnodes[i]->Spawn(indices,3); 107 121 } 108 122 } 109 // do not spawn hmaterial. material will be taken care of by Penta 123 124 /*do not spawn hmaterial. material will be taken care of by Penta*/ 110 125 triahook->hmaterial=NULL; 111 126 triahook->hvertices=(Hook*)this->hvertices->Spawn(indices,3); -
issm/trunk-jpl/src/c/classes/Elements/ElementHook.h
r15372 r15737 25 25 26 26 void SetHookNodes(int* node_ids,int numnodes,int analysis_counter); 27 void SpawnTriaHook(ElementHook* triahook,int * indices);//3d only27 void SpawnTriaHook(ElementHook* triahook,int location); //3d only 28 28 void InitHookNeighbors(int* element_ids); //3d only 29 29 }; -
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r15730 r15737 500 500 this->InputDepthAverageAtBase(VyEnum,VyAverageEnum); 501 501 502 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.502 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 503 503 ElementMatrix* Ke=tria->CreateKMatrixPrognostic(); 504 504 delete tria->material; delete tria; … … 517 517 if (!IsOnBed()) return NULL; 518 518 519 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.519 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 520 520 ElementMatrix* Ke=tria->CreateMassMatrix(); 521 521 delete tria->material; delete tria; … … 675 675 676 676 /*Call Tria function*/ 677 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.677 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 678 678 ElementVector* pe=tria->CreatePVectorPrognostic(); 679 679 delete tria->material; delete tria; … … 693 693 694 694 /*Call Tria function*/ 695 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.695 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 696 696 ElementVector* pe=tria->CreatePVectorSlope(); 697 697 delete tria->material; delete tria; … … 3060 3060 /*}}}*/ 3061 3061 /*FUNCTION Penta::SpawnTria {{{*/ 3062 Tria* Penta::SpawnTria(int g0, int g1, int g2){ 3063 3064 int analysis_counter; 3065 int indices[3]; 3066 int zero=0; 3067 Tria* tria = NULL; 3068 Inputs* tria_inputs = NULL; 3069 Results* tria_results = NULL; 3070 Parameters* tria_parameters = NULL; 3062 Tria* Penta::SpawnTria(int location){ 3063 3064 int analysis_counter; 3071 3065 3072 3066 /*go into parameters and get the analysis_counter: */ 3073 3067 this->parameters->FindParam(&analysis_counter,AnalysisCounterEnum); 3074 3068 3075 indices[0]=g0; 3076 indices[1]=g1; 3077 indices[2]=g2; 3078 3079 tria_parameters=this->parameters; 3080 tria_inputs=(Inputs*)this->inputs->SpawnTriaInputs(indices); 3081 tria_results=(Results*)this->results->SpawnTriaResults(indices); 3082 3083 tria=new Tria(); 3069 /*Create Tria*/ 3070 Tria* tria=new Tria(); 3084 3071 tria->id=this->id; 3085 tria->inputs=tria_inputs; 3086 tria->results=tria_results; 3087 tria->parameters=tria_parameters; 3072 tria->inputs=(Inputs*)this->inputs->SpawnTriaInputs(location); 3073 tria->parameters=this->parameters; 3088 3074 tria->element_type=P1Enum; //Only P1 CG for now (TO BE CHANGED) 3089 this->SpawnTriaHook(dynamic_cast<ElementHook*>(tria), &indices[0]);3075 this->SpawnTriaHook(dynamic_cast<ElementHook*>(tria),location); 3090 3076 3091 3077 /*Spawn material*/ … … 3093 3079 tria->material=(Material*)this->material->copy(); 3094 3080 delete tria->material->inputs; 3095 tria->material->inputs=(Inputs*)this->material->inputs->SpawnTriaInputs( indices);3081 tria->material->inputs=(Inputs*)this->material->inputs->SpawnTriaInputs(location); 3096 3082 3097 3083 /*recover nodes, material and matpar: */ … … 3100 3086 tria->matpar=(Matpar*)tria->hmatpar->delivers(); 3101 3087 3088 /*Return new Tria*/ 3102 3089 return tria; 3103 3090 } … … 3172 3159 /*This element should be collapsed into a tria element at its base. Create this tria element, 3173 3160 * and compute SurfaceArea*/ 3174 tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria (lower face).3161 tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria (lower face). 3175 3162 S=tria->SurfaceArea(); 3176 3163 delete tria->material; delete tria; … … 3179 3166 else{ 3180 3167 3181 tria=(Tria*)SpawnTria( 3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).3168 tria=(Tria*)SpawnTria(1); //nodes 3, 4 and 5 make the new tria (upper face). 3182 3169 S=tria->SurfaceArea(); 3183 3170 delete tria->material; delete tria; … … 3668 3655 3669 3656 /*Spawn Tria element from the base of the Penta: */ 3670 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.3657 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 3671 3658 mass_flux=tria->MassFlux(segment); 3672 3659 delete tria->material; delete tria; … … 4051 4038 if (!IsOnBed()) return NULL; 4052 4039 4053 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.4040 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 4054 4041 ElementMatrix* Ke=tria->CreateKMatrixMelting(); 4055 4042 … … 5092 5079 5093 5080 /*Call Tria function*/ 5094 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.5081 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 5095 5082 ElementMatrix* Ke=tria->CreateKMatrixAdjointSSA(); 5096 5083 delete tria->material; delete tria; … … 5275 5262 5276 5263 /*Call Tria function*/ 5277 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.5264 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 5278 5265 ElementVector* pe=tria->CreatePVectorAdjointHoriz(); 5279 5266 delete tria->material; delete tria; … … 5762 5749 case DragCoefficientAbsGradientEnum: 5763 5750 if(IsOnBed()){ 5764 tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.5751 tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 5765 5752 tria->GradjDragGradient(gradient,resp,control_index); 5766 5753 delete tria->material; delete tria; … … 5769 5756 case RheologyBbarAbsGradientEnum: 5770 5757 if(IsOnBed()){ 5771 tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.5758 tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 5772 5759 tria->GradjBGradient(gradient,resp,control_index); 5773 5760 delete tria->material; delete tria; … … 5787 5774 5788 5775 /*Spawn tria*/ 5789 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.5776 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 5790 5777 tria->GradjDragSSA(gradient,control_index); 5791 5778 delete tria->material; delete tria; … … 5965 5952 5966 5953 /*Collapse element to the base*/ 5967 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria (lower face).5954 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria (lower face). 5968 5955 tria->GradjBSSA(gradient,control_index); 5969 5956 delete tria->material; delete tria; … … 5983 5970 5984 5971 /*Collapse element to the base*/ 5985 Tria* tria=(Tria*)SpawnTria(0 ,1,2);5972 Tria* tria=(Tria*)SpawnTria(0); 5986 5973 tria->GradjBSSA(gradient,control_index); //We use SSA as an estimate for now 5987 5974 delete tria->material; delete tria; … … 6000 5987 6001 5988 /*Collapse element to the base*/ 6002 Tria* tria=(Tria*)SpawnTria(0 ,1,2);5989 Tria* tria=(Tria*)SpawnTria(0); 6003 5990 tria->GradjBSSA(gradient,control_index); //We use SSA as an estimate for now 6004 5991 delete tria->material; delete tria; … … 6175 6162 /*This element should be collapsed into a tria element at its base. Create this tria element, 6176 6163 * and compute SurfaceAverageVelMisfit*/ 6177 tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria (lower face).6164 tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria (lower face). 6178 6165 J=tria->SurfaceAverageVelMisfit(weight_index); 6179 6166 delete tria->material; delete tria; … … 6182 6169 else{ 6183 6170 6184 tria=(Tria*)SpawnTria( 3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).6171 tria=(Tria*)SpawnTria(1); //nodes 3, 4 and 5 make the new tria (upper face). 6185 6172 J=tria->SurfaceAverageVelMisfit(weight_index); 6186 6173 delete tria->material; delete tria; … … 6212 6199 /*This element should be collapsed into a tria element at its base. Create this tria element, 6213 6200 * and compute SurfaceAbsVelMisfit*/ 6214 tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria (lower face).6201 tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria (lower face). 6215 6202 J=tria->SurfaceAbsVelMisfit(weight_index); 6216 6203 delete tria->material; delete tria; … … 6219 6206 else{ 6220 6207 6221 tria=(Tria*)SpawnTria( 3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).6208 tria=(Tria*)SpawnTria(1); //nodes 3, 4 and 5 make the new tria (upper face). 6222 6209 J=tria->SurfaceAbsVelMisfit(weight_index); 6223 6210 delete tria->material; delete tria; … … 6249 6236 /*This element should be collapsed into a tria element at its base. Create this tria element, 6250 6237 * and compute SurfaceLogVelMisfit*/ 6251 tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria (lower face).6238 tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria (lower face). 6252 6239 J=tria->SurfaceLogVelMisfit(weight_index); 6253 6240 delete tria->material; delete tria; … … 6256 6243 else{ 6257 6244 6258 tria=(Tria*)SpawnTria( 3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).6245 tria=(Tria*)SpawnTria(1); //nodes 3, 4 and 5 make the new tria (upper face). 6259 6246 J=tria->SurfaceLogVelMisfit(weight_index); 6260 6247 delete tria->material; delete tria; … … 6288 6275 /*This element should be collapsed into a tria element at its base. Create this tria element, 6289 6276 * and compute SurfaceLogVxVyMisfit*/ 6290 tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria (lower face).6277 tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria (lower face). 6291 6278 J=tria->SurfaceLogVxVyMisfit(weight_index); 6292 6279 delete tria->material; delete tria; … … 6295 6282 else{ 6296 6283 6297 tria=(Tria*)SpawnTria( 3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).6284 tria=(Tria*)SpawnTria(1); //nodes 3, 4 and 5 make the new tria (upper face). 6298 6285 J=tria->SurfaceLogVxVyMisfit(weight_index); 6299 6286 delete tria->material; delete tria; … … 6325 6312 /*This element should be collapsed into a tria element at its base. Create this tria element, 6326 6313 * and compute SurfaceRelVelMisfit*/ 6327 tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria (lower face).6314 tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria (lower face). 6328 6315 J=tria->SurfaceRelVelMisfit(weight_index); 6329 6316 delete tria->material; delete tria; … … 6332 6319 else{ 6333 6320 6334 tria=(Tria*)SpawnTria( 3,4,5); //nodes 3, 4 and 5 make the new tria (upper face).6321 tria=(Tria*)SpawnTria(1); //nodes 3, 4 and 5 make the new tria (upper face). 6335 6322 J=tria->SurfaceRelVelMisfit(weight_index); 6336 6323 delete tria->material; delete tria; … … 6359 6346 _error_("Not implemented yet"); 6360 6347 6361 tria=(Tria*)SpawnTria(0 ,1,2);6348 tria=(Tria*)SpawnTria(0); 6362 6349 J=tria->ThicknessAbsMisfit(weight_index); 6363 6350 delete tria->material; delete tria; … … 6374 6361 if(IsOnWater()|| IsFloating() || !IsOnBed()) return 0; 6375 6362 6376 tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria6363 tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria 6377 6364 J=tria->DragCoefficientAbsGradient(weight_index); 6378 6365 delete tria->material; delete tria; … … 6389 6376 if(IsOnWater() || !IsOnBed()) return 0; 6390 6377 6391 tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria6378 tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria 6392 6379 J=tria->RheologyBbarAbsGradient(weight_index); 6393 6380 delete tria->material; delete tria; … … 6693 6680 /*Find penta on bed as HO must be coupled to the dofs on the bed: */ 6694 6681 Penta* pentabase=GetBasalElement(); 6695 Tria* tria=pentabase->SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.6682 Tria* tria=pentabase->SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 6696 6683 6697 6684 /*Prepare node list*/ … … 6890 6877 /*Find penta on bed as FS must be coupled to the dofs on the bed: */ 6891 6878 Penta* pentabase=GetBasalElement(); 6892 Tria* tria=pentabase->SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.6879 Tria* tria=pentabase->SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 6893 6880 6894 6881 /*Prepare node list*/ … … 7247 7234 7248 7235 /*Call Tria function*/ 7249 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.7236 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 7250 7237 ElementMatrix* Ke=tria->CreateKMatrixDiagnosticSSA(); 7251 7238 delete tria->material; delete tria; … … 7298 7285 /*Find penta on bed as this is a SSA elements: */ 7299 7286 pentabase=GetBasalElement(); 7300 tria=pentabase->SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.7287 tria=pentabase->SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 7301 7288 7302 7289 /*Initialize Element matrix*/ … … 7370 7357 * the tria functionality to build a friction stiffness matrix on these 3 7371 7358 * nodes: */ 7372 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.7359 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 7373 7360 ElementMatrix* Ke=tria->CreateKMatrixDiagnosticSSAFriction(); 7374 7361 delete tria->material; delete tria; … … 7446 7433 /*Find penta on bed as this is a SSA elements: */ 7447 7434 pentabase=GetBasalElement(); 7448 tria=pentabase->SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.7435 tria=pentabase->SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 7449 7436 7450 7437 /*Initialize Element matrix*/ … … 7501 7488 * the tria functionality to build a friction stiffness matrix on these 3 7502 7489 * nodes: */ 7503 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.7490 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 7504 7491 ElementMatrix* Ke=tria->CreateKMatrixDiagnosticSSAFriction(); 7505 7492 delete tria->material; delete tria; … … 8528 8515 8529 8516 /*Call Tria function*/ 8530 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.8517 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 8531 8518 ElementVector* pe=tria->CreatePVectorDiagnosticSSA(); 8532 8519 delete tria->material; delete tria; … … 8542 8529 8543 8530 /*Call Tria function*/ 8544 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.8531 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 8545 8532 ElementVector* pe=tria->CreatePVectorDiagnosticSSA(); 8546 8533 delete tria->material; delete tria; … … 9227 9214 9228 9215 /*Call Tria function*/ 9229 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.9216 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 9230 9217 ElementMatrix* Ke=tria->CreateJacobianDiagnosticSSA(); 9231 9218 delete tria->material; delete tria; … … 10459 10446 10460 10447 /*Spawn Tria element from the base of the Penta: */ 10461 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.10448 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 10462 10449 ElementMatrix* Ke=tria->CreateKMatrixBalancethickness(); 10463 10450 delete tria->material; delete tria; … … 10481 10468 10482 10469 /*Call Tria function*/ 10483 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.10470 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 10484 10471 ElementVector* pe=tria->CreatePVectorBalancethickness(); 10485 10472 delete tria->material; delete tria; … … 10501 10488 if (!IsOnBed()) return NULL; 10502 10489 10503 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.10490 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 10504 10491 ElementMatrix* Ke=tria->CreateKMatrixHydrologyDCInefficient(); 10505 10492 delete tria->material; delete tria; … … 10514 10501 if (!IsOnBed()) return NULL; 10515 10502 10516 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.10503 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 10517 10504 ElementMatrix* Ke=tria->CreateKMatrixHydrologyDCEfficient(); 10518 10505 delete tria->material; delete tria; … … 10528 10515 10529 10516 /*Call Tria function*/ 10530 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.10517 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 10531 10518 ElementVector* pe=tria->CreatePVectorHydrologyDCInefficient(); 10532 10519 delete tria->material; delete tria; … … 10542 10529 10543 10530 /*Call Tria function*/ 10544 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.10531 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 10545 10532 ElementVector* pe=tria->CreatePVectorHydrologyDCEfficient(); 10546 10533 delete tria->material; delete tria; … … 10555 10542 if (!IsOnBed()) return; 10556 10543 10557 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.10544 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 10558 10545 tria->GetHydrologyDCInefficientHmax(ph_max,innode); 10559 10546 delete tria->material; delete tria; … … 10565 10552 if (!IsOnBed()) return; 10566 10553 10567 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.10554 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 10568 10555 tria->GetHydrologyTransfer(transfer); 10569 10556 delete tria->material; delete tria; … … 10606 10593 if (!IsOnBed())return; 10607 10594 10608 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.10595 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 10609 10596 tria->HydrologyEPLGetActive(active_vec); 10610 10597 delete tria->material; delete tria; … … 10617 10604 if (!IsOnBed())return; 10618 10605 10619 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.10606 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 10620 10607 tria->HydrologyEPLGetMask(vec_mask); 10621 10608 delete tria->material; delete tria; … … 10659 10646 kappa=kmax*pow(10.,penalty_factor); 10660 10647 10661 Tria* tria=(Tria*)SpawnTria(0 ,1,2); //nodes 0, 1 and 2 make the new tria.10648 Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria. 10662 10649 for(int i=0;i<NUMVERTICES2D;i++){ 10663 10650 tria->GetHydrologyDCInefficientHmax(&h_max,nodes[i]); -
issm/trunk-jpl/src/c/classes/Elements/Penta.h
r15695 r15737 224 224 void ReduceVectorFS(IssmDouble* Pe_reduced, IssmDouble* Ke_temp, IssmDouble* Pe_temp); 225 225 void SetClone(int* minranks); 226 Tria* SpawnTria(int g0, int g1, int g2);226 Tria* SpawnTria(int location); 227 227 void SurfaceNormal(IssmDouble* surface_normal, IssmDouble xyz_list[3][3]); 228 228 void UpdateConstraints(void); -
issm/trunk-jpl/src/c/classes/ExternalResults/Results.cpp
r15012 r15737 34 34 35 35 /*Object management*/ 36 /*FUNCTION Results::SpawnTriaResults{{{*/37 Results* Results::SpawnTriaResults(int* indices){38 39 /*Intermediary*/40 vector<Object*>::iterator object;41 ElementResult* resultin=NULL;42 ElementResult* resultout=NULL;43 44 /*Output*/45 Results* newresults=new Results();46 47 /*Go through results and call Spawn function*/48 for ( object=objects.begin() ; object < objects.end(); object++ ){49 50 /*Create new result*/51 resultin=(ElementResult*)(*object);52 resultout=resultin->SpawnTriaElementResult(indices);53 54 /*Add result to new results*/55 newresults->AddObject((Object*)resultout);56 }57 58 /*Assign output pointer*/59 return newresults;60 }61 /*}}}*/62 36 /*FUNCTION Results::Write{{{*/ 63 37 void Results::Write(Parameters* parameters){ -
issm/trunk-jpl/src/c/classes/ExternalResults/Results.h
r15067 r15737 1 1 #ifndef _CONTAINER_RESULTS_H_ 2 #define 2 #define _CONTAINER_RESULTS_H_ 3 3 4 4 #include "../../datastructures/datastructures.h" … … 20 20 21 21 /*numerics*/ 22 Results* SpawnTriaResults(int* indices); 23 void Write(Parameters* parameters); 22 void Write(Parameters* parameters); 24 23 }; 25 24 #endif //ifndef _RESULTS_H_ -
issm/trunk-jpl/src/c/classes/Inputs/BoolInput.cpp
r15130 r15737 72 72 /*}}}*/ 73 73 /*FUNCTION BoolInput::SpawnTriaInput{{{*/ 74 Input* BoolInput::SpawnTriaInput(int * indices){74 Input* BoolInput::SpawnTriaInput(int location){ 75 75 76 76 /*output*/ -
issm/trunk-jpl/src/c/classes/Inputs/BoolInput.h
r15564 r15737 34 34 /*BoolInput management: {{{*/ 35 35 int InstanceEnum(); 36 Input* SpawnTriaInput(int * indices);36 Input* SpawnTriaInput(int location); 37 37 Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");}; 38 38 Input* PointwiseMin(Input* inputB){_error_("not implemented yet");}; -
issm/trunk-jpl/src/c/classes/Inputs/ControlInput.cpp
r15417 r15737 183 183 }/*}}}*/ 184 184 /*FUNCTION ControlInput::SpawnTriaInput{{{*/ 185 Input* ControlInput::SpawnTriaInput(int * indices){186 return values->SpawnTriaInput( indices);185 Input* ControlInput::SpawnTriaInput(int location){ 186 return values->SpawnTriaInput(location); 187 187 }/*}}}*/ 188 188 /*FUNCTION ControlInput::SpawnGradient{{{*/ -
issm/trunk-jpl/src/c/classes/Inputs/ControlInput.h
r15564 r15737 38 38 /*ControlInput management: {{{*/ 39 39 int InstanceEnum(); 40 Input* SpawnTriaInput(int * indices);40 Input* SpawnTriaInput(int location); 41 41 Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");}; 42 42 Input* PointwiseMin(Input* inputB){_error_("not implemented yet");}; -
issm/trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp
r15654 r15737 70 70 /*}}}*/ 71 71 /*FUNCTION DatasetInput::SpawnTriaInput{{{*/ 72 Input* DatasetInput::SpawnTriaInput(int * indices){72 Input* DatasetInput::SpawnTriaInput(int location){ 73 73 74 74 /*output*/ … … 78 78 outinput=new DatasetInput(); 79 79 outinput->enum_type=this->enum_type; 80 outinput->inputs=dynamic_cast<Inputs*>(this->inputs->SpawnTriaInputs( indices));80 outinput->inputs=dynamic_cast<Inputs*>(this->inputs->SpawnTriaInputs(location)); 81 81 82 82 /*Assign output*/ -
issm/trunk-jpl/src/c/classes/Inputs/DatasetInput.h
r15654 r15737 33 33 /*DatasetInput management: {{{*/ 34 34 int InstanceEnum(); 35 Input* SpawnTriaInput(int * indices);35 Input* SpawnTriaInput(int location); 36 36 Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");}; 37 37 Input* PointwiseMin(Input* inputB){_error_("not implemented yet");}; -
issm/trunk-jpl/src/c/classes/Inputs/DoubleInput.cpp
r15564 r15737 72 72 /*}}}*/ 73 73 /*FUNCTION DoubleInput::SpawnTriaInput{{{*/ 74 Input* DoubleInput::SpawnTriaInput(int * indices){74 Input* DoubleInput::SpawnTriaInput(int location){ 75 75 76 76 /*output*/ -
issm/trunk-jpl/src/c/classes/Inputs/DoubleInput.h
r15564 r15737 33 33 /*DoubleInput management: {{{*/ 34 34 int InstanceEnum(); 35 Input* SpawnTriaInput(int * indices);35 Input* SpawnTriaInput(int location); 36 36 Input* PointwiseDivide(Input* inputB); 37 37 Input* PointwiseMin(Input* inputB); -
issm/trunk-jpl/src/c/classes/Inputs/Input.h
r15564 r15737 64 64 virtual void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist)=0; 65 65 66 virtual Input* SpawnTriaInput(int * indices)=0;66 virtual Input* SpawnTriaInput(int location)=0; 67 67 virtual Input* PointwiseDivide(Input* inputB)=0; 68 68 virtual Input* PointwiseMax(Input* inputmax)=0; -
issm/trunk-jpl/src/c/classes/Inputs/Inputs.cpp
r15082 r15737 370 370 /*}}}*/ 371 371 /*FUNCTION Inputs::SpawnTriaInputs{{{*/ 372 Inputs* Inputs::SpawnTriaInputs(int * indices){372 Inputs* Inputs::SpawnTriaInputs(int location){ 373 373 374 374 /*Intermediary*/ … … 385 385 /*Create new input*/ 386 386 inputin=dynamic_cast<Input*>(*object); 387 inputout=inputin->SpawnTriaInput( indices);387 inputout=inputin->SpawnTriaInput(location); 388 388 389 389 /*Add input to new inputs*/ -
issm/trunk-jpl/src/c/classes/Inputs/Inputs.h
r15082 r15737 28 28 void DuplicateInput(int original_enum,int new_enum); 29 29 Input* GetInput(int enum_name); 30 Inputs* SpawnTriaInputs(int * indices);30 Inputs* SpawnTriaInputs(int position); 31 31 void AXPY(int MeshYEnum, IssmDouble scalar, int MeshXEnum); 32 32 IssmDouble InfinityNorm(int enumtype); -
issm/trunk-jpl/src/c/classes/Inputs/IntInput.cpp
r15130 r15737 72 72 /*}}}*/ 73 73 /*FUNCTION IntInput::SpawnTriaInput{{{*/ 74 Input* IntInput::SpawnTriaInput(int * indices){74 Input* IntInput::SpawnTriaInput(int location){ 75 75 76 76 /*output*/ -
issm/trunk-jpl/src/c/classes/Inputs/IntInput.h
r15564 r15737 34 34 /*IntInput management: {{{*/ 35 35 int InstanceEnum(); 36 Input* SpawnTriaInput(int * indices);36 Input* SpawnTriaInput(int location); 37 37 Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");}; 38 38 Input* PointwiseMin(Input* inputB){_error_("not implemented yet");}; -
issm/trunk-jpl/src/c/classes/Inputs/PentaInput.cpp
r15654 r15737 84 84 /*}}}*/ 85 85 /*FUNCTION PentaInput::SpawnTriaInput{{{*/ 86 Input* PentaInput::SpawnTriaInput(int * indices){86 Input* PentaInput::SpawnTriaInput(int location){ 87 87 88 88 /*output*/ … … 90 90 IssmDouble newvalues[3]; //Assume P1 interpolation only for now 91 91 92 /*Create arrow of indices depending on location (0=base 1=surface)*/ 93 int indices[3]; 94 switch(location){ 95 case 0: 96 indices[0] = 0; 97 indices[1] = 1; 98 indices[2] = 2; 99 break; 100 case 1: 101 indices[0] = 3; 102 indices[1] = 4; 103 indices[2] = 5; 104 break; 105 default: 106 _error_("case "<<location<<" not supported"); 107 } 108 92 109 /*Loop over the new indices*/ 93 110 for(int i=0;i<3;i++){ … … 105 122 /*Assign output*/ 106 123 return outinput; 107 108 124 } 109 125 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Inputs/PentaInput.h
r15564 r15737 34 34 /*PentaInput management*/ 35 35 int InstanceEnum(); 36 Input* SpawnTriaInput(int * indices);36 Input* SpawnTriaInput(int location); 37 37 Input* PointwiseDivide(Input* inputB); 38 38 Input* PointwiseMin(Input* inputB); -
issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp
r15216 r15737 108 108 /*}}}*/ 109 109 /*FUNCTION TransientInput::SpawnTriaInput{{{*/ 110 Input* TransientInput::SpawnTriaInput(int * indices){110 Input* TransientInput::SpawnTriaInput(int location){ 111 111 112 112 /*output*/ … … 119 119 outinput->timesteps=xNew<IssmDouble>(this->numtimesteps); 120 120 xMemCpy(outinput->timesteps,this->timesteps,this->numtimesteps); 121 outinput->inputs=(Inputs*)this->inputs->SpawnTriaInputs( indices);121 outinput->inputs=(Inputs*)this->inputs->SpawnTriaInputs(location); 122 122 outinput->parameters=this->parameters; 123 123 -
issm/trunk-jpl/src/c/classes/Inputs/TransientInput.h
r15564 r15737 38 38 /*TransientInput management: {{{*/ 39 39 int InstanceEnum(); 40 Input* SpawnTriaInput(int * indices);40 Input* SpawnTriaInput(int location); 41 41 Input* PointwiseDivide(Input* forcingB){_error_("not implemented yet");}; 42 42 Input* PointwiseMin(Input* forcingB){_error_("not implemented yet");}; -
issm/trunk-jpl/src/c/classes/Inputs/TriaInput.cpp
r15567 r15737 84 84 /*}}}*/ 85 85 /*FUNCTION TriaInput::SpawnTriaInput{{{*/ 86 Input* TriaInput::SpawnTriaInput(int * indices){86 Input* TriaInput::SpawnTriaInput(int location){ 87 87 88 88 /*output*/ -
issm/trunk-jpl/src/c/classes/Inputs/TriaInput.h
r15564 r15737 34 34 /*TriaInput management:*/ 35 35 int InstanceEnum(); 36 Input* SpawnTriaInput(int * indices);36 Input* SpawnTriaInput(int location); 37 37 Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");}; 38 38 Input* PointwiseMin(Input* inputB);
Note:
See TracChangeset
for help on using the changeset viewer.