Changeset 21382
- Timestamp:
- 11/16/16 19:51:51 (8 years ago)
- Location:
- issm/trunk-jpl/src/c/analyses
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
r21377 r21382 108 108 109 109 bool dakota_analysis,ismovingfront,isenthalpy; 110 int frictionlaw,basalforcing_model ;110 int frictionlaw,basalforcing_model,materialstype; 111 111 int FrictionCoupling; 112 112 … … 134 134 iomodel->FindConstant(&ismovingfront,"md.transient.ismovingfront"); 135 135 iomodel->FindConstant(&frictionlaw,"md.friction.law"); 136 iomodel->FindConstant(&materialstype,"md.materials.type"); 136 137 137 138 iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum); … … 145 146 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 146 147 } 147 iomodel->FetchDataToInput(elements,"md.materials.rheology_B",MaterialsRheologyBEnum);148 iomodel->FetchDataToInput(elements,"md.materials.rheology_n",MaterialsRheologyNEnum);149 148 iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum); 150 149 iomodel->FetchDataToInput(elements,"md.initialization.temperature",TemperatureEnum); … … 171 170 iomodel->FetchDataToInput(elements,"md.basalforcings.geothermalflux",BasalforcingsGeothermalfluxEnum); 172 171 break; 172 } 173 174 /*Rheology type*/ 175 iomodel->FetchDataToInput(elements,"md.materials.rheology_B",MaterialsRheologyBEnum); 176 switch(materialstype){ 177 case MatdamageiceEnum: 178 iomodel->FetchDataToInput(elements,"md.materials.rheology_n",MaterialsRheologyNEnum); 179 break; 180 case MatestarEnum: 181 iomodel->FetchDataToInput(elements,"md.materials.rheology_Ec",MaterialsRheologyEcEnum); 182 iomodel->FetchDataToInput(elements,"md.materials.rheology_Es",MaterialsRheologyEsEnum); 183 break; 184 case MaticeEnum: 185 iomodel->FetchDataToInput(elements,"md.materials.rheology_n",MaterialsRheologyNEnum); 186 break; 187 default: 188 _error_("not supported"); 173 189 } 174 190 … … 589 605 } 590 606 591 /*Artif ficial diffusivity*/607 /*Artificial diffusivity*/ 592 608 if(stabilization==1){ 593 609 element->ElementSizes(&hx,&hy,&hz); … … 1452 1468 int i,rheology_law; 1453 1469 IssmDouble B_average,s_average,T_average=0.,P_average=0.; 1470 IssmDouble n=3.0; 1454 1471 int *doflist = NULL; 1455 1472 IssmDouble *xyz_list = NULL; … … 1477 1494 1478 1495 /*Get all inputs and parameters*/ 1496 if(element->material->ObjectEnum()!=MatestarEnum) n=element->GetMaterialParameter(MaterialsRheologyNEnum); 1479 1497 element->GetInputValue(&converged,ConvergedEnum); 1480 1498 element->GetInputListOnNodes(&pressure[0],PressureEnum); … … 1506 1524 break; 1507 1525 case CuffeyTemperateEnum: 1508 for(i=0;i<numnodes;i++) B[i]=CuffeyTemperate(temperature[i], waterfraction[i], element->GetMaterialParameter(MaterialsRheologyNEnum));1526 for(i=0;i<numnodes;i++) B[i]=CuffeyTemperate(temperature[i], waterfraction[i],n); 1509 1527 element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType()); 1510 1528 break; … … 1515 1533 case ArrheniusEnum: 1516 1534 element->GetVerticesCoordinates(&xyz_list); 1517 for(i=0;i<numnodes;i++) B[i]=Arrhenius(temperature[i],surface[i]-xyz_list[i*3+2], element->GetMaterialParameter(MaterialsRheologyNEnum));1535 for(i=0;i<numnodes;i++) B[i]=Arrhenius(temperature[i],surface[i]-xyz_list[i*3+2],n); 1518 1536 element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType()); 1519 1537 break; 1520 1538 case LliboutryDuvalEnum: 1521 for(i=0;i<numnodes;i++) B[i]=LliboutryDuval(values[i],pressure[i], element->GetMaterialParameter(MaterialsRheologyNEnum),element->GetMaterialParameter(MaterialsBetaEnum),element->GetMaterialParameter(ConstantsReferencetemperatureEnum),element->GetMaterialParameter(MaterialsHeatcapacityEnum),element->GetMaterialParameter(MaterialsLatentheatEnum));1539 for(i=0;i<numnodes;i++) B[i]=LliboutryDuval(values[i],pressure[i],n,element->GetMaterialParameter(MaterialsBetaEnum),element->GetMaterialParameter(ConstantsReferencetemperatureEnum),element->GetMaterialParameter(MaterialsHeatcapacityEnum),element->GetMaterialParameter(MaterialsLatentheatEnum)); 1522 1540 element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType()); 1523 1541 break; -
issm/trunk-jpl/src/c/analyses/ThermalAnalysis.cpp
r21377 r21382 73 73 void ThermalAnalysis::UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/ 74 74 75 int frictionlaw,basalforcing_model ;75 int frictionlaw,basalforcing_model,materialstype; 76 76 int FrictionCoupling; 77 77 /*Now, is the model 3d? otherwise, do nothing: */ … … 93 93 iomodel->FindConstant(&ismovingfront,"md.transient.ismovingfront"); 94 94 iomodel->FindConstant(&frictionlaw,"md.friction.law"); 95 iomodel->FindConstant(&materialstype,"md.materials.type"); 95 96 96 97 iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum); … … 106 107 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 107 108 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 109 iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum); 111 110 iomodel->FetchDataToInput(elements,"md.initialization.temperature",TemperatureEnum); … … 116 115 InputUpdateFromConstantx(elements,0.,VyMeshEnum); 117 116 InputUpdateFromConstantx(elements,0.,VzMeshEnum); 117 118 /*Rheology type*/ 119 iomodel->FetchDataToInput(elements,"md.materials.rheology_B",MaterialsRheologyBEnum); 120 switch(materialstype){ 121 case MatdamageiceEnum: 122 iomodel->FetchDataToInput(elements,"md.materials.rheology_n",MaterialsRheologyNEnum); 123 break; 124 case MatestarEnum: 125 iomodel->FetchDataToInput(elements,"md.materials.rheology_Ec",MaterialsRheologyEcEnum); 126 iomodel->FetchDataToInput(elements,"md.materials.rheology_Es",MaterialsRheologyEsEnum); 127 break; 128 case MaticeEnum: 129 iomodel->FetchDataToInput(elements,"md.materials.rheology_n",MaterialsRheologyNEnum); 130 break; 131 default: 132 _error_("not supported"); 133 } 118 134 if(ismovingfront){ 119 135 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); // required for updating active nodes … … 722 738 int *doflist = NULL; 723 739 IssmDouble *xyz_list = NULL; 740 IssmDouble n=3.0; 724 741 bool hack = false; 725 742 … … 756 773 757 774 /*Get all inputs and parameters*/ 775 if(element->material->ObjectEnum()!=MatestarEnum) n=element->GetMaterialParameter(MaterialsRheologyNEnum); 758 776 element->GetInputValue(&converged,ConvergedEnum); 759 777 if(converged){ … … 782 800 case ArrheniusEnum:{ 783 801 element->GetVerticesCoordinates(&xyz_list); 784 for(i=0;i<numnodes;i++) B[i]=Arrhenius(values[i],surface[i]-xyz_list[i*3+2], element->GetMaterialParameter(MaterialsRheologyNEnum));802 for(i=0;i<numnodes;i++) B[i]=Arrhenius(values[i],surface[i]-xyz_list[i*3+2],n); 785 803 element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType()); 786 804 break;
Note:
See TracChangeset
for help on using the changeset viewer.