Changeset 926


Ignore:
Timestamp:
06/11/09 16:45:42 (16 years ago)
Author:
Mathieu Morlighem
Message:

fixed melting

File:
1 edited

Legend:

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

    r803 r926  
    309309void  Pengrid::PenaltyCreateKMatrixMelting(Mat Kgg,void* vinputs,double kmax,int analysis_type,int sub_analysis_type){
    310310
     311
    311312        int found=0;
    312313        const int numgrids=1;
     
    325326        ParameterInputs* inputs=NULL;
    326327
     328        /*check that pengrid is not a clone (penalty to be added only once)*/
     329        if (node->IsClone()) return;
     330
    327331        /*recover pointers: */
    328332        inputs=(ParameterInputs*)vinputs;
     
    345349        if (temperature<t_pmp){ //If T<Tpmp, there must be no melting. Therefore, melting should be  constrained to 0 when T<Tpmp, instead of using spcs, use penalties
    346350                Ke[0][0]=kmax*pow(10,penalty_offset);
     351                if (id==65){
     352                        printf("Ke_terms[0] = %10.10lf\n",Ke[0]);
     353                        printf("penalty_offset(K) = %g\n",penalty_offset);
     354                        printf("kmax = %10.10lf\n",kmax);
     355                }
    347356        }
    348357       
     
    458467        ParameterInputs* inputs=NULL;
    459468
     469        /*check that pengrid is not a clone (penalty to be added only once)*/
     470        if (node->IsClone()) return;
     471
    460472        /*recover pointers: */
    461473        inputs=(ParameterInputs*)vinputs;
     
    495507                if (sub_analysis_type==SteadyAnalysisEnum()){
    496508                        P_terms[0]=melting_offset*pow(10,penalty_offset)*(temperature-t_pmp);
     509                        if (id==65){
     510                                printf("penalty_offset(P) = %g\n",penalty_offset);
     511                                printf("melting_offset(P) = %10.10lf\n",melting_offset);
     512                                printf("P_terms[0] = %10.10lf\n",P_terms[0]);
     513                        }
    497514                }
    498515                else{
     
    553570        ParameterInputs* inputs=NULL;
    554571
     572        /*check that pengrid is not a clone (penalty to be added only once)*/
     573        if (node->IsClone()){
     574                unstable=0;
     575                *punstable=unstable;
     576                return;
     577        }
     578
    555579        /*recover pointers: */
    556580        inputs=(ParameterInputs*)vinputs;
    557 
    558581
    559582        //First recover beta, pressure and temperature vectors;
Note: See TracChangeset for help on using the changeset viewer.