Changeset 511


Ignore:
Timestamp:
05/20/09 07:46:55 (16 years ago)
Author:
Mathieu Morlighem
Message:

first fixing of thermal runs

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

Legend:

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

    r503 r511  
    44
    55#ifdef HAVE_CONFIG_H
    6         #include "config.h"
     6#include "config.h"
    77#else
    88#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
     
    2020}
    2121Penta::Penta( int penta_id, int penta_mid, int penta_mparid, int penta_node_ids[6], double penta_h[6], double penta_s[6], double penta_b[6], double penta_k[6], int penta_friction_type,
    22                                 double penta_p, double penta_q, int penta_shelf, int penta_onbed, int penta_onsurface, double penta_meanvel,double penta_epsvel,
    23                                 int penta_collapse, double penta_melting[6], double penta_accumulation[6], double penta_geothermalflux[6],
    24                                 int penta_artdiff, int penta_thermal_steadystate,double penta_viscosity_overshoot,double penta_stokesreconditioning){
    25        
     22                        double penta_p, double penta_q, int penta_shelf, int penta_onbed, int penta_onsurface, double penta_meanvel,double penta_epsvel,
     23                        int penta_collapse, double penta_melting[6], double penta_accumulation[6], double penta_geothermalflux[6],
     24                        int penta_artdiff, int penta_thermal_steadystate,double penta_viscosity_overshoot,double penta_stokesreconditioning){
     25
    2626        int i;
    2727
     
    8383        printf("   b=[%i,%i,%i,%i,%i,%i]\n",b[0],b[1],b[2],b[3],b[4],b[5]);
    8484        printf("   k=[%i,%i,%i,%i,%i,%i]\n",k[0],k[1],k[2],k[3],k[4],k[5]);
    85        
     85
    8686        printf("   friction_type: %i\n",friction_type);
    8787        printf("   p: %g\n",p);
     
    9393        printf("   epsvel: %g\n",epsvel);
    9494        printf("   collapse: %i\n",collapse);
    95        
     95
    9696        printf("   melting=[%i,%i,%i,%i,%i,%i]\n",melting[0],melting[1],melting[2],melting[3],melting[4],melting[5]);
    9797        printf("   accumulation=[%i,%i,%i,%i,%i,%i]\n",accumulation[0],accumulation[1],accumulation[2],accumulation[3],accumulation[4],accumulation[5]);
     
    114114        /*get enum type of Penta: */
    115115        enum_type=PentaEnum();
    116        
     116
    117117        /*marshall enum: */
    118118        memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    119        
     119
    120120        /*marshall Penta data: */
    121121        memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
     
    149149        memcpy(marshalled_dataset,&viscosity_overshoot,sizeof(viscosity_overshoot));marshalled_dataset+=sizeof(viscosity_overshoot);
    150150        memcpy(marshalled_dataset,&stokesreconditioning,sizeof(stokesreconditioning));marshalled_dataset+=sizeof(stokesreconditioning);
    151        
     151
    152152        *pmarshalled_dataset=marshalled_dataset;
    153153        return;
    154154}
    155                
     155
    156156int   Penta::MarshallSize(){
    157157
    158158        return sizeof(id)+
    159                 sizeof(mid)+
    160                 sizeof(mparid)+
    161                 sizeof(node_ids)+
    162                 sizeof(nodes)+
    163                 sizeof(node_offsets)+
    164                 sizeof(matice)+
    165                 sizeof(matice_offset)+
    166                 sizeof(matpar)+
    167                 sizeof(matpar_offset)+
    168                 sizeof(h)+
    169                 sizeof(s)+
    170                 sizeof(b)+
    171                 sizeof(k)+
    172                 sizeof(friction_type)+
    173                 sizeof(p)+
    174                 sizeof(q)+
    175                 sizeof(shelf)+
    176                 sizeof(onbed)+
    177                 sizeof(onsurface)+
    178                 sizeof(meanvel)+
    179                 sizeof(epsvel)+
    180                 sizeof(collapse)+
    181                 sizeof(melting)+
    182                 sizeof(accumulation)+
    183                 sizeof(geothermalflux)+
    184                 sizeof(artdiff)+
    185                 sizeof(thermal_steadystate) +
    186                 sizeof(viscosity_overshoot) +
    187                 sizeof(stokesreconditioning) +
    188                 sizeof(int); //sizeof(int) for enum type
     159          sizeof(mid)+
     160          sizeof(mparid)+
     161          sizeof(node_ids)+
     162          sizeof(nodes)+
     163          sizeof(node_offsets)+
     164          sizeof(matice)+
     165          sizeof(matice_offset)+
     166          sizeof(matpar)+
     167          sizeof(matpar_offset)+
     168          sizeof(h)+
     169          sizeof(s)+
     170          sizeof(b)+
     171          sizeof(k)+
     172          sizeof(friction_type)+
     173          sizeof(p)+
     174          sizeof(q)+
     175          sizeof(shelf)+
     176          sizeof(onbed)+
     177          sizeof(onsurface)+
     178          sizeof(meanvel)+
     179          sizeof(epsvel)+
     180          sizeof(collapse)+
     181          sizeof(melting)+
     182          sizeof(accumulation)+
     183          sizeof(geothermalflux)+
     184          sizeof(artdiff)+
     185          sizeof(thermal_steadystate) +
     186          sizeof(viscosity_overshoot) +
     187          sizeof(stokesreconditioning) +
     188          sizeof(int); //sizeof(int) for enum type
    189189}
    190190
     
    262262
    263263        int i;
    264        
     264
    265265        DataSet* loadsin=NULL;
    266266        DataSet* nodesin=NULL;
     
    274274        /*Link this element with its nodes, ie find pointers to the nodes in the nodes dataset.: */
    275275        ResolvePointers((Object**)nodes,node_ids,node_offsets,6,nodesin);
    276        
     276
    277277        /*Same for materials: */
    278278        ResolvePointers((Object**)&matice,&mid,&matice_offset,1,materialsin);
     
    293293        }
    294294        else if (analysis_type==DiagnosticAnalysisEnum()){
    295        
     295
    296296                if (sub_analysis_type==HorizAnalysisEnum()){
    297                
     297
    298298                        CreateKMatrixDiagnosticHoriz( Kgg,inputs,analysis_type,sub_analysis_type);
    299299                }
    300300                else if (sub_analysis_type==VertAnalysisEnum()){
    301                
     301
    302302                        CreateKMatrixDiagnosticVert( Kgg,inputs,analysis_type,sub_analysis_type);
    303303                }
    304304                else if (sub_analysis_type==StokesAnalysisEnum()){
    305                
     305
    306306                        CreateKMatrixDiagnosticStokes( Kgg,inputs,analysis_type,sub_analysis_type);
    307                
     307
    308308                }
    309309                else throw ErrorException(__FUNCT__,exprintf("%s%i%s\n","sub_analysis: ",sub_analysis_type," not supported yet"));
    310310        }
    311311        else if (analysis_type==SlopeComputeAnalysisEnum()){
    312                
     312
    313313                CreateKMatrixSlopeCompute( Kgg,inputs,analysis_type,sub_analysis_type);
    314314        }
    315315        else if (analysis_type==ThermalAnalysisEnum()){
    316                
     316
    317317                CreateKMatrixThermal( Kgg,inputs,analysis_type,sub_analysis_type);
    318318        }
    319319        else if (analysis_type==MeltingAnalysisEnum()){
    320                
     320
    321321                CreateKMatrixMelting( Kgg,inputs,analysis_type,sub_analysis_type);
    322322        }
     
    342342        int          doflist[numdof];
    343343        int          numberofdofspernode;
    344        
    345        
     344
     345
    346346        /* 3d gaussian points: */
    347347        int     num_gauss,ig;
     
    359359        int     num_area_gauss;
    360360        double  gauss_weight;
    361        
     361
    362362        /* 2d gaussian point: */
    363363        int     num_gauss2d;
     
    391391        double Ke_gg_drag_gaussian[numdof][numdof]; //stiffness matrix contribution from drag
    392392        double Jdet;
    393        
     393
    394394        /*slope: */
    395395        double  slope[2]={0.0,0.0};
     
    454454                }
    455455
    456                 #ifdef _DEBUGELEMENTS_
     456#ifdef _DEBUGELEMENTS_
    457457                if(my_rank==RANK && id==ELID){
    458458                        printf("El id %i Rank %i PentaElement input list before gaussian loop: \n",ELID,RANK);
     
    471471                        printf("   temperature_average [%g %g %g %g %g %g]\n",temperature_average_list[0],temperature_average_list[1],temperature_average_list[2],temperature_average_list[3],temperature_average_list[4],temperature_average_list[5]);
    472472                }
    473                 #endif
     473#endif
    474474
    475475                /*Get gaussian points and weights. Penta is an extrusion of a Tria, we therefore
     
    484484                GaussPenta( &num_area_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &area_gauss_weights, &fourth_gauss_vert_coord,&vert_gauss_weights,order_area_gauss,num_vert_gauss);
    485485
    486                 #ifdef _DEBUGGAUSS_
     486#ifdef _DEBUGGAUSS_
    487487                if(my_rank==RANK && id==ELID){
    488488                        printf("El id %i Rank %i PentaElement gauss points\n",ELID,RANK);
     
    494494                        }       
    495495                }
    496                 #endif
     496#endif
    497497                /* Start  looping on the number of gaussian points: */
    498498                for (ig1=0; ig1<num_area_gauss; ig1++){
    499499                        for (ig2=0; ig2<num_vert_gauss; ig2++){
    500                        
     500
    501501                                /*Pick up the gaussian point: */
    502502                                gauss_weight1=*(area_gauss_weights+ig1);
    503503                                gauss_weight2=*(vert_gauss_weights+ig2);
    504504                                gauss_weight=gauss_weight1*gauss_weight2;
    505                                
    506                                
     505
     506
    507507                                gauss_l1l2l3l4[0]=*(first_gauss_area_coord+ig1);
    508508                                gauss_l1l2l3l4[1]=*(second_gauss_area_coord+ig1);
     
    514514                                GetStrainRate(&epsilon[0],&vxvy_list[0][0],&xyz_list[0][0],gauss_l1l2l3l4);
    515515                                GetStrainRate(&oldepsilon[0],&oldvxvy_list[0][0],&xyz_list[0][0],gauss_l1l2l3l4);
    516                        
     516
    517517                                /*Get viscosity: */
    518518                                matice->GetViscosity3d(&viscosity, &epsilon[0]);
     
    525525                                /* Get Jacobian determinant: */
    526526                                GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss_l1l2l3l4);
    527        
     527
    528528                                /*Build the D matrix: we plug the gaussian weight, the thickness, the viscosity, and the jacobian determinant
    529529                                  onto this scalar matrix, so that we win some computational time: */
    530                                
     530
    531531                                newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity);
    532532                                D_scalar=newviscosity*gauss_weight*Jdet;
     
    534534                                        D[i][i]=D_scalar;
    535535                                }
    536                
     536
    537537                                /*  Do the triple product tB*D*Bprime: */
    538538                                TripleMultiply( &B[0][0],5,numdof,1,
    539                                                 &D[0][0],5,5,0,
    540                                                 &Bprime[0][0],5,numdof,0,
    541                                                 &Ke_gg_gaussian[0][0],0);
     539                                                        &D[0][0],5,5,0,
     540                                                        &Bprime[0][0],5,numdof,0,
     541                                                        &Ke_gg_gaussian[0][0],0);
    542542
    543543                                /* Add the Ke_gg_gaussian, and optionally Ke_gg_gaussian onto Ke_gg: */
     
    549549                        } //for (ig2=0; ig2<num_vert_gauss; ig2++)
    550550                } //for (ig1=0; ig1<num_area_gauss; ig1++)
    551                
     551
    552552
    553553                /*Add Ke_gg to global matrix Kgg: */
    554554                MatSetValues(Kgg,numdof,doflist,numdof,doflist,(const double*)Ke_gg,ADD_VALUES);
    555        
     555
    556556                //Deal with 2d friction at the bedrock interface
    557557                if((onbed && !shelf)){
     
    567567
    568568        }
    569                
    570         cleanup_and_return:
     569
     570cleanup_and_return:
    571571        xfree((void**)&first_gauss_area_coord);
    572572        xfree((void**)&second_gauss_area_coord);
     
    627627        /*recover pointers: */
    628628        inputs=(ParameterInputs*)vinputs;
    629        
     629
    630630
    631631        /*If this element  is on the surface, we have a dynamic boundary condition that applies, as a stiffness
     
    660660
    661661        GaussPenta( &num_area_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &area_gauss_weights, &fourth_gauss_vert_coord,&vert_gauss_weights,order_area_gauss,num_vert_gauss);
    662         #ifdef _DEBUG_
     662#ifdef _DEBUG_
    663663        for (i=0;i<num_area_gauss;i++){
    664664                _printf_("Area Gauss coord %i: %lf %lf %lf Weight: %lf\n",i,*(first_gauss_area_coord+i),*(second_gauss_area_coord+i),*(third_gauss_area_coord+i),*(area_gauss_weights+i));
     
    667667                _printf_("Vert Gauss coord %i: %lf Weight: %lf\n",i,*(fourth_gauss_vert_coord+i),*(vert_gauss_weights+i));
    668668        }
    669         #endif
    670        
     669#endif
     670
    671671        /* Start  looping on the number of gaussian points: */
    672672        for (ig1=0; ig1<num_area_gauss; ig1++){
    673673                for (ig2=0; ig2<num_vert_gauss; ig2++){
    674                
     674
    675675                        /*Pick up the gaussian point: */
    676676                        gauss_weight1=*(area_gauss_weights+ig1);
    677677                        gauss_weight2=*(vert_gauss_weights+ig2);
    678678                        gauss_weight=gauss_weight1*gauss_weight2;
    679                        
     679
    680680                        gauss_l1l2l3l4[0]=*(first_gauss_area_coord+ig1);
    681681                        gauss_l1l2l3l4[1]=*(second_gauss_area_coord+ig1);
     
    693693                        /*  Do the triple product tB*D*Bprime: */
    694694                        TripleMultiply( &B[0][0],1,numgrids,1,
    695                                         &DL_scalar,1,1,0,
    696                                         &Bprime[0][0],1,numgrids,0,
    697                                         &Ke_gg_gaussian[0][0],0);
     695                                                &DL_scalar,1,1,0,
     696                                                &Bprime[0][0],1,numgrids,0,
     697                                                &Ke_gg_gaussian[0][0],0);
    698698
    699699                        /* Add the Ke_gg_gaussian, and optionally Ke_gg_drag_gaussian onto Ke_gg: */
     
    708708        /*Add Ke_gg to global matrix Kgg: */
    709709        MatSetValues(Kgg,numdof,doflist,numdof,doflist,(const double*)Ke_gg,ADD_VALUES);
    710        
    711         cleanup_and_return:
     710
     711cleanup_and_return:
    712712        xfree((void**)&first_gauss_area_coord);
    713713        xfree((void**)&second_gauss_area_coord);
     
    740740        double         gravity,rho_ice,rho_water;
    741741
    742        
     742
    743743        /*Collapsed formulation: */
    744744        Tria*  tria=NULL;
     
    746746        /*Grid data: */
    747747        double        xyz_list[numgrids][3];
    748        
     748
    749749        /*parameters: */
    750750        double             xyz_list_tria[numgrids2d][3];
     
    770770        double     DLStokes[14][14]={0.0};
    771771        double     tLDStokes[numdof2d][14];
    772        
     772
    773773        /* gaussian points: */
    774774        int     num_area_gauss;
     
    792792        double  alpha2_list[numgrids2d];
    793793        double  alpha2_gauss;
    794        
     794
    795795        ParameterInputs* inputs=NULL;
    796796
     
    804804                }
    805805        }
    806        
     806
    807807        /*recovre material parameters: */
    808808        rho_water=matpar->GetRhoWater();
     
    818818
    819819        /* Get gaussian points and weights. Penta is an extrusion of a Tria, we therefore
    820            get tria gaussian points as well as segment gaussian points. For tria gaussian
    821            points, order of integration is 2, because we need to integrate the product tB*D*B'
    822            which is a polynomial of degree 3 (see GaussTria for more details). For segment gaussian
    823            points, same deal, which yields 3 gaussian points.*/
     820                get tria gaussian points as well as segment gaussian points. For tria gaussian
     821                points, order of integration is 2, because we need to integrate the product tB*D*B'
     822                which is a polynomial of degree 3 (see GaussTria for more details). For segment gaussian
     823                points, same deal, which yields 3 gaussian points.*/
    824824
    825825        area_order=5;
     
    845845                        /*Compute strain rate: */
    846846                        GetStrainRateStokes(&epsilon[0],&vxvyvz_list[0][0],&xyz_list[0][0],gauss_coord);
    847                
     847
    848848                        /*Get viscosity: */
    849849                        matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
     
    883883                /*Build alpha2_list used by drag stiffness matrix*/
    884884                Friction* friction=NewFriction();
    885                
     885
    886886                /*Initialize all fields: */
    887887                friction->element_type=(char*)xmalloc((strlen("2d")+1)*sizeof(char));
    888888                strcpy(friction->element_type,"2d");
    889                
     889
    890890                friction->gravity=matpar->GetG();
    891891                friction->rho_ice=matpar->GetRhoIce();
     
    910910                        }
    911911                }
    912                
     912
    913913                GaussTria (&num_area_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &area_gauss_weights, 2);
    914914
     
    920920                        gauss_coord[2]=*(third_gauss_area_coord+igarea);
    921921                        gauss_coord[3]=-1;
    922                        
     922
    923923                        gauss_coord_tria[0]=*(first_gauss_area_coord+igarea);
    924924                        gauss_coord_tria[1]=*(second_gauss_area_coord+igarea);
    925925                        gauss_coord_tria[2]=*(third_gauss_area_coord+igarea);
    926        
     926
    927927                        /*Get the Jacobian determinant */
    928928                        tria->GetJacobianDeterminant3d(&Jdet2d, &xyz_list_tria[0][0], gauss_coord_tria);
    929                        
     929
    930930                        /*Get L matrix if viscous basal drag present: */
    931931                        GetLStokes(&LStokes[0][0],  gauss_coord_tria);
    932932                        GetLprimeStokes(&LprimeStokes[0][0], &xyz_list[0][0], gauss_coord_tria, gauss_coord);
    933                                
     933
    934934                        /*Compute strain rate: */
    935935                        GetStrainRateStokes(&epsilon[0],&vxvyvz_list[0][0],&xyz_list[0][0],gauss_coord);
    936                
     936
    937937                        /*Get viscosity at last iteration: */
    938938                        matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
    939        
     939
    940940                        /*Get normal vecyor to the bed */
    941941                        SurfaceNormal(&surface_normal[0],xyz_list_tria);
    942                        
     942
    943943                        bed_normal[0]=-surface_normal[0]; //Program is for surface, so the normal to the bed is the opposite of the result
    944944                        bed_normal[1]=-surface_normal[1];
     
    974974                }
    975975        } //if ( (onbed==1) && (shelf==0))
    976        
     976
    977977        /*Reduce the matrix */
    978978        ReduceMatrixStokes(&Ke_reduced[0][0], &Ke_temp[0][0]);
     
    986986        /*Add Ke_gg to global matrix Kgg: */
    987987        MatSetValues(Kgg,numdof,doflist,numdof,doflist,(const double*)K_terms,ADD_VALUES);
    988        
    989         cleanup_and_return:
     988
     989cleanup_and_return:
    990990
    991991        return;
     
    998998        /*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */
    999999        if (analysis_type==ControlAnalysisEnum()){
    1000                
     1000
    10011001                CreatePVectorDiagnosticHoriz( pg,inputs,analysis_type,sub_analysis_type);
    10021002        }
    10031003        else if (analysis_type==DiagnosticAnalysisEnum()){
    1004        
     1004
    10051005                if (sub_analysis_type==HorizAnalysisEnum()){
    10061006
     
    10081008                }
    10091009                else if (sub_analysis_type==VertAnalysisEnum()){
    1010                
     1010
    10111011                        CreatePVectorDiagnosticVert( pg,inputs,analysis_type,sub_analysis_type);
    10121012                }
    10131013                else if (sub_analysis_type==StokesAnalysisEnum()){
    1014                
     1014
    10151015                        CreatePVectorDiagnosticStokes( pg,inputs,analysis_type,sub_analysis_type);
    10161016                }
     
    10181018        }
    10191019        else if (analysis_type==SlopeComputeAnalysisEnum()){
    1020                
     1020
    10211021                CreatePVectorSlopeCompute( pg,inputs,analysis_type,sub_analysis_type);
    10221022        }
    10231023        else if (analysis_type==ThermalAnalysisEnum()){
    1024                
     1024
    10251025                CreatePVectorThermal( pg,inputs,analysis_type,sub_analysis_type);
    10261026        }
    10271027        else if (analysis_type==MeltingAnalysisEnum()){
    1028                
     1028
    10291029                CreatePVectorMelting( pg,inputs,analysis_type,sub_analysis_type);
    10301030        }
     
    10561056        inputs->Recover("melting",&melting[0],1,dofs,6,(void**)nodes);
    10571057        inputs->Recover("accumulation_param",&accumulation[0],1,dofs,6,(void**)nodes);
    1058        
     1058
    10591059        //Update material if necessary
    10601060        if(inputs->Recover("temperature_average",&temperature_list[0],1,dofs,6,(void**)nodes)){
     
    10631063                matice->SetB(B_average);
    10641064        }
    1065        
     1065
    10661066        if(inputs->Recover("B",&B_list[0],1,dofs,6,(void**)nodes)){
    10671067                B_average=(B_list[0]+B_list[1]+B_list[2]+B_list[3]+B_list[4]+B_list[5])/6.0;
     
    10881088        }
    10891089}
    1090                
     1090
    10911091int Penta::GetOnBed(){
    10921092        return onbed;
     
    10991099}
    11001100void          Penta::GetBedList(double* bed_list){
    1101        
     1101
    11021102        int i;
    11031103        for(i=0;i<6;i++)bed_list[i]=b[i];
     
    11151115        int i;
    11161116        Tria* tria=NULL;
    1117        
     1117
    11181118        /*Bail out if this element if:
    11191119         * -> Non collapsed and not on the surface
     
    11321132        }
    11331133        else{
    1134                
     1134
    11351135                tria=(Tria*)SpawnTria(3,4,5); //grids 3, 4 and 5 make the new tria (upper face).
    11361136                tria->Du(du_g,u_g,u_g_obs,inputs,analysis_type,sub_analysis_type);
     
    11561156#define __FUNCT__ "Penta::GradjDrag"
    11571157void  Penta::GradjDrag(Vec grad_g,double* u_g,double* lambda_g,void* inputs,int analysis_type,int sub_analysis_type){
    1158        
    1159        
     1158
     1159
    11601160        Tria* tria=NULL;
    1161        
     1161
    11621162        /*Bail out if this element does not touch the bedrock: */
    11631163        if (!onbed){
     
    11651165        }
    11661166        else{
    1167                
     1167
    11681168                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    11691169                tria->GradjDrag( grad_g,u_g,lambda_g,inputs,analysis_type,sub_analysis_type);
     
    11781178        throw ErrorException(__FUNCT__," not supported yet!");
    11791179}
    1180        
     1180
    11811181#undef __FUNCT__
    11821182#define __FUNCT__ "Penta::Misfit"
    11831183double Penta::Misfit(double* velocity,double* obs_velocity,void* inputs,int analysis_type,int sub_analysis_type){
    1184        
     1184
    11851185        double J;
    11861186        Tria* tria=NULL;
    1187        
     1187
    11881188        /*Bail out if this element if:
    11891189         * -> Non collapsed and not on the surface
     
    12091209        }
    12101210}
    1211                
     1211
    12121212#undef __FUNCT__
    12131213#define __FUNCT__ "Penta::SpawnTria"
     
    12241224        double   tria_accumulation[3];
    12251225        double   tria_geothermalflux[3];
    1226        
     1226
    12271227        /*configuration: */
    12281228        int tria_node_ids[3];
     
    12491249        tria_melting[1]=melting[g1];
    12501250        tria_melting[2]=melting[g2];
    1251        
     1251
    12521252        tria_accumulation[0]=accumulation[g0];
    12531253        tria_accumulation[1]=accumulation[g1];
     
    12861286        int doflist_per_node[MAXDOFSPERNODE];
    12871287        int numberofdofspernode;
    1288        
     1288
    12891289        for(i=0;i<6;i++){
    12901290                nodes[i]->GetDofList(&doflist_per_node[0],&numberofdofspernode);
     
    13201320        GetB(&B[0][0], xyz_list, gauss_l1l2l3l4);
    13211321
    1322         #ifdef _DEBUG_
     1322#ifdef _DEBUG_
    13231323        _printf_("B for grid1 : [ %lf   %lf  \n",B[0][0],B[0][1]);
    13241324        _printf_("              [ %lf   %lf  \n",B[1][0],B[1][1]);
     
    13261326        _printf_("              [ %lf   %lf  ]\n",B[3][0],B[3][1]);
    13271327        _printf_("              [ %lf   %lf  ]\n",B[4][0],B[4][1]);
    1328        
     1328
    13291329        _printf_("B for grid2 : [ %lf   %lf  \n",B[0][2],B[0][3]);
    13301330        _printf_("              [ %lf   %lf  \n",B[1][2],B[1][3]);
     
    13321332        _printf_("              [ %lf   %lf  ]\n",B[3][2],B[3][3]);
    13331333        _printf_("              [ %lf   %lf  ]\n",B[4][2],B[4][3]);
    1334        
     1334
    13351335        _printf_("B for grid3 : [ %lf   %lf  \n", B[0][4],B[0][5]);
    13361336        _printf_("              [ %lf   %lf  \n", B[1][4],B[1][5]);
     
    13381338        _printf_("              [ %lf   %lf  ]\n",B[3][4],B[3][5]);
    13391339        _printf_("              [ %lf   %lf  ]\n",B[4][4],B[4][5]);
    1340        
     1340
    13411341        _printf_("B for grid4 : [ %lf   %lf  \n", B[0][6],B[0][7]);
    13421342        _printf_("              [ %lf   %lf  \n", B[1][6],B[1][7]);
     
    13441344        _printf_("              [ %lf   %lf  ]\n",B[3][6],B[3][7]);
    13451345        _printf_("              [ %lf   %lf  ]\n",B[4][6],B[4][7]);
    1346                                
     1346
    13471347        _printf_("B for grid5 : [ %lf   %lf  \n", B[0][8],B[0][9]);
    13481348        _printf_("              [ %lf   %lf  \n", B[1][8],B[1][9]);
     
    13601360                _printf_("Velocity for grid %i %lf %lf\n",i,*(vxvy_list+2*i+0),*(vxvy_list+2*i+1));
    13611361        }
    1362         #endif
     1362#endif
    13631363
    13641364        /*Multiply B by velocity, to get strain rate: */
    13651365        MatrixMultiply( &B[0][0],5,NDOF2*numgrids,0,
    1366                                       velocity,NDOF2*numgrids,1,0,
    1367                                                   epsilon,0);
     1366                                velocity,NDOF2*numgrids,1,0,
     1367                                epsilon,0);
    13681368
    13691369}
     
    13851385         * We assume B has been allocated already, of size: 5x(NDOF2*numgrids)
    13861386         */
    1387        
     1387
    13881388        int i;
    13891389        const int numgrids=6;
     
    13961396        GetNodalFunctionsDerivativesBasic(&dh1dh2dh3dh4dh5dh6_basic[0][0],xyz_list, gauss_l1l2l3l4);
    13971397
    1398         #ifdef _DEBUG_
     1398#ifdef _DEBUG_
    13991399        for (i=0;i<numgrids;i++){
    14001400                _printf_("Node %i  dh/dx=%lf dh/dy=%lf dh/dz=%lf\n",i,dh1dh2dh3dh4dh5dh6_basic[0][i],dh1dh2dh3dh4dh5dh6_basic[1][i],dh1dh2dh3dh4dh5dh6_basic[2][i]);
    14011401        }
    1402         #endif
     1402#endif
    14031403
    14041404        /*Build B: */
     
    14151415                *(B+NDOF2*numgrids*3+NDOF2*i)=(float).5*dh1dh2dh3dh4dh5dh6_basic[2][i];
    14161416                *(B+NDOF2*numgrids*3+NDOF2*i+1)=0.0;
    1417                
     1417
    14181418                *(B+NDOF2*numgrids*4+NDOF2*i)=0.0;
    14191419                *(B+NDOF2*numgrids*4+NDOF2*i+1)=(float).5*dh1dh2dh3dh4dh5dh6_basic[2][i];
     
    14391439         * We assume B has been allocated already, of size: 5x(NDOF2*numgrids)
    14401440         */
    1441        
     1441
    14421442        int i;
    14431443        const int NDOF3=3;
     
    14501450        GetNodalFunctionsDerivativesBasic(&dh1dh2dh3dh4dh5dh6_basic[0][0],xyz_list, gauss_l1l2l3l4);
    14511451
    1452         #ifdef _DEBUG_
     1452#ifdef _DEBUG_
    14531453        for (i=0;i<numgrids;i++){
    14541454                _printf_("Node %i  dh/dx=%lf dh/dy=%lf dh/dz=%lf\n",i,dh1dh2dh3dh4dh5dh6_basic[0][i],dh1dh2dh3dh4dh5dh6_basic[1][i],dh1dh2dh3dh4dh5dh6_basic[2][i]);
    14551455        }
    1456         #endif
     1456#endif
    14571457
    14581458        /*Build BPrime: */
     
    14691469                *(B+NDOF2*numgrids*3+NDOF2*i)=dh1dh2dh3dh4dh5dh6_basic[2][i];
    14701470                *(B+NDOF2*numgrids*3+NDOF2*i+1)=0.0;
    1471                
     1471
    14721472                *(B+NDOF2*numgrids*4+NDOF2*i)=0.0;
    14731473                *(B+NDOF2*numgrids*4+NDOF2*i+1)=dh1dh2dh3dh4dh5dh6_basic[2][i];
     
    14821482         * the determinant of it: */
    14831483        const int NDOF3=3;
    1484        
     1484
    14851485        double J[NDOF3][NDOF3];
    14861486
     
    14961496#define __FUNCT__ "Penta::GetNodalFunctionsDerivativesBasic"
    14971497void Penta::GetNodalFunctionsDerivativesBasic(double* dh1dh2dh3dh4dh5dh6_basic,double* xyz_list, double* gauss_l1l2l3l4){
    1498        
     1498
    14991499        /*This routine returns the values of the nodal functions derivatives  (with respect to the basic coordinate system: */
    15001500
    1501        
     1501
    15021502        int i;
    15031503        const int NDOF3=3;
     
    15341534        const int NDOF3=3;
    15351535        int i,j;
    1536        
     1536
    15371537        /*The Jacobian is constant over the element, discard the gaussian points.
    15381538         * J is assumed to have been allocated of size NDOF2xNDOF2.*/
     
    15441544        double y1,y2,y3,y4,y5,y6;
    15451545        double z1,z2,z3,z4,z5,z6;
    1546        
     1546
    15471547        double sqrt3=sqrt(3.0);
    1548        
     1548
    15491549        /*Figure out xi,eta and zi (parametric coordinates), for this gaussian point: */
    15501550        A1=gauss_l1l2l3l4[0];
     
    15621562        x5=*(xyz_list+3*4+0);
    15631563        x6=*(xyz_list+3*5+0);
    1564        
     1564
    15651565        y1=*(xyz_list+3*0+1);
    15661566        y2=*(xyz_list+3*1+1);
     
    15901590        *(J+NDOF3*2+2)=sqrt3/12.0*(z1+z2-2*z3-z4-z5+2*z6)*eta+1.0/4.0*(z1-z2-z4+z5)*xi+1.0/4.0*(-z1+z5-z2+z4);
    15911591
    1592         #ifdef _DEBUG_
     1592#ifdef _DEBUG_
    15931593        for(i=0;i<3;i++){
    15941594                for (j=0;j<3;j++){
     
    15971597                printf("\n");
    15981598        }
    1599         #endif
     1599#endif
    16001600}
    16011601
     
    16031603#define __FUNCT__ "Penta::GetNodalFunctionsDerivativesParams"
    16041604void Penta::GetNodalFunctionsDerivativesParams(double* dl1dl2dl3dl4dl5dl6,double* gauss_l1l2l3l4){
    1605        
     1605
    16061606        /*This routine returns the values of the nodal functions derivatives  (with respect to the
    16071607         * natural coordinate system) at the gaussian point. Those values vary along xi,eta,z */
     
    16101610        double A1,A2,A3,z;
    16111611        double sqrt3=sqrt(3.0);
    1612        
     1612
    16131613        A1=gauss_l1l2l3l4[0]; //first area coordinate value. In term of xi and eta: A1=(1-xi)/2-eta/(2*sqrt(3));
    16141614        A2=gauss_l1l2l3l4[1]; //second area coordinate value In term of xi and eta: A2=(1+xi)/2-eta/(2*sqrt(3));
     
    16771677        int          doflist[numdof];
    16781678        int          numberofdofspernode;
    1679        
     1679
    16801680        /* parameters: */
    16811681        double  slope[NDOF2];
     
    17521752
    17531753                GaussPenta( &num_area_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &area_gauss_weights, &fourth_gauss_vert_coord,&vert_gauss_weights,order_area_gauss,num_vert_gauss);
    1754                 #ifdef _DEBUG_
     1754#ifdef _DEBUG_
    17551755                for (i=0;i<num_area_gauss;i++){
    17561756                        _printf_("Area Gauss coord %i: %lf %lf %lf Weight: %lf\n",i,*(first_gauss_area_coord+i),*(second_gauss_area_coord+i),*(third_gauss_area_coord+i),*(area_gauss_weights+i));
     
    17591759                        _printf_("Vert Gauss coord %i: %lf Weight: %lf\n",i,*(fourth_gauss_vert_coord+i),*(vert_gauss_weights+i));
    17601760                }
    1761                 #endif
    1762        
     1761#endif
     1762
    17631763                /* Start  looping on the number of gaussian points: */
    17641764                for (ig1=0; ig1<num_area_gauss; ig1++){
    17651765                        for (ig2=0; ig2<num_vert_gauss; ig2++){
    1766                        
     1766
    17671767                                /*Pick up the gaussian point: */
    17681768                                gauss_weight1=*(area_gauss_weights+ig1);
    17691769                                gauss_weight2=*(vert_gauss_weights+ig2);
    17701770                                gauss_weight=gauss_weight1*gauss_weight2;
    1771                                
     1771
    17721772                                gauss_l1l2l3l4[0]=*(first_gauss_area_coord+ig1);
    17731773                                gauss_l1l2l3l4[1]=*(second_gauss_area_coord+ig1);
    17741774                                gauss_l1l2l3l4[2]=*(third_gauss_area_coord+ig1);
    17751775                                gauss_l1l2l3l4[3]=*(fourth_gauss_vert_coord+ig2);
    1776                
     1776
    17771777                                /*Compute thickness at gaussian point: */
    17781778                                GetParameterValue(&thickness, &h[0],gauss_l1l2l3l4);
     
    17831783                                /* Get Jacobian determinant: */
    17841784                                GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss_l1l2l3l4);
    1785                
    1786                                  /*Get nodal functions: */
     1785
     1786                                /*Get nodal functions: */
    17871787                                GetNodalFunctions(l1l2l3l4l5l6, gauss_l1l2l3l4);
    17881788
     
    18081808        VecSetValues(pg,numdof,doflist,(const double*)pe_g,ADD_VALUES);
    18091809
    1810         cleanup_and_return:
     1810cleanup_and_return:
    18111811        xfree((void**)&first_gauss_area_coord);
    18121812        xfree((void**)&second_gauss_area_coord);
     
    18221822#define __FUNCT__ "Penta::CreateKMatrix"
    18231823void Penta::GetParameterValue(double* pvalue, double* v_list,double* gauss_l1l2l3l4){
    1824        
     1824
    18251825        const int numgrids=6;
    18261826        double l1l2l3l4l5l6[numgrids];
     
    18341834#define __FUNCT__ "Penta::GetParameterDerivativeValue"
    18351835void Penta::GetParameterDerivativeValue(double* p, double* p_list,double* xyz_list, double* gauss_l1l2l3l4){
    1836                                
     1836
    18371837        /*From grid values of parameter p (p_list[0], p_list[1], p_list[2], p_list[3], p_list[4] and p_list[4]), return parameter derivative value at gaussian point specified by gauss_l1l2l3l4:
    18381838         *   dp/dx=p_list[0]*dh1/dx+p_list[1]*dh2/dx+p_list[2]*dh3/dx+p_list[3]*dh4/dx+p_list[4]*dh5/dx+p_list[5]*dh6/dx;
     
    18491849        /*Get dh1dh2dh3dh4dh5dh6_basic in basic coordinate system: */
    18501850        GetNodalFunctionsDerivativesBasic(&dh1dh2dh3dh4dh5dh6_basic[0][0],xyz_list, gauss_l1l2l3l4);
    1851        
     1851
    18521852        *(p+0)=p_list[0]*dh1dh2dh3dh4dh5dh6_basic[0][0]+p_list[1]*dh1dh2dh3dh4dh5dh6_basic[0][1]+p_list[2]*dh1dh2dh3dh4dh5dh6_basic[0][2]+p_list[3]*dh1dh2dh3dh4dh5dh6_basic[0][3]+p_list[4]*dh1dh2dh3dh4dh5dh6_basic[0][4]+p_list[5]*dh1dh2dh3dh4dh5dh6_basic[0][5];
    1853 ;
     1853        ;
    18541854        *(p+1)=p_list[0]*dh1dh2dh3dh4dh5dh6_basic[1][0]+p_list[1]*dh1dh2dh3dh4dh5dh6_basic[1][1]+p_list[2]*dh1dh2dh3dh4dh5dh6_basic[1][2]+p_list[3]*dh1dh2dh3dh4dh5dh6_basic[1][3]+p_list[4]*dh1dh2dh3dh4dh5dh6_basic[1][4]+p_list[5]*dh1dh2dh3dh4dh5dh6_basic[1][5];
    18551855
     
    18611861#define __FUNCT__ "Penta::GetNodalFunctions"
    18621862void Penta::GetNodalFunctions(double* l1l2l3l4l5l6, double* gauss_l1l2l3l4){
    1863        
     1863
    18641864        /*This routine returns the values of the nodal functions  at the gaussian point.*/
    18651865
     
    18671867
    18681868        l1l2l3l4l5l6[1]=gauss_l1l2l3l4[1]*(1-gauss_l1l2l3l4[3])/2.0;
    1869        
     1869
    18701870        l1l2l3l4l5l6[2]=gauss_l1l2l3l4[2]*(1-gauss_l1l2l3l4[3])/2.0;
    18711871
     
    18731873
    18741874        l1l2l3l4l5l6[4]=gauss_l1l2l3l4[1]*(1+gauss_l1l2l3l4[3])/2.0;
    1875        
     1875
    18761876        l1l2l3l4l5l6[5]=gauss_l1l2l3l4[2]*(1+gauss_l1l2l3l4[3])/2.0;
    18771877
     
    18881888        int          nodedofs[2];
    18891889        int          numberofdofspernode;
    1890        
     1890
    18911891        Node* node=NULL;
    18921892        int   i;
    18931893        double velocity[2];
    1894                
     1894
    18951895
    18961896        if((collapse==1) && (onbed==1)){
    1897                        
     1897
    18981898                GetDofList(&doflist[0],&numberofdofspernode);
    18991899
     
    19021902                 * inserting the same velocity value into ug, until we reach the surface: */
    19031903                for(i=0;i<3;i++){
    1904        
     1904
    19051905                        node=nodes[i]; //base nodes
    1906        
     1906
    19071907                        /*get velocity for this base node: */
    19081908                        velocity[0]=ug_serial[doflist[numberofdofspernode*i+0]];
     
    19381938        int          nodedof;
    19391939        int          numberofdofspernode;
    1940        
     1940
    19411941        Node* node=NULL;
    19421942        int   i;
    19431943        double slope;
    1944                
     1944
    19451945
    19461946        if(onbed==1){
    1947                        
     1947
    19481948                GetDofList(&doflist[0],&numberofdofspernode);
    19491949
     
    19521952                /*For each node on the base of this penta,  we grab the slope. Once we know the slope, we follow the upper nodes,
    19531953                 * inserting the same slope value into sg, until we reach the surface: */
    1954                
     1954
    19551955                for(i=0;i<3;i++){
    1956        
     1956
    19571957                        node=nodes[i]; //base nodes
    1958        
     1958
    19591959                        /*get velocity for this base node: */
    19601960                        slope=sg_serial[doflist[i]];
     
    19841984
    19851985        /*      Compute B  matrix. B=[dh1/dz dh2/dz dh3/dz dh4/dz dh5/dz dh6/dz];
    1986         where hi is the interpolation function for grid i.*/
     1986                where hi is the interpolation function for grid i.*/
    19871987
    19881988        int i;
     
    19941994        GetNodalFunctionsDerivativesBasic(&dh1dh2dh3dh4dh5dh6_basic[0][0],xyz_list, gauss_l1l2l3l4);
    19951995
    1996         #ifdef _DEBUG_
     1996#ifdef _DEBUG_
    19971997        for (i=0;i<numgrids;i++){
    19981998                _printf_("Node %i  dh/dx=%lf dh/dy=%lf dh/dz=%lf\n",i,dh1dh2dh3dh4dh5dh6_basic[0][i],dh1dh2dh3dh4dh5dh6_basic[1][i],dh1dh2dh3dh4dh5dh6_basic[2][i]);
    19991999        }
    2000         #endif
     2000#endif
    20012001
    20022002        /*Build B: */
     
    20042004                B[i]=dh1dh2dh3dh4dh5dh6_basic[2][i]; 
    20052005        }
    2006        
     2006
    20072007}
    20082008
     
    20152015
    20162016        int i;
    2017                                
     2017
    20182018        GetNodalFunctions(B, gauss_l1l2l3l4);
    20192019
     
    20342034        int          doflist[numdof];
    20352035        int          numberofdofspernode;
    2036        
     2036
    20372037        /* gaussian points: */
    20382038        int     num_gauss,ig;
     
    20942094        /* recover input parameters: */
    20952095        if(!inputs->Recover("velocity",&vx_list[0],1,dofs1,numgrids,(void**)nodes))throw ErrorException(__FUNCT__," cannot compute vertical velocity without horizontal velocity!");
    2096             inputs->Recover("velocity",&vy_list[0],1,dofs2,numgrids,(void**)nodes);
     2096        inputs->Recover("velocity",&vy_list[0],1,dofs2,numgrids,(void**)nodes);
    20972097
    20982098        /*Get gaussian points and weights :*/
     
    21012101
    21022102        GaussPenta( &num_area_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &area_gauss_weights, &fourth_gauss_vert_coord,&vert_gauss_weights,order_area_gauss,num_vert_gauss);
    2103         #ifdef _DEBUG_
     2103#ifdef _DEBUG_
    21042104        for (i=0;i<num_area_gauss;i++){
    21052105                _printf_("Area Gauss coord %i: %lf %lf %lf Weight: %lf\n",i,*(first_gauss_area_coord+i),*(second_gauss_area_coord+i),*(third_gauss_area_coord+i),*(area_gauss_weights+i));
     
    21082108                _printf_("Vert Gauss coord %i: %lf Weight: %lf\n",i,*(fourth_gauss_vert_coord+i),*(vert_gauss_weights+i));
    21092109        }
    2110         #endif
     2110#endif
    21112111
    21122112        /* Start  looping on the number of gaussian points: */
    21132113        for (ig1=0; ig1<num_area_gauss; ig1++){
    21142114                for (ig2=0; ig2<num_vert_gauss; ig2++){
    2115                
     2115
    21162116                        /*Pick up the gaussian point: */
    21172117                        gauss_weight1=*(area_gauss_weights+ig1);
    21182118                        gauss_weight2=*(vert_gauss_weights+ig2);
    21192119                        gauss_weight=gauss_weight1*gauss_weight2;
    2120                        
     2120
    21212121                        gauss_l1l2l3l4[0]=*(first_gauss_area_coord+ig1);
    21222122                        gauss_l1l2l3l4[1]=*(second_gauss_area_coord+ig1);
    21232123                        gauss_l1l2l3l4[2]=*(third_gauss_area_coord+ig1);
    21242124                        gauss_l1l2l3l4[3]=*(fourth_gauss_vert_coord+ig2);
    2125        
     2125
    21262126                        /*Get velocity derivative, with respect to x and y: */
    21272127                        GetParameterDerivativeValue(&du[0], &vx_list[0],&xyz_list[0][0], gauss_l1l2l3l4);
     
    21292129                        dudx=du[0];
    21302130                        dvdy=dv[1];
    2131                        
     2131
    21322132
    21332133                        /* Get Jacobian determinant: */
    21342134                        GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss_l1l2l3l4);
    2135                         #ifdef _DEBUG_
     2135#ifdef _DEBUG_
    21362136                        _printf_("Element id %i Jacobian determinant: %lf\n",PentaElementGetID(this),Jdet);
    2137                         #endif
    2138                
    2139                          /*Get nodal functions: */
     2137#endif
     2138
     2139                        /*Get nodal functions: */
    21402140                        GetNodalFunctions(l1l2l3l4l5l6, gauss_l1l2l3l4);
    21412141
     
    21542154        VecSetValues(pg,numdof,doflist,(const double*)pe_g,ADD_VALUES);
    21552155
    2156         cleanup_and_return:
     2156cleanup_and_return:
    21572157        xfree((void**)&first_gauss_area_coord);
    21582158        xfree((void**)&second_gauss_area_coord);
     
    21752175        double rho_ice,g;
    21762176        double       xyz_list[numgrids][3];
    2177                
     2177
    21782178        /*Get node data: */
    21792179        GetElementNodeData( &xyz_list[0][0], nodes, numgrids);
    2180        
     2180
    21812181        /*pressure is lithostatic: */
    21822182        //md.pressure=md.rho_ice*md.g*(md.surface-md.z); a la matlab
     
    21912191                pressure[i]=rho_ice*g*(s[i]-xyz_list[i][2]);
    21922192        }
    2193        
     2193
    21942194        /*plug local pressure values into global pressure vector: */
    21952195        VecSetValues(pg,numgrids,doflist,(const double*)pressure,INSERT_VALUES);
     
    22052205        /*Collapsed formulation: */
    22062206        Tria*  tria=NULL;
    2207        
     2207
    22082208        /*Is this element on the bed? :*/
    22092209        if(!onbed)return;
     
    22212221
    22222222void Penta::CreatePVectorSlopeCompute( Vec pg, void* inputs, int analysis_type,int sub_analysis_type){
    2223        
     2223
    22242224        /*Collapsed formulation: */
    22252225        Tria*  tria=NULL;
    2226        
     2226
    22272227        /*Is this element on the bed? :*/
    22282228        if(!onbed)return;
     
    22382238#define __FUNCT__ "ReduceMatrixStokes"
    22392239void Penta::ReduceMatrixStokes(double* Ke_reduced, double* Ke_temp){
    2240                
     2240
    22412241        int i,j;
    22422242
     
    22922292        double det;
    22932293        int calculationdof=3;
    2294        
     2294
    22952295        /*Take the matrix components: */
    22962296        a=*(Ke+calculationdof*0+0);
     
    23052305
    23062306        det=a*(e*i-f*h)-b*(d*i-f*g)+c*(d*h-e*g);
    2307        
     2307
    23082308        *(Ke_invert+calculationdof*0+0)=(e*i-f*h)/det;
    23092309        *(Ke_invert+calculationdof*0+1)=(c*h-b*i)/det;
     
    23922392         * For grid i, Bi can be expressed in the basic coordinate system
    23932393         * by:                          Bi_basic=[ dh/dx          0             0       0  ]
    2394                 *                                       [   0           dh/dy           0       0  ]
    2395                 *                                       [   0             0           dh/dy     0  ]
    2396                 *                                       [ 1/2*dh/dy    1/2*dh/dx        0       0  ]
    2397                 *                                       [ 1/2*dh/dz       0         1/2*dh/dx   0  ]
    2398                 *                                       [   0          1/2*dh/dz    1/2*dh/dy   0  ]
    2399                 *                                       [   0             0             0       h  ]
    2400                 *                                       [ dh/dx         dh/dy         dh/dz     0  ]
    2401                 *       where h is the interpolation function for grid i.
    2402                 *       Same thing for Bb except the last column that does not exist.
    2403                 */
    2404        
     2394         *                                      [   0           dh/dy           0       0  ]
     2395         *                                      [   0             0           dh/dy     0  ]
     2396         *                                      [ 1/2*dh/dy    1/2*dh/dx        0       0  ]
     2397         *                                      [ 1/2*dh/dz       0         1/2*dh/dx   0  ]
     2398         *                                      [   0          1/2*dh/dz    1/2*dh/dy   0  ]
     2399         *                                      [   0             0             0       h  ]
     2400         *                                      [ dh/dx         dh/dy         dh/dz     0  ]
     2401         *      where h is the interpolation function for grid i.
     2402         *      Same thing for Bb except the last column that does not exist.
     2403         */
     2404
    24052405        int i;
    24062406        int calculationdof=3;
     
    24162416
    24172417        GetNodalFunctions(l1l6, gauss_coord);
    2418        
    2419         #ifdef _DEBUG_
     2418
     2419#ifdef _DEBUG_
    24202420        for (i=0;i<7;i++){
    24212421                printf("Node %i  dh/dx=%lf dh/dy=%lf dh/dz=%lf \n",i,dh1dh7_basic[0][i],dh1dh7_basic[1][i],dh1dh7_basic[2][i]);
    24222422        }
    24232423
    2424         #endif
     2424#endif
    24252425
    24262426        /*Build B: */
     
    24702470
    24712471        /*      Compute B'  matrix. B'=[B1' B2' B3' B4' B5' B6' Bb'] where Bi' is of size 3*NDOF2.
    2472         *       For grid i, Bi' can be expressed in the basic coordinate system
    2473         *       by:
    2474         *                               Bi_basic'=[ dh/dx   0          0       0]
    2475         *                                        [   0      dh/dy      0       0]
    2476         *                                        [   0      0         dh/dz    0]
    2477         *                                        [  dh/dy   dh/dx      0       0]
    2478         *                                        [  dh/dz   0        dh/dx     0]
    2479         *                                        [   0      dh/dz    dh/dy     0]
    2480         *                                        [  dh/dx   dh/dy    dh/dz     0]
    2481         *                                        [   0      0          0       h]
    2482         *       where h is the interpolation function for grid i.
    2483         *
    2484         *       Same thing for the bubble fonction except that there is no fourth column
    2485         */
     2472         *      For grid i, Bi' can be expressed in the basic coordinate system
     2473         *      by:
     2474         *                              Bi_basic'=[ dh/dx   0          0       0]
     2475         *                                       [   0      dh/dy      0       0]
     2476         *                                       [   0      0         dh/dz    0]
     2477         *                                       [  dh/dy   dh/dx      0       0]
     2478         *                                       [  dh/dz   0        dh/dx     0]
     2479         *                                       [   0      dh/dz    dh/dy     0]
     2480         *                                       [  dh/dx   dh/dy    dh/dz     0]
     2481         *                                       [   0      0          0       h]
     2482         *      where h is the interpolation function for grid i.
     2483         *
     2484         *      Same thing for the bubble fonction except that there is no fourth column
     2485         */
    24862486
    24872487        int i;
     
    24982498
    24992499        GetNodalFunctions(l1l6, gauss_coord);
    2500        
    2501         #ifdef _DEBUG_
     2500
     2501#ifdef _DEBUG_
    25022502        for (i=0;i<6;i++){
    25032503                printf("Node %i  dh/dx=%lf dh/dy=%lf dh/dz=%lf \n",i,dh1dh7_basic[0][i],dh1dh7_basic[1][i]);
    25042504        }
    25052505
    2506         #endif
     2506#endif
    25072507
    25082508        /*B_primeuild B_prime: */
     
    25512551
    25522552        /*
    2553         * Compute L  matrix. L=[L1 L2 L3] where Li is square and of size numdof.
    2554         * For grid i, Li can be expressed in the basic coordinate system
    2555         * by:
    2556         *       Li_basic=[ h    0    0   0]
    2557         *                [ 0    h    0   0]
    2558         *                [ 0    0    h   0]
    2559         *                [ 0    0    h   0]
    2560         *                [ h    0    0   0]
    2561         *                [ 0    h    0   0]
    2562         *                [ h    0    0   0]
    2563         *                [ 0    h    0   0]
    2564         *                [ 0    0    h   0]
    2565         *                [ 0    0    h   0]
    2566         *                [ 0    0    h   0]
    2567         *                [ h    0    0   0]
    2568         *                [ 0    h    0   0]
    2569         *                [ 0    0    h   0]
    2570         * where h is the interpolation function for grid i.
    2571         */
     2553         * Compute L  matrix. L=[L1 L2 L3] where Li is square and of size numdof.
     2554         * For grid i, Li can be expressed in the basic coordinate system
     2555         * by:
     2556         *       Li_basic=[ h    0    0   0]
     2557         *               [ 0    h    0   0]
     2558         *               [ 0    0    h   0]
     2559         *               [ 0    0    h   0]
     2560         *               [ h    0    0   0]
     2561         *               [ 0    h    0   0]
     2562         *               [ h    0    0   0]
     2563         *               [ 0    h    0   0]
     2564         *               [ 0    0    h   0]
     2565         *               [ 0    0    h   0]
     2566         *               [ 0    0    h   0]
     2567         *               [ h    0    0   0]
     2568         *               [ 0    h    0   0]
     2569         *               [ 0    0    h   0]
     2570         * where h is the interpolation function for grid i.
     2571         */
    25722572
    25732573        int i;
     
    25822582        l1l2l3[1]=gauss_coord_tria[1];
    25832583        l1l2l3[2]=gauss_coord_tria[2];
    2584        
    2585 
    2586         #ifdef _DELUG_
     2584
     2585
     2586#ifdef _DELUG_
    25872587        for (i=0;i<3;i++){
    25882588                printf("Node %i  h=%lf \n",i,l1l2l3[i]);
    25892589        }
    2590         #endif
     2590#endif
    25912591
    25922592        /*Build LStokes: */
     
    26482648                *(LStokes+num_dof*numgrids2d*13+num_dof*i+2)=l1l2l3[i];
    26492649                *(LStokes+num_dof*numgrids2d*13+num_dof*i+3)=0;
    2650        
     2650
    26512651        }
    26522652}
     
    26582658
    26592659        /*
    2660         * Compute Lprime  matrix. Lprime=[Lp1 Lp2 Lp3] where Lpi is square and of size numdof.
    2661         * For grid i, Lpi can be expressed in the basic coordinate system
    2662         * by:
    2663         *       Lpi_basic=[ h    0    0   0]
    2664         *                [ 0    h    0   0]
    2665         *                [ h    0    0   0]
    2666         *                [ 0    h    0   0]
    2667         *                [ 0    0    h   0]
    2668         *                [ 0    0    h   0]
    2669         *                [ 0    0  dh/dz 0]
    2670         *                [ 0    0  dh/dz 0]
    2671         *                [ 0    0  dh/dz 0]
    2672         *                [dh/dz 0  dh/dx 0]
    2673         *                [ 0 dh/dz dh/dy 0]
    2674         *                [ 0    0    0   h]
    2675         *                [ 0    0    0   h]
    2676         *                [ 0    0    0   h]
    2677         * where h is the interpolation function for grid i.
    2678         */
     2660         * Compute Lprime  matrix. Lprime=[Lp1 Lp2 Lp3] where Lpi is square and of size numdof.
     2661         * For grid i, Lpi can be expressed in the basic coordinate system
     2662         * by:
     2663         *       Lpi_basic=[ h    0    0   0]
     2664         *               [ 0    h    0   0]
     2665         *               [ h    0    0   0]
     2666         *               [ 0    h    0   0]
     2667         *               [ 0    0    h   0]
     2668         *               [ 0    0    h   0]
     2669         *               [ 0    0  dh/dz 0]
     2670         *               [ 0    0  dh/dz 0]
     2671         *               [ 0    0  dh/dz 0]
     2672         *               [dh/dz 0  dh/dx 0]
     2673         *               [ 0 dh/dz dh/dy 0]
     2674         *               [ 0    0    0   h]
     2675         *               [ 0    0    0   h]
     2676         *               [ 0    0    0   h]
     2677         * where h is the interpolation function for grid i.
     2678         */
    26792679
    26802680        int i;
     
    26902690        l1l2l3[1]=gauss_coord_tria[1];
    26912691        l1l2l3[2]=gauss_coord_tria[2];
    2692        
     2692
    26932693        GetNodalFunctionsDerivativesBasic(&dh1dh6_basic[0][0],xyz_list,gauss_coord);
    26942694
    2695         #ifdef _DELUG_
     2695#ifdef _DELUG_
    26962696        for (i=0;i<3;i++){
    26972697                printf("Node %i  h=%lf \n",i,l1l2l3[i]);
    26982698        }
    2699         #endif
     2699#endif
    27002700
    27012701        /*Build LprimeStokes: */
     
    27572757                *(LprimeStokes+num_dof*numgrids2d*13+num_dof*i+2)=0;
    27582758                *(LprimeStokes+num_dof*numgrids2d*13+num_dof*i+3)=l1l2l3[i];
    2759        
    2760         }
    2761        
     2759
     2760        }
     2761
    27622762}
    27632763
     
    27652765#define __FUNCT__ "Penta::GetNodalFunctionsDerivativesBasicStokes"
    27662766void Penta::GetNodalFunctionsDerivativesBasicStokes(double* dh1dh7_basic,double* xyz_list, double* gauss_coord){
    2767        
     2767
    27682768        /*This routine returns the values of the nodal functions derivatives  (with respect to the
    27692769         * basic coordinate system: */
     
    28012801#define __FUNCT__ "Penta::GetNodalFunctionsDerivativesParamsStokes"
    28022802void Penta::GetNodalFunctionsDerivativesParamsStokes(double* dl1dl7,double* gauss_coord){
    2803        
     2803
    28042804        /*This routine returns the values of the nodal functions derivatives  (with respect to the
    28052805         * natural coordinate system) at the gaussian point. */
     
    28932893        int     area_order=5;
    28942894        int       num_vert_gauss=5;
    2895        
     2895
    28962896        double  epsilon[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
    28972897        double  viscosity;
     
    29162916        double     tBD[27][8];
    29172917        double     P_terms[numdof];
    2918        
     2918
    29192919        ParameterInputs* inputs=NULL;
    29202920        Tria*            tria=NULL;
     
    29412941
    29422942        /* Get gaussian points and weights. Penta is an extrusion of a Tria, we therefore
    2943            get tria gaussian points as well as segment gaussian points. For tria gaussian
    2944            points, order of integration is 2, because we need to integrate the product tB*D*B'
    2945            which is a polynomial of degree 3 (see GaussTria for more details). For segment gaussian
    2946            points, same deal, which yields 3 gaussian points.*/
     2943                get tria gaussian points as well as segment gaussian points. For tria gaussian
     2944                points, order of integration is 2, because we need to integrate the product tB*D*B'
     2945                which is a polynomial of degree 3 (see GaussTria for more details). For segment gaussian
     2946                points, same deal, which yields 3 gaussian points.*/
    29472947
    29482948        /* Get gaussian points and weights (make this a statically initialized list of points? fstd): */
     
    29642964                        GetStrainRateStokes(&epsilon[0],&vxvyvz_list[0][0],&xyz_list[0][0],gauss_coord);
    29652965                        matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
    2966                
     2966
    29672967                        /* Get Jacobian determinant: */
    29682968                        GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss_coord);
     
    29842984                        GetBStokes(&B[0][0],&xyz_list[0][0],gauss_coord);
    29852985                        GetBprimeStokes(&B_prime[0][0],&xyz_list[0][0], gauss_coord);
    2986                        
     2986
    29872987                        /*Get bubble part of Bprime */
    29882988                        for(i=0;i<8;i++){
     
    30333033                        gauss_coord[2]=*(third_gauss_area_coord+igarea);
    30343034                        gauss_coord[3]=-1;
    3035                        
     3035
    30363036                        gauss_coord_tria[0]=*(first_gauss_area_coord+igarea);
    30373037                        gauss_coord_tria[1]=*(second_gauss_area_coord+igarea);
     
    30403040                        /*Get the Jacobian determinant */
    30413041                        tria->GetJacobianDeterminant3d(&Jdet2d, &xyz_list_tria[0][0], gauss_coord_tria);
    3042                        
     3042
    30433043                        /* Get bed at gaussian point */
    30443044                        GetParameterValue(&bed,&b[0],gauss_coord);
     
    30463046                        /*Get L matrix : */
    30473047                        tria->GetL(&L[0], &xyz_list[0][0], gauss_coord_tria,1);
    3048                                
     3048
    30493049                        /*Get water_pressure at gaussian point */
    30503050                        water_pressure=gravity*rho_water*bed;
     
    30523052                        /*Get normal vecyor to the bed */
    30533053                        SurfaceNormal(&surface_normal[0],xyz_list_tria);
    3054                        
     3054
    30553055                        bed_normal[0]=-surface_normal[0]; //Program is for surface, so the normal to the bed is the opposite of the result
    30563056                        bed_normal[1]=-surface_normal[1];
     
    30643064                }
    30653065        } //if ( (onbed==1) && (shelf==1))
    3066        
     3066
    30673067        /*Reduce the matrix */
    30683068        ReduceVectorStokes(&Pe_reduced[0], &Ke_temp[0][0], &Pe_temp[0]);
     
    30803080#define __FUNCT__ "Penta::ReduceVectorStokes"
    30813081void Penta::ReduceVectorStokes(double* Pe_reduced, double* Ke_temp, double* Pe_temp){
    3082                
     3082
    30833083        int i,j;
    30843084
     
    31233123#define __FUNCT__ "Penta::GetNodalFunctionsStokes"
    31243124void Penta::GetNodalFunctionsStokes(double* l1l7, double* gauss_coord){
    3125        
     3125
    31263126        /*This routine returns the values of the nodal functions  at the gaussian point.*/
    31273127
     
    31613161        const int    NDOF1=1;
    31623162        const int    numdof=NDOF1*numgrids;
    3163         double       xyz_list[numgrids][3];
    3164         int          doflist[numdof];
    3165         int          numberofdofspernode;
     3163        double xyz_list[numgrids][3];
     3164        int    doflist[numdof];
     3165        int    numberofdofspernode;
    31663166
    31673167        /* gaussian points: */
     
    31773177
    31783178        int area_order=5;
    3179         int     num_vert_gauss=5;
    3180        
    3181         int            dofs[3]={0,1,2};
    3182         double         dt;
    3183         int            dt_exists;
    3184        
    3185         double         vxvyvz_list[numgrids][3];
    3186         double         vx_list[numgrids];
    3187         int            vx_list_exists;
    3188         double         u;
    3189         double         vy_list[numgrids];
    3190         int            vy_list_exists;
    3191         double         v;
    3192         double         vz_list[numgrids];
    3193         int            vz_list_exists;
    3194         double         w;
    3195 
    3196         /* element parameters: */
    3197         int         onbed;
    3198         int         shelf;
    3199         int     steady_state;
     3179        int num_vert_gauss=5;
     3180
     3181        int     dofs[3]={0,1,2};
     3182        double  dt;
     3183        int     dt_exists;
     3184
     3185        double  vxvyvz_list[numgrids][3];
     3186        double  vx_list[numgrids];
     3187        int     vx_list_exists;
     3188        double  u;
     3189        double  vy_list[numgrids];
     3190        int     vy_list_exists;
     3191        double  v;
     3192        double  vz_list[numgrids];
     3193        int     vz_list_exists;
     3194        double  w;
    32003195
    32013196        /*matrices: */
    3202         double     K_terms[numdof][numdof]={0.0};
    3203         double     Ke_gaussian_conduct[numdof][numdof];
    3204         double     Ke_gaussian_advec[numdof][numdof];
    3205         double     Ke_gaussian_transient[numdof][numdof];
    3206         double     B[3][numdof];
    3207         double     Bprime[3][numdof];
    3208         double     B_conduct[3][numdof];
    3209         double     B_advec[3][numdof];
    3210         double     Bprime_advec[3][numdof];
    3211         double     L[numdof];
    3212         double     D_scalar;
    3213         double     D[3][3];
    3214         double     l1l2l3[3];
    3215         double     tl1l2l3D[3];
    3216         double     tBD[3][numdof];
    3217         double     tBD_conduct[3][numdof];
    3218         double     tBD_advec[3][numdof];
    3219         double     tLD[numdof];
    3220 
    3221         double     Jdet;
     3197        double  K_terms[numdof][numdof]={0.0};
     3198        double  Ke_gaussian_conduct[numdof][numdof];
     3199        double  Ke_gaussian_advec[numdof][numdof];
     3200        double  Ke_gaussian_transient[numdof][numdof];
     3201        double  B[3][numdof];
     3202        double  Bprime[3][numdof];
     3203        double  B_conduct[3][numdof];
     3204        double  B_advec[3][numdof];
     3205        double  Bprime_advec[3][numdof];
     3206        double  L[numdof];
     3207        double  D_scalar;
     3208        double  D[3][3];
     3209        double  l1l2l3[3];
     3210        double  tl1l2l3D[3];
     3211        double  tBD[3][numdof];
     3212        double  tBD_conduct[3][numdof];
     3213        double  tBD_advec[3][numdof];
     3214        double  tLD[numdof];
     3215
     3216        double  Jdet;
    32223217
    32233218        /*Material properties: */
    3224         double         gravity,rho_ice,rho_water;
    3225         double         heatcapacity,thermalconductivity;
    3226         double         mixed_layer_capacity,thermal_exchange_velocity;
     3219        double  gravity,rho_ice,rho_water;
     3220        double  heatcapacity,thermalconductivity;
     3221        double  mixed_layer_capacity,thermal_exchange_velocity;
    32273222
    32283223        /*Collapsed formulation: */
     
    32373232        GetDofList(&doflist[0],&numberofdofspernode);
    32383233       
    3239         // /*recovre material parameters: */
     3234        /*recovre material parameters: */
    32403235        rho_water=matpar->GetRhoWater();
    32413236        rho_ice=matpar->GetRhoIce();
     
    32433238        heatcapacity=matpar->GetHeatCapacity();
    32443239        thermalconductivity=matpar->GetThermalConductivity();
    3245 
    32463240               
    32473241        /*recover extra inputs from users, dt and velocity: */
     
    33003294                        D[2][0]=0; D[2][1]=0; D[2][2]=D_scalar;
    33013295
    3302 
    33033296                        /*  Do the triple product B'*D*B: */
    33043297                        MatrixMultiply(&B_conduct[0][0],3,numdof,1,&D[0][0],3,3,0,&tBD_conduct[0][0],0);
     
    33103303                        GetB_advec(&B_advec[0][0],&xyz_list[0][0],gauss_coord);
    33113304                        GetBprime_advec(&Bprime_advec[0][0],&xyz_list[0][0],gauss_coord);
    3312 
    33133305
    33143306                        //Build the D matrix
     
    33303322                        MatrixMultiply(&B_advec[0][0],3,numdof,1,&D[0][0],3,3,0,&tBD_advec[0][0],0);
    33313323                        MatrixMultiply(&tBD_advec[0][0],numdof,3,0,&Bprime_advec[0][0],3,numdof,0,&Ke_gaussian_advec[0][0],0);
    3332 
    33333324
    33343325                        /*Transient: */
     
    33593350                }
    33603351        }
    3361        
    3362         //Ice/ocean heat exchange flux on ice shelf base
    3363 
    3364         if(onbed && shelf){
    3365 
    3366                 tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    3367                 tria->CreateKMatrixThermal(Kgg,inputs, analysis_type,sub_analysis_type);
    3368                 delete tria;
    3369                 return;
    3370         }
    33713352
    33723353        /*Add Ke_gg to global matrix Kgg: */
     
    33813362        xfree((void**)&vert_gauss_coord);
    33823363
     3364        //Ice/ocean heat exchange flux on ice shelf base
     3365        if(onbed && shelf){
     3366
     3367                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
     3368                tria->CreateKMatrixThermal(Kgg,inputs, analysis_type,sub_analysis_type);
     3369                delete tria;
     3370        }
    33833371}
    33843372
     
    33973385         * We assume B has been allocated already, of size: 3x(DOFPERGRID*numgrids)
    33983386         */
    3399        
     3387
    34003388        int i;
    34013389        int calculationdof=3;
     
    34313419         * We assume B has been allocated already, of size: 3x(DOFPERGRID*numgrids)
    34323420         */
    3433        
     3421
    34343422        int i;
    34353423        int calculationdof=3;
     
    34663454         * We assume B has been allocated already, of size: 3x(DOFPERGRID*numgrids)
    34673455         */
    3468        
     3456
    34693457        int i;
    34703458        int calculationdof=3;
     
    34893477#define __FUNCT__ "Penta::CreateKMatrixMelting"
    34903478void  Penta::CreateKMatrixMelting(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type){
    3491        
     3479
    34923480        Tria* tria=NULL;
    34933481        if (!onbed){
     
    34953483        }
    34963484        else{
    3497                
     3485
    34983486                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    34993487                tria->CreateKMatrixMelting(Kgg,inputs, analysis_type,sub_analysis_type);
     
    35203508        /*Grid data: */
    35213509        double        xyz_list[numgrids][3];
    3522        
     3510
    35233511        /* gaussian points: */
    35243512        int     num_area_gauss,igarea,igvert;
     
    35333521        int area_order=2;
    35343522        int     num_vert_gauss=3;
    3535        
     3523
    35363524        double         dt;
    35373525        double         vx_list[numgrids];
     
    35493537        /* element parameters: */
    35503538        int     friction_type;
    3551        
     3539
    35523540        int            dofs[3]={0,1,2};
    35533541        int            dofs1[1]={0};
     
    35843572        GetElementNodeData( &xyz_list[0][0], nodes, numgrids);
    35853573        GetDofList(&doflist[0],&numberofdofspernode);
    3586        
     3574
    35873575        // /*recovre material parameters: */
    35883576        rho_water=matpar->GetRhoWater();
     
    36043592                if(!found)throw ErrorException(__FUNCT__," could not find temperature in inputs!");
    36053593        }
    3606        
     3594
    36073595        for(i=0;i<numgrids;i++){
    36083596                vx_list[i]=vxvyvz_list[i][0];
     
    36123600
    36133601        /* Get gaussian points and weights. Penta is an extrusion of a Tria, we therefore
    3614            get tria gaussian points as well as segment gaussian points. For tria gaussian
    3615            points, order of integration is 2, because we need to integrate the product tB*D*B'
    3616            which is a polynomial of degree 3 (see GaussTria for more details). For segment gaussian
    3617            points, same deal, which yields 3 gaussian points.: */
    3618        
     3602                get tria gaussian points as well as segment gaussian points. For tria gaussian
     3603                points, order of integration is 2, because we need to integrate the product tB*D*B'
     3604                which is a polynomial of degree 3 (see GaussTria for more details). For segment gaussian
     3605                points, same deal, which yields 3 gaussian points.: */
     3606
    36193607        /*Get gaussian points: */
    36203608        GaussPenta( &num_area_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &area_gauss_weights,&vert_gauss_coord, &vert_gauss_weights, area_order, num_vert_gauss);
     
    36313619                        gauss_coord[2]=*(third_gauss_area_coord+igarea);
    36323620                        gauss_coord[3]=*(vert_gauss_coord+igvert);
    3633        
     3621
    36343622                        /*Compute strain rate and viscosity: */
    36353623                        GetStrainRateStokes(&epsilon[0],&vxvyvz_list[0][0],&xyz_list[0][0],gauss_coord);
     
    36733661        /* Ice/ocean heat exchange flux on ice shelf base */
    36743662        if(onbed && shelf){
    3675 
    36763663
    36773664                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
  • issm/trunk/src/c/objects/Tria.cpp

    r503 r511  
    1616#include "../DataSet/DataSet.h"
    1717#include "../include/typedefs.h"
    18 
    1918
    2019/*For debugging purposes: */
     
    5150                melting[i]=tria_melting[i];
    5251                accumulation[i]=tria_accumulation[i];
    53                 geothermalflux[i]=tria_geothermalflux[i]; }
     52                geothermalflux[i]=tria_geothermalflux[i];
     53        }
    5454        matice=NULL;
    5555        matice_offset=UNDEF;
     
    242242}
    243243
    244 
    245244#undef __FUNCT__
    246245#define __FUNCT__ "Tria::Configure"
     
    294293                throw ErrorException(__FUNCT__,exprintf("%s%i%s\n","analysis: ",analysis_type," not supported yet"));
    295294        }
    296 
    297 }
    298 
     295}
    299296
    300297#undef __FUNCT__
     
    302299
    303300void  Tria::CreateKMatrixDiagnosticHoriz(Mat Kgg,void* vinputs,int analysis_type,int sub_analysis_type){
    304 
    305301
    306302        /* local declarations */
Note: See TracChangeset for help on using the changeset viewer.