Changeset 823


Ignore:
Timestamp:
06/05/09 15:14:47 (16 years ago)
Author:
Eric.Larour
Message:

New transient 2d solution in parallel

Location:
issm/trunk/src
Files:
4 added
8 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/DataSet/DataSet.cpp

    r804 r823  
    338338}
    339339
     340int   DataSet::FindResult(Vec* presult,char* name){
     341
     342        /*Go through a dataset, and find a Result* object
     343         *whith result name is "name" : */
     344       
     345        vector<Object*>::iterator object;
     346        Result* result=NULL;
     347
     348        int found=0;
     349
     350        for ( object=objects.begin() ; object < objects.end(); object++ ){
     351
     352                /*Find param type objects: */
     353                if((*object)->Enum()==ResultEnum()){
     354
     355                        /*Ok, this object is a result,recover it and ask which name it has: */
     356                        result=(Result*)(*object);
     357
     358                        if (strcmp(result->GetFieldName(),name)==0){
     359                                /*Ok, this is the one! Recover the value of this result: */
     360                                result->GetField(presult);
     361                                found=1;
     362                                break;
     363                        }
     364                }
     365        }
     366        return found;
     367}
     368
    340369int   DataSet::FindResult(void* pvalue, char* name){
    341370
  • issm/trunk/src/c/DataSet/DataSet.h

    r804 r823  
    4444                int   Size();
    4545                int   FindParam(void* pvalue, char* name);
     46                int   FindResult(Vec* presult,char* name);
    4647                Object* FindParamObject(char* name);
    4748                void  NodeRank(int* ranks);
  • issm/trunk/src/c/Makefile.am

    r816 r823  
    557557                                        ./parallel/ProcessResults.cpp\
    558558                                        ./parallel/prognostic_core.cpp\
     559                                        ./parallel/transient_core.cpp\
     560                                        ./parallel/transient_core_2d.cpp\
     561                                        ./parallel/transient_core_3d.cpp\
    559562                                        ./parallel/qmu.cpp\
    560563                                        ./parallel/DakotaResponses.cpp\
     
    567570bin_PROGRAMS =
    568571else
    569 bin_PROGRAMS = diagnostic.exe  control.exe thermal.exe prognostic.exe
     572bin_PROGRAMS = diagnostic.exe  control.exe thermal.exe prognostic.exe transient.exe
    570573endif
    571574
     
    584587prognostic_exe_CXXFLAGS= -fPIC -D_PARALLEL_
    585588
     589transient_exe_SOURCES = parallel/transient.cpp
     590transient_exe_CXXFLAGS= -fPIC -D_PARALLEL_
     591
  • issm/trunk/src/c/ModelProcessorx/Prognostic/CreateParametersPrognostic.cpp

    r765 r823  
    2626        double* pressure=NULL;
    2727        double* thickness=NULL;
     28        double* surface=NULL;
     29        double* bed=NULL;
    2830        double* accumulation=NULL;
    2931        double* melting=NULL;
     
    6870        xfree((void**)&thickness);
    6971
     72        /*Get surface: */
     73        ModelFetchData((void**)&surface,NULL,NULL,model_handle,"surface","Matrix","Mat");
     74       
     75        count++;
     76        param= new Param(count,"s_g",DOUBLEVEC);
     77        if(surface) param->SetDoubleVec(surface,model->numberofnodes,1);
     78        else param->SetDoubleVec(surface,0,0);
     79        parameters->AddObject(param);
     80
     81        /*Free surface: */
     82        xfree((void**)&surface);
     83
     84        /*Get bed: */
     85        ModelFetchData((void**)&bed,NULL,NULL,model_handle,"bed","Matrix","Mat");
     86       
     87        count++;
     88        param= new Param(count,"b_g",DOUBLEVEC);
     89        if(bed) param->SetDoubleVec(bed,model->numberofnodes,1);
     90        else param->SetDoubleVec(bed,0,0);
     91        parameters->AddObject(param);
     92
     93        /*Free bed: */
     94        xfree((void**)&bed);
     95
     96
    7097        /*Get melting: */
    7198        ModelFetchData((void**)&melting,NULL,NULL,model_handle,"melting","Matrix","Mat");
     
    93120
    94121
    95 
    96 
    97122        /*Assign output pointer: */
    98123        *pparameters=parameters;
  • issm/trunk/src/c/objects/Result.cpp

    r803 r823  
    196196
    197197void  Result::GetField(Vec* pfield){
    198         *pfield=field;
     198
     199        VecDuplicatePatch(pfield,field);
     200
    199201}
    200202               
    201203void  Result::GetField(double** pfield){
    202         *pfield=dfield;
     204        *pfield=(double*)xmalloc(size*sizeof(double));
     205        memcpy(*pfield,dfield,size*sizeof(double));
    203206}
    204207
  • issm/trunk/src/c/parallel/SpawnCore.cpp

    r805 r823  
    144144
    145145                if(debug)_printf_("Starting transient core\n");
    146                 throw ErrorException(__FUNCT__,"not supported yet!");
     146                transient_core(results,femmodels,inputs);
    147147
    148148        }
  • issm/trunk/src/c/parallel/parallel.h

    r804 r823  
    1919void diagnostic_core_nonlinear(Vec* pug,Mat* pK_ff0,Mat* pK_fs0, FemModel* fem,ParameterInputs* inputs,int analysis_type,int sub_analysis_type);
    2020void diagnostic_core_linear(Vec* ppg,FemModel* fem,ParameterInputs* inputs,int  analysis_type,int sub_analysis_type);
     21
     22void transient_core(DataSet* results,FemModel* fems, ParameterInputs* inputs);
     23void transient_core_2d(DataSet* results,FemModel* fems, ParameterInputs* inputs);
     24void transient_core_3d(DataSet* results,FemModel* fems, ParameterInputs* inputs);
    2125
    2226//int GradJOrth(WorkspaceParams* workspaceparams);
  • issm/trunk/src/m/solutions/cielo/transient2d.m

    r816 r823  
    3333solution.p_g=[];
    3434solution.h_g=m_p.parameters.h_g;
    35 solution.s_g=md.surface;
    36 solution.b_g=md.bed;
     35solution.s_g=m_p.parameters.s_g;
     36solution.b_g=m_p.parameters.b_g;
    3737
    3838%initialize inputs
Note: See TracChangeset for help on using the changeset viewer.