- Timestamp:
- 06/07/17 10:50:54 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/branches/trunk-larour-NatGeoScience2016/src/c/analyses/ThermalAnalysis.cpp
r20690 r21759 9 9 10 10 /*Intermediary*/ 11 int finiteelement = P1Enum; 11 int finiteelement; 12 iomodel->FindConstant(&finiteelement,"md.thermal.fe"); 13 _assert_(finiteelement==P1Enum); 12 14 13 15 /*Only 3d mesh supported*/ … … 62 64 void ThermalAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/ 63 65 64 int finiteelement = P1Enum; 66 int finiteelement; 67 iomodel->FindConstant(&finiteelement,"md.thermal.fe"); 68 _assert_(finiteelement==P1Enum); 65 69 66 70 if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); … … 73 77 void ThermalAnalysis::UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/ 74 78 75 int frictionlaw,basalforcing_model ;79 int frictionlaw,basalforcing_model,materialstype; 76 80 int FrictionCoupling; 77 81 /*Now, is the model 3d? otherwise, do nothing: */ … … 79 83 80 84 /*Update elements: */ 81 int finiteelement = P1Enum; 85 int finiteelement; 86 iomodel->FindConstant(&finiteelement,"md.thermal.fe"); 87 _assert_(finiteelement==P1Enum); 82 88 int counter=0; 83 89 for(int i=0;i<iomodel->numberofelements;i++){ … … 93 99 iomodel->FindConstant(&ismovingfront,"md.transient.ismovingfront"); 94 100 iomodel->FindConstant(&frictionlaw,"md.friction.law"); 101 iomodel->FindConstant(&materialstype,"md.materials.type"); 95 102 96 103 iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum); … … 106 113 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 107 114 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 108 iomodel->FetchDataToInput(elements,"md.materials.rheology_B",MaterialsRheologyBEnum);109 iomodel->FetchDataToInput(elements,"md.materials.rheology_n",MaterialsRheologyNEnum);110 115 iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum); 111 116 iomodel->FetchDataToInput(elements,"md.initialization.temperature",TemperatureEnum); … … 116 121 InputUpdateFromConstantx(elements,0.,VyMeshEnum); 117 122 InputUpdateFromConstantx(elements,0.,VzMeshEnum); 123 124 /*Rheology type*/ 125 iomodel->FetchDataToInput(elements,"md.materials.rheology_B",MaterialsRheologyBEnum); 126 switch(materialstype){ 127 case MatenhancediceEnum: 128 iomodel->FetchDataToInput(elements,"md.materials.rheology_n",MaterialsRheologyNEnum); 129 iomodel->FetchDataToInput(elements,"md.materials.rheology_E",MaterialsRheologyEEnum); 130 break; 131 case MatdamageiceEnum: 132 iomodel->FetchDataToInput(elements,"md.materials.rheology_n",MaterialsRheologyNEnum); 133 break; 134 case MatestarEnum: 135 iomodel->FetchDataToInput(elements,"md.materials.rheology_Ec",MaterialsRheologyEcEnum); 136 iomodel->FetchDataToInput(elements,"md.materials.rheology_Es",MaterialsRheologyEsEnum); 137 break; 138 case MaticeEnum: 139 iomodel->FetchDataToInput(elements,"md.materials.rheology_n",MaterialsRheologyNEnum); 140 break; 141 default: 142 _error_("not supported"); 143 } 118 144 if(ismovingfront){ 119 145 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); // required for updating active nodes … … 131 157 switch(frictionlaw){ 132 158 case 1: 159 iomodel->FindConstant(&FrictionCoupling,"md.friction.coupling"); 133 160 iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum); 134 161 iomodel->FetchDataToInput(elements,"md.friction.p",FrictionPEnum); 135 162 iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum); 163 if (FrictionCoupling==1){ 164 iomodel->FetchDataToInput(elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum); 165 } 136 166 break; 137 167 case 2: … … 144 174 iomodel->FetchDataToInput(elements,"md.friction.As",FrictionAsEnum); 145 175 iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum); 146 if (FrictionCoupling== 0){147 176 if (FrictionCoupling==1){ 177 iomodel->FetchDataToInput(elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum); 148 178 } 149 179 break; … … 194 224 iomodel->FindConstant(&frictionlaw,"md.friction.law"); 195 225 if(frictionlaw==4 || frictionlaw==6) parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum)); 196 if(frictionlaw==3) parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum)); 226 if(frictionlaw==3 || frictionlaw==1) parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum)); 227 197 228 }/*}}}*/ 198 229 … … 722 753 int *doflist = NULL; 723 754 IssmDouble *xyz_list = NULL; 755 IssmDouble n=3.0; 724 756 bool hack = false; 725 757 … … 756 788 757 789 /*Get all inputs and parameters*/ 790 if(element->material->ObjectEnum()!=MatestarEnum) n=element->GetMaterialParameter(MaterialsRheologyNEnum); 758 791 element->GetInputValue(&converged,ConvergedEnum); 759 792 if(converged){ … … 767 800 case NoneEnum: 768 801 /*Do nothing: B is not temperature dependent*/ 802 break; 803 case BuddJackaEnum: 804 for(i=0;i<numnodes;i++) B[i]=BuddJacka(values[i]); 805 element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType()); 769 806 break; 770 807 case CuffeyEnum: … … 778 815 case ArrheniusEnum:{ 779 816 element->GetVerticesCoordinates(&xyz_list); 780 for(i=0;i<numnodes;i++) B[i]=Arrhenius(values[i],surface[i]-xyz_list[i*3+2], element->GetMaterialParameter(MaterialsRheologyNEnum));817 for(i=0;i<numnodes;i++) B[i]=Arrhenius(values[i],surface[i]-xyz_list[i*3+2],n); 781 818 element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType()); 782 819 break;
Note:
See TracChangeset
for help on using the changeset viewer.