Changeset 18337
- Timestamp:
- 08/06/14 13:22:01 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
r18237 r18337 15 15 16 16 parameters->AddObject(iomodel->CopyConstantObject(FlowequationIsFSEnum)); 17 18 17 parameters->AddObject(iomodel->CopyConstantObject(MasstransportIsfreesurfaceEnum)); 19 18 parameters->AddObject(iomodel->CopyConstantObject(MasstransportHydrostaticAdjustmentEnum)); … … 362 361 &Ke->values[0],1); 363 362 364 if(stabilization==2){ 365 if(dim==1){ 366 vel=fabs(vx)+1.e-8; 367 D[0]=h/(2*vel)*vx*vx; 368 } 369 else{ 370 /*Streamline upwinding*/ 371 vel=sqrt(vx*vx+vy*vy)+1.e-8; 372 D[0*dim+0]=h/(2*vel)*vx*vx; 373 D[1*dim+0]=h/(2*vel)*vy*vx; 374 D[0*dim+1]=h/(2*vel)*vx*vy; 375 D[1*dim+1]=h/(2*vel)*vy*vy; 376 } 377 } 378 else if(stabilization==1){ 379 /*SSA*/ 380 vxaverage_input->GetInputAverage(&vx); 381 if(dim==2) vyaverage_input->GetInputAverage(&vy); 382 D[0*dim+0]=h/2.0*fabs(vx); 383 if(dim==2) D[1*dim+1]=h/2.0*fabs(vy); 363 switch(stabilization){ 364 case 0: 365 /*Nothing to be onde*/ 366 break; 367 case 1: 368 /*SSA*/ 369 vxaverage_input->GetInputAverage(&vx); 370 if(dim==2) vyaverage_input->GetInputAverage(&vy); 371 D[0*dim+0]=h/2.0*fabs(vx); 372 if(dim==2) D[1*dim+1]=h/2.0*fabs(vy); 373 break; 374 case 2: 375 if(dim==1){ 376 vel=fabs(vx)+1.e-8; 377 D[0]=h/(2*vel)*vx*vx; 378 } 379 else{ 380 /*Streamline upwinding*/ 381 vel=sqrt(vx*vx+vy*vy)+1.e-8; 382 D[0*dim+0]=h/(2*vel)*vx*vx; 383 D[1*dim+0]=h/(2*vel)*vy*vx; 384 D[0*dim+1]=h/(2*vel)*vx*vy; 385 D[1*dim+1]=h/(2*vel)*vy*vy; 386 } 387 break; 388 default: 389 _error_("Stabilization "<<stabilization<<" not supported yet"); 384 390 } 385 391 if(stabilization==1 || stabilization==2){
Note:
See TracChangeset
for help on using the changeset viewer.