Changeset 5839


Ignore:
Timestamp:
09/16/10 09:10:42 (15 years ago)
Author:
Mathieu Morlighem
Message:

Added some ElementMatrices

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

Legend:

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

    r5831 r5839  
    705705        /*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */
    706706        if (analysis_type==DiagnosticHorizAnalysisEnum || analysis_type==AdjointHorizAnalysisEnum){
    707                 CreateKMatrixDiagnosticMacAyeal( Kgg,Kff,Kfs);
     707                ElementMatrix* Ke=CreateKMatrixDiagnosticMacAyeal();
     708                Ke->AddToGlobal(Kgg,Kff,Kfs);
     709                delete Ke;
    708710        }
    709711        else if (analysis_type==DiagnosticHutterAnalysisEnum){
     
    714716        }
    715717        else if (analysis_type==PrognosticAnalysisEnum){
    716                 if (GetElementType()==P1Enum)
    717                  CreateKMatrixPrognostic_CG( Kgg);
    718                 else if (GetElementType()==P1DGEnum)
    719                  CreateKMatrixPrognostic_DG( Kgg);
    720                 else
    721                  ISSMERROR("Element type %s not supported yet",EnumToString(GetElementType()));
     718                ElementMatrix* Ke=CreateKMatrixPrognostic();
     719                Ke->AddToGlobal(Kgg,Kff,Kfs);
     720                delete Ke;
    722721        }
    723722        else if (analysis_type==BalancedthicknessAnalysisEnum || analysis_type==AdjointBalancedthicknessAnalysisEnum){
    724                 if (GetElementType()==P1Enum)
    725                  CreateKMatrixBalancedthickness_CG( Kgg);
    726                 else if (GetElementType()==P1DGEnum)
    727                  CreateKMatrixBalancedthickness_DG( Kgg);
    728                 else
    729                  ISSMERROR("Element type %s not supported yet",EnumToString(GetElementType()));
     723                ElementMatrix* Ke=CreateKMatrixBalancedthickness();
     724                Ke->AddToGlobal(Kgg,Kff,Kfs);
     725                delete Ke;
    730726        }
    731727        else if (analysis_type==BalancedvelocitiesAnalysisEnum){
     
    23912387
    23922388/*Tria specific routines: */
     2389/*FUNCTION Tria::CreateKMatrixBalancedthickness {{{1*/
     2390ElementMatrix* Tria::CreateKMatrixBalancedthickness(void){
     2391
     2392        switch(GetElementType()){
     2393                case P1Enum:
     2394                        return CreateKMatrixBalancedthickness_CG();
     2395                case P1DGEnum:
     2396                        return CreateKMatrixBalancedthickness_DG();
     2397                default:
     2398                        ISSMERROR("Element type %s not supported yet",EnumToString(GetElementType()));
     2399        }
     2400
     2401}
     2402/*}}}*/
    23932403/*FUNCTION Tria::CreateKMatrixBalancedthickness_CG {{{1*/
    2394 void  Tria::CreateKMatrixBalancedthickness_CG(Mat Kgg){
     2404ElementMatrix* Tria::CreateKMatrixBalancedthickness_CG(void){
    23952405
    23962406        /*Constants*/
     
    24152425        double     Ke_gg_thickness1[numdof][numdof] = {0.0};
    24162426        double     Ke_gg_thickness2[numdof][numdof] = {0.0};
    2417         int       *doflist                          = NULL;
    24182427        GaussTria *gauss                            = NULL;
    24192428
    2420         /* Get node coordinates and dof list: */
     2429           /*Initialize Element matrix and return if necessary*/
     2430        if(IsOnWater()) return NULL;
     2431        ElementMatrix* Ke=this->NewElementMatrix(NoneApproximationEnum);
     2432
     2433        /*Retrieve all Inputs and parameters: */
    24212434        GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
    2422         GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
    2423 
    2424         /*Retrieve all Inputs and parameters: */
    24252435        this->parameters->FindParam(&artdiff,ArtDiffEnum);
    24262436        this->parameters->FindParam(&dim,DimEnum);
     
    24842494                                        &Ke_gg_thickness2[0][0],0);
    24852495
    2486                 for( i=0; i<numdof; i++) for(j=0;j<numdof;j++) Ke_gg[i][j]+=Ke_gg_thickness1[i][j];
    2487                 for( i=0; i<numdof; i++) for(j=0;j<numdof;j++) Ke_gg[i][j]+=Ke_gg_thickness2[i][j];
     2496                for( i=0; i<numdof; i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_gg_thickness1[i][j];
     2497                for( i=0; i<numdof; i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_gg_thickness2[i][j];
    24882498
    24892499                if(artdiff){
     
    24962506                                                &Ke_gg_gaussian[0][0],0);
    24972507
    2498                         for( i=0; i<numdof; i++) for(j=0;j<numdof;j++) Ke_gg[i][j]+=Ke_gg_gaussian[i][j];
     2508                        for( i=0; i<numdof; i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_gg_gaussian[i][j];
    24992509                }
    25002510        }
    25012511
    2502         MatSetValues(Kgg,numdof,doflist,numdof,doflist,(const double*)Ke_gg,ADD_VALUES);
    2503 
    2504         /*Clean up*/
     2512        /*Clean up and return*/
    25052513        delete gauss;
    2506         xfree((void**)&doflist);
     2514        return Ke;
    25072515}
    25082516/*}}}*/
    25092517/*FUNCTION Tria::CreateKMatrixBalancedthickness_DG {{{1*/
    2510 void  Tria::CreateKMatrixBalancedthickness_DG(Mat Kgg){
     2518ElementMatrix* Tria::CreateKMatrixBalancedthickness_DG(void){
    25112519
    25122520        /* local declarations */
     2521        const int    numdof=NDOF1*NUMVERTICES;
    25132522        int             i,j;
    2514 
    2515         /* node data: */
    2516         const int    numdof=NDOF1*NUMVERTICES;
     2523        int     ig;
    25172524        double       xyz_list[NUMVERTICES][3];
    2518         int*         doflist=NULL;
    2519 
    2520         /* gaussian points: */
    2521         int     ig;
    25222525        GaussTria *gauss=NULL;
    2523 
    2524         /* matrices: */
    25252526        double B[2][NUMVERTICES];
    25262527        double Bprime[2][NUMVERTICES];
     
    25312532        double Ke_gg2[numdof][numdof]={0.0};
    25322533        double Jdettria;
    2533 
    2534         /*input parameters for structural analysis (diagnostic): */
    25352534        double  vx,vy;
    25362535        int     dim;
    25372536
    2538         /* Get node coordinates and dof list: */
     2537        /*Initialize Element matrix and return if necessary*/
     2538        if(IsOnWater()) return NULL;
     2539        ElementMatrix* Ke=this->NewElementMatrix(NoneApproximationEnum);
     2540
     2541        /*Retrieve all inputs and parameters*/
    25392542        GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
    2540         GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
    25412543        this->parameters->FindParam(&dim,DimEnum);
    2542 
    2543         /*Retrieve all inputs we will be needed*/
    25442544        Input* vx_input=inputs->GetInput(VxEnum); ISSMASSERT(vx_input);
    25452545        Input* vy_input=inputs->GetInput(VyEnum); ISSMASSERT(vy_input);
     
    25512551                gauss->GaussPoint(ig);
    25522552
    2553                 /* Get Jacobian determinant: */
    2554                 GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
    2555 
    2556                 /*Get B  and B prime matrix: */
    25572553                /*WARNING: B and Bprime are inverted compared to usual prognostic!!!!*/
    25582554                GetBPrognostic(&Bprime[0][0], &xyz_list[0][0], gauss);
    25592555                GetBprimePrognostic(&B[0][0], &xyz_list[0][0], gauss);
    25602556
    2561                 //Get vx, vy and their derivatives at gauss point
    25622557                vx_input->GetParameterValue(&vx,gauss);
    25632558                vy_input->GetParameterValue(&vy,gauss);
    25642559
     2560                GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
    25652561                DL_scalar=-gauss->weight*Jdettria;
    25662562
     
    25682564                DLprime[1][1]=DL_scalar*vy;
    25692565
    2570                 //Do the triple product tL*D*L.
    25712566                TripleMultiply( &B[0][0],2,numdof,1,
    25722567                                        &DLprime[0][0],2,2,0,
     
    25742569                                        &Ke_gg2[0][0],0);
    25752570
    2576                 /* Add the Ke_gg_gaussian, and optionally Ke_gg_drag_gaussian onto Ke_gg: */
    2577                 for( i=0; i<numdof; i++) for(j=0;j<numdof;j++) Ke_gg[i][j]+=Ke_gg2[i][j];
    2578 
    2579         }
    2580 
    2581         /*Add Ke_gg to global matrix Kgg: */
    2582         MatSetValues(Kgg,numdof,doflist,numdof,doflist,(const double*)Ke_gg,ADD_VALUES);
     2571                for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_gg2[i][j];
     2572        }
    25832573
    25842574        /*Clean up and return*/
    25852575        delete gauss;
    2586         xfree((void**)&doflist);
     2576        return Ke;
    25872577}
    25882578/*}}}*/
     
    27532743/*}}}*/
    27542744/*FUNCTION Tria::CreateKMatrixDiagnosticMacAyeal {{{1*/
    2755 void  Tria::CreateKMatrixDiagnosticMacAyeal(Mat Kgg,Mat Kff, Mat Kfs){
     2745ElementMatrix* Tria::CreateKMatrixDiagnosticMacAyeal(void){
    27562746       
    27572747        /*compute all stiffness matrices for this element*/
     
    27602750        ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
    27612751
    2762         /*Add Ke element stiffness matrix to global stiffness matrix: */
    2763         Ke->AddToGlobal(Kgg,Kff,Kfs);
    2764 
    2765         /*Free ressources:*/
     2752        /*clean-up and return*/
    27662753        delete Ke1;
    27672754        delete Ke2;
    2768         delete Ke;
     2755        return Ke;
     2756
    27692757}
    27702758/*}}}*/
     
    28282816                                        &Ke_g[0][0],0);
    28292817
    2830                 for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[numdof*j+i]+=Ke_g[i][j];
     2818                for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g[i][j];
    28312819        }
    28322820
     
    29092897                                        &Ke_g[0][0],0);
    29102898
    2911                 for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[numdof*j+i]+=Ke_g[i][j];
     2899                for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g[i][j];
    29122900        }
    29132901
     
    33483336}
    33493337/*}}}*/
     3338/*FUNCTION Tria::CreateKMatrixPrognostic {{{1*/
     3339ElementMatrix* Tria::CreateKMatrixPrognostic(void){
     3340
     3341        switch(GetElementType()){
     3342                case P1Enum:
     3343                        return CreateKMatrixPrognostic_CG();
     3344                case P1DGEnum:
     3345                        return CreateKMatrixPrognostic_DG();
     3346                default:
     3347                        ISSMERROR("Element type %s not supported yet",EnumToString(GetElementType()));
     3348        }
     3349
     3350}
     3351/*}}}*/
    33503352/*FUNCTION Tria::CreateKMatrixPrognostic_CG {{{1*/
    3351 void  Tria::CreateKMatrixPrognostic_CG(Mat Kgg){
     3353ElementMatrix* Tria::CreateKMatrixPrognostic_CG(void){
    33523354
    33533355        /* local declarations */
     3356        const int    numdof=NDOF1*NUMVERTICES;
    33543357        int             i,j;
    3355 
    3356         /* node data: */
    3357         const int    numdof=NDOF1*NUMVERTICES;
     3358        int     ig;
    33583359        double       xyz_list[NUMVERTICES][3];
    3359         int*         doflist=NULL;
    33603360        int          numberofdofspernode=1;
    3361 
    3362         /* gaussian points: */
    3363         int     ig;
    33643361        GaussTria *gauss=NULL;
    3365 
    3366         /* matrices: */
    33673362        double L[NUMVERTICES];
    33683363        double B[2][NUMVERTICES];
     
    33763371        double Ke_gg_thickness2[numdof][numdof]={0.0};
    33773372        double Jdettria;
    3378 
    3379         /*input parameters for structural analysis (diagnostic): */
    33803373        double  dvx[2];
    33813374        double  dvy[2];
     
    33863379        double  KDL[2][2]={0.0};
    33873380        int     dim;
    3388 
    3389         /*inputs: */
    3390         Input* vxaverage_input=NULL;
    3391         Input* vyaverage_input=NULL;
    33923381        double dt;
    33933382        bool artdiff;
    33943383
    3395         /*retrieve some parameters: */
     3384        /*Initialize Element matrix and return if necessary*/
     3385        if(IsOnWater()) return NULL;
     3386        ElementMatrix* Ke=this->NewElementMatrix(NoneApproximationEnum);
     3387
     3388        /*Retrieve all inputs and parameters*/
     3389        GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
    33963390        this->parameters->FindParam(&dt,DtEnum);
    33973391        this->parameters->FindParam(&dim,DimEnum);
    33983392        this->parameters->FindParam(&artdiff,ArtDiffEnum);
    3399 
    3400         /* Get node coordinates and dof list: */
    3401         GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
    3402         GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
    3403 
    3404         /*Retrieve all inputs we will be needing: */
     3393        Input* vxaverage_input=NULL;
     3394        Input* vyaverage_input=NULL;
    34053395        if(dim==2){
    34063396                vxaverage_input=inputs->GetInput(VxEnum); ISSMASSERT(vxaverage_input);
     
    34343424                gauss->GaussPoint(ig);
    34353425
    3436                 /* Get Jacobian determinant: */
     3426                GetL(&L[0], &xyz_list[0][0], gauss,numberofdofspernode);
    34373427                GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
    34383428
    3439                 /*Get L matrix: */
    3440                 GetL(&L[0], &xyz_list[0][0], gauss,numberofdofspernode);
    3441 
    34423429                DL_scalar=gauss->weight*Jdettria;
    34433430
    3444                 /*  Do the triple product tL*D*L: */
    34453431                TripleMultiply( &L[0],1,numdof,1,
    34463432                                        &DL_scalar,1,1,0,
     
    34483434                                        &Ke_gg_gaussian[0][0],0);
    34493435
    3450                 /*Get B  and B prime matrix: */
    34513436                GetBPrognostic(&B[0][0], &xyz_list[0][0], gauss);
    34523437                GetBprimePrognostic(&Bprime[0][0], &xyz_list[0][0], gauss);
    34533438
    3454                 //Get vx, vy and their derivatives at gauss point
    34553439                vxaverage_input->GetParameterValue(&vx,gauss);
    34563440                vyaverage_input->GetParameterValue(&vy,gauss);
    3457 
    34583441                vxaverage_input->GetParameterDerivativeValue(&dvx[0],&xyz_list[0][0],gauss);
    34593442                vyaverage_input->GetParameterDerivativeValue(&dvy[0],&xyz_list[0][0],gauss);
    3460 
    34613443                dvxdx=dvx[0];
    34623444                dvydy=dvy[1];
    3463 
    34643445                DL_scalar=dt*gauss->weight*Jdettria;
    34653446
    3466                 //Create DL and DLprime matrix
    34673447                DL[0][0]=DL_scalar*dvxdx;
    34683448                DL[1][1]=DL_scalar*dvydy;
    3469 
    34703449                DLprime[0][0]=DL_scalar*vx;
    34713450                DLprime[1][1]=DL_scalar*vy;
    3472 
    3473                 //Do the triple product tL*D*L.
    3474                 //Ke_gg_thickness=B'*DL*B+B'*DLprime*Bprime;
    34753451
    34763452                TripleMultiply( &B[0][0],2,numdof,1,
     
    34843460                                        &Ke_gg_thickness2[0][0],0);
    34853461
    3486                 /* Add the Ke_gg_gaussian, and optionally Ke_gg_drag_gaussian onto Ke_gg: */
    3487                 for( i=0; i<numdof; i++) for(j=0;j<numdof;j++) Ke_gg[i][j]+=Ke_gg_gaussian[i][j];
    3488                 for( i=0; i<numdof; i++) for(j=0;j<numdof;j++) Ke_gg[i][j]+=Ke_gg_thickness1[i][j];
    3489                 for( i=0; i<numdof; i++) for(j=0;j<numdof;j++) Ke_gg[i][j]+=Ke_gg_thickness2[i][j];
     3462                for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_gg_gaussian[i][j];
     3463                for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_gg_thickness1[i][j];
     3464                for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_gg_thickness2[i][j];
    34903465
    34913466                if(artdiff){
    3492 
    3493                         /* Compute artificial diffusivity */
    34943467                        KDL[0][0]=DL_scalar*K[0][0];
    34953468                        KDL[1][1]=DL_scalar*K[1][1];
     
    35003473                                                &Ke_gg_gaussian[0][0],0);
    35013474
    3502                         /* Add artificial diffusivity matrix */
    3503                         for( i=0; i<numdof; i++) for(j=0;j<numdof;j++) Ke_gg[i][j]+=Ke_gg_gaussian[i][j];
    3504 
     3475                        for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_gg_gaussian[i][j];
    35053476                }
    3506 
    3507         }
    3508 
    3509         /*Add Ke_gg to global matrix Kgg: */
    3510         MatSetValues(Kgg,numdof,doflist,numdof,doflist,(const double*)Ke_gg,ADD_VALUES);
     3477        }
    35113478
    35123479        /*Clean up and return*/
    35133480        delete gauss;
    3514         xfree((void**)&doflist);
     3481        return Ke;
    35153482}
    35163483/*}}}*/
    35173484/*FUNCTION Tria::CreateKMatrixPrognostic_DG {{{1*/
    3518 void  Tria::CreateKMatrixPrognostic_DG(Mat Kgg){
     3485ElementMatrix* Tria::CreateKMatrixPrognostic_DG(void){
    35193486
    35203487        /* local declarations */
    35213488        int             i,j;
    3522 
    3523         /* node data: */
    35243489        const int    numdof=NDOF1*NUMVERTICES;
    35253490        double       xyz_list[NUMVERTICES][3];
    35263491        int*         doflist=NULL;
    35273492        int          numberofdofspernode=1;
    3528 
    3529         /* gaussian points: */
    35303493        int     ig;
    35313494        GaussTria *gauss=NULL;
    3532 
    3533         /* matrices: */
    35343495        double L[NUMVERTICES];
    35353496        double B[2][NUMVERTICES];
     
    35423503        double Ke_gg2[numdof][numdof]={0.0};
    35433504        double Jdettria;
    3544 
    3545         /*input parameters for structural analysis (diagnostic): */
    35463505        double  vx,vy;
    35473506        int     dim;
    3548 
    3549         /*inputs: */
     3507        double dt;
     3508
     3509        /*Initialize Element matrix and return if necessary*/
     3510        if(IsOnWater()) return NULL;
     3511        ElementMatrix* Ke=this->NewElementMatrix(NoneApproximationEnum);
     3512
     3513        /*Retrieve all inputs and parameters*/
     3514        GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
     3515        this->parameters->FindParam(&dt,DtEnum);
     3516        this->parameters->FindParam(&dim,DimEnum);
    35503517        Input* vxaverage_input=NULL;
    35513518        Input* vyaverage_input=NULL;
    3552         double dt;
    3553 
    3554         /*retrieve some parameters: */
    3555         this->parameters->FindParam(&dt,DtEnum);
    3556         this->parameters->FindParam(&dim,DimEnum);
    3557 
    3558         /* Get node coordinates and dof list: */
    3559         GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
    3560         GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
    3561 
    3562         /*Retrieve all inputs we will be needed*/
    35633519        if(dim==2){
    35643520                vxaverage_input=inputs->GetInput(VxEnum); ISSMASSERT(vxaverage_input);
     
    35763532                gauss->GaussPoint(ig);
    35773533
    3578                 /* Get Jacobian determinant: */
     3534
     3535                GetL(&L[0], &xyz_list[0][0], gauss,numberofdofspernode);
    35793536                GetJacobianDeterminant2d(&Jdettria, &xyz_list[0][0],gauss);
    35803537
    3581                 /*Get L matrix: */
    3582                 GetL(&L[0], &xyz_list[0][0], gauss,numberofdofspernode);
    3583 
    35843538                DL_scalar=gauss->weight*Jdettria;
    35853539
    3586                 /*  Do the triple product tL*D*L: */
    35873540                TripleMultiply( &L[0],1,numdof,1,
    35883541                                        &DL_scalar,1,1,0,
     
    35953548                GetBprimePrognostic(&B[0][0], &xyz_list[0][0], gauss);
    35963549
    3597                 //Get vx, vy and their derivatives at gauss point
    35983550                vxaverage_input->GetParameterValue(&vx,gauss);
    35993551                vyaverage_input->GetParameterValue(&vy,gauss);
    3600 
    36013552                DL_scalar=-dt*gauss->weight*Jdettria;
    36023553
     
    36043555                DLprime[1][1]=DL_scalar*vy;
    36053556
    3606                 //Do the triple product tL*D*L.
    36073557                TripleMultiply( &B[0][0],2,numdof,1,
    36083558                                        &DLprime[0][0],2,2,0,
     
    36103560                                        &Ke_gg2[0][0],0);
    36113561
    3612                 /* Add the Ke_gg_gaussian, and optionally Ke_gg_drag_gaussian onto Ke_gg: */
    3613                 for( i=0; i<numdof; i++) for(j=0;j<numdof;j++) Ke_gg[i][j]+=Ke_gg1[i][j];
    3614                 for( i=0; i<numdof; i++) for(j=0;j<numdof;j++) Ke_gg[i][j]+=Ke_gg2[i][j];
    3615 
    3616         }
    3617 
    3618         /*Add Ke_gg to global matrix Kgg: */
    3619         MatSetValues(Kgg,numdof,doflist,numdof,doflist,(const double*)Ke_gg,ADD_VALUES);
     3562                for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_gg1[i][j];
     3563                for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_gg2[i][j];
     3564        }
    36203565
    36213566        /*Clean up and return*/
    36223567        delete gauss;
    3623         xfree((void**)&doflist);
     3568        return Ke;
    36243569}
    36253570/*}}}*/
  • issm/trunk/src/c/objects/Elements/Tria.h

    r5831 r5839  
    121121                /*}}}*/
    122122                /*Tria specific routines:{{{1*/
    123                 void      CreateKMatrixBalancedthickness_DG(Mat Kgg);
    124                 void      CreateKMatrixBalancedthickness_CG(Mat Kgg);
     123                ElementMatrix* CreateKMatrixBalancedthickness(void);
     124                ElementMatrix* CreateKMatrixBalancedthickness_DG(void);
     125                ElementMatrix* CreateKMatrixBalancedthickness_CG(void);
    125126                void      CreateKMatrixBalancedvelocities(Mat Kgg);
    126                 void      CreateKMatrixDiagnosticMacAyeal(Mat Kgg,Mat Kff, Mat Kfs);
     127                ElementMatrix* CreateKMatrixDiagnosticMacAyeal(void);
    127128                ElementMatrix* CreateKMatrixDiagnosticMacAyealViscous(void);
    128129                ElementMatrix* CreateKMatrixDiagnosticMacAyealFriction(void);
     
    133134                void      CreateKMatrixDiagnosticSurfaceVert(Mat Kgg);
    134135                void      CreateKMatrixMelting(Mat Kgg);
    135                 void      CreateKMatrixPrognostic_CG(Mat Kgg);
    136                 void      CreateKMatrixPrognostic_DG(Mat Kgg);
     136                ElementMatrix* CreateKMatrixPrognostic(void);
     137                ElementMatrix* CreateKMatrixPrognostic_CG(void);
     138                ElementMatrix* CreateKMatrixPrognostic_DG(void);
    137139                void      CreateKMatrixSlope(Mat Kgg);
    138140                void      CreateKMatrixThermal(Mat Kgg);
  • issm/trunk/src/c/objects/Numerics/ElementMatrix.cpp

    r5834 r5839  
    358358        for(i=0;i<nrows;i++){
    359359                printf("      %i: ",i);
    360                 for(j=0;j<ncols;j++) printf("%g ",*(values+ncols*i+j));
     360                for(j=0;j<ncols;j++) printf("%10g ",*(values+ncols*i+j));
    361361                printf("\n");
    362362        }
    363363
    364364        printf("   gglobaldoflist (%p): ",gglobaldoflist);
    365     if(gglobaldoflist) for(i=0;i<nrows;i++)printf("%i ",gglobaldoflist[i]); printf("\n");
     365        if(gglobaldoflist) for(i=0;i<nrows;i++)printf("%i ",gglobaldoflist[i]); printf("\n");
    366366
    367367        printf("   row_fsize: %i\n",row_fsize);
    368368        printf("   row_flocaldoflist (%p): ",row_flocaldoflist);
    369     if(row_flocaldoflist) for(i=0;i<row_fsize;i++)printf("%i ",row_flocaldoflist[i]); printf("\n");
     369        if(row_flocaldoflist) for(i=0;i<row_fsize;i++)printf("%i ",row_flocaldoflist[i]); printf("\n");
    370370        printf("   row_fglobaldoflist (%p): ",row_fglobaldoflist);
    371371        if(row_fglobaldoflist)for(i=0;i<row_fsize;i++)printf("%i ",row_fglobaldoflist[i]); printf("\n");
     
    373373        printf("   row_ssize: %i\n",row_ssize);
    374374        printf("   row_slocaldoflist (%p): ",row_slocaldoflist);
    375     if(row_slocaldoflist)for(i=0;i<row_ssize;i++)printf("%i ",row_slocaldoflist[i]); printf("\n");
     375        if(row_slocaldoflist)for(i=0;i<row_ssize;i++)printf("%i ",row_slocaldoflist[i]); printf("\n");
    376376        printf("   row_sglobaldoflist (%p): ",row_sglobaldoflist);
    377377        if(row_sglobaldoflist)for(i=0;i<row_ssize;i++)printf("%i ",row_sglobaldoflist[i]); printf("\n");
Note: See TracChangeset for help on using the changeset viewer.