Changeset 15641


Ignore:
Timestamp:
07/26/13 10:51:28 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: minor cosmetics

Location:
issm/trunk-jpl/src/c/classes/Elements
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Elements/Penta.cpp

    r15636 r15641  
    80838083        if(!isfront) return NULL;
    80848084
    8085         /*Fetch number of nodes and dof for this finite element*/
    8086         int         numnodes = this->NumberofNodes();
    8087         int         numdof   = numnodes*NDOF2;
     8085        /*Intermediaries*/
    80888086        IssmDouble  rho_ice,rho_water,gravity;
    80898087        IssmDouble  Jdet,surface,z_g,water_pressure,ice_pressure,air_pressure;
    80908088        IssmDouble  surface_under_water,base_under_water,pressure;
    8091         GaussPenta*  gauss;
    8092         IssmDouble* basis = xNew<IssmDouble>(numnodes);
    80938089        IssmDouble  xyz_list_front[4][3];
    80948090        IssmDouble  area_coordinates[4][3];
    80958091        IssmDouble  normal[3];
    8096 
     8092        GaussPenta* gauss;
     8093
     8094        /*Fetch number of nodes and dof for this finite element*/
     8095        int numnodes = this->NumberofNodes();
     8096        int numdof   = numnodes*NDOF2;
     8097
     8098        /*Initialize Element vector and other vectors*/
    80978099        GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
    8098         ElementVector* pe=new ElementVector(nodes,numnodes,this->parameters,HOApproximationEnum);
     8100        ElementVector* pe    = new ElementVector(nodes,numnodes,this->parameters,HOApproximationEnum);
     8101        IssmDouble*    basis = xNew<IssmDouble>(numnodes);
     8102
     8103        /*Retrieve all inputs and parameters*/
    80998104        Input* surface_input=inputs->GetInput(SurfaceEnum); _assert_(surface_input);
    81008105        rho_water=matpar->GetRhoWater();
     
    81058110        GetQuadNormal(&normal[0],xyz_list_front);
    81068111
    8107         /*Start looping on Gaussian points*/
     8112        /*Initialize gauss points*/
    81088113        IssmDouble zmax=xyz_list[0][2]; for(int i=1;i<6;i++) if(xyz_list[i][2]>zmax) zmax=xyz_list[i][2];
    81098114        IssmDouble zmin=xyz_list[0][2]; for(int i=1;i<6;i++) if(xyz_list[i][2]<zmin) zmin=xyz_list[i][2];
     
    81118116        else                 gauss=new GaussPenta(area_coordinates,3,3);
    81128117
     8118        /* Start  looping on the number of gaussian points: */
    81138119        for(int ig=gauss->begin();ig<gauss->end();ig++){
    81148120
     
    81198125                GetQuadJacobianDeterminant(&Jdet,xyz_list_front,gauss);
    81208126
    8121                 water_pressure=rho_water*gravity*min(0.,z_g);//0 if the gaussian point is above water level
    8122                 ice_pressure=rho_ice*gravity*(surface-z_g);
    8123                 air_pressure=0;
    8124                 pressure = ice_pressure + water_pressure + air_pressure;
     8127                water_pressure = rho_water*gravity*min(0.,z_g);//0 if the gaussian point is above water level
     8128                ice_pressure   = rho_ice*gravity*(surface-z_g);
     8129                air_pressure   = 0;
     8130                pressure       = ice_pressure + water_pressure + air_pressure;
    81258131
    81268132                for (int i=0;i<numnodes;i++){
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r15625 r15641  
    31583158        if(!isfront) return NULL;
    31593159
    3160         /*Fetch number of nodes and dof for this finite element*/
    3161         int         numnodes = this->NumberofNodes();
    3162         int         numdof   = numnodes*NDOF2;
     3160        /*Intermediaries*/
    31633161        IssmDouble  rho_ice,rho_water,gravity;
    31643162        IssmDouble  Jdet,thickness,bed,water_pressure,ice_pressure,air_pressure;
    31653163        IssmDouble  surface_under_water,base_under_water,pressure;
    3166         GaussTria*  gauss;
    3167         IssmDouble* basis = xNew<IssmDouble>(numnodes);
    31683164        IssmDouble  xyz_list_front[2][3];
    31693165        IssmDouble  area_coordinates[2][3];
    31703166        IssmDouble  normal[2];
    31713167
     3168        /*Fetch number of nodes and dof for this finite element*/
     3169        int numnodes = this->NumberofNodes();
     3170        int numdof   = numnodes*NDOF2;
     3171
     3172        /*Initialize Element vector and other vectors*/
    31723173        GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
    3173         ElementVector* pe=new ElementVector(nodes,numnodes,this->parameters,SSAApproximationEnum);
     3174        ElementVector* pe    = new ElementVector(nodes,numnodes,this->parameters,HOApproximationEnum);
     3175        IssmDouble*    basis = xNew<IssmDouble>(numnodes);
     3176
     3177        /*Retrieve all inputs and parameters*/
    31743178        Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
    31753179        Input* bed_input      =inputs->GetInput(BedEnum);       _assert_(bed_input);
    3176         rho_water=matpar->GetRhoWater();
    3177         rho_ice  =matpar->GetRhoIce();
    3178         gravity  =matpar->GetG();
     3180        rho_water = matpar->GetRhoWater();
     3181        rho_ice   = matpar->GetRhoIce();
     3182        gravity   = matpar->GetG();
    31793183        GetZeroLevelsetCoordinates(&xyz_list_front[0][0],xyz_list,MaskIcelevelsetEnum);
    31803184        GetAreaCoordinates(&area_coordinates[0][0],xyz_list_front,xyz_list,2);
     
    31823186
    31833187        /*Start looping on Gaussian points*/
    3184         gauss=new GaussTria(area_coordinates,3);
    3185 
     3188        GaussTria* gauss=new GaussTria(area_coordinates,3);
    31863189        for(int ig=gauss->begin();ig<gauss->end();ig++){
    31873190
     
    31923195                GetNodalFunctions(basis,gauss);
    31933196
    3194                 surface_under_water=min(0.,thickness+bed); // 0 if the top of the glacier is above water level
    3195                 base_under_water=min(0.,bed);              // 0 if the bottom of the glacier is above water level
    3196                 water_pressure=1.0/2.0*gravity*rho_water*(pow(surface_under_water,2) - pow(base_under_water,2));
    3197                 ice_pressure=1.0/2.0*gravity*rho_ice*pow(thickness,2);
    3198                 air_pressure=0;
     3197                surface_under_water = min(0.,thickness+bed); // 0 if the top of the glacier is above water level
     3198                base_under_water    = min(0.,bed);           // 0 if the bottom of the glacier is above water level
     3199                water_pressure = 1.0/2.0*gravity*rho_water*(pow(surface_under_water,2) - pow(base_under_water,2));
     3200                ice_pressure   = 1.0/2.0*gravity*rho_ice*pow(thickness,2);
     3201                air_pressure   = 0;
    31993202                pressure = ice_pressure + water_pressure + air_pressure;
    32003203
Note: See TracChangeset for help on using the changeset viewer.