Changeset 557


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

fixed problem with subamalysis type if thermal (ERIC, tell me if you like it)

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

Legend:

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

    r465 r557  
    3636
    3737        _printf_("   specifying analysis\n");
     38        //specify analysis_type
    3839        model->analysis_type=(char*)xmalloc((strlen(analysis_type)+1)*sizeof(char)); strcpy(model->analysis_type,analysis_type);
    39         model->sub_analysis_type=(char*)xmalloc((strlen(sub_analysis_type)+1)*sizeof(char)); strcpy(model->sub_analysis_type,sub_analysis_type);
     40        //specify sub_analysis_type EXCEPT if thermal: we do not know if it is transient or steady yet (only the model knows)!!
     41        if (strcmp(analysis_type,"thermal")!=0){
     42                model->sub_analysis_type=(char*)xmalloc((strlen(sub_analysis_type)+1)*sizeof(char)); strcpy(model->sub_analysis_type,sub_analysis_type);
     43        }
    4044
    4145        _printf_("   create datasets:\n");
  • issm/trunk/src/c/parallel/thermal.cpp

    r472 r557  
    3030
    3131        /*initial velocity and pressure: */
    32         Vec u_g=NULL;
    33         Vec p_g=NULL;
     32        double* u_g=NULL;
     33        double* p_g=NULL;
    3434        double dt;
    3535        double ndt;
     
    7373
    7474        _printf_("initialize inputs:\n");
     75        PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok1\n");
     76        PetscSynchronizedFlush(MPI_COMM_WORLD);
    7577        femmodels[0].parameters->FindParam((void*)&u_g,"u_g");
     78        PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok2\n");
     79        PetscSynchronizedFlush(MPI_COMM_WORLD);
     80
    7681        femmodels[0].parameters->FindParam((void*)&p_g,"p_g");
     82        PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok3\n");
     83        PetscSynchronizedFlush(MPI_COMM_WORLD);
     84
    7785        femmodels[0].parameters->FindParam((void*)&numberofnodes,"numberofnodes");
     86        PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok4\n");
     87        PetscSynchronizedFlush(MPI_COMM_WORLD);
     88
    7889        femmodels[0].parameters->FindParam((void*)&dt,"dt");
     90        PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok5\n");
     91        PetscSynchronizedFlush(MPI_COMM_WORLD);
     92
    7993        femmodels[0].parameters->FindParam((void*)&ndt,"ndt");
     94        PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok6\n");
     95        PetscSynchronizedFlush(MPI_COMM_WORLD);
     96
    8097        femmodels[0].parameters->FindParam((void*)&waitonlock,"waitonlock");
     98        PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok7\n");
     99        PetscSynchronizedFlush(MPI_COMM_WORLD);
     100
    81101        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
    82105        femmodels[0].parameters->FindParam((void*)&debug,"debug");
    83106
    84107        inputs=new ParameterInputs;
     108
     109        PetscSynchronizedPrintf(MPI_COMM_WORLD,"numberofnodes = %i\n",numberofnodes);
     110        PetscSynchronizedFlush(MPI_COMM_WORLD);
    85111        inputs->Add("velocity",u_g,3,numberofnodes);
     112        PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok1\n");
     113        PetscSynchronizedFlush(MPI_COMM_WORLD);
     114
    86115        inputs->Add("pressure",p_g,1,numberofnodes);
    87116        inputs->Add("dt",dt);
    88117
    89118        //erase velocities and pressure embedded in parameters
     119        PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok2\n");
     120        PetscSynchronizedFlush(MPI_COMM_WORLD);
     121
    90122        param=(Param*)femmodels[0].parameters->FindParamObject("u_g");
    91123        femmodels[0].parameters->DeleteObject((Object*)param);
     124        PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok3\n");
     125        PetscSynchronizedFlush(MPI_COMM_WORLD);
     126
    92127        param=(Param*)femmodels[0].parameters->FindParamObject("p_g");
    93128        femmodels[0].parameters->DeleteObject((Object*)param);
     129        PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok4\n");
     130        PetscSynchronizedFlush(MPI_COMM_WORLD);
     131
    94132        param=(Param*)femmodels[1].parameters->FindParamObject("u_g");
    95133        femmodels[1].parameters->DeleteObject((Object*)param);
     134        PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok5\n");
     135        PetscSynchronizedFlush(MPI_COMM_WORLD);
     136
    96137        param=(Param*)femmodels[1].parameters->FindParamObject("p_g");
    97138        femmodels[1].parameters->DeleteObject((Object*)param);
     139        PetscSynchronizedPrintf(MPI_COMM_WORLD,"ok6\n");
     140        PetscSynchronizedFlush(MPI_COMM_WORLD);
    98141
    99142        if(sub_analysis_type==SteadyAnalysisEnum()){
     
    154197        PetscFinalize();
    155198
    156 
    157199        /*end module: */
    158200        MODULEEND();
     
    160202        return 0; //unix success return;
    161203}
    162        
Note: See TracChangeset for help on using the changeset viewer.