Changeset 2000


Ignore:
Timestamp:
08/27/09 08:54:15 (16 years ago)
Author:
seroussi
Message:

added control for steadystate paralle

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

Legend:

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

    r1964 r2000  
    2121        /*Intermediary: */
    2222        DataSet* diagnostic_results=NULL;
     23        DataSet* gradjcompute_results=NULL;
    2324        Vec     u_g=NULL;
    2425        double  search_scalar;
     
    8889
    8990                _printf_("%s\n","      computing gradJ...");
    90                 grad_g=GradJCompute(inputs,fem_model);
     91                gradjcompute_results=new DataSet(ResultsEnum());
     92                gradjcompute_core(gradjcompute_results,model, inputs);
     93                gradjcompute_results->FindResult(&grad_g,"grad_g");
     94                delete gradjcompute_results;
    9195                _printf_("%s\n","      done.");
    9296
  • issm/trunk/src/c/parallel/gradjcompute_core.cpp

    r1997 r2000  
    1 /*!\file:  GradJCompute.cpp
     1/*!\file:  gradjcompute_core.cpp
    22 * \brief compute inverse method gradient direction.
    33 */
     
    77
    88#undef __FUNCT__
    9 #define __FUNCT__ "GradJCompute"
     9#define __FUNCT__ "gradjcompute_core"
    1010
    1111#ifdef HAVE_CONFIG_H
     
    1515#endif
    1616
    17 Vec GradJCompute(ParameterInputs* inputs,FemModel* femmodel){
     17void gradjcompute_core(DataSet* results,Model* model, ParameterInputs* inputs){
    1818       
    1919       
    2020        /*intermediary: */
     21        FemModel* femmodel=NULL;
     22        DataSet* diagnostic_results=NULL;
    2123        int analysis_type;
    2224        int sub_analysis_type;
     
    3133        Vec du_g=NULL;
    3234        Vec du_f=NULL;
     35        Vec grad_g=NULL;
    3336
    3437        Vec lambda_f=NULL;
     
    4043       
    4144        /*output: */
    42         Vec grad_g=NULL;
     45        Result* result=NULL;
    4346
    4447        /*flags: */
     
    4851       
    4952        /*some parameters:*/
     53        femmodel=model->GetActiveFormulation();
    5054        femmodel->parameters->FindParam((void*)&analysis_type,"analysis_type");
    5155        femmodel->parameters->FindParam((void*)&sub_analysis_type,"sub_analysis_type");
     
    9094                FieldExtrudex( grad_g, femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials,"gradj",0);
    9195        }
     96
     97        if(analysis_type==SteadystateAnalysisEnum()){
     98                diagnostic_results=new DataSet(ResultsEnum());
     99                diagnostic_core(diagnostic_results,model, inputs);
     100
     101                //extract u_g and add it to input (3d velocity needed by thermal_core)
     102                diagnostic_results->FindResult(&u_g,"u_g");
     103                inputs->Add("velocity",u_g,3,numberofnodes);
     104                delete diagnostic_results;
     105        }
     106
     107        /*Plug results into output dataset: */
     108        result=new Result(results->Size()+1,0,1,"grad_g",grad_g);
     109        results->AddObject(result);
    92110       
    93111        /*Free ressources:*/
     
    95113        xfree((void**)&control_type);
    96114        xfree((void**)&u_g_double);
     115        xfree((void**)&grad_g);
    97116        xfree((void**)&lambda_g_double);
    98117
    99         return grad_g;
    100 
    101118}
  • issm/trunk/src/c/parallel/parallel.h

    r1881 r2000  
    1313class FemModel;
    1414
    15 Vec GradJCompute(ParameterInputs* inputs,FemModel* femmodel);
     15void gradjcompute_core(DataSet* results,Model* model, ParameterInputs* inputs);
    1616
    1717void diagnostic_core(DataSet* results,Model* model, ParameterInputs* inputs);
Note: See TracChangeset for help on using the changeset viewer.