Changeset 5373


Ignore:
Timestamp:
08/18/10 12:12:46 (15 years ago)
Author:
seroussi
Message:

keep working on coupling

Location:
issm/trunk/src/c/objects
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r5358 r5373  
    773773                }
    774774                else if(approximation==MacAyealPattynApproximationEnum){
    775                         ISSMERROR("coupling MacAyeal/Pattyn not implemented yet");
    776775                        CreateKMatrixDiagnosticMacAyeal( Kgg);
    777776                        CreateKMatrixDiagnosticPattyn( Kgg);
     
    23772376        /* local element matrices: */
    23782377        double Ke_gg[numdofp][numdofm]={0.0}; //local element stiffness matrix
     2378        double Ke_gg_transp[numdofm][numdofp]={0.0}; //local element stiffness matrix
    23792379        double Ke_gg_gaussian[numdofp][numdofm]; //stiffness matrix evaluated at the gaussian point.
    23802380        double Jdet;
     
    24902490        } //for (ig1=0; ig1<num_area_gauss; ig1++)
    24912491
    2492         /*Add Ke_gg to global matrix Kgg: */
    2493         // one need to be transposed
     2492        /*Add Ke_gg and its transpose to global matrix Kgg: */
     2493        MatrixTranspose(&Ke_gg_transp[0][0],&Ke_gg[0][0],12,6);
    24942494        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);
    24962496
    24972497        //Deal with 2d friction at the bedrock interface
     
    25052505        }
    25062506
    2507         delete tria;
    2508         delete pentabase;
     2507        delete tria->matice; delete tria;
    25092508
    25102509        xfree((void**)&first_gauss_area_coord);
     
    49734972        double       vx;
    49744973        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        }
    49784987
    49794988        /*Ok, we have vx and vy in values, fill in vx and vy arrays: */
     
    54585467
    54595468        /*Get dof list: */
    5460         GetDofList(&doflist);
     5469        GetDofList(&doflist,MacAyealApproximationEnum);
    54615470
    54625471        /*Use the dof list to index into the solution vector: */
     
    55295538
    55305539        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;
    55365546        double       macayeal_values[numdof];
    55375547        double       pattyn_values[numdof];
     
    55565566
    55575567        /*Get dof listof this element (pattyn dofs) and of the penta at base (macayeal dofs): */
    5558         GetDofList(&doflist);
    5559         penta->GetDofList(&doflistbase);
     5568        GetDofList(&doflistp,PattynApproximationEnum);
     5569        penta->GetDofList(&doflistm,MacAyealApproximationEnum);
    55605570
    55615571        /*Get node data: */
     
    55635573
    55645574        /*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];
    55685582        }
    55695583
     
    55885602
    55895603        /*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        }
    55915607
    55925608        /*For pressure: we have not computed pressure in this analysis, for this element. We are in 3D,
     
    56125628
    56135629        /*Free ressources:*/
    5614         xfree((void**)&doflist);
    5615         xfree((void**)&doflistbase);
     5630        xfree((void**)&doflistp);
     5631        xfree((void**)&doflistm);
    56165632}
    56175633/*}}}*/
     
    56415657
    56425658        /*Get dof list: */
    5643         GetDofList(&doflist);
     5659        GetDofList(&doflist,PattynApproximationEnum);
    56445660
    56455661        /*Get node data: */
  • issm/trunk/src/c/objects/Loads/Icefront.cpp

    r5311 r5373  
    448448
    449449        /* Get dof list and node coordinates: */
    450         GetDofList(&doflist);
     450        GetDofList(&doflist,MacAyealApproximationEnum);
    451451        GetVerticesCoordinates(&xyz_list[0][0],nodes,numgrids);
    452452       
     
    571571
    572572        /* Get dof list and node coordinates: */
    573         GetDofList(&doflist);
     573        GetDofList(&doflist,PattynApproximationEnum);
    574574        GetVerticesCoordinates(&xyz_list[0][0], nodes, numgrids);
    575575       
     
    641641        normal_norm=norm(normal3);normal3[0]=normal3[0]/normal_norm;normal3[1]=normal3[1]/normal_norm;normal3[2]=normal3[2]/normal_norm;
    642642        normal_norm=norm(normal4);normal4[0]=normal4[0]/normal_norm;normal4[1]=normal4[1]/normal_norm;normal4[2]=normal4[2]/normal_norm;
    643 
    644643
    645644        //Compute load contribution for this quad:
     
    796795/*}}}*/
    797796/*FUNCTION Icefront::GetDofList {{{1*/
    798 void  Icefront::GetDofList(int** pdoflist){
     797void  Icefront::GetDofList(int** pdoflist,int approximation_enum){
    799798
    800799        int i,j;
     
    825824        /*Figure out size of doflist: */
    826825        for(i=0;i<numberofnodes;i++){
    827                 numberofdofs+=nodes[i]->GetNumberOfDofs();
     826                numberofdofs+=nodes[i]->GetNumberOfDofs(approximation_enum);
    828827        }
    829828
     
    834833        count=0;
    835834        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);
    838837        }
    839838
  • issm/trunk/src/c/objects/Loads/Icefront.h

    r5311 r5373  
    7575                void  CreatePVectorDiagnosticHorizQuad( Vec pg);
    7676                void  CreatePVectorDiagnosticStokes( Vec pg);
    77                 void  GetDofList(int** pdoflist);
     77                void  GetDofList(int** pdoflist,int approximation_enum=0);
    7878                void  QuadPressureLoad(double* pe_g,double rho_water,double rho_ice,double gravity, double* thickness_list, double* bed_list,
    7979                                              double* normal1,double* normal2,double* normal3,double* normal4,double* xyz_list);
  • issm/trunk/src/c/objects/Materials/Matice.cpp

    r5358 r5373  
    378378                if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0) &&
    379379                                (epsilon[3]==0) && (epsilon[4]==0)){
    380                         viscosity3d=pow((double)10,(double)14);
     380                        viscosity3d=0.5*pow((double)10,(double)14);
    381381                }
    382382                else{
     
    450450                if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0) &&
    451451                                (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);
    453453                }
    454454                else{
Note: See TracChangeset for help on using the changeset viewer.