Changeset 2000
- Timestamp:
- 08/27/09 08:54:15 (16 years ago)
- 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 21 21 /*Intermediary: */ 22 22 DataSet* diagnostic_results=NULL; 23 DataSet* gradjcompute_results=NULL; 23 24 Vec u_g=NULL; 24 25 double search_scalar; … … 88 89 89 90 _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; 91 95 _printf_("%s\n"," done."); 92 96 -
issm/trunk/src/c/parallel/gradjcompute_core.cpp
r1997 r2000 1 /*!\file: GradJCompute.cpp1 /*!\file: gradjcompute_core.cpp 2 2 * \brief compute inverse method gradient direction. 3 3 */ … … 7 7 8 8 #undef __FUNCT__ 9 #define __FUNCT__ " GradJCompute"9 #define __FUNCT__ "gradjcompute_core" 10 10 11 11 #ifdef HAVE_CONFIG_H … … 15 15 #endif 16 16 17 Vec GradJCompute(ParameterInputs* inputs,FemModel* femmodel){17 void gradjcompute_core(DataSet* results,Model* model, ParameterInputs* inputs){ 18 18 19 19 20 20 /*intermediary: */ 21 FemModel* femmodel=NULL; 22 DataSet* diagnostic_results=NULL; 21 23 int analysis_type; 22 24 int sub_analysis_type; … … 31 33 Vec du_g=NULL; 32 34 Vec du_f=NULL; 35 Vec grad_g=NULL; 33 36 34 37 Vec lambda_f=NULL; … … 40 43 41 44 /*output: */ 42 Vec grad_g=NULL;45 Result* result=NULL; 43 46 44 47 /*flags: */ … … 48 51 49 52 /*some parameters:*/ 53 femmodel=model->GetActiveFormulation(); 50 54 femmodel->parameters->FindParam((void*)&analysis_type,"analysis_type"); 51 55 femmodel->parameters->FindParam((void*)&sub_analysis_type,"sub_analysis_type"); … … 90 94 FieldExtrudex( grad_g, femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials,"gradj",0); 91 95 } 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); 92 110 93 111 /*Free ressources:*/ … … 95 113 xfree((void**)&control_type); 96 114 xfree((void**)&u_g_double); 115 xfree((void**)&grad_g); 97 116 xfree((void**)&lambda_g_double); 98 117 99 return grad_g;100 101 118 } -
issm/trunk/src/c/parallel/parallel.h
r1881 r2000 13 13 class FemModel; 14 14 15 Vec GradJCompute(ParameterInputs* inputs,FemModel* femmodel);15 void gradjcompute_core(DataSet* results,Model* model, ParameterInputs* inputs); 16 16 17 17 void diagnostic_core(DataSet* results,Model* model, ParameterInputs* inputs);
Note:
See TracChangeset
for help on using the changeset viewer.