Changeset 3028
- Timestamp:
- 02/12/10 19:19:23 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/parallel/DakotaResponses.cpp
r2333 r3028 182 182 if(my_rank==0)responses[i]=max_abs_vz; 183 183 } 184 else if(strcmp(response_descriptor,"misfit")==0){ 185 186 ParameterInputs* inputs=NULL; //needed to plug velocity into elements. 187 double J=0; 188 int analysis_type,sub_analysis_type; 189 int numberofdofspernode,numberofnodes; 190 Vec u_g=NULL; 191 192 /*Recover analysis_type: */ 193 fem->parameters->FindParam(&analysis_type,"analysis_type"); 194 fem->parameters->FindParam(&sub_analysis_type,"sub_analysis_type"); 195 fem->parameters->FindParam(&numberofdofspernode,"numberofdofspernode"); 196 fem->parameters->FindParam(&numberofnodes,"numberofnodes"); 197 198 /*Recover velocity: */ 199 found=results->FindResult(&u_g,"u_g"); 200 if(!found)throw ErrorException(__FUNCT__," could not find velocity to compute misfit"); 201 202 /*Add to inputs: */ 203 inputs->Add("velocity",u_g,numberofdofspernode,numberofnodes); 204 205 /*Compute misfit: */ 206 Misfitx( &J, fem->elements,fem->nodes, fem->loads, fem->materials, fem->parameters,inputs,analysis_type,sub_analysis_type); 207 208 if(my_rank==0)responses[i]=J; 209 210 /*Some cleanup: */ 211 VecFree(&u_g); 212 213 } 184 214 else{ 185 215 if(my_rank==0)printf("%s%s%s"," response descriptor : ",response_descriptor," not supported yet!");
Note:
See TracChangeset
for help on using the changeset viewer.