Changeset 5934
- Timestamp:
- 09/21/10 16:58:02 (15 years ago)
- Location:
- issm/trunk/src/c/objects/Elements
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Penta.cpp
r5933 r5934 2371 2371 ElementMatrix* Penta::CreateKMatrixDiagnosticPattynViscous(void){ 2372 2372 2373 /* local declarations */ 2374 const int numdof=2*NUMVERTICES; 2375 int i,j,ig; 2376 double xyz_list[NUMVERTICES][3]; 2373 /*Constants*/ 2374 const int numdof=NDOF2*NUMVERTICES; 2375 2376 /*Intermediaries */ 2377 int i,j,ig; 2378 double xyz_list[NUMVERTICES][3]; 2379 double Jdet; 2380 double viscosity,oldviscosity,newviscosity,viscosity_overshoot; //viscosity 2381 double epsilon[5],oldepsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/ 2382 double D_scalar; 2383 double D[5][5]={0.0}; // material matrix, simple scalar matrix. 2384 double B[5][numdof]; 2385 double Bprime[5][numdof]; 2386 double Ke_gg_gaussian[numdof][numdof]; //stiffness matrix evaluated at the gaussian point. 2387 Tria* tria=NULL; 2377 2388 GaussPenta *gauss=NULL; 2378 double viscosity; //viscosity2379 double oldviscosity; //viscosity2380 double newviscosity; //viscosity2381 double viscosity_overshoot;2382 double epsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/2383 double oldepsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/2384 double B[5][numdof];2385 double Bprime[5][numdof];2386 double L[2][numdof];2387 double D[5][5]={0.0}; // material matrix, simple scalar matrix.2388 double D_scalar;2389 double DL[2][2]={0.0}; //for basal drag2390 double DL_scalar;2391 double Ke_gg[numdof][numdof]={0.0}; //local element stiffness matrix2392 double Ke_gg_gaussian[numdof][numdof]; //stiffness matrix evaluated at the gaussian point.2393 double Jdet;2394 double slope[2]={0.0};2395 double slope_magnitude;2396 double alpha2_list[3];2397 double alpha2;2398 double MAXSLOPE=.06; // 6 %2399 double MOUNTAINKEXPONENT=10;2400 Tria* tria=NULL;2401 2389 2402 2390 /*Initialize Element matrix and return if necessary*/ … … 2418 2406 gauss->GaussPoint(ig); 2419 2407 2408 GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss); 2409 GetBPattyn(&B[0][0], &xyz_list[0][0], gauss); 2410 GetBprimePattyn(&Bprime[0][0], &xyz_list[0][0], gauss); 2411 2420 2412 this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input); 2421 2413 this->GetStrainRate3dPattyn(&oldepsilon[0],&xyz_list[0][0],gauss,vxold_input,vyold_input); 2422 2414 matice->GetViscosity3d(&viscosity, &epsilon[0]); 2423 2415 matice->GetViscosity3d(&oldviscosity, &oldepsilon[0]); 2424 2425 GetBPattyn(&B[0][0], &xyz_list[0][0], gauss);2426 GetBprimePattyn(&Bprime[0][0], &xyz_list[0][0], gauss);2427 2428 GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);2429 2416 2430 2417 newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity); … … 2495 2482 ElementMatrix* Penta::CreateKMatrixDiagnosticStokesViscous(void){ 2496 2483 2497 const int numdof=NUMVERTICES*NDOF4;2498 int i,j;2499 int ig;2484 /*Intermediaries */ 2485 int i,j,ig,approximation; 2486 double Jdet,viscosity,stokesreconditioning; 2500 2487 double xyz_list[NUMVERTICES][3]; 2501 double xyz_list_tria[NUMVERTICES2D][3]; 2502 double bed_normal[3]; 2503 double Ke_temp[27][27]={0.0}; //for the six nodes and the bubble 2504 double Ke_reduced[numdof][numdof]; //for the six nodes only 2505 double Ke_gaussian[27][27]; 2488 double epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/ 2506 2489 double B[8][27]; 2507 2490 double B_prime[8][27]; 2508 double Jdet;2491 double D_scalar; 2509 2492 double D[8][8]={0.0}; 2510 double D_scalar;2511 double DLStokes[14][14]={0.0};2493 double Ke_temp[27][27]={0.0}; //for the six nodes and the bubble 2494 double Ke_gaussian[27][27]; 2512 2495 GaussPenta *gauss=NULL; 2513 double epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/2514 double viscosity;2515 double alpha2_gauss;2516 Friction* friction=NULL;2517 double stokesreconditioning;2518 int analysis_type;2519 int approximation;2520 2496 2521 2497 /*If on water or not Stokes, skip stiffness: */ … … 2526 2502 /*Retrieve all inputs and parameters*/ 2527 2503 GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES); 2528 parameters->FindParam(&analysis_type,AnalysisTypeEnum);2529 2504 parameters->FindParam(&stokesreconditioning,StokesReconditioningEnum); 2530 2505 Input* vx_input=inputs->GetInput(VxEnum); ISSMASSERT(vx_input); … … 2538 2513 gauss->GaussPoint(ig); 2539 2514 2515 GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss); 2516 GetBStokes(&B[0][0],&xyz_list[0][0],gauss); 2517 GetBprimeStokes(&B_prime[0][0],&xyz_list[0][0],gauss); 2518 2540 2519 this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input); 2541 2520 matice->GetViscosity3dStokes(&viscosity,&epsilon[0]); 2542 2521 2543 GetBStokes(&B[0][0],&xyz_list[0][0],gauss);2544 GetBprimeStokes(&B_prime[0][0],&xyz_list[0][0],gauss);2545 2546 GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);2547 2548 /* Build the D matrix: we plug the gaussian weight, the thickness, the viscosity, and the jacobian determinant2549 * onto this scalar matrix, so that we win some computational time: */2550 2522 D_scalar=gauss->weight*Jdet; 2551 2523 for (i=0;i<6;i++) D[i][i]=D_scalar*2*viscosity; … … 2571 2543 ElementMatrix* Penta::CreateKMatrixDiagnosticStokesFriction(void){ 2572 2544 2545 /*Constants*/ 2573 2546 const int numdof=NUMVERTICES*NDOF4; 2574 2547 const int numdof2d=NUMVERTICES2D*NDOF4; 2575 int i,j; 2576 int ig; 2548 2549 /*Intermediaries */ 2550 int i,j,ig; 2551 int analysis_type,approximation; 2552 double stokesreconditioning; 2553 double viscosity,alpha2_gauss,Jdet2d; 2554 double bed_normal[3]; 2555 double epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/ 2577 2556 double xyz_list[NUMVERTICES][3]; 2578 2557 double xyz_list_tria[NUMVERTICES2D][3]; 2579 double bed_normal[3];2580 double Ke_temp[27][27]={0.0}; //for the six nodes and the bubble2581 double Ke_reduced[numdof][numdof]; //for the six nodes only2582 double Ke_gaussian[27][27];2583 double Ke_drag_gaussian[numdof2d][numdof2d];2584 double B[8][27];2585 double B_prime[8][27];2586 2558 double LStokes[14][numdof2d]; 2587 2559 double LprimeStokes[14][numdof2d]; 2588 double Jdet;2589 double Jdet2d;2590 double D[8][8]={0.0};2591 double D_scalar;2592 2560 double DLStokes[14][14]={0.0}; 2561 double Ke_temp[27][27]={0.0}; //for the six nodes and the bubble 2562 double Ke_drag_gaussian[numdof2d][numdof2d]; 2563 Friction* friction=NULL; 2593 2564 GaussPenta *gauss=NULL; 2594 double epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/2595 double viscosity;2596 double alpha2_gauss;2597 Friction* friction=NULL;2598 double stokesreconditioning;2599 int analysis_type;2600 int approximation;2601 2565 2602 2566 /*If on water or not Stokes, skip stiffness: */ … … 2623 2587 gauss->GaussPoint(ig); 2624 2588 2589 GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0],gauss); 2625 2590 GetLStokes(&LStokes[0][0], gauss); 2626 2591 GetLprimeStokes(&LprimeStokes[0][0], &xyz_list[0][0], gauss); … … 2630 2595 2631 2596 BedNormal(&bed_normal[0],xyz_list_tria); 2632 GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0],gauss);2633 2597 friction->GetAlpha2(&alpha2_gauss, gauss,VxEnum,VyEnum,VzEnum); 2634 2598 -
issm/trunk/src/c/objects/Elements/Tria.cpp
r5933 r5934 2401 2401 ElementMatrix* Tria::CreateKMatrixBalancedthickness_CG(void){ 2402 2402 2403 2404 2403 /*Constants*/ 2405 2404 const int numdof=NDOF1*NUMVERTICES;
Note:
See TracChangeset
for help on using the changeset viewer.