Changeset 8657 for issm/trunk/src/c/objects/Loads/Friction.cpp
- Timestamp:
- 06/17/11 13:20:05 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Loads/Friction.cpp
r8654 r8657 71 71 double alpha2; 72 72 73 74 73 /*Recover parameters: */ 75 74 inputs->GetParameterValue(&drag_p,DragPEnum); … … 136 135 double alpha2; 137 136 138 139 137 /*Recover parameters: */ 140 138 inputs->GetParameterValue(&drag_p,DragPEnum); … … 185 183 } 186 184 /*}}}*/ 187 /*FUNCTION Friction::GetAlphaComplement(double* palpha_complement, GaussTria* gauss,int vxenum,int vyenum ) {{{1*/188 void Friction::GetAlphaComplement(double* palpha_complement, GaussTria* gauss,int vxenum,int vyenum ){185 /*FUNCTION Friction::GetAlphaComplement(double* palpha_complement, GaussTria* gauss,int vxenum,int vyenum,int vzenum) {{{1*/ 186 void Friction::GetAlphaComplement(double* palpha_complement, GaussTria* gauss,int vxenum,int vyenum,int vzenum){ 189 187 190 188 /* FrictionGetAlpha2 computes alpha2= drag^2 * Neff ^r * vel ^s, with Neff=rho_ice*g*thickness+rho_ice*g*bed, r=q/p and s=1/p. … … 194 192 /*diverse: */ 195 193 int i; 194 double r,s; 195 double vx,vy,vz,vmag; 196 double drag_p,drag_q; 196 197 double Neff; 197 double r,s;198 double vx;199 double vy;200 double vmag;201 double drag_p,drag_q;202 198 double drag_coefficient; 203 199 double bed,thickness; … … 217 213 rho_water=matpar->GetRhoWater(); 218 214 219 220 215 //compute r and q coefficients: */ 221 216 r=drag_q/drag_p; … … 232 227 233 228 //We need the velocity magnitude to evaluate the basal stress: 234 this->GetParameterValue(&vx, gauss,vxenum); 235 this->GetParameterValue(&vy, gauss,vyenum); 236 vmag=sqrt(pow(vx,2)+pow(vy,2)); 229 if(strcmp(element_type,"2d")==0){ 230 this->GetParameterValue(&vx, gauss,vxenum); 231 this->GetParameterValue(&vy, gauss,vyenum); 232 vmag=sqrt(pow(vx,2)+pow(vy,2)); 233 } 234 else if (strcmp(element_type,"3d")==0){ 235 this->GetParameterValue(&vx, gauss,vxenum); 236 this->GetParameterValue(&vy, gauss,vyenum); 237 this->GetParameterValue(&vz, gauss,vzenum); 238 vmag=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2)); 239 } 240 else _error_("element_type %s not supported yet",element_type); 237 241 238 242 /*Checks that s-1>0 if v=0*/ … … 245 249 } 246 250 /*}}}*/ 247 /*FUNCTION Friction::GetAlphaComplement(double* palpha_complement, GaussPenta* gauss,int vxenum,int vyenum ) {{{1*/248 void Friction::GetAlphaComplement(double* palpha_complement, GaussPenta* gauss,int vxenum,int vyenum ){251 /*FUNCTION Friction::GetAlphaComplement(double* palpha_complement, GaussPenta* gauss,int vxenum,int vyenum,int vzenum) {{{1*/ 252 void Friction::GetAlphaComplement(double* palpha_complement, GaussPenta* gauss,int vxenum,int vyenum,int vzenum){ 249 253 250 254 /* FrictionGetAlpha2 computes alpha2= drag^2 * Neff ^r * vel ^s, with Neff=rho_ice*g*thickness+rho_ice*g*bed, r=q/p and s=1/p. … … 254 258 /*diverse: */ 255 259 int i; 260 double r,s; 261 double vx,vy,vz,vmag; 262 double drag_p,drag_q; 256 263 double Neff; 257 double r,s;258 double vx;259 double vy;260 double vmag;261 double drag_p,drag_q;262 264 double drag_coefficient; 263 265 double bed,thickness; … … 277 279 rho_water=matpar->GetRhoWater(); 278 280 279 280 281 //compute r and q coefficients: */ 281 282 r=drag_q/drag_p; … … 292 293 293 294 //We need the velocity magnitude to evaluate the basal stress: 294 this->GetParameterValue(&vx, gauss,vxenum); 295 this->GetParameterValue(&vy, gauss,vyenum); 296 vmag=sqrt(pow(vx,2)+pow(vy,2)); 295 if(strcmp(element_type,"2d")==0){ 296 this->GetParameterValue(&vx, gauss,vxenum); 297 this->GetParameterValue(&vy, gauss,vyenum); 298 vmag=sqrt(pow(vx,2)+pow(vy,2)); 299 } 300 else if (strcmp(element_type,"3d")==0){ 301 this->GetParameterValue(&vx, gauss,vxenum); 302 this->GetParameterValue(&vy, gauss,vyenum); 303 this->GetParameterValue(&vz, gauss,vzenum); 304 vmag=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2)); 305 } 306 else _error_("element_type %s not supported yet",element_type); 297 307 298 308 /*Checks that s-1>0 if v=0*/
Note:
See TracChangeset
for help on using the changeset viewer.