Changeset 70


Ignore:
Timestamp:
04/27/09 16:50:16 (16 years ago)
Author:
seroussi
Message:

added overshooting in tri

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

Legend:

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

    r46 r70  
    3333
    3434Tria::Tria(int tria_id,int tria_mid,int tria_mparid,int tria_node_ids[3],double tria_h[3],double tria_s[3],double tria_b[3],double tria_k[3],
    35                                 int tria_friction_type,double tria_p,double tria_q,int tria_shelf,double tria_meanvel,double tria_epsvel){
     35                                int tria_friction_type,double tria_p,double tria_q,int tria_shelf,double tria_meanvel,double tria_epsvel,double tria_viscosity_overshoot){
    3636       
    3737        int i;
     
    6060        epsvel=tria_epsvel;
    6161        onbed=1;
     62        viscosity_overshoot=tria_viscosity_overshoot;
    6263       
    6364        return;
     
    8889        printf("   epsvel: %g\n",epsvel);
    8990        printf("   onbed: %i\n",onbed);
     91        printf("   viscosity_overshoot=%g\n",viscosity_overshoot);
    9092        printf("   nodes: \n");
    9193        if(nodes[0])nodes[0]->Echo();
     
    134136        memcpy(marshalled_dataset,&meanvel,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel);
    135137        memcpy(marshalled_dataset,&epsvel,sizeof(epsvel));marshalled_dataset+=sizeof(epsvel);
     138        memcpy(marshalled_dataset,&viscosity_overshoot,sizeof(viscosity_overshoot));marshalled_dataset+=sizeof(viscosity_overshoot);
    136139       
    137140        *pmarshalled_dataset=marshalled_dataset;
     
    161164                +sizeof(meanvel)
    162165                +sizeof(epsvel)
     166                +sizeof(viscosity_overshoot)
    163167                +sizeof(int); //sizeof(int) for enum type
    164168}
     
    200204        memcpy(&meanvel,marshalled_dataset,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel);
    201205        memcpy(&epsvel,marshalled_dataset,sizeof(epsvel));marshalled_dataset+=sizeof(epsvel);
     206        memcpy(&viscosity_overshoot,marshalled_dataset,sizeof(viscosity_overshoot));marshalled_dataset+=sizeof(viscosity_overshoot);
    202207
    203208        /*nodes and materials are not pointing to correct objects anymore:*/
     
    292297        /* material data: */
    293298        double viscosity; //viscosity
     299        double newviscosity; //viscosity
     300        double oldviscosity; //viscosity
    294301       
    295302        /* strain rate: */
    296303        double epsilon[3]; /* epsilon=[exx,eyy,exy];*/
     304        double oldepsilon[3]; /* oldepsilon=[exx,eyy,exy];*/
    297305
    298306        /* matrices: */
     
    318326        /*input parameters for structural analysis (diagnostic): */
    319327        double* velocity_param=NULL;
     328        double* oldvelocity_param=NULL;
    320329        double  vxvy_list[numgrids][2];
     330        double  oldvxvy_list[numgrids][2];
    321331        double  thickness;
    322332
     
    331341        /*recover extra inputs from users, at current convergence iteration: */
    332342        velocity_param=ParameterInputsRecover(inputs,"velocity");
     343        oldvelocity_param=ParameterInputsRecover(inputs,"old_velocity");
    333344
    334345        /* Get node coordinates and dof list: */
     
    338349        /* Set Ke_gg to 0: */
    339350        for(i=0;i<numdofs;i++) for(j=0;j<numdofs;j++) Ke_gg[i][j]=0.0;
    340 
    341351
    342352        /*Initialize vxvy_list: */
     
    349359                        vxvy_list[i][0]=0;
    350360                        vxvy_list[i][1]=0;
     361                }
     362
     363                if(oldvelocity_param){
     364                        oldvxvy_list[i][0]=oldvelocity_param[doflist[i*numberofdofspernode+0]];
     365                        oldvxvy_list[i][1]=oldvelocity_param[doflist[i*numberofdofspernode+1]];
     366                }
     367                else{
     368                        oldvxvy_list[i][0]=0;
     369                        oldvxvy_list[i][1]=0;
    351370                }
    352371        }
     
    443462                /*Get strain rate from velocity: */
    444463                GetStrainRate(&epsilon[0],&vxvy_list[0][0],&xyz_list[0][0],gauss_l1l2l3);
     464                GetStrainRate(&oldepsilon[0],&oldvxvy_list[0][0],&xyz_list[0][0],gauss_l1l2l3);
    445465               
    446466                /*Get viscosity: */
    447467                matice->GetViscosity2d(&viscosity, &epsilon[0]);
     468                matice->GetViscosity2d(&oldviscosity, &oldepsilon[0]);
    448469               
    449470                /* Get Jacobian determinant: */
     
    452473                /* Build the D matrix: we plug the gaussian weight, the thickness, the viscosity, and the jacobian determinant
    453474                   onto this scalar matrix, so that we win some computational time: */
    454                 D_scalar=viscosity*thickness*gauss_weight*Jdet;
     475                newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity);
     476                D_scalar=newviscosity*thickness*gauss_weight*Jdet;
     477
    455478                for (i=0;i<3;i++){
    456479                        D[i][i]=D_scalar;
  • issm/trunk/src/c/objects/Tria.h

    r46 r70  
    4343                double epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
    4444                int    onbed;
     45                double viscosity_overshoot;
    4546       
    4647        public:
     
    4849                Tria();
    4950                Tria(int id,int mid,int mparid,int node_ids[3],double h[3],double s[3],double b[3],double k[3],
    50                                 int friction_type,double p,double q,int shelf,double meanvel,double epsvel);
     51                                int friction_type,double p,double q,int shelf,double meanvel,double epsvel,double viscosity_overshoot);
    5152                ~Tria();
    5253
Note: See TracChangeset for help on using the changeset viewer.