Changeset 17513
- Timestamp:
- 03/21/14 09:07:07 (11 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp ¶
r17274 r17513 36 36 void L2ProjectionBaseAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/ 37 37 38 if(iomodel->meshtype==Mesh3DEnum ){38 if(iomodel->meshtype==Mesh3DEnum || iomodel->meshtype==Mesh3DtetrasEnum){ 39 39 iomodel->FetchData(2,MeshVertexonbedEnum,MeshVertexonsurfaceEnum); 40 40 } … … 82 82 break; 83 83 case Mesh3DEnum: 84 if(!element->IsOnBed()) return NULL; 85 basalelement = element->SpawnBasalElement(); 86 break; 87 case Mesh3DtetrasEnum: 84 88 if(!element->IsOnBed()) return NULL; 85 89 basalelement = element->SpawnBasalElement(); … … 141 145 break; 142 146 case Mesh3DEnum: 147 if(!element->IsOnBed()) return NULL; 148 basalelement = element->SpawnBasalElement(); 149 break; 150 case Mesh3DtetrasEnum: 143 151 if(!element->IsOnBed()) return NULL; 144 152 basalelement = element->SpawnBasalElement(); … … 213 221 break; 214 222 case Mesh2DverticalEnum: 223 case Mesh3DtetrasEnum: 215 224 element->InputUpdateFromSolutionOneDof(solution,inputenum); 216 225 break; -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/ElementHook.cpp ¶
r16382 r17513 128 128 } 129 129 /*}}}*/ 130 /*FUNCTION ElementHook::SpawnTriaHook{{{*/ 131 void ElementHook::SpawnTriaHook(ElementHook* triahook,int index1,int index2,int index3){ 132 133 /*Create arrow of indices depending on location (0=base 1=surface)*/ 134 int indices[3]; 135 indices[0] = index1; 136 indices[1] = index2; 137 indices[2] = index3; 138 139 triahook->numanalyses=this->numanalyses; 140 141 /*Spawn nodes hook*/ 142 triahook->hnodes=new Hook*[this->numanalyses]; 143 for(int i=0;i<this->numanalyses;i++){ 144 /*Do not do anything if Hook is empty*/ 145 if (!this->hnodes[i] || this->hnodes[i]->GetNum()==0){ 146 triahook->hnodes[i]=NULL; 147 } 148 else{ 149 triahook->hnodes[i]=this->hnodes[i]->Spawn(indices,3); 150 } 151 } 152 153 /*do not spawn hmaterial. material will be taken care of by Penta*/ 154 triahook->hmaterial=NULL; 155 triahook->hvertices=(Hook*)this->hvertices->Spawn(indices,3); 156 triahook->hmatpar=(Hook*)this->hmatpar->copy(); 157 } 158 /*}}}*/ 130 159 /*FUNCTION ElementHook::SpawnSegHook{{{*/ 131 160 void ElementHook::SpawnSegHook(ElementHook* triahook,int index1,int index2){ -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/ElementHook.h ¶
r16382 r17513 25 25 26 26 void SetHookNodes(int* node_ids,int numnodes,int analysis_counter); 27 void SpawnTriaHook(ElementHook* triahook,int location); //3d only 27 void SpawnTriaHook(ElementHook* triahook,int location); //3d only TO BE REMOVED (replaced by the one below) 28 void SpawnTriaHook(ElementHook* triahook,int index1,int index2,int index3); //3d only 28 29 void SpawnSegHook(ElementHook* triahook,int ndex1,int index2); //2d only 29 30 void InitHookNeighbors(int* element_ids); //3d only -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp ¶
r17511 r17513 763 763 } 764 764 /*}}}*/ 765 /*FUNCTION Tetra::SpawnBasalElement{{{*/ 766 Element* Tetra::SpawnBasalElement(void){ 767 768 _assert_(HasFaceOnBed()); 769 770 int index1,index2,index3; 771 this->FaceOnBedIndices(&index1,&index2,&index3); 772 return SpawnTria(index1,index2,index3); 773 }/*}}}*/ 774 /*FUNCTION Tetra::SpawnTopElement{{{*/ 775 Element* Tetra::SpawnTopElement(void){ 776 777 _assert_(HasFaceOnSurface()); 778 779 int index1,index2,index3; 780 this->FaceOnSurfaceIndices(&index1,&index2,&index3); 781 return SpawnTria(index1,index2,index3); 782 }/*}}}*/ 783 /*FUNCTION Tetra::SpawnTria{{{*/ 784 Tria* Tetra::SpawnTria(int index1,int index2,int index3){ 785 786 int analysis_counter; 787 788 /*go into parameters and get the analysis_counter: */ 789 this->parameters->FindParam(&analysis_counter,AnalysisCounterEnum); 790 791 /*Create Tria*/ 792 Tria* tria=new Tria(); 793 tria->id=this->id; 794 tria->inputs=(Inputs*)this->inputs->SpawnTriaInputs(index1,index2,index3); 795 tria->parameters=this->parameters; 796 tria->element_type=P1Enum; //Only P1 CG for now (TO BE CHANGED) 797 this->SpawnTriaHook(dynamic_cast<ElementHook*>(tria),index1,index2,index3); 798 799 /*Spawn material*/ 800 tria->material=(Material*)this->material->copy2(tria); 801 802 /*recover nodes, material and matpar: */ 803 tria->nodes = (Node**)tria->hnodes[analysis_counter]->deliverp(); 804 tria->vertices = (Vertex**)tria->hvertices->deliverp(); 805 tria->matpar = (Matpar*)tria->hmatpar->delivers(); 806 807 /*Return new Tria*/ 808 return tria; 809 } 810 /*}}}*/ 765 811 /*FUNCTION Tetra::Update {{{*/ 766 812 void Tetra::Update(int index,IoModel* iomodel,int analysis_counter,int analysis_type,int finiteelement_type){ -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tetra.h ¶
r17511 r17513 112 112 int NumberofNodesVelocity(void); 113 113 int NumberofNodesPressure(void); 114 Element* SpawnBasalElement(void){_error_("not implemented yet");}; 115 Element* SpawnTopElement(void){_error_("not implemented yet");}; 114 Element* SpawnBasalElement(void); 115 Element* SpawnTopElement(void); 116 Tria* SpawnTria(int index1,int index2,int index3); 116 117 IssmDouble StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){_error_("not implemented yet");}; 117 118 IssmDouble PureIceEnthalpy(IssmDouble pressure){_error_("not implemented yet");}; -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/BoolInput.cpp ¶
r16799 r17513 71 71 /*FUNCTION BoolInput::SpawnTriaInput{{{*/ 72 72 Input* BoolInput::SpawnTriaInput(int location){ 73 74 /*output*/ 75 BoolInput* outinput=new BoolInput(); 76 77 /*only copy current value*/ 78 outinput->enum_type=this->enum_type; 79 outinput->value=this->value; 80 81 /*Assign output*/ 82 return outinput; 83 84 } 85 /*}}}*/ 86 /*FUNCTION BoolInput::SpawnTriaInput{{{*/ 87 Input* BoolInput::SpawnTriaInput(int index1,int index2,int index3){ 73 88 74 89 /*output*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/BoolInput.h ¶
r17100 r17513 31 31 int InstanceEnum(); 32 32 Input* SpawnTriaInput(int location); 33 Input* SpawnTriaInput(int index1,int index2,int index3); 33 34 Input* SpawnSegInput(int index1,int index2); 34 35 Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");}; -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/ControlInput.cpp ¶
r17100 r17513 196 196 return values->SpawnTriaInput(location); 197 197 }/*}}}*/ 198 /*FUNCTION ControlInput::SpawnTriaInput{{{*/ 199 Input* ControlInput::SpawnTriaInput(int index1,int index2,int index3){ 200 return values->SpawnTriaInput(index1,index2,index3); 201 }/*}}}*/ 198 202 /*FUNCTION ControlInput::SpawnSegInput{{{*/ 199 203 Input* ControlInput::SpawnSegInput(int index1,int index2){ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/ControlInput.h ¶
r17100 r17513 39 39 int InstanceEnum(); 40 40 Input* SpawnTriaInput(int location); 41 Input* SpawnTriaInput(int index1,int index2,int index3); 41 42 Input* SpawnSegInput(int index1,int index2); 42 43 Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");}; -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp ¶
r16675 r17513 96 96 } 97 97 /*}}}*/ 98 /*FUNCTION DatasetInput::SpawnTriaInput{{{*/ 99 Input* DatasetInput::SpawnTriaInput(int index1,int index2,int index3){ 100 101 /*output*/ 102 DatasetInput* outinput=NULL; 103 104 /*Create new Datasetinput (copy of current input)*/ 105 outinput=new DatasetInput(); 106 outinput->enum_type=this->enum_type; 107 outinput->inputs=dynamic_cast<Inputs*>(this->inputs->SpawnTriaInputs(index1,index2,index3)); 108 outinput->numids=this->numids; 109 outinput->ids=xNew<int>(this->numids); 110 xMemCpy(outinput->ids,this->ids,this->numids); 111 112 /*Assign output*/ 113 return outinput; 114 } 115 /*}}}*/ 98 116 /*FUNCTION DatasetInput::SpawnSegInput{{{*/ 99 117 Input* DatasetInput::SpawnSegInput(int index1,int index2){ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/DatasetInput.h ¶
r17100 r17513 37 37 int InstanceEnum(); 38 38 Input* SpawnTriaInput(int location); 39 Input* SpawnTriaInput(int index1,int index2,int index3); 39 40 Input* SpawnSegInput(int index1,int index2); 40 41 Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");}; -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/DoubleInput.cpp ¶
r17094 r17513 84 84 } 85 85 /*}}}*/ 86 /*FUNCTION DoubleInput::SpawnTriaInput{{{*/ 87 Input* DoubleInput::SpawnTriaInput(int index1,int index2,int index3){ 88 89 /*output*/ 90 DoubleInput* outinput=new DoubleInput(); 91 92 /*only copy current value*/ 93 outinput->enum_type=this->enum_type; 94 outinput->value=this->value; 95 96 /*Assign output*/ 97 return outinput; 98 99 } 100 /*}}}*/ 86 101 /*FUNCTION DoubleInput::SpawnSegInput{{{*/ 87 102 Input* DoubleInput::SpawnSegInput(int index1,int index2){ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/DoubleInput.h ¶
r17100 r17513 34 34 int InstanceEnum(); 35 35 Input* SpawnTriaInput(int location); 36 Input* SpawnTriaInput(int index1,int index2,int index3); 36 37 Input* SpawnSegInput(int index1,int index2); 37 38 Input* PointwiseDivide(Input* inputB); -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/Input.h ¶
r17100 r17513 55 55 56 56 virtual Input* SpawnTriaInput(int location)=0; 57 virtual Input* SpawnTriaInput(int index1,int index2,int index3)=0; 57 58 virtual Input* SpawnSegInput(int index1,int index2)=0; 58 59 virtual Input* PointwiseDivide(Input* inputB)=0; -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/Inputs.cpp ¶
r16382 r17513 395 395 } 396 396 /*}}}*/ 397 /*FUNCTION Inputs::SpawnTriaInputs{{{*/ 398 Inputs* Inputs::SpawnTriaInputs(int index1,int index2,int index3){ 399 400 /*Intermediary*/ 401 vector<Object*>::iterator object; 402 Input* inputin=NULL; 403 Input* inputout=NULL; 404 405 /*Output*/ 406 Inputs* newinputs=new Inputs(); 407 408 /*Go through inputs and call Spawn function*/ 409 for ( object=objects.begin() ; object < objects.end(); object++ ){ 410 411 /*Create new input*/ 412 inputin=dynamic_cast<Input*>(*object); 413 inputout=inputin->SpawnTriaInput(index1,index2,index3); 414 415 /*Add input to new inputs*/ 416 newinputs->AddObject(inputout); 417 } 418 419 /*Assign output pointer*/ 420 return newinputs; 421 } 422 /*}}}*/ 397 423 /*FUNCTION Inputs::SpawnSegInputs{{{*/ 398 424 Inputs* Inputs::SpawnSegInputs(int index1,int index2){ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/Inputs.h ¶
r16382 r17513 28 28 void DuplicateInput(int original_enum,int new_enum); 29 29 Input* GetInput(int enum_name); 30 Inputs* SpawnTriaInputs(int position); 30 Inputs* SpawnTriaInputs(int position);//TO BE REMOVED (replaced by the other one) 31 Inputs* SpawnTriaInputs(int index1,int index2,int index3); 31 32 Inputs* SpawnSegInputs(int index1,int index2); 32 33 Inputs* SpawnSegInputs(int position); -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/IntInput.cpp ¶
r16799 r17513 71 71 /*FUNCTION IntInput::SpawnTriaInput{{{*/ 72 72 Input* IntInput::SpawnTriaInput(int location){ 73 74 /*output*/ 75 IntInput* outinput=new IntInput(); 76 77 /*only copy current value*/ 78 outinput->enum_type=this->enum_type; 79 outinput->value=this->value; 80 81 /*Assign output*/ 82 return outinput; 83 } 84 /*}}}*/ 85 /*FUNCTION IntInput::SpawnTriaInput{{{*/ 86 Input* IntInput::SpawnTriaInput(int index1,int index2,int index3){ 73 87 74 88 /*output*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/IntInput.h ¶
r17100 r17513 35 35 int InstanceEnum(); 36 36 Input* SpawnTriaInput(int location); 37 Input* SpawnTriaInput(int index1,int index2,int index3); 37 38 Input* SpawnSegInput(int index1,int index2); 38 39 Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");}; -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/PentaInput.cpp ¶
r17345 r17513 123 123 } 124 124 /*}}}*/ 125 /*FUNCTION PentaInput::SpawnTriaInput{{{*/ 126 Input* PentaInput::SpawnTriaInput(int index1,int index2,int index3){ 127 128 /*output*/ 129 TriaInput* outinput=NULL; 130 131 if(this->element_type==P0Enum){ 132 outinput=new TriaInput(this->enum_type,&this->values[0],P0Enum); 133 } 134 else{ 135 /*Assume P1 interpolation only for now*/ 136 IssmDouble newvalues[3]; 137 138 /*Create array of indices depending on location (0=base 1=surface)*/ 139 int indices[3]; 140 indices[0] = index1; 141 indices[1] = index2; 142 indices[2] = index3; 143 144 /*Create new input*/ 145 for(int i=0;i<3;i++){ 146 _assert_(indices[i]>=0 && indices[i]<6); 147 newvalues[i]=this->values[indices[i]]; 148 } 149 outinput=new TriaInput(this->enum_type,&newvalues[0],P1Enum); 150 } 151 152 /*Assign output*/ 153 return outinput; 154 } 155 /*}}}*/ 125 156 /*FUNCTION PentaInput::SpawnSegInput{{{*/ 126 157 Input* PentaInput::SpawnSegInput(int index1,int index2){ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/PentaInput.h ¶
r17345 r17513 35 35 int InstanceEnum(); 36 36 Input* SpawnTriaInput(int location); 37 Input* SpawnTriaInput(int index1,int index2,int index3); 37 38 Input* SpawnSegInput(int index1,int index2); 38 39 Input* PointwiseDivide(Input* inputB); -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/SegInput.h ¶
r17309 r17513 35 35 int InstanceEnum(); 36 36 Input* SpawnTriaInput(int location){_error_("not supported yet");}; 37 Input* SpawnTriaInput(int index1,int index2,int index3){_error_("not supported yet");}; 37 38 Input* SpawnSegInput(int index1,int index2){_error_("not implemented yet");}; 38 39 Input* PointwiseDivide(Input* inputB){_error_("not supported yet");}; -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/TetraInput.cpp ¶
r17472 r17513 185 185 } 186 186 /*}}}*/ 187 /*FUNCTION TetraInput::SpawnTriaInput{{{*/ 188 Input* TetraInput::SpawnTriaInput(int index1,int index2,int index3){ 189 190 /*output*/ 191 TriaInput* outinput=NULL; 192 193 if(this->element_type==P0Enum){ 194 outinput=new TriaInput(this->enum_type,&this->values[0],P0Enum); 195 } 196 else{ 197 /*Assume P1 interpolation only for now*/ 198 IssmDouble newvalues[3]; 199 200 /*Create array of indices depending on location (0=base 1=surface)*/ 201 int indices[3]; 202 indices[0] = index1; 203 indices[1] = index2; 204 indices[2] = index3; 205 206 /*Create new input*/ 207 for(int i=0;i<3;i++){ 208 _assert_(indices[i]>=0 && indices[i]<4); 209 newvalues[i]=this->values[indices[i]]; 210 } 211 outinput=new TriaInput(this->enum_type,&newvalues[0],P1Enum); 212 } 213 214 /*Assign output*/ 215 return outinput; 216 } 217 /*}}}*/ 187 218 188 219 /*Intermediary*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/TetraInput.h ¶
r17472 r17513 35 35 int InstanceEnum(); 36 36 Input* SpawnTriaInput(int location){_error_("not supported yet");}; 37 Input* SpawnTriaInput(int index1,int index2,int index3); 37 38 Input* SpawnSegInput(int index1,int index2){_error_("not supported yet");}; 38 39 Input* PointwiseDivide(Input* inputB); -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp ¶
r17100 r17513 135 135 xMemCpy(outinput->timesteps,this->timesteps,this->numtimesteps); 136 136 outinput->inputs=(Inputs*)this->inputs->SpawnTriaInputs(location); 137 outinput->parameters=this->parameters; 138 139 /*Assign output*/ 140 return outinput; 141 142 } 143 /*}}}*/ 144 /*FUNCTION TransientInput::SpawnTriaInput{{{*/ 145 Input* TransientInput::SpawnTriaInput(int index1,int index2,int index3){ 146 147 /*output*/ 148 TransientInput* outinput=NULL; 149 150 /*Create new Transientinput (copy of current input)*/ 151 outinput=new TransientInput(); 152 outinput->enum_type=this->enum_type; 153 outinput->numtimesteps=this->numtimesteps; 154 outinput->timesteps=xNew<IssmDouble>(this->numtimesteps); 155 xMemCpy(outinput->timesteps,this->timesteps,this->numtimesteps); 156 outinput->inputs=(Inputs*)this->inputs->SpawnTriaInputs(index1,index2,index3); 137 157 outinput->parameters=this->parameters; 138 158 -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/TransientInput.h ¶
r17100 r17513 41 41 int InstanceEnum(); 42 42 Input* SpawnTriaInput(int location); 43 Input* SpawnTriaInput(int index1,int index2,int index3); 43 44 Input* SpawnSegInput(int index1,int index2); 44 45 Input* PointwiseDivide(Input* forcingB){_error_("not implemented yet");}; -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/TriaInput.cpp ¶
r17321 r17513 95 95 } 96 96 /*}}}*/ 97 /*FUNCTION TriaInput::SpawnTriaInput{{{*/ 98 Input* TriaInput::SpawnTriaInput(int index1,int index2,int index3){ 99 100 /*output*/ 101 TriaInput* outinput=NULL; 102 103 /*Create new Tria input (copy of current input)*/ 104 outinput=new TriaInput(this->enum_type,&this->values[0],this->element_type); 105 106 /*Assign output*/ 107 return outinput; 108 109 } 110 /*}}}*/ 97 111 /*FUNCTION TriaInput::SpawnSegInput{{{*/ 98 112 Input* TriaInput::SpawnSegInput(int index1,int index2){ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/TriaInput.h ¶
r17100 r17513 35 35 int InstanceEnum(); 36 36 Input* SpawnTriaInput(int location); 37 Input* SpawnTriaInput(int index1,int index2,int index3); 37 38 Input* SpawnSegInput(int index1,int index2); 38 39 Input* PointwiseDivide(Input* inputB); -
TabularUnified issm/trunk-jpl/src/c/classes/Node.cpp ¶
r17429 r17513 101 101 analysis_enum==ExtrapolationAnalysisEnum 102 102 ){ 103 if(iomodel->meshtype ==Mesh3DEnum || iomodel->meshtype==Mesh2DverticalEnum){103 if(iomodel->meshtype!=Mesh2DhorizontalEnum){ 104 104 /*On a 3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */ 105 105 _assert_(iomodel->Data(MeshVertexonbedEnum)); … … 112 112 analysis_enum==FreeSurfaceTopAnalysisEnum 113 113 ){ 114 if(iomodel->meshtype ==Mesh3DEnum || iomodel->meshtype==Mesh2DverticalEnum){114 if(iomodel->meshtype!=Mesh2DhorizontalEnum){ 115 115 /*On a 3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */ 116 116 _assert_(iomodel->Data(MeshVertexonsurfaceEnum)); -
TabularUnified issm/trunk-jpl/src/c/shared/Exceptions/exceptions.h ¶
r16228 r17513 63 63 return 0;\ 64 64 }\ 65 catch 65 catch(exception& e) {\ 66 66 _printf_("Standard exception: " << e.what() << "\n\n");\ 67 67 return 0;\
Note:
See TracChangeset
for help on using the changeset viewer.