Changeset 5373
- Timestamp:
- 08/18/10 12:12:46 (15 years ago)
- Location:
- issm/trunk/src/c/objects
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Penta.cpp
r5358 r5373 773 773 } 774 774 else if(approximation==MacAyealPattynApproximationEnum){ 775 ISSMERROR("coupling MacAyeal/Pattyn not implemented yet");776 775 CreateKMatrixDiagnosticMacAyeal( Kgg); 777 776 CreateKMatrixDiagnosticPattyn( Kgg); … … 2377 2376 /* local element matrices: */ 2378 2377 double Ke_gg[numdofp][numdofm]={0.0}; //local element stiffness matrix 2378 double Ke_gg_transp[numdofm][numdofp]={0.0}; //local element stiffness matrix 2379 2379 double Ke_gg_gaussian[numdofp][numdofm]; //stiffness matrix evaluated at the gaussian point. 2380 2380 double Jdet; … … 2490 2490 } //for (ig1=0; ig1<num_area_gauss; ig1++) 2491 2491 2492 /*Add Ke_gg to global matrix Kgg: */2493 // one need to be transposed2492 /*Add Ke_gg and its transpose to global matrix Kgg: */ 2493 MatrixTranspose(&Ke_gg_transp[0][0],&Ke_gg[0][0],12,6); 2494 2494 MatSetValues(Kgg,numdofp,doflistp,numdofm,doflistm,(const double*)Ke_gg,ADD_VALUES); 2495 MatSetValues(Kgg,numdofm,doflistm,numdofp,doflistp,(const double*)Ke_gg ,ADD_VALUES);2495 MatSetValues(Kgg,numdofm,doflistm,numdofp,doflistp,(const double*)Ke_gg_transp,ADD_VALUES); 2496 2496 2497 2497 //Deal with 2d friction at the bedrock interface … … 2505 2505 } 2506 2506 2507 delete tria; 2508 delete pentabase; 2507 delete tria->matice; delete tria; 2509 2508 2510 2509 xfree((void**)&first_gauss_area_coord); … … 4973 4972 double vx; 4974 4973 double vy; 4975 4976 /*Get dof list: */ 4977 GetDofList(&doflist); 4974 int approximation; 4975 4976 /*Get approximation enum and dof list: */ 4977 inputs->GetParameterValue(&approximation,ApproximationEnum); 4978 4979 /*If the element is a coupling, do nothing: every grid is also on an other elements 4980 * (as coupling is between MacAyeal and Pattyn) so the other element will take care of it*/ 4981 if(approximation==MacAyealPattynApproximationEnum){ 4982 return; 4983 } 4984 else{ 4985 GetDofList(&doflist,approximation); 4986 } 4978 4987 4979 4988 /*Ok, we have vx and vy in values, fill in vx and vy arrays: */ … … 5458 5467 5459 5468 /*Get dof list: */ 5460 GetDofList(&doflist );5469 GetDofList(&doflist,MacAyealApproximationEnum); 5461 5470 5462 5471 /*Use the dof list to index into the solution vector: */ … … 5529 5538 5530 5539 const int numvertices=6; 5531 const int numdofpervertex=4; 5532 const int solutionnumdof=2; 5533 const int numdof=solutionnumdof*numvertices; 5534 int* doflist=NULL; 5535 int* doflistbase=NULL; 5540 const int numvertices2d=3; 5541 const int numdofpervertex=2; 5542 const int numdof=numdofpervertex*numvertices; 5543 const int numdof2d=numdofpervertex*numvertices2d; 5544 int* doflistp=NULL; 5545 int* doflistm=NULL; 5536 5546 double macayeal_values[numdof]; 5537 5547 double pattyn_values[numdof]; … … 5556 5566 5557 5567 /*Get dof listof this element (pattyn dofs) and of the penta at base (macayeal dofs): */ 5558 GetDofList(&doflist );5559 penta->GetDofList(&doflist base);5568 GetDofList(&doflistp,PattynApproximationEnum); 5569 penta->GetDofList(&doflistm,MacAyealApproximationEnum); 5560 5570 5561 5571 /*Get node data: */ … … 5563 5573 5564 5574 /*Use the dof list to index into the solution vector: */ 5565 for(i=0;i<numdof;i++){ 5566 pattyn_values[i]=solution[doflist[i]]; 5567 macayeal_values[i]=solution[doflistbase[i]]; 5575 for(i=0;i<numdof2d;i++){ 5576 pattyn_values[i]=solution[doflistp[i]]; 5577 macayeal_values[i]=solution[doflistm[i]]; 5578 } 5579 for(i=numdof2d;i<numdof;i++){ 5580 pattyn_values[i]=solution[doflistp[i]]; 5581 macayeal_values[i]=macayeal_values[i-numdof2d]; 5568 5582 } 5569 5583 … … 5588 5602 5589 5603 /*Now Compute vel*/ 5590 for(i=0;i<numvertices;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5); 5604 for(i=0;i<numvertices;i++) { 5605 vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5); 5606 } 5591 5607 5592 5608 /*For pressure: we have not computed pressure in this analysis, for this element. We are in 3D, … … 5612 5628 5613 5629 /*Free ressources:*/ 5614 xfree((void**)&doflist );5615 xfree((void**)&doflist base);5630 xfree((void**)&doflistp); 5631 xfree((void**)&doflistm); 5616 5632 } 5617 5633 /*}}}*/ … … 5641 5657 5642 5658 /*Get dof list: */ 5643 GetDofList(&doflist );5659 GetDofList(&doflist,PattynApproximationEnum); 5644 5660 5645 5661 /*Get node data: */ -
issm/trunk/src/c/objects/Loads/Icefront.cpp
r5311 r5373 448 448 449 449 /* Get dof list and node coordinates: */ 450 GetDofList(&doflist );450 GetDofList(&doflist,MacAyealApproximationEnum); 451 451 GetVerticesCoordinates(&xyz_list[0][0],nodes,numgrids); 452 452 … … 571 571 572 572 /* Get dof list and node coordinates: */ 573 GetDofList(&doflist );573 GetDofList(&doflist,PattynApproximationEnum); 574 574 GetVerticesCoordinates(&xyz_list[0][0], nodes, numgrids); 575 575 … … 641 641 normal_norm=norm(normal3);normal3[0]=normal3[0]/normal_norm;normal3[1]=normal3[1]/normal_norm;normal3[2]=normal3[2]/normal_norm; 642 642 normal_norm=norm(normal4);normal4[0]=normal4[0]/normal_norm;normal4[1]=normal4[1]/normal_norm;normal4[2]=normal4[2]/normal_norm; 643 644 643 645 644 //Compute load contribution for this quad: … … 796 795 /*}}}*/ 797 796 /*FUNCTION Icefront::GetDofList {{{1*/ 798 void Icefront::GetDofList(int** pdoflist ){797 void Icefront::GetDofList(int** pdoflist,int approximation_enum){ 799 798 800 799 int i,j; … … 825 824 /*Figure out size of doflist: */ 826 825 for(i=0;i<numberofnodes;i++){ 827 numberofdofs+=nodes[i]->GetNumberOfDofs( );826 numberofdofs+=nodes[i]->GetNumberOfDofs(approximation_enum); 828 827 } 829 828 … … 834 833 count=0; 835 834 for(i=0;i<numberofnodes;i++){ 836 nodes[i]->GetDofList(doflist+count );837 count+=nodes[i]->GetNumberOfDofs( );835 nodes[i]->GetDofList(doflist+count,approximation_enum); 836 count+=nodes[i]->GetNumberOfDofs(approximation_enum); 838 837 } 839 838 -
issm/trunk/src/c/objects/Loads/Icefront.h
r5311 r5373 75 75 void CreatePVectorDiagnosticHorizQuad( Vec pg); 76 76 void CreatePVectorDiagnosticStokes( Vec pg); 77 void GetDofList(int** pdoflist );77 void GetDofList(int** pdoflist,int approximation_enum=0); 78 78 void QuadPressureLoad(double* pe_g,double rho_water,double rho_ice,double gravity, double* thickness_list, double* bed_list, 79 79 double* normal1,double* normal2,double* normal3,double* normal4,double* xyz_list); -
issm/trunk/src/c/objects/Materials/Matice.cpp
r5358 r5373 378 378 if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0) && 379 379 (epsilon[3]==0) && (epsilon[4]==0)){ 380 viscosity3d= pow((double)10,(double)14);380 viscosity3d=0.5*pow((double)10,(double)14); 381 381 } 382 382 else{ … … 450 450 if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0) && 451 451 (epsilon[3]==0) && (epsilon[4]==0) && (epsilon[5]==0)){ 452 viscosity3d= pow((double)10,(double)14);452 viscosity3d=0.5*pow((double)10,(double)14); 453 453 } 454 454 else{
Note:
See TracChangeset
for help on using the changeset viewer.