Changeset 10277
- Timestamp:
- 10/24/11 16:04:31 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Tria.cpp
r10143 r10277 501 501 int stabilization; 502 502 int i,j,ig,dim; 503 double Jdettria,DL_scalar,dt ;504 double v x,vy,dvxdx,dvydy;503 double Jdettria,DL_scalar,dt,h; 504 double vel,vx,vy,dvxdx,dvydy; 505 505 double dvx[2],dvy[2]; 506 506 double v_gauss[2]={0.0}; … … 533 533 vyaverage_input=inputs->GetInput(VyAverageEnum); _assert_(vyaverage_input); 534 534 } 535 536 //Create Artificial diffusivity once for all if requested 537 if(stabilization==1){ 538 gauss=new GaussTria(); 539 gauss->GaussCenter(); 540 GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss); 541 delete gauss; 542 543 vxaverage_input->GetInputAverage(&v_gauss[0]); 544 vyaverage_input->GetInputAverage(&v_gauss[1]); 545 546 K[0][0]=pow(Jdettria,(double).5)/2.0*fabs(v_gauss[0]); 547 K[1][1]=pow(Jdettria,(double).5)/2.0*fabs(v_gauss[1]); 548 } 535 h=sqrt(2*this->GetArea()); 549 536 550 537 /* Start looping on the number of gaussian points: */ … … 591 578 &Ke->values[0],1); 592 579 593 if(stabilization==1){ 580 if(stabilization==2){ 581 /*Streamline upwinding*/ 582 vel=sqrt(pow(vx,2.)+pow(vy,2.)); 583 K[0][0]=h/(2*vel)*vx*vx; 584 K[1][0]=h/(2*vel)*vy*vx; 585 K[0][1]=h/(2*vel)*vx*vy; 586 K[1][1]=h/(2*vel)*vy*vy; 587 } 588 else if(stabilization==1){ 589 /*MacAyeal*/ 590 vxaverage_input->GetInputAverage(&vx); 591 vyaverage_input->GetInputAverage(&vy); 592 K[0][0]=h/2.0*fabs(vx) /sqrt(2*sqrt(3)); // the second part should not be there 593 K[0][1]=0.; 594 K[1][0]=0.; 595 K[1][1]=h/2.0*fabs(vy) /sqrt(2*sqrt(3)); // the second part should not be there 596 } 597 if(stabilization==1 || stabilization==2){ 594 598 KDL[0][0]=DL_scalar*K[0][0]; 599 KDL[1][0]=DL_scalar*K[1][0]; 600 KDL[0][1]=DL_scalar*K[0][1]; 595 601 KDL[1][1]=DL_scalar*K[1][1]; 596 597 602 TripleMultiply( &Bprime[0][0],2,numdof,1, 598 603 &KDL[0][0],2,2,0, … … 1078 1083 x3=xyz_list[2][0]; y3=xyz_list[2][1]; 1079 1084 1085 _assert_(x2*y3 - y2*x3 + x1*y2 - y1*x2 + x3*y1 - y3*x1>0); 1080 1086 return (x2*y3 - y2*x3 + x1*y2 - y1*x2 + x3*y1 - y3*x1)/2; 1081 1087 }
Note:
See TracChangeset
for help on using the changeset viewer.