Changeset 559


Ignore:
Timestamp:
05/21/09 10:31:48 (16 years ago)
Author:
Mathieu Morlighem
Message:

missing memory allocation for tg

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/parallel/thermal.cpp

    r557 r559  
    3232        double* u_g=NULL;
    3333        double* p_g=NULL;
    34         double dt;
    35         double ndt;
    36         int    nsteps;
    37         int    debug=0;
     34        double  dt;
     35        double  ndt;
     36        int     nsteps;
     37        int     debug=0;
    3838
    3939        /*solution vectors: */
     
    4242
    4343        ParameterInputs* inputs=NULL;
    44         Param*  param=NULL;
     44        Param*           param=NULL;
    4545
    46         int waitonlock=0;
    47         int sub_analysis_type;
     46        int    waitonlock=0;
     47        int    sub_analysis_type;
    4848        double melting_offset;
    4949       
     
    7373
    7474        _printf_("initialize inputs:\n");
    75         PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok1\n");
    76         PetscSynchronizedFlush(MPI_COMM_WORLD);
    7775        femmodels[0].parameters->FindParam((void*)&u_g,"u_g");
    78         PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok2\n");
    79         PetscSynchronizedFlush(MPI_COMM_WORLD);
    80 
    8176        femmodels[0].parameters->FindParam((void*)&p_g,"p_g");
    82         PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok3\n");
    83         PetscSynchronizedFlush(MPI_COMM_WORLD);
    84 
    8577        femmodels[0].parameters->FindParam((void*)&numberofnodes,"numberofnodes");
    86         PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok4\n");
    87         PetscSynchronizedFlush(MPI_COMM_WORLD);
    88 
    8978        femmodels[0].parameters->FindParam((void*)&dt,"dt");
    90         PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok5\n");
    91         PetscSynchronizedFlush(MPI_COMM_WORLD);
    92 
    9379        femmodels[0].parameters->FindParam((void*)&ndt,"ndt");
    94         PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok6\n");
    95         PetscSynchronizedFlush(MPI_COMM_WORLD);
    96 
    9780        femmodels[0].parameters->FindParam((void*)&waitonlock,"waitonlock");
    98         PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok7\n");
    99         PetscSynchronizedFlush(MPI_COMM_WORLD);
    100 
    10181        femmodels[0].parameters->FindParam((void*)&sub_analysis_type,"sub_analysis_type");
    102         PetscSynchronizedPrintf(MPI_COMM_WORLD,"subana=%i\n",sub_analysis_type);
    103         PetscSynchronizedFlush(MPI_COMM_WORLD);
    104 
    10582        femmodels[0].parameters->FindParam((void*)&debug,"debug");
    10683
    10784        inputs=new ParameterInputs;
    10885
    109         PetscSynchronizedPrintf(MPI_COMM_WORLD,"numberofnodes = %i\n",numberofnodes);
    110         PetscSynchronizedFlush(MPI_COMM_WORLD);
    11186        inputs->Add("velocity",u_g,3,numberofnodes);
    112         PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok1\n");
    113         PetscSynchronizedFlush(MPI_COMM_WORLD);
    114 
    11587        inputs->Add("pressure",p_g,1,numberofnodes);
    11688        inputs->Add("dt",dt);
    11789
    11890        //erase velocities and pressure embedded in parameters
    119         PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok2\n");
    120         PetscSynchronizedFlush(MPI_COMM_WORLD);
    121 
    12291        param=(Param*)femmodels[0].parameters->FindParamObject("u_g");
    12392        femmodels[0].parameters->DeleteObject((Object*)param);
    124         PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok3\n");
    125         PetscSynchronizedFlush(MPI_COMM_WORLD);
    126 
    12793        param=(Param*)femmodels[0].parameters->FindParamObject("p_g");
    12894        femmodels[0].parameters->DeleteObject((Object*)param);
    129         PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok4\n");
    130         PetscSynchronizedFlush(MPI_COMM_WORLD);
    131 
    13295        param=(Param*)femmodels[1].parameters->FindParamObject("u_g");
    13396        femmodels[1].parameters->DeleteObject((Object*)param);
    134         PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok5\n");
    135         PetscSynchronizedFlush(MPI_COMM_WORLD);
    136 
    13797        param=(Param*)femmodels[1].parameters->FindParamObject("p_g");
    13898        femmodels[1].parameters->DeleteObject((Object*)param);
    139         PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok6\n");
    140         PetscSynchronizedFlush(MPI_COMM_WORLD);
    14199
    142100        if(sub_analysis_type==SteadyAnalysisEnum()){
     101
     102                /*allocate t_g and m_g arrays: */
     103                t_g=(Vec*)xmalloc(sizeof(Vec));
     104                m_g=(Vec*)xmalloc(sizeof(Vec));
     105
    143106                if(debug)_printf_("computing temperatures:\n");
    144107                thermal_core(&t_g[0],&melting_offset,&femmodels[0],inputs,ThermalAnalysisEnum(),SteadyAnalysisEnum());
    145        
    146108                inputs->Add("temperature",t_g[0],1,numberofnodes);
    147109                inputs->Add("melting_offset",melting_offset);
Note: See TracChangeset for help on using the changeset viewer.