Changeset 5934


Ignore:
Timestamp:
09/21/10 16:58:02 (15 years ago)
Author:
seroussi
Message:

some cleaning in KMAtrix penta

Location:
issm/trunk/src/c/objects/Elements
Files:
2 edited

Legend:

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

    r5933 r5934  
    23712371ElementMatrix* Penta::CreateKMatrixDiagnosticPattynViscous(void){
    23722372
    2373         /* local declarations */
    2374         const int    numdof=2*NUMVERTICES;
    2375         int             i,j,ig;
    2376         double       xyz_list[NUMVERTICES][3];
     2373        /*Constants*/
     2374        const int    numdof=NDOF2*NUMVERTICES;
     2375
     2376        /*Intermediaries */
     2377        int        i,j,ig;
     2378        double     xyz_list[NUMVERTICES][3];
     2379        double     Jdet;
     2380        double     viscosity,oldviscosity,newviscosity,viscosity_overshoot; //viscosity
     2381        double     epsilon[5],oldepsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
     2382        double     D_scalar;
     2383        double     D[5][5]={0.0};            // material matrix, simple scalar matrix.
     2384        double     B[5][numdof];
     2385        double     Bprime[5][numdof];
     2386        double     Ke_gg_gaussian[numdof][numdof]; //stiffness matrix evaluated at the gaussian point.
     2387        Tria*      tria=NULL;
    23772388        GaussPenta *gauss=NULL;
    2378         double viscosity; //viscosity
    2379         double oldviscosity; //viscosity
    2380         double newviscosity; //viscosity
    2381         double viscosity_overshoot;
    2382         double epsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
    2383         double oldepsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
    2384         double B[5][numdof];
    2385         double Bprime[5][numdof];
    2386         double L[2][numdof];
    2387         double D[5][5]={0.0};            // material matrix, simple scalar matrix.
    2388         double D_scalar;
    2389         double DL[2][2]={0.0}; //for basal drag
    2390         double DL_scalar;
    2391         double Ke_gg[numdof][numdof]={0.0}; //local element stiffness matrix
    2392         double Ke_gg_gaussian[numdof][numdof]; //stiffness matrix evaluated at the gaussian point.
    2393         double Jdet;
    2394         double  slope[2]={0.0};
    2395         double  slope_magnitude;
    2396         double  alpha2_list[3];
    2397         double  alpha2;
    2398         double MAXSLOPE=.06; // 6 %
    2399         double MOUNTAINKEXPONENT=10;
    2400         Tria*  tria=NULL;
    24012389
    24022390        /*Initialize Element matrix and return if necessary*/
     
    24182406                gauss->GaussPoint(ig);
    24192407
     2408                GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
     2409                GetBPattyn(&B[0][0], &xyz_list[0][0], gauss);
     2410                GetBprimePattyn(&Bprime[0][0], &xyz_list[0][0], gauss);
     2411
    24202412                this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
    24212413                this->GetStrainRate3dPattyn(&oldepsilon[0],&xyz_list[0][0],gauss,vxold_input,vyold_input);
    24222414                matice->GetViscosity3d(&viscosity, &epsilon[0]);
    24232415                matice->GetViscosity3d(&oldviscosity, &oldepsilon[0]);
    2424 
    2425                 GetBPattyn(&B[0][0], &xyz_list[0][0], gauss);
    2426                 GetBprimePattyn(&Bprime[0][0], &xyz_list[0][0], gauss);
    2427 
    2428                 GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
    24292416
    24302417                newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity);
     
    24952482ElementMatrix* Penta::CreateKMatrixDiagnosticStokesViscous(void){
    24962483
    2497         const int numdof=NUMVERTICES*NDOF4;
    2498         int i,j;
    2499         int     ig;
     2484        /*Intermediaries */
     2485        int        i,j,ig,approximation;
     2486        double     Jdet,viscosity,stokesreconditioning;
    25002487        double     xyz_list[NUMVERTICES][3];
    2501         double    xyz_list_tria[NUMVERTICES2D][3];
    2502         double    bed_normal[3];
    2503         double     Ke_temp[27][27]={0.0}; //for the six nodes and the bubble
    2504         double     Ke_reduced[numdof][numdof]; //for the six nodes only
    2505         double     Ke_gaussian[27][27];
     2488        double     epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
    25062489        double     B[8][27];
    25072490        double     B_prime[8][27];
    2508         double     Jdet;
     2491        double     D_scalar;
    25092492        double     D[8][8]={0.0};
    2510         double     D_scalar;
    2511         double     DLStokes[14][14]={0.0};
     2493        double     Ke_temp[27][27]={0.0}; //for the six nodes and the bubble
     2494        double     Ke_gaussian[27][27];
    25122495        GaussPenta *gauss=NULL;
    2513         double  epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
    2514         double  viscosity;
    2515         double  alpha2_gauss;
    2516         Friction* friction=NULL;
    2517         double stokesreconditioning;
    2518         int analysis_type;
    2519         int approximation;
    25202496
    25212497        /*If on water or not Stokes, skip stiffness: */
     
    25262502        /*Retrieve all inputs and parameters*/
    25272503        GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
    2528         parameters->FindParam(&analysis_type,AnalysisTypeEnum);
    25292504        parameters->FindParam(&stokesreconditioning,StokesReconditioningEnum);
    25302505        Input* vx_input=inputs->GetInput(VxEnum); ISSMASSERT(vx_input);
     
    25382513                gauss->GaussPoint(ig);
    25392514
     2515                GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
     2516                GetBStokes(&B[0][0],&xyz_list[0][0],gauss);
     2517                GetBprimeStokes(&B_prime[0][0],&xyz_list[0][0],gauss);
     2518
    25402519                this->GetStrainRate3d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
    25412520                matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
    25422521
    2543                 GetBStokes(&B[0][0],&xyz_list[0][0],gauss);
    2544                 GetBprimeStokes(&B_prime[0][0],&xyz_list[0][0],gauss);
    2545 
    2546                 GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
    2547 
    2548                 /* Build the D matrix: we plug the gaussian weight, the thickness, the viscosity, and the jacobian determinant
    2549                  * onto this scalar matrix, so that we win some computational time: */
    25502522                D_scalar=gauss->weight*Jdet;
    25512523                for (i=0;i<6;i++) D[i][i]=D_scalar*2*viscosity;
     
    25712543ElementMatrix* Penta::CreateKMatrixDiagnosticStokesFriction(void){
    25722544
     2545        /*Constants*/
    25732546        const int numdof=NUMVERTICES*NDOF4;
    25742547        const int numdof2d=NUMVERTICES2D*NDOF4;
    2575         int i,j;
    2576         int     ig;
     2548
     2549        /*Intermediaries */
     2550        int        i,j,ig;
     2551        int        analysis_type,approximation;
     2552        double     stokesreconditioning;
     2553        double     viscosity,alpha2_gauss,Jdet2d;
     2554        double    bed_normal[3];
     2555        double     epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
    25772556        double     xyz_list[NUMVERTICES][3];
    25782557        double    xyz_list_tria[NUMVERTICES2D][3];
    2579         double    bed_normal[3];
    2580         double     Ke_temp[27][27]={0.0}; //for the six nodes and the bubble
    2581         double     Ke_reduced[numdof][numdof]; //for the six nodes only
    2582         double     Ke_gaussian[27][27];
    2583         double     Ke_drag_gaussian[numdof2d][numdof2d];
    2584         double     B[8][27];
    2585         double     B_prime[8][27];
    25862558        double     LStokes[14][numdof2d];
    25872559        double     LprimeStokes[14][numdof2d];
    2588         double     Jdet;
    2589         double     Jdet2d;
    2590         double     D[8][8]={0.0};
    2591         double     D_scalar;
    25922560        double     DLStokes[14][14]={0.0};
     2561        double     Ke_temp[27][27]={0.0}; //for the six nodes and the bubble
     2562        double     Ke_drag_gaussian[numdof2d][numdof2d];
     2563        Friction*  friction=NULL;
    25932564        GaussPenta *gauss=NULL;
    2594         double  epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
    2595         double  viscosity;
    2596         double  alpha2_gauss;
    2597         Friction* friction=NULL;
    2598         double stokesreconditioning;
    2599         int analysis_type;
    2600         int approximation;
    26012565
    26022566        /*If on water or not Stokes, skip stiffness: */
     
    26232587                gauss->GaussPoint(ig);
    26242588
     2589                GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0],gauss);
    26252590                GetLStokes(&LStokes[0][0], gauss);
    26262591                GetLprimeStokes(&LprimeStokes[0][0], &xyz_list[0][0], gauss);
     
    26302595
    26312596                BedNormal(&bed_normal[0],xyz_list_tria);
    2632                 GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0],gauss);
    26332597                friction->GetAlpha2(&alpha2_gauss, gauss,VxEnum,VyEnum,VzEnum);
    26342598
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r5933 r5934  
    24012401ElementMatrix* Tria::CreateKMatrixBalancedthickness_CG(void){
    24022402
    2403 
    24042403        /*Constants*/
    24052404        const int    numdof=NDOF1*NUMVERTICES;
Note: See TracChangeset for help on using the changeset viewer.