Changeset 3539
- Timestamp:
- 04/15/10 07:37:19 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/parallel/objectivefunctionC.cpp
r3446 r3539 22 22 Model* model=NULL; 23 23 FemModel* femmodel=NULL; 24 DataSet* diagnostic_results=NULL; 24 25 double* param_g=NULL; 25 26 double* grad_g=NULL; … … 80 81 /*First, update param_g using search_scalar: */ 81 82 for(i=0;i<numberofnodes;i++)param_g_copy[i]=param_g_copy[i]+search_scalar*optscal[n]*grad_g[i]; 83 printf("numberofdofspernode: %i\n",numberofdofspernode); 82 84 83 85 /*Constrain:*/ … … 88 90 89 91 /*Run diagnostic with updated parameters.*/ 90 diagnostic_core_nonlinear(&u_g,NULL,NULL,NULL,femmodel,inputs,DiagnosticAnalysisEnum(),sub_analysis_type); 91 VecToMPISerial(&u_g_double,u_g); VecFree(&u_g); 92 inputs->Add("velocity",u_g_double,numberofdofspernode,numberofnodes); 92 if(!control_steady){ 93 diagnostic_core_nonlinear(&u_g,NULL,NULL,NULL,femmodel,inputs,DiagnosticAnalysisEnum(),sub_analysis_type); 94 VecToMPISerial(&u_g_double,u_g); VecFree(&u_g); 95 inputs->Add("velocity",u_g_double,numberofdofspernode,numberofnodes); 96 } 97 else{ 98 //We need a 3D velocity!! (vz is required for the next thermal run) 99 diagnostic_results=new DataSet(ResultsEnum()); 100 diagnostic_core(diagnostic_results,model, inputs); 101 102 //extract u_g and add it to input (3d velocity needed by thermal_core) 103 diagnostic_results->FindResult(&u_g,"u_g"); 104 inputs->Add("velocity",u_g,3,numberofnodes); 105 delete diagnostic_results; 106 } 93 107 94 108 /*Compute misfit for this velocity field.*/
Note:
See TracChangeset
for help on using the changeset viewer.