Changeset 171


Ignore:
Timestamp:
05/01/09 14:44:07 (16 years ago)
Author:
seroussi
Message:

fixed Pattyn to be similar in cielo and ice

Location:
issm/trunk/src/c/objects
Files:
2 edited

Legend:

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

    r137 r171  
    341341        /* material data: */
    342342        double viscosity; //viscosity
     343        double oldviscosity; //viscosity
     344        double newviscosity; //viscosity
    343345
    344346        /* strain rate: */
    345347        double epsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
     348        double oldepsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
    346349
    347350        /* matrices: */
     
    367370        double* velocity_param=NULL;
    368371        double  vxvy_list[numgrids][2];
     372        double* oldvelocity_param=NULL;
     373        double  oldvxvy_list[numgrids][2];
    369374        double  thickness;
    370375
     
    403408                /*recover extra inputs from users, at current convergence iteration: */
    404409                velocity_param=ParameterInputsRecover(inputs,"velocity");
     410                oldvelocity_param=ParameterInputsRecover(inputs,"old_velocity");
    405411
    406412                /* Get node coordinates and dof list: */
     
    427433                }
    428434                       
     435                /*Initialize oldvxvy_list: */
     436                for(i=0;i<numgrids;i++){
     437                        if(oldvelocity_param){
     438                                oldvxvy_list[i][0]=oldvelocity_param[doflist[i*numberofdofspernode+0]];
     439                                oldvxvy_list[i][1]=oldvelocity_param[doflist[i*numberofdofspernode+1]];
     440                        }
     441                        else{
     442                                oldvxvy_list[i][0]=0;
     443                                oldvxvy_list[i][1]=0;
     444                        }
     445                }
     446
    429447                #ifdef _DEBUGELEMENTS_
    430448                if(my_rank==RANK && id==ELID){
     
    486504                                /*Get strain rate from velocity: */
    487505                                GetStrainRate(&epsilon[0],&vxvy_list[0][0],&xyz_list[0][0],gauss_l1l2l3l4);
     506                                GetStrainRate(&oldepsilon[0],&oldvxvy_list[0][0],&xyz_list[0][0],gauss_l1l2l3l4);
    488507                       
    489508                                /*Get viscosity: */
    490509                                matice->GetViscosity3d(&viscosity, &epsilon[0]);
     510                                matice->GetViscosity3d(&oldviscosity, &oldepsilon[0]);
    491511
    492512                                /*Get B and Bprime matrices: */
     
    499519                                /*Build the D matrix: we plug the gaussian weight, the thickness, the viscosity, and the jacobian determinant
    500520                                  onto this scalar matrix, so that we win some computational time: */
    501                                 D_scalar=viscosity*gauss_weight*Jdet;
     521                               
     522                                newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity);
     523                                D_scalar=newviscosity*gauss_weight*Jdet;
    502524                                for (i=0;i<5;i++){
    503525                                        D[i][i]=D_scalar;
     
    510532                                                &Ke_gg_gaussian[0][0],0);
    511533
    512                                 /* Add the Ke_gg_gaussian, and optionally Ke_gg_drag_gaussian onto Ke_gg: */
     534                                /* Add the Ke_gg_gaussian, and optionally Ke_gg_gaussian onto Ke_gg: */
    513535                                for( i=0; i<numdofs; i++){
    514536                                        for(j=0;j<numdofs;j++){
     
    594616        /*If this element is on the bed rock, spawn a Tria element out of the bed triangle, and use it
    595617         * to create the stifness matrix for the base velocity: */
    596         if(onbed){
    597                 tria=SpawnTria(0,1,2); //nodes 0, 1 and 2 for the base
    598                 tria->CreateKMatrixDiagnosticBaseVert(Kgg,inputs, analysis_type);
    599                 delete tria;
    600         }
     618        //if(onbed){
     619//              tria=SpawnTria(0,1,2); //nodes 0, 1 and 2 for the base
     620//              tria->CreateKMatrixDiagnosticBaseVert(Kgg,inputs, analysis_type);
     621//              delete tria;
     622//      }
    601623
    602624        /*If this element  is on the surface, we have a dynamic boundary condition that applies, as a stiffness
     
    16781700        /*If we are on the bedrock, spawn a tria on the bedrock, and use it to build the
    16791701         *diagnostic base vertical stifness: */
    1680         tria=SpawnTria(0,1,2); //nodes 0, 1 and 2 are on the bedrock
    1681         tria->CreatePVectorDiagnosticBaseVert(pg,inputs, analysis_type);
    1682         delete tria;
     1702        if(onbed){
     1703                tria=SpawnTria(0,1,2); //nodes 0, 1 and 2 are on the bedrock
     1704                tria->CreatePVectorDiagnosticBaseVert(pg,inputs, analysis_type);
     1705                delete tria;
     1706        }
    16831707
    16841708        /*Now, handle the standard penta element: */
  • issm/trunk/src/c/objects/Tria.cpp

    r137 r171  
    663663                GetParameterValue(&alpha2, &alpha2_list[0],gauss_l1l2l3);
    664664
    665                 if (velocity_param){
    666                         DL_scalar=alpha2*gauss_weight*Jdet;
    667                 }
    668                 else{
    669                         DL_scalar=0;
    670                 }
    671                        
     665                DL_scalar=alpha2*gauss_weight*Jdet;
    672666                for (i=0;i<2;i++){
    673667                        DL[i][i]=DL_scalar;
     
    21262120                                        &Ke_gg_gaussian[0][0],0);
    21272121
     2122               
    21282123                /* Add the Ke_gg_gaussian, and optionally Ke_gg_drag_gaussian onto Ke_gg: */
    21292124                for( i=0; i<numdofs; i++) for(j=0;j<numdofs;j++) Ke_gg[i][j]+=Ke_gg_gaussian[i][j];
     
    23552350                /*Get bed slope: */
    23562351                GetParameterDerivativeValue(&slope[0], &b[0],&xyz_list[0][0], gauss_l1l2l3);
    2357                 dbdx=slope[0];
    2358                 dbdy=slope[1];
     2352                dbdx=-slope[0];
     2353                dbdy=-slope[1];
    23592354
    23602355                /* Get Jacobian determinant: */
Note: See TracChangeset for help on using the changeset viewer.