Changeset 1676
- Timestamp:
- 08/14/09 09:13:47 (16 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/ModelProcessorx/Thermal/CreateElementsNodesAndMaterialsThermal.cpp
r1651 r1676 198 198 penta_epsvel=model->epsvel; 199 199 penta_onwater=(bool)*(model->elementonwater+i); 200 penta_artdiff=model->artificial_diffusivity; 200 201 201 202 /*We need the field collapse for transient, so that we can use compute B with the average temperature*/ -
issm/trunk/src/c/objects/Penta.cpp
r1480 r1676 3389 3389 double gauss_weight,area_gauss_weight,vert_gauss_weight; 3390 3390 double gauss_coord[4]; 3391 double gauss_l1l2l3[3]; 3391 3392 3392 3393 int area_order=5; … … 3395 3396 int dofs[3]={0,1,2}; 3396 3397 double dt; 3398 double K[2][2]={0.0}; 3397 3399 3398 3400 double vxvyvz_list[numgrids][3]; … … 3411 3413 double Ke_gaussian_conduct[numdof][numdof]; 3412 3414 double Ke_gaussian_advec[numdof][numdof]; 3415 double Ke_gaussian_artdiff[numdof][numdof]; 3413 3416 double Ke_gaussian_transient[numdof][numdof]; 3414 3417 double B[3][numdof]; … … 3416 3419 double B_conduct[3][numdof]; 3417 3420 double B_advec[3][numdof]; 3421 double B_artdiff[2][numdof]; 3418 3422 double Bprime_advec[3][numdof]; 3419 3423 double L[numdof]; … … 3425 3429 double tBD_conduct[3][numdof]; 3426 3430 double tBD_advec[3][numdof]; 3431 double tBD_artdiff[3][numdof]; 3427 3432 double tLD[numdof]; 3428 3433 … … 3466 3471 vz_list[i]=vxvyvz_list[i][2]; 3467 3472 } 3473 3468 3474 3469 3475 /* Get gaussian points and weights. Penta is an extrusion of a Tria, we therefore … … 3556 3562 } 3557 3563 } 3564 3565 /*Artifficial diffusivity*/ 3566 if(artdiff){ 3567 /*Build K: */ 3568 D_scalar=gauss_weight*Jdet/(pow(u,2)+pow(v,2)+epsvel); 3569 if(sub_analysis_type!=SteadyAnalysisEnum()){ 3570 D_scalar=D_scalar*dt; 3571 } 3572 K[0][0]=D_scalar*pow(u,2); K[0][1]=D_scalar*fabs(u)*fabs(v); 3573 K[1][0]=D_scalar*fabs(u)*fabs(v);K[1][1]=D_scalar*pow(v,2); 3574 3575 /*Get B_artdiff: */ 3576 GetB_artdiff(&B_artdiff[0][0],&xyz_list[0][0],gauss_coord); 3577 3578 /* Do the triple product B'*K*B: */ 3579 MatrixMultiply(&B_artdiff[0][0],2,numdof,1,&K[0][0],2,2,0,&tBD_artdiff[0][0],0); 3580 MatrixMultiply(&tBD_artdiff[0][0],numdof,2,0,&B_artdiff[0][0],2,numdof,0,&Ke_gaussian_artdiff[0][0],0); 3581 } 3582 else{ 3583 for(i=0;i<numdof;i++){ 3584 for(j=0;j<numdof;j++){ 3585 Ke_gaussian_artdiff[i][j]=0; 3586 } 3587 } 3588 } 3558 3589 3559 3590 /*Add Ke_gaussian to pKe: */ 3560 3591 for(i=0;i<numdof;i++){ 3561 3592 for(j=0;j<numdof;j++){ 3562 K_terms[i][j]+=Ke_gaussian_conduct[i][j]+Ke_gaussian_advec[i][j]+Ke_gaussian_transient[i][j] ;3593 K_terms[i][j]+=Ke_gaussian_conduct[i][j]+Ke_gaussian_advec[i][j]+Ke_gaussian_transient[i][j]+Ke_gaussian_artdiff[i][j]; 3563 3594 } 3564 3595 } … … 3622 3653 3623 3654 #undef __FUNCT__ 3624 #define __FUNCT__ "Penta::GetB_a dvec"3625 void Penta::GetB_a dvec(double* B_advec, double* xyz_list, double* gauss_coord){3655 #define __FUNCT__ "Penta::GetB_artdiff" 3656 void Penta::GetB_artdiff(double* B_artdiff, double* xyz_list, double* gauss_coord){ 3626 3657 3627 3658 /*Compute B matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*DOFPERGRID. 3628 3659 * For grid i, Bi' can be expressed in the basic coordinate system 3629 3660 * by: 3630 * Bi_conduct_basic=[ h ] 3661 * Bi_artdiff_basic=[ dh/dx ] 3662 * [ dh/dy ] 3663 * where h is the interpolation function for grid i. 3664 * 3665 * We assume B has been allocated already, of size: 2x(DOFPERGRID*numgrids) 3666 */ 3667 3668 int i; 3669 const int calculationdof=3; 3670 const int numgrids=6; 3671 int DOFPERGRID=1; 3672 3673 /*Same thing in the basic coordinate system: */ 3674 double dh1dh6_basic[calculationdof][numgrids]; 3675 3676 /*Get dh1dh2dh3 in basic coordinates system : */ 3677 GetNodalFunctionsDerivativesBasic(&dh1dh6_basic[0][0],xyz_list,gauss_coord); 3678 3679 /*Build B': */ 3680 for (i=0;i<numgrids;i++){ 3681 *(B_artdiff+DOFPERGRID*numgrids*0+DOFPERGRID*i)=dh1dh6_basic[0][i]; 3682 *(B_artdiff+DOFPERGRID*numgrids*1+DOFPERGRID*i)=dh1dh6_basic[1][i]; 3683 } 3684 } 3685 3686 #undef __FUNCT__ 3687 #define __FUNCT__ "Penta::GetB_advec" 3688 void Penta::GetB_advec(double* B_advec, double* xyz_list, double* gauss_coord){ 3689 3690 /*Compute B matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*DOFPERGRID. 3691 * For grid i, Bi' can be expressed in the basic coordinate system 3692 * by: 3693 * Bi_advec_basic =[ h ] 3631 3694 * [ h ] 3632 3695 * [ h ] -
issm/trunk/src/c/objects/Penta.h
r1188 r1676 137 137 void GetB_advec(double* B_advec, double* xyz_list, double* gauss_coord); 138 138 void GetBprime_advec(double* Bprime_advec, double* xyz_list, double* gauss_coord); 139 void GetB_artdiff(double* B_artdiff, double* xyz_list, double* gauss_coord); 139 140 void CreateKMatrixMelting(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type); 140 141 void CreatePVectorThermal( Vec pg, void* vinputs,int analysis_type,int sub_analysis_type); -
issm/trunk/src/m/classes/public/solveparallel.m
r1268 r1676 30 30 waitonlock([executionpath '/' md.name '.lock']); 31 31 %load results 32 displaystring(md.debug,'loading results from cluster'); 32 33 md=loadresultsfromcluster(md); 33 34 end
Note:
See TracChangeset
for help on using the changeset viewer.