Changeset 694


Ignore:
Timestamp:
06/02/09 08:25:14 (16 years ago)
Author:
Mathieu Morlighem
Message:

fixed thermal output

File:
1 edited

Legend:

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

    r693 r694  
    4040        FemModel* fem_sl=NULL;
    4141
     42        /*fem thermal models: */
     43        FemModel* fem_t=NULL;
     44
    4245        /*fem prognostic models: */
    4346        FemModel* fem_p=NULL;
    4447
     48        /*some parameters*/
    4549        int ishutter;
    4650        int ismacayealpattyn;
     
    6670        double* thickness=NULL;
    6771
     72        Vec     t_g=NULL;
     73        double* t_g_serial=NULL;
     74        double* temperature=NULL;
     75
     76        Vec     m_g=NULL;
     77        double* m_g_serial=NULL;
     78        double* melting=NULL;
     79
    6880        int numberofnodes;
    6981
     
    92104        if(analysis_type==PrognosticAnalysisEnum()){
    93105                fem_p=fems+0;
     106        }
     107
     108        if(analysis_type==ThermalAnalysisEnum()){
     109                fem_t=fems+0;
    94110        }
    95111
     
    229245                }
    230246
     247                else if(strcmp(result->GetFieldName(),"t_g")==0){
     248                        /*easy, t_g is of size numberofnodes, on 1 dof, just repartition: */
     249                        result->GetField(&t_g);
     250                        VecToMPISerial(&t_g_serial,t_g);
     251                        fem_t->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
     252                        VecToMPISerial(&partition,fem_t->partition);
     253
     254                        temperature=(double*)xmalloc(numberofnodes*sizeof(double));
     255
     256                        for(i=0;i<numberofnodes;i++){
     257                                temperature[i]=t_g_serial[(int)partition[i]];
     258                        }
     259
     260                        /*Ok, add pressure to newresults: */
     261                        newresult=new Result(newresults->Size()+1,result->GetTime(),result->GetStep(),"temperature",temperature,numberofnodes);
     262                        newresults->AddObject(newresult);
     263
     264                        /*do some cleanup: */
     265                        xfree((void**)&t_g_serial);
     266                        xfree((void**)&partition);
     267                }
     268
     269                else if(strcmp(result->GetFieldName(),"m_g")==0){
     270                        /*easy, m_g is of size numberofnodes, on 1 dof, just repartition: */
     271                        result->GetField(&m_g);
     272                        VecToMPISerial(&m_g_serial,m_g);
     273                        fem_t->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
     274                        VecToMPISerial(&partition,fem_t->partition);
     275
     276                        melting=(double*)xmalloc(numberofnodes*sizeof(double));
     277
     278                        for(i=0;i<numberofnodes;i++){
     279                                melting[i]=m_g_serial[(int)partition[i]];
     280                        }
     281
     282                        /*Ok, add pressure to newresults: */
     283                        newresult=new Result(newresults->Size()+1,result->GetTime(),result->GetStep(),"melting",melting,numberofnodes);
     284                        newresults->AddObject(newresult);
     285
     286                        /*do some cleanup: */
     287                        xfree((void**)&m_g_serial);
     288                        xfree((void**)&partition);
     289                }
     290
    231291                else if(strcmp(result->GetFieldName(),"h_g")==0){
    232292                        /*easy, h_g is of size numberofnodes, on 1 dof, just repartition: */
Note: See TracChangeset for help on using the changeset viewer.