Changeset 171
- Timestamp:
- 05/01/09 14:44:07 (16 years ago)
- Location:
- issm/trunk/src/c/objects
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Penta.cpp
r137 r171 341 341 /* material data: */ 342 342 double viscosity; //viscosity 343 double oldviscosity; //viscosity 344 double newviscosity; //viscosity 343 345 344 346 /* strain rate: */ 345 347 double epsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/ 348 double oldepsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/ 346 349 347 350 /* matrices: */ … … 367 370 double* velocity_param=NULL; 368 371 double vxvy_list[numgrids][2]; 372 double* oldvelocity_param=NULL; 373 double oldvxvy_list[numgrids][2]; 369 374 double thickness; 370 375 … … 403 408 /*recover extra inputs from users, at current convergence iteration: */ 404 409 velocity_param=ParameterInputsRecover(inputs,"velocity"); 410 oldvelocity_param=ParameterInputsRecover(inputs,"old_velocity"); 405 411 406 412 /* Get node coordinates and dof list: */ … … 427 433 } 428 434 435 /*Initialize oldvxvy_list: */ 436 for(i=0;i<numgrids;i++){ 437 if(oldvelocity_param){ 438 oldvxvy_list[i][0]=oldvelocity_param[doflist[i*numberofdofspernode+0]]; 439 oldvxvy_list[i][1]=oldvelocity_param[doflist[i*numberofdofspernode+1]]; 440 } 441 else{ 442 oldvxvy_list[i][0]=0; 443 oldvxvy_list[i][1]=0; 444 } 445 } 446 429 447 #ifdef _DEBUGELEMENTS_ 430 448 if(my_rank==RANK && id==ELID){ … … 486 504 /*Get strain rate from velocity: */ 487 505 GetStrainRate(&epsilon[0],&vxvy_list[0][0],&xyz_list[0][0],gauss_l1l2l3l4); 506 GetStrainRate(&oldepsilon[0],&oldvxvy_list[0][0],&xyz_list[0][0],gauss_l1l2l3l4); 488 507 489 508 /*Get viscosity: */ 490 509 matice->GetViscosity3d(&viscosity, &epsilon[0]); 510 matice->GetViscosity3d(&oldviscosity, &oldepsilon[0]); 491 511 492 512 /*Get B and Bprime matrices: */ … … 499 519 /*Build the D matrix: we plug the gaussian weight, the thickness, the viscosity, and the jacobian determinant 500 520 onto this scalar matrix, so that we win some computational time: */ 501 D_scalar=viscosity*gauss_weight*Jdet; 521 522 newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity); 523 D_scalar=newviscosity*gauss_weight*Jdet; 502 524 for (i=0;i<5;i++){ 503 525 D[i][i]=D_scalar; … … 510 532 &Ke_gg_gaussian[0][0],0); 511 533 512 /* Add the Ke_gg_gaussian, and optionally Ke_gg_ drag_gaussian onto Ke_gg: */534 /* Add the Ke_gg_gaussian, and optionally Ke_gg_gaussian onto Ke_gg: */ 513 535 for( i=0; i<numdofs; i++){ 514 536 for(j=0;j<numdofs;j++){ … … 594 616 /*If this element is on the bed rock, spawn a Tria element out of the bed triangle, and use it 595 617 * to create the stifness matrix for the base velocity: */ 596 if(onbed){597 tria=SpawnTria(0,1,2); //nodes 0, 1 and 2 for the base598 tria->CreateKMatrixDiagnosticBaseVert(Kgg,inputs, analysis_type);599 delete tria;600 }618 //if(onbed){ 619 // tria=SpawnTria(0,1,2); //nodes 0, 1 and 2 for the base 620 // tria->CreateKMatrixDiagnosticBaseVert(Kgg,inputs, analysis_type); 621 // delete tria; 622 // } 601 623 602 624 /*If this element is on the surface, we have a dynamic boundary condition that applies, as a stiffness … … 1678 1700 /*If we are on the bedrock, spawn a tria on the bedrock, and use it to build the 1679 1701 *diagnostic base vertical stifness: */ 1680 tria=SpawnTria(0,1,2); //nodes 0, 1 and 2 are on the bedrock 1681 tria->CreatePVectorDiagnosticBaseVert(pg,inputs, analysis_type); 1682 delete tria; 1702 if(onbed){ 1703 tria=SpawnTria(0,1,2); //nodes 0, 1 and 2 are on the bedrock 1704 tria->CreatePVectorDiagnosticBaseVert(pg,inputs, analysis_type); 1705 delete tria; 1706 } 1683 1707 1684 1708 /*Now, handle the standard penta element: */ -
issm/trunk/src/c/objects/Tria.cpp
r137 r171 663 663 GetParameterValue(&alpha2, &alpha2_list[0],gauss_l1l2l3); 664 664 665 if (velocity_param){ 666 DL_scalar=alpha2*gauss_weight*Jdet; 667 } 668 else{ 669 DL_scalar=0; 670 } 671 665 DL_scalar=alpha2*gauss_weight*Jdet; 672 666 for (i=0;i<2;i++){ 673 667 DL[i][i]=DL_scalar; … … 2126 2120 &Ke_gg_gaussian[0][0],0); 2127 2121 2122 2128 2123 /* Add the Ke_gg_gaussian, and optionally Ke_gg_drag_gaussian onto Ke_gg: */ 2129 2124 for( i=0; i<numdofs; i++) for(j=0;j<numdofs;j++) Ke_gg[i][j]+=Ke_gg_gaussian[i][j]; … … 2355 2350 /*Get bed slope: */ 2356 2351 GetParameterDerivativeValue(&slope[0], &b[0],&xyz_list[0][0], gauss_l1l2l3); 2357 dbdx= slope[0];2358 dbdy= slope[1];2352 dbdx=-slope[0]; 2353 dbdy=-slope[1]; 2359 2354 2360 2355 /* Get Jacobian determinant: */
Note:
See TracChangeset
for help on using the changeset viewer.