Ignore:
Timestamp:
05/18/09 16:55:54 (16 years ago)
Author:
Eric.Larour
Message:

Finished thermal and melting elemnets, as well as thermal constraints

File:
1 edited

Legend:

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

    r394 r483  
    7272        double  velocity_x[numgrids];
    7373        double  velocity_y[numgrids];
     74        double  velocity_z[numgrids];
    7475        double  velocity_mag[numgrids];
    7576
     
    9091
    9192                //We need the velocity magnitude to evaluate the basal stress:
    92                 velocity_x[i]=*(friction->velocities+2*i+0); //velocities of size numgridsx2
    93                 velocity_y[i]=*(friction->velocities+2*i+1);
    94                 velocity_mag[i]=sqrt(pow(velocity_x[i],2)+pow(velocity_y[i],2));
     93                if(strcmp(friction->element_type,"2d")){
     94                        velocity_x[i]=*(friction->velocities+2*i+0); //velocities of size numgridsx2
     95                        velocity_y[i]=*(friction->velocities+2*i+1);
     96                        velocity_mag[i]=sqrt(pow(velocity_x[i],2)+pow(velocity_y[i],2));
     97                }
     98                else{
     99                        velocity_x[i]=*(friction->velocities+3*i+0); //velocities of size numgridsx3
     100                        velocity_y[i]=*(friction->velocities+3*i+1);
     101                        velocity_z[i]=*(friction->velocities+3*i+2);
     102                        velocity_mag[i]=sqrt(pow(velocity_x[i],2)+pow(velocity_y[i],2)+pow(velocity_z[i],2));
     103                }
    95104       
    96105                alpha2[i]=pow(friction->K[i],2)*pow(Neff[i],r)*pow(velocity_mag[i],(s-1));
Note: See TracChangeset for help on using the changeset viewer.