Changeset 15853


Ignore:
Timestamp:
08/21/13 11:27:27 (12 years ago)
Author:
Mathieu Morlighem
Message:

NEW: preparing Dynamic Basal Dirichlet conditions for enthalpy model (not working for now, preparing code for Johannes)

Location:
issm/trunk-jpl/src/c
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/trunk-jpl/src/c/analyses/thermal_core.cpp

    r15849 r15853  
    2727        }
    2828
     29        if(VerboseSolution()) _printf0_("   setting basal Dirichlet boundary conditions\n");
     30        femmodel->UpdateThermalBasalConstraintsx();
     31
    2932        if(VerboseSolution()) _printf0_("   computing temperatures\n");
    3033        femmodel->SetCurrentConfiguration(ThermalAnalysisEnum);
  • TabularUnified issm/trunk-jpl/src/c/classes/Elements/Element.h

    r15643 r15853  
    127127                #endif
    128128
     129                #ifdef _HAVE_THERMAL_
     130                virtual void UpdateThermalBasalConstraints(void)=0;
     131                #endif
     132
    129133                #ifdef _HAVE_HYDROLOGY_
    130134                virtual void GetHydrologyDCInefficientHmax(IssmDouble* ph_max, Node* innode)=0;
  • TabularUnified issm/trunk-jpl/src/c/classes/Elements/Penta.cpp

    r15847 r15853  
    50035003        /*Free ressources:*/
    50045004        xDelete<int>(doflist);
     5005}
     5006/*}}}*/
     5007/*FUNCTION Penta::UpdateThermalBasalConstraints{{{*/
     5008void  Penta::UpdateThermalBasalConstraints(void){
     5009
     5010        /*Intermediary*/
     5011        bool        isenthalpy,isdynamicbasalspc,istemperatelayer;
     5012        int         numindices;
     5013        IssmDouble  h_pmp,pressure;
     5014        int        *indices = NULL;
     5015
     5016        /* Only update Constraints at the base of grounded ice*/
     5017        if(!IsOnBed() || !IsFloating()) return;
     5018
     5019        /*Check wether dynamic basal boudary conditions are activated -> TODO: Johannes :) */
     5020        parameters->FindParam(&isenthalpy,ThermalIsenthalpyEnum);
     5021        if(!isenthalpy) return;
     5022        //parameters->FindParam(&isdynamicbasalspc,ThermalIsdynamicbasalspcEnum);
     5023        isdynamicbasalspc = true;
     5024        if(!isdynamicbasalspc) return;
     5025
     5026
     5027        /*Fetch indices of basal nodes for this finite element*/
     5028        BasalNodeIndices(&numindices,&indices,this->VelocityInterpolation());
     5029
     5030        /*Get parameters and inputs: */
     5031        Input* pressure_input=inputs->GetInput(PressureEnum); _assert_(pressure_input);
     5032
     5033        /*Ok, we have vx and vy in values, fill in vx and vy arrays: */
     5034        GaussPenta* gauss=new GaussPenta();
     5035        for(int i=0;i<numindices;i++){
     5036                gauss->GaussNode(this->element_type,indices[i]);
     5037
     5038                /*Check wether there is a temperate layer at the base or not -> TODO: Johannes:) */
     5039                istemperatelayer = false;
     5040
     5041                /*Add Dirichlet constraint to this node if there is a positive thickness of temperate ice*/
     5042                if(istemperatelayer){
     5043
     5044                        /*Calculate enthalpy at pressure melting point */
     5045                        pressure_input->GetInputValue(&pressure,gauss);
     5046                        h_pmp=matpar->PureIceEnthalpy(pressure);
     5047
     5048
     5049                        /*Apply Dirichlet condition (dof = 0 here, since there is only one degree of freedom per node)*/
     5050                        nodes[indices[i]]->ApplyConstraint(0,h_pmp);
     5051                }
     5052        }
     5053
     5054        /*Free ressources:*/
     5055        xDelete<int>(indices);
    50055056}
    50065057/*}}}*/
  • TabularUnified issm/trunk-jpl/src/c/classes/Elements/Penta.h

    r15771 r15853  
    349349                ElementVector* CreatePVectorThermalSheet(void);
    350350                void             GetSolutionFromInputsThermal(Vector<IssmDouble>* solutiong);
    351                 void           InputUpdateFromSolutionThermal( IssmDouble* solutiong);
    352                 void           InputUpdateFromSolutionEnthalpy( IssmDouble* solutiong);
     351                void           InputUpdateFromSolutionThermal(IssmDouble* solutiong);
     352                void           InputUpdateFromSolutionEnthalpy(IssmDouble* solutiong);
     353                void           UpdateThermalBasalConstraints(void);
    353354                #endif
    354355
  • TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tria.h

    r15771 r15853  
    246246                #endif
    247247
     248                #ifdef _HAVE_THERMAL_
     249                void UpdateThermalBasalConstraints(void){_error_("not implemented yet");};
     250                #endif
     251
    248252                #ifdef _HAVE_HYDROLOGY_
    249253                ElementMatrix* CreateKMatrixHydrologyShreve(void);
  • TabularUnified issm/trunk-jpl/src/c/classes/FemModel.cpp

    r15849 r15853  
    15571557/*}}}*/
    15581558#endif
    1559 
    15601559#ifdef _HAVE_HYDROLOGY_
    15611560void FemModel::HydrologyEPLupdateDomainx(void){ /*{{{*/
     
    16401639/*}}}*/
    16411640#endif
     1641#ifdef _HAVE_THERMAL_
     1642void FemModel::UpdateThermalBasalConstraintsx(void){ /*{{{*/
     1643
     1644        for(int i=0;i<elements->Size();i++){
     1645                Element* element=dynamic_cast<Element*>(elements->GetObjectByOffset(i));
     1646                element->UpdateThermalBasalConstraints();
     1647        }
     1648
     1649}
     1650/*}}}*/
     1651#endif
  • TabularUnified issm/trunk-jpl/src/c/classes/FemModel.h

    r15839 r15853  
    9999                void UpdateConstraintsx(void);
    100100                int  UpdateVertexPositionsx(void);
    101                 void ParEplMask(void);         
     101                #ifdef _HAVE_HYDROLOGY_
    102102                void HydrologyTransferx(void);
    103103                void HydrologyEPLupdateDomainx(void);
     104                #endif
     105                #ifdef _HAVE_THERMAL_
     106                void UpdateThermalBasalConstraintsx(void);
     107                #endif
    104108};
    105109
Note: See TracChangeset for help on using the changeset viewer.