Changeset 24053


Ignore:
Timestamp:
06/28/19 05:47:22 (6 years ago)
Author:
Mathieu Morlighem
Message:

CHG: added mouling relaxation

Location:
issm/trunk-jpl/src/c/classes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h

    r23750 r24053  
    8787                } /*}}}*/
    8888                GenericExternalResult(int in_id, int in_enum_type,ResultType in_values, int in_M,int in_N,int in_step,IssmDouble in_time){/*{{{*/
    89                         _error_("template GenericExternalResult(int in_id, int in_enum_type,double* in_values, int in_M,int in_N,int in_step,IssmDouble in_time) not implemented for this ResultType\n");
     89                        id        = in_id;
     90                        step      = in_step;
     91                        time      = in_time;
     92                        M         = in_M;
     93                        N         = in_N;
     94
     95                        /*Copy result in values*/
     96                        if(M*N){
     97                                value=xNew<IssmDouble>(M*N);
     98                                xMemCpy<IssmDouble>(value,in_values,M*N);
     99                        }
     100                        else value=NULL;
     101
     102                        /*Convert enum to name*/
     103                        EnumToStringx(&this->result_name,in_enum_type);
    90104                }
    91105/*}}}*/
  • issm/trunk-jpl/src/c/classes/Loads/Moulin.cpp

    r23971 r24053  
    147147void  Moulin::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){/*{{{*/
    148148
    149         /*No loads applied, do nothing: */
    150         return;
     149        /*recover some parameters*/
     150        ElementMatrix* Ke=NULL;
     151        int analysis_type;
     152        this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
     153
     154        switch(analysis_type){
     155                case HydrologyGlaDSAnalysisEnum:
     156                        Ke = this->CreateKMatrixHydrologyGlaDS();
     157                        break;
     158                case HydrologyShaktiAnalysisEnum:
     159                        /*do nothing: */
     160                        return;
     161                case HydrologyDCInefficientAnalysisEnum:
     162                        /*do nothing: */
     163                        return;
     164                case HydrologyDCEfficientAnalysisEnum:
     165                        /*do nothing: */
     166                        return;
     167                default:
     168                        _error_("Don't know why we should be here");
     169
     170        }
     171        /*Add to global matrix*/
     172        if(Ke){
     173                Ke->AddToGlobal(Kff,Kfs);
     174                delete Ke;
     175        }
    151176
    152177}
     
    313338/*}}}*/
    314339
    315 ElementVector* Moulin::CreatePVectorHydrologyGlaDS(void){/*{{{*/
     340ElementMatrix* Moulin::CreateKMatrixHydrologyGlaDS(void){/*{{{*/
    316341
    317342        /*If this node is not the master node (belongs to another partition of the
     
    319344        if(node->IsClone()) return NULL;
    320345
    321         IssmDouble moulin_load;
    322 
    323346        /*Initialize Element matrix*/
     347        ElementMatrix* Ke=new ElementMatrix(&node,1,this->parameters);
     348
     349        /*Get all inputs and parameters*/
     350        IssmDouble dt        = element->FindParam(TimesteppingTimeStepEnum);
     351        IssmDouble rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
     352        IssmDouble g         = element->FindParam(ConstantsGEnum);
     353        IssmDouble Am        = 0.; //For now...
     354
     355        /*Load vector*/
     356        Ke->values[0] = - Am/(rho_water*g)/dt;
     357
     358        /*Clean up and return*/
     359        return Ke;
     360}
     361/*}}}*/
     362ElementVector* Moulin::CreatePVectorHydrologyGlaDS(void){/*{{{*/
     363
     364        /*If this node is not the master node (belongs to another partition of the
     365         * mesh), don't add the moulin input a second time*/
     366        if(node->IsClone()) return NULL;
     367
     368        /*Initialize Element vector*/
    324369        ElementVector* pe=new ElementVector(&node,1,this->parameters);
    325370
    326         this->element->GetInputValue(&moulin_load,node,HydrologyMoulinInputEnum);
    327         pe->values[0]=moulin_load;
     371        /*Get all inputs and parameters*/
     372        IssmDouble dt        = element->FindParam(TimesteppingTimeStepEnum);
     373        IssmDouble rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
     374        IssmDouble g         = element->FindParam(ConstantsGEnum);
     375        IssmDouble Am        = 0.; //For now...
     376
     377        /*Get hydraulic potential*/
     378        IssmDouble phi_old,moulin_load;
     379        element->GetInputValue(&phi_old,node,HydraulicPotentialOldEnum);
     380        element->GetInputValue(&moulin_load,node,HydrologyMoulinInputEnum);
     381
     382        pe->values[0] = moulin_load -Am/(rho_water*g) * phi_old/dt;
    328383
    329384        /*Clean up and return*/
  • issm/trunk-jpl/src/c/classes/Loads/Moulin.h

    r23971 r24053  
    7676                /*}}}*/
    7777
     78                ElementMatrix* CreateKMatrixHydrologyGlaDS(void);
    7879                ElementVector* CreatePVectorHydrologyShakti(void);
    7980                ElementVector* CreatePVectorHydrologyGlaDS(void);
Note: See TracChangeset for help on using the changeset viewer.