Changeset 8561


Ignore:
Timestamp:
06/08/11 14:02:04 (14 years ago)
Author:
Mathieu Morlighem
Message:

removed all hydro_gamma and fixed indentation

Location:
issm/trunk/src/c
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r8549 r8561  
    991991        double     Ke_gg_gaussian2[numdof][numdof]  ={0.0};
    992992        double     Ke_gg_gaussian3[numdof][numdof]  ={0.0};
    993         double     hydro_gamma,hydro_p,hydro_q,hydro_CR,hydro_n,rho_water,g;
     993        double     hydro_p,hydro_q,hydro_CR,hydro_n,rho_water,g,gamma;
    994994        double     DL_scalar1;
    995995        double     DL_scalar2;
     
    10051005
    10061006        /*retrieve material parameters: */
    1007 //      hydro_gamma=matpar->GetGamma();
    1008         g          =matpar->GetG();
    1009         rho_water  =matpar->GetRhoWater();
    1010         hydro_p    =matpar->GetHydroP();
    1011         hydro_q    =matpar->GetHydroQ();
    1012    hydro_CR    =matpar->GetHydroCR();
    1013         hydro_n    =matpar->GetHydroN();
    1014        
    1015         hydro_gamma=1/(hydro_n*pow(hydro_CR,hydro_p)*pow((rho_water*g),hydro_q));
     1007        g        =matpar->GetG();
     1008        rho_water=matpar->GetRhoWater();
     1009        hydro_p  =matpar->GetHydroP();
     1010        hydro_q  =matpar->GetHydroQ();
     1011        hydro_CR =matpar->GetHydroCR();
     1012        hydro_n  =matpar->GetHydroN();
     1013        gamma=1/(hydro_n*pow(hydro_CR,hydro_p)*pow((rho_water*g),hydro_q));
    10161014       
    10171015        /* Start  looping on the number of gaussian points: */
     
    10241022                GetNodalFunctions(&L[0],gauss);
    10251023                GetNodalFunctionsDerivatives(&dL[0][0],&xyz_list[0][0],gauss);
    1026  //printf("NUMVERTICES=%d, Jdettria=%f\n",NUMVERTICES,Jdettria); //BK
     1024                //printf("NUMVERTICES=%d, Jdettria=%f\n",NUMVERTICES,Jdettria); //BK
    10271025                for(i=0;i<NUMVERTICES;i++)dLx[i]=dL[0][i];
    1028            for(i=0;i<NUMVERTICES;i++)dLy[i]=dL[1][i];
    1029   /*    for(i=0;i<NUMVERTICES;i++)
    1030                   { dLx[i]=dL[0][i];
    1031                 printf("dLx[%d]=%f, L[%d]=%f\n",i,dLx[i]),i,L[i];}
    1032                 for(i=0;i<NUMVERTICES;i++)
    1033                          { dLy[i]=dL[1][i];
    1034                                                printf("dLy[%d]=%f\n",i,dLy[i]);} */
     1026                for(i=0;i<NUMVERTICES;i++)dLy[i]=dL[1][i];
     1027                /*    for(i=0;i<NUMVERTICES;i++)
     1028                                { dLx[i]=dL[0][i];
     1029                                printf("dLx[%d]=%f, L[%d]=%f\n",i,dLx[i]),i,L[i];}
     1030                                for(i=0;i<NUMVERTICES;i++)
     1031                                { dLy[i]=dL[1][i];
     1032                                printf("dLy[%d]=%f\n",i,dLy[i]);} */
    10351033
    10361034                /*Get K parameter: */
    10371035                GetHydrologyK(&K[0],&xyz_list[0][0],gauss);
    1038 //      printf("K[0]=%g,K[1]=%g\n",K[0],K[1]);
     1036                //printf("K[0]=%g,K[1]=%g\n",K[0],K[1]);
    10391037
    10401038                if(dt){
     
    10471045
    10481046                if(dt){
    1049                         DL_scalar2=-gauss->weight*Jdettria*hydro_gamma*K[0]*dt; //don't forget the -
    1050                         DL_scalar3=-gauss->weight*Jdettria*hydro_gamma*K[1]*dt; //don't forget the -
     1047                        DL_scalar2=-gauss->weight*Jdettria*gamma*K[0]*dt; //don't forget the -
     1048                        DL_scalar3=-gauss->weight*Jdettria*gamma*K[1]*dt; //don't forget the -
    10511049
    10521050                }
    10531051                else{
    1054                         DL_scalar2=-gauss->weight*Jdettria*hydro_gamma*K[0]; //don't forget the -
    1055                         DL_scalar3=-gauss->weight*Jdettria*hydro_gamma*K[1]; //don't forget the -
     1052                        DL_scalar2=-gauss->weight*Jdettria*gamma*K[0]; //don't forget the -
     1053                        DL_scalar3=-gauss->weight*Jdettria*gamma*K[1]; //don't forget the -
    10561054                }
    10571055               
     
    21052103                basal_melting_input->GetParameterValue(&basal_melting_g,gauss);
    21062104                old_watercolumn_input->GetParameterValue(&old_watercolumn_g,gauss);
    2107 //      printf("ig=%d, old_watercolumn_g=%f,Jdettria=%f\n",ig,old_watercolumn_g,Jdettria);//bk
    2108 //      if(old_watercolumn_g<0) printf("old_watercolumn_g=%g,Jdettria=%f\n",old_watercolumn_g,Jdettria);//bk
     2105                //printf("ig=%d, old_watercolumn_g=%f,Jdettria=%f\n",ig,old_watercolumn_g,Jdettria);//bk
     2106                //if(old_watercolumn_g<0) printf("old_watercolumn_g=%g,Jdettria=%f\n",old_watercolumn_g,Jdettria);//bk
    21092107
    21102108                if(dt)for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*(old_watercolumn_g+dt*basal_melting_g)*L[i];
     
    27152713                watercolumn_input->GetParameterValue(&watercolumn,gauss);
    27162714                values[i]=watercolumn;
    2717         //      if((values[i])<0)values[i]=0;
    27182715        }
    27192716
     
    28032800 
    28042801        //bk
    2805           // K[0]=fabs(pow(w,2)*(rho_ice*g*dsdx+(rho_water/rho_ice-1)*rho_ice*g*dbdx) - rho_ice * g * kn* w * (dsdx - dbdx ) * surface_slope);
    2806           // K[1]=fabs(pow(w,2)*(rho_ice*g*dsdy+(rho_water/rho_ice-1)*rho_ice*g*dbdy) - rho_ice * g * kn *w * (dsdy - dbdy ) * surface_slope);
    2807 //       printf("K[0]=%g,K[1]=%g,w=%g\n",K[0],K[1],w); //bk
    2808 //   if (w<0) {printf("negative w!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
    2809 //             printf("K[0]=%g,K[1]=%g,w=%g\n",K[0],K[1],w);}
    2810 
    2811 
    2812 }
    2813 
     2802        //K[0]=fabs(pow(w,2)*(rho_ice*g*dsdx+(rho_water/rho_ice-1)*rho_ice*g*dbdx) - rho_ice * g * kn* w * (dsdx - dbdx ) * surface_slope);
     2803        //K[1]=fabs(pow(w,2)*(rho_ice*g*dsdy+(rho_water/rho_ice-1)*rho_ice*g*dbdy) - rho_ice * g * kn *w * (dsdy - dbdy ) * surface_slope);
     2804        //printf("K[0]=%g,K[1]=%g,w=%g\n",K[0],K[1],w); //bk
     2805        //if (w<0) {printf("negative w!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
     2806        //printf("K[0]=%g,K[1]=%g,w=%g\n",K[0],K[1],w);}
     2807}
    28142808/*}}}*/
    28152809/*FUNCTION Tria::Gradj {{{1*/
     
    39403934                values[i]=solution[doflist[i]];
    39413935                if(isnan(values[i])) _error_("NaN found in solution vector");
    3942         //      if (values[i]<pow(10,-10))values[i]=pow(10,-10); //correcting the water column to positive values
     3936                //if (values[i]<pow(10,-10))values[i]=pow(10,-10); //correcting the water column to positive values
    39433937 
    39443938        }
  • issm/trunk/src/c/objects/IoModel.cpp

    r8551 r8561  
    226226        IoModelFetchData(&this->numforcings,iomodel_handle,"numforcings");
    227227       
    228     /*!Get hydrology parameters: */
    229         //      IoModelFetchData(&this->hydro_gamma,iomodel_handle,"hydro_gamma");
     228        /*!Get hydrology parameters: */
    230229        IoModelFetchData(&this->hydro_kn,iomodel_handle,"hydro_kn");
    231230        IoModelFetchData(&this->hydro_p,iomodel_handle,"hydro_p");
     
    233232        IoModelFetchData(&this->hydro_CR,iomodel_handle,"hydro_CR");
    234233        IoModelFetchData(&this->hydro_n,iomodel_handle,"hydro_n");
     234
    235235        /*qmu: */
    236236        if(this->qmu_analysis){
  • issm/trunk/src/c/objects/IoModel.h

    r8549 r8561  
    227227                int     constraintcounter; //keep track of how many constraints are being created in each analysis type
    228228
    229                  /*hydrology parameters: */
    230 //               double hydro_gamma;
    231             double hydro_kn;
    232             double hydro_p;
    233                  double hydro_q;
    234        double hydro_CR;
    235                  double hydro_n;
     229                /*hydrology parameters: */
     230                double hydro_kn;
     231                double hydro_p;
     232                double hydro_q;
     233                double hydro_CR;
     234                double hydro_n;
    236235                 /*}}}*/
    237236                /*Methods: {{{1*/
  • issm/trunk/src/c/objects/Materials/Matpar.cpp

    r8549 r8561  
    3636        double  matpar_thermal_exchange_velocity;
    3737        double  matpar_g;
    38         double  matpar_gamma;
    3938        double  matpar_kn;
    4039
     
    5049        matpar_mixed_layer_capacity=iomodel->mixed_layer_capacity;
    5150        matpar_thermal_exchange_velocity=iomodel->thermal_exchange_velocity;
    52 //      matpar_gamma=iomodel->hydro_gamma;
    5351        matpar_kn=iomodel->hydro_kn;
    5452
     
    6563        this->thermal_exchange_velocity=matpar_thermal_exchange_velocity;
    6664        this->g=matpar_g;
    67         this->gamma=matpar_gamma;
    6865        this->kn=matpar_kn;
    6966        this->hydro_p=iomodel->hydro_p;
     
    9693        printf("   thermal_exchange_velocity: %g\n",thermal_exchange_velocity);
    9794        printf("   g: %g\n",g);
    98         printf("   gamma: %g\n",gamma);
    9995        printf("   kn: %g\n",kn);
    10096        return;
     
    117113        printf("   thermal_exchange_velocity: %g\n",thermal_exchange_velocity);
    118114        printf("   g: %g\n",g);
    119         printf("   gamma: %g\n",gamma);
    120115        printf("   kn: %g\n",kn);
    121116        return;
     
    159154        memcpy(marshalled_dataset,&thermal_exchange_velocity,sizeof(thermal_exchange_velocity));marshalled_dataset+=sizeof(thermal_exchange_velocity);
    160155        memcpy(marshalled_dataset,&g,sizeof(g));marshalled_dataset+=sizeof(g);
    161         memcpy(marshalled_dataset,&gamma,sizeof(gamma));marshalled_dataset+=sizeof(gamma);
    162156        memcpy(marshalled_dataset,&kn,sizeof(kn));marshalled_dataset+=sizeof(kn);
    163157
     
    181175                sizeof(thermal_exchange_velocity)+
    182176                sizeof(g)+
    183                 sizeof(gamma)+
    184177                sizeof(kn)+
    185178                sizeof(int); //sizeof(int) for enum type
     
    209202        memcpy(&thermal_exchange_velocity,marshalled_dataset,sizeof(thermal_exchange_velocity));marshalled_dataset+=sizeof(thermal_exchange_velocity);
    210203        memcpy(&g,marshalled_dataset,sizeof(g));marshalled_dataset+=sizeof(g);
    211         memcpy(&gamma,marshalled_dataset,sizeof(gamma));marshalled_dataset+=sizeof(gamma);
    212204        memcpy(&kn,marshalled_dataset,sizeof(kn));marshalled_dataset+=sizeof(kn);
    213205
     
    393385double Matpar::GetThermalExchangeVelocity(){
    394386        return thermal_exchange_velocity;
    395 }
    396 /*}}}1*/
    397 /*FUNCTION Matpar::GetGamma {{{1*/
    398 double Matpar::GetGamma(){
    399         return gamma;
    400387}
    401388/*}}}1*/
  • issm/trunk/src/c/objects/Materials/Matpar.h

    r8549 r8561  
    3030                /*hydrology: */
    3131                double  kn;
    32                 double  gamma;
    3332                double  hydro_p;
    3433                double  hydro_q;
    35       double  hydro_CR;
     34                double  hydro_CR;
    3635                double  hydro_n;
     36
    3737        public:
    38 
    3938                Matpar();
    40        
    4139                Matpar(int matpar_id, IoModel* iomodel);
    4240                ~Matpar();
     
    8381                double GetMeltingPoint();
    8482                double GetReferenceTemperature();
    85                 double GetGamma();
    8683                double GetKn();
    8784                double GetHydroP();
    8885                double GetHydroQ();
    89       double GetHydroCR();
    90       double GetHydroN();
     86                double GetHydroCR();
     87                double GetHydroN();
    9188                double TMeltingPoint(double pressure);
    9289                double PureIceEnthalpy(double pressure);
  • issm/trunk/src/c/solutions/hydrology_core.cpp

    r8549 r8561  
    4646                time=(i+1)*dt;
    4747
    48 //              printf("time step=%d=============================\n",i+1);//bk
    4948                /*call hydrology_core step: */
    5049                hydrology_core_step(femmodel,i,time);
Note: See TracChangeset for help on using the changeset viewer.