source: issm/oecreview/Archive/16554-17801/ISSM-17443-17444.diff@ 17802

Last change on this file since 17802 was 17802, checked in by Mathieu Morlighem, 11 years ago

Added archives

File size: 5.0 KB
  • ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp

     
    123123
    124124        iomodel->FetchData(1,MeshVertexonbedEnum);
    125125
    126         //create penalties for nodes: no node can have a temperature over the melting point
     126        //create penalties for nodes: no node can have water above the max
    127127        CreateSingleNodeToElementConnectivity(iomodel);
    128128        for(int i=0;i<iomodel->numberofvertices;i++){
    129                 if (iomodel->meshtype==Mesh3DEnum){
     129                if (iomodel->meshtype!=Mesh3DEnum){
    130130                        /*keep only this partition's nodes:*/
    131131                        if(iomodel->my_vertices[i]){
    132132                                loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,HydrologyDCInefficientAnalysisEnum));
     
    279279        /*Intermediaries */
    280280        bool       active_element,isefficientlayer;
    281281        IssmDouble dt,scalar;
    282         IssmDouble moulin_load,water_head;
     282        IssmDouble water_head;
    283283        IssmDouble water_load,transfer;
    284284        IssmDouble Jdet;
    285285
     
    306306        Input* thickness_input   = basalelement->GetInput(ThicknessEnum);
    307307        Input* bed_input         = basalelement->GetInput(BedEnum);
    308308        Input* water_input       = basalelement->GetInput(BasalforcingsMeltingRateEnum);    _assert_(water_input);
    309         Input* moulin_input      = basalelement->GetInput(HydrologydcBasalMoulinInputEnum); _assert_(moulin_input);
    310309        if(dt!= 0.){old_wh_input = basalelement->GetInput(SedimentHeadOldEnum);             _assert_(old_wh_input);}
    311310
    312311        IssmDouble sediment_storing    = SedimentStoring(basalelement);
     
    326325
    327326                /*Loading term*/
    328327                water_input->GetInputValue(&water_load,gauss);
    329                 moulin_input->GetInputValue(&moulin_load,gauss);
    330        
     328
    331329                scalar = Jdet*gauss->weight*(water_load);
    332                 scalar = scalar + Jdet* moulin_load;
    333330                if(dt!=0.) scalar = scalar*dt;
    334331                for(int i=0;i<numnodes;i++){
    335332                        pe->values[i]+=scalar*basis[i];
  • ../trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp

     
    7575                ElementVector* pe = analysis->CreatePVector(element);
    7676                element->ReduceMatrices(Ke,pe);
    7777                if(Ke) Ke->AddToGlobal(Kff,Kfs);
    78                 if(pe) pe->AddToGlobal(pf);
     78                if(pe){
     79                        pe->AddToGlobal(pf);
     80                        /* printf("-------------------USUAL \n"); */
     81                        /* pf->Echo(); */
     82                }
    7983                delete Ke;
    8084                delete pe;
    8185        }
     
    8690                if(load->InAnalysis(configuration_type)){
    8791                        load->CreateKMatrix(Kff,Kfs);
    8892                        load->CreatePVector(pf);
     93                        /* printf("-------------------LOADING \n"); */
     94                        /* pf->Echo(); */
    8995                }
    9096        }
    9197
     
    96102                        if(load->InAnalysis(configuration_type)){
    97103                                load->PenaltyCreateKMatrix(Kff,Kfs,kmax);
    98104                                load->PenaltyCreatePVector(pf,kmax);
     105                                /* printf("-------------------PENALTY \n"); */
     106                                /* pf->Echo(); */
    99107                        }
    100108                }
    101109        }
  • ../trunk-jpl/src/c/classes/Loads/Pengrid.cpp

     
    180180/*FUNCTION Pengrid::CreatePVector {{{*/
    181181void  Pengrid::CreatePVector(Vector<IssmDouble>* pf){
    182182
    183         /*No loads applied, do nothing: */
    184         return;
     183        ElementVector* pe=NULL;
     184        int analysis_type;
     185        this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
    185186
     187        switch(analysis_type){
     188               
     189        case HydrologyDCInefficientAnalysisEnum:
     190                pe = CreatePVectorHydrologyDCInefficient();
     191                break;
     192        default:
     193                /*No loads applied, do nothing: */
     194                return;
     195        }
     196        if(pe){
     197                pe->AddToGlobal(pf);
     198                delete pe;
     199        }
     200
    186201}
    187202/*}}}*/
    188203/*FUNCTION Pengrid::GetNodesSidList{{{*/
     
    792807        return pe;
    793808}
    794809/*}}}*/
     810/*FUNCTION Pengrid::CreatePVectorHydrologyDCInefficient {{{*/
     811ElementVector* Pengrid::CreatePVectorHydrologyDCInefficient(void){
     812
     813        IssmDouble moulin_load,dt;
     814
     815        /*Initialize Element matrix*/
     816        ElementVector* pe=new ElementVector(&node,1,this->parameters);
     817
     818        this->element->GetInputValue(&moulin_load,node,HydrologydcBasalMoulinInputEnum);
     819        parameters->FindParam(&dt,TimesteppingTimeStepEnum);
     820
     821        if(dt!=0.0) pe->values[0]=moulin_load*dt;
     822
     823        /*Clean up and return*/
     824        return pe;
     825 }
     826/*}}}*/
    795827/*FUNCTION Pengrid::ResetConstraint {{{*/
    796828void  Pengrid::ResetConstraint(void){
    797829        active         = 0;
  • ../trunk-jpl/src/c/classes/Loads/Pengrid.h

     
    9393                ElementVector* PenaltyCreatePVectorHydrologyDCInefficient(IssmDouble kmax);
    9494                void           ConstraintActivateHydrologyDCInefficient(int* punstable);
    9595                void  ConstraintActivate(int* punstable);
     96                ElementVector* CreatePVectorHydrologyDCInefficient(void);
    9697                void  ResetConstraint(void);
    9798                /*}}}*/
    9899
Note: See TracBrowser for help on using the repository browser.