Changeset 15641
- Timestamp:
- 07/26/13 10:51:28 (12 years ago)
- 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 8083 8083 if(!isfront) return NULL; 8084 8084 8085 /*Fetch number of nodes and dof for this finite element*/ 8086 int numnodes = this->NumberofNodes(); 8087 int numdof = numnodes*NDOF2; 8085 /*Intermediaries*/ 8088 8086 IssmDouble rho_ice,rho_water,gravity; 8089 8087 IssmDouble Jdet,surface,z_g,water_pressure,ice_pressure,air_pressure; 8090 8088 IssmDouble surface_under_water,base_under_water,pressure; 8091 GaussPenta* gauss;8092 IssmDouble* basis = xNew<IssmDouble>(numnodes);8093 8089 IssmDouble xyz_list_front[4][3]; 8094 8090 IssmDouble area_coordinates[4][3]; 8095 8091 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*/ 8097 8099 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*/ 8099 8104 Input* surface_input=inputs->GetInput(SurfaceEnum); _assert_(surface_input); 8100 8105 rho_water=matpar->GetRhoWater(); … … 8105 8110 GetQuadNormal(&normal[0],xyz_list_front); 8106 8111 8107 /* Start looping on Gaussianpoints*/8112 /*Initialize gauss points*/ 8108 8113 IssmDouble zmax=xyz_list[0][2]; for(int i=1;i<6;i++) if(xyz_list[i][2]>zmax) zmax=xyz_list[i][2]; 8109 8114 IssmDouble zmin=xyz_list[0][2]; for(int i=1;i<6;i++) if(xyz_list[i][2]<zmin) zmin=xyz_list[i][2]; … … 8111 8116 else gauss=new GaussPenta(area_coordinates,3,3); 8112 8117 8118 /* Start looping on the number of gaussian points: */ 8113 8119 for(int ig=gauss->begin();ig<gauss->end();ig++){ 8114 8120 … … 8119 8125 GetQuadJacobianDeterminant(&Jdet,xyz_list_front,gauss); 8120 8126 8121 water_pressure =rho_water*gravity*min(0.,z_g);//0 if the gaussian point is above water level8122 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; 8125 8131 8126 8132 for (int i=0;i<numnodes;i++){ -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r15625 r15641 3158 3158 if(!isfront) return NULL; 3159 3159 3160 /*Fetch number of nodes and dof for this finite element*/ 3161 int numnodes = this->NumberofNodes(); 3162 int numdof = numnodes*NDOF2; 3160 /*Intermediaries*/ 3163 3161 IssmDouble rho_ice,rho_water,gravity; 3164 3162 IssmDouble Jdet,thickness,bed,water_pressure,ice_pressure,air_pressure; 3165 3163 IssmDouble surface_under_water,base_under_water,pressure; 3166 GaussTria* gauss;3167 IssmDouble* basis = xNew<IssmDouble>(numnodes);3168 3164 IssmDouble xyz_list_front[2][3]; 3169 3165 IssmDouble area_coordinates[2][3]; 3170 3166 IssmDouble normal[2]; 3171 3167 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*/ 3172 3173 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*/ 3174 3178 Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input); 3175 3179 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(); 3179 3183 GetZeroLevelsetCoordinates(&xyz_list_front[0][0],xyz_list,MaskIcelevelsetEnum); 3180 3184 GetAreaCoordinates(&area_coordinates[0][0],xyz_list_front,xyz_list,2); … … 3182 3186 3183 3187 /*Start looping on Gaussian points*/ 3184 gauss=new GaussTria(area_coordinates,3); 3185 3188 GaussTria* gauss=new GaussTria(area_coordinates,3); 3186 3189 for(int ig=gauss->begin();ig<gauss->end();ig++){ 3187 3190 … … 3192 3195 GetNodalFunctions(basis,gauss); 3193 3196 3194 surface_under_water =min(0.,thickness+bed); // 0 if the top of the glacier is above water level3195 base_under_water =min(0.,bed);// 0 if the bottom of the glacier is above water level3196 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; 3199 3202 pressure = ice_pressure + water_pressure + air_pressure; 3200 3203
Note:
See TracChangeset
for help on using the changeset viewer.