Changeset 11341
- Timestamp:
- 02/07/12 09:07:26 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/objects/Elements/Penta.cpp
r11340 r11341 7437 7437 case StokesApproximationEnum: 7438 7438 return CreateJacobianDiagnosticStokes(); 7439 case NoneApproximationEnum: 7440 return NULL; 7439 7441 default: 7440 7442 _error_("Approximation %s not supported yet",EnumToStringx(approximation)); … … 7473 7475 /*Intermediaries */ 7474 7476 int i,j,ig; 7475 int approximation;7476 7477 double xyz_list[NUMVERTICES][3]; 7477 7478 double Jdet; … … 7489 7490 7490 7491 /*Retrieve all inputs and parameters*/ 7491 inputs->GetInputValue(&approximation,ApproximationEnum);7492 7492 GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES); 7493 7493 Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input); … … 7535 7535 ElementMatrix* Penta::CreateJacobianDiagnosticStokes(void){ 7536 7536 7537 _error_("Not implemented yet");7538 7537 /*Constants*/ 7539 const int numdof=NDOF 2*NUMVERTICES;7538 const int numdof=NDOF4*NUMVERTICES; 7540 7539 7541 7540 /*Intermediaries */ 7542 7541 int i,j,ig; 7543 int approximation;7544 7542 double xyz_list[NUMVERTICES][3]; 7545 7543 double Jdet; 7546 7544 double eps1dotdphii,eps1dotdphij; 7547 7545 double eps2dotdphii,eps2dotdphij; 7546 double eps3dotdphii,eps3dotdphij; 7548 7547 double mu_prime; 7549 7548 double epsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/ 7550 double eps1[3],eps2[3] ;7549 double eps1[3],eps2[3],eps3[3]; 7551 7550 double phi[NUMVERTICES]; 7552 7551 double dphi[3][NUMVERTICES]; 7553 7552 GaussPenta *gauss=NULL; 7554 7553 7555 /*Initialize Jacobian with regular Pattyn(first part of the Gateau derivative)*/7556 ElementMatrix* Ke=CreateKMatrixDiagnostic Pattyn();7554 /*Initialize Jacobian with regular Stokes (first part of the Gateau derivative)*/ 7555 ElementMatrix* Ke=CreateKMatrixDiagnosticStokes(); 7557 7556 7558 7557 /*Retrieve all inputs and parameters*/ 7559 inputs->GetInputValue(&approximation,ApproximationEnum);7560 7558 GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES); 7561 7559 Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input); 7562 7560 Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input); 7561 Input* vz_input=inputs->GetInput(VzEnum); _assert_(vz_input); 7563 7562 7564 7563 /* Start looping on the number of gaussian points: */ … … 7573 7572 this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input); 7574 7573 matice->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]); 7575 eps1[0]= 2*epsilon[0]+epsilon[1]; eps2[0]=epsilon[2];7576 eps1[1]=epsilon[2]; eps2[1]=epsilon[0]+2*epsilon[1];7577 eps1[2]=epsilon[3]; eps2[2]=epsilon[4];7574 eps1[0]=epsilon[0]; eps2[0]=epsilon[2]; eps3[0]=epsilon[3]; 7575 eps1[1]=epsilon[2]; eps2[1]=epsilon[1]; eps3[1]=epsilon[4]; 7576 eps1[2]=epsilon[3]; eps2[2]=epsilon[4]; eps3[2]= -epsilon[0] -epsilon[1]; 7578 7577 7579 7578 for(i=0;i<6;i++){ … … 7583 7582 eps2dotdphii=eps2[0]*dphi[0][i]+eps2[1]*dphi[1][i]+eps2[2]*dphi[2][i]; 7584 7583 eps2dotdphij=eps2[0]*dphi[0][j]+eps2[1]*dphi[1][j]+eps2[2]*dphi[2][j]; 7585 7586 Ke->values[12*(2*i+0)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps1dotdphii; 7587 Ke->values[12*(2*i+0)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps1dotdphii; 7588 Ke->values[12*(2*i+1)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps2dotdphii; 7589 Ke->values[12*(2*i+1)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps2dotdphii; 7584 eps3dotdphii=eps3[0]*dphi[0][i]+eps3[1]*dphi[1][i]+eps3[2]*dphi[2][i]; 7585 eps3dotdphij=eps3[0]*dphi[0][j]+eps3[1]*dphi[1][j]+eps3[2]*dphi[2][j]; 7586 7587 Ke->values[numdof*(4*i+0)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps1dotdphii; 7588 Ke->values[numdof*(4*i+0)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps1dotdphii; 7589 Ke->values[numdof*(4*i+0)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps1dotdphii; 7590 7591 Ke->values[numdof*(4*i+1)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps2dotdphii; 7592 Ke->values[numdof*(4*i+1)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps2dotdphii; 7593 Ke->values[numdof*(4*i+1)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps2dotdphii; 7594 7595 Ke->values[numdof*(4*i+2)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps3dotdphii; 7596 Ke->values[numdof*(4*i+2)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps3dotdphii; 7597 Ke->values[numdof*(4*i+2)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps3dotdphii; 7590 7598 } 7591 7599 } … … 7593 7601 7594 7602 /*Transform Coordinate System*/ 7595 TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XY Enum);7603 TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYZPEnum); 7596 7604 7597 7605 /*Clean up and return*/
Note:
See TracChangeset
for help on using the changeset viewer.