Ignore:
Timestamp:
06/07/17 10:50:54 (8 years ago)
Author:
Eric.Larour
Message:

CHG: merged branch back to trunk-jpl 21754.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/branches/trunk-larour-NatGeoScience2016/src/c/analyses/ThermalAnalysis.cpp

    r20690 r21759  
    99
    1010        /*Intermediary*/
    11         int finiteelement = P1Enum;
     11        int finiteelement;
     12        iomodel->FindConstant(&finiteelement,"md.thermal.fe");
     13        _assert_(finiteelement==P1Enum);
    1214
    1315        /*Only 3d mesh supported*/
     
    6264void ThermalAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
    6365
    64         int finiteelement = P1Enum;
     66        int finiteelement;
     67        iomodel->FindConstant(&finiteelement,"md.thermal.fe");
     68        _assert_(finiteelement==P1Enum);
    6569       
    6670        if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
     
    7377void ThermalAnalysis::UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
    7478
    75         int frictionlaw,basalforcing_model;
     79        int frictionlaw,basalforcing_model,materialstype;
    7680        int FrictionCoupling;
    7781        /*Now, is the model 3d? otherwise, do nothing: */
     
    7983
    8084        /*Update elements: */
    81         int finiteelement = P1Enum;
     85        int finiteelement;
     86        iomodel->FindConstant(&finiteelement,"md.thermal.fe");
     87        _assert_(finiteelement==P1Enum);
    8288        int counter=0;
    8389        for(int i=0;i<iomodel->numberofelements;i++){
     
    9399        iomodel->FindConstant(&ismovingfront,"md.transient.ismovingfront");
    94100        iomodel->FindConstant(&frictionlaw,"md.friction.law");
     101        iomodel->FindConstant(&materialstype,"md.materials.type");
    95102
    96103        iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum);
     
    106113        iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum);
    107114        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);
    110115        iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum);
    111116        iomodel->FetchDataToInput(elements,"md.initialization.temperature",TemperatureEnum);
     
    116121        InputUpdateFromConstantx(elements,0.,VyMeshEnum);
    117122        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        }
    118144        if(ismovingfront){
    119145                iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); // required for updating active nodes
     
    131157        switch(frictionlaw){
    132158                case 1:
     159                        iomodel->FindConstant(&FrictionCoupling,"md.friction.coupling");
    133160                        iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum);
    134161                        iomodel->FetchDataToInput(elements,"md.friction.p",FrictionPEnum);
    135162                        iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum);
     163                        if (FrictionCoupling==1){
     164                          iomodel->FetchDataToInput(elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum);
     165                        }
    136166                        break;
    137167                case 2:
     
    144174                        iomodel->FetchDataToInput(elements,"md.friction.As",FrictionAsEnum);
    145175                        iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum);
    146                         if (FrictionCoupling==0){
    147                                 iomodel->FetchDataToInput(elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum);
     176                        if (FrictionCoupling==1){
     177                          iomodel->FetchDataToInput(elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum);
    148178                        }
    149179                        break;
     
    194224        iomodel->FindConstant(&frictionlaw,"md.friction.law");
    195225        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
    197228}/*}}}*/
    198229
     
    722753        int        *doflist   = NULL;
    723754        IssmDouble *xyz_list  = NULL;
     755        IssmDouble  n=3.0;
    724756        bool        hack      = false;
    725757
     
    756788
    757789        /*Get all inputs and parameters*/
     790        if(element->material->ObjectEnum()!=MatestarEnum) n=element->GetMaterialParameter(MaterialsRheologyNEnum);
    758791        element->GetInputValue(&converged,ConvergedEnum);
    759792        if(converged){
     
    767800                        case NoneEnum:
    768801                                /*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());
    769806                                break;
    770807                        case CuffeyEnum:
     
    778815                        case ArrheniusEnum:{
    779816                                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);
    781818                                element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
    782819                                break;
Note: See TracChangeset for help on using the changeset viewer.