Changeset 21744
- Timestamp:
- 05/26/17 19:46:14 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp
r21738 r21744 53 53 /*Free ressources:*/ 54 54 for(j=0;j<numgates;j++){ 55 char* string = gatenames[j]; xDelete<char>(string); 56 char* string2 = gatedefinitionstrings[j]; xDelete<char>(string2); 57 IssmDouble* gate = gatesegments[j]; xDelete<IssmDouble>(gate); 55 char* string = gatenames[j]; xDelete<char>(string); 56 IssmDouble* gate = gatesegments[j]; xDelete<IssmDouble>(gate); 58 57 } 59 58 xDelete<char*>(gatenames); … … 95 94 for(j=0;j<nummisfits;j++){ 96 95 96 int obs_vector_type=0; 97 if ((misfit_observation_M_s[j]==iomodel->numberofvertices) || (misfit_observation_M_s[j]==iomodel->numberofvertices+1))obs_vector_type=1; 98 if ((misfit_observation_M_s[j]==iomodel->numberofelements) || (misfit_observation_M_s[j]==iomodel->numberofelements+1))obs_vector_type=2; 99 int weight_vector_type=0; 100 if ((misfit_weights_M_s[j]==iomodel->numberofvertices) || (misfit_weights_M_s[j]==iomodel->numberofvertices+1))weight_vector_type=1; 101 if ((misfit_weights_M_s[j]==iomodel->numberofelements) || (misfit_weights_M_s[j]==iomodel->numberofelements+1))weight_vector_type=2; 102 103 97 104 /*First create a misfit object for that specific string (misfit_model_string_s[j]):*/ 98 105 output_definitions->AddObject(new Misfit(misfit_name_s[j],StringToEnumx(misfit_definitionstring_s[j]),StringToEnumx(misfit_model_string_s[j]),StringToEnumx(misfit_observation_string_s[j]),misfit_timeinterpolation_s[j],misfit_local_s[j],StringToEnumx(misfit_weights_string_s[j]))); … … 101 108 for(int k=0;k<elements->Size();k++){ 102 109 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(k)); 103 element->InputCreate(misfit_observation_s[j], iomodel,misfit_observation_M_s[j],misfit_observation_N_s[j], 1,StringToEnumx(misfit_observation_string_s[j]),7);104 element->InputCreate(misfit_weights_s[j], iomodel,misfit_weights_M_s[j],misfit_weights_N_s[j], 1,StringToEnumx(misfit_weights_string_s[j]),7);110 element->InputCreate(misfit_observation_s[j], iomodel,misfit_observation_M_s[j],misfit_observation_N_s[j],obs_vector_type,StringToEnumx(misfit_observation_string_s[j]),7); 111 element->InputCreate(misfit_weights_s[j], iomodel,misfit_weights_M_s[j],misfit_weights_N_s[j],weight_vector_type,StringToEnumx(misfit_weights_string_s[j]),7); 105 112 } 106 113 … … 212 219 /*masscon variables: */ 213 220 char** masscon_name_s = NULL; 214 int* masscon_definitionenum_s= NULL;221 char** masscon_definitionstring_s = NULL; 215 222 char** masscon_namex_s = NULL; 216 223 char** masscon_namey_s = NULL; … … 221 228 /*Fetch names and multiplicators, etc ... (see src/m/classes/masscon_axpby.m): */ 222 229 iomodel->FetchMultipleData(&masscon_name_s,&num, "md.massconaxpby.name"); 223 iomodel->FetchMultipleData(&masscon_definition enum_s,&num,"md.massconaxpby.definitionenum");230 iomodel->FetchMultipleData(&masscon_definitionstring_s,&num,"md.massconaxpby.definitionstring"); 224 231 iomodel->FetchMultipleData(&masscon_namex_s,&num, "md.massconaxpby.namex"); 225 232 iomodel->FetchMultipleData(&masscon_namey_s,&num, "md.massconaxpby.namey"); … … 229 236 230 237 /*Create a masscon axpyb object: */ 231 output_definitions->AddObject(new Massconaxpby(masscon_name_s[j], masscon_definitionenum_s[j],masscon_namex_s[j],masscon_namey_s[j],masscon_alpha_s[j],masscon_beta_s[j]));238 output_definitions->AddObject(new Massconaxpby(masscon_name_s[j],StringToEnumx(masscon_definitionstring_s[j]),masscon_namex_s[j],masscon_namey_s[j],masscon_alpha_s[j],masscon_beta_s[j])); 232 239 233 240 } … … 236 243 for(j=0;j<num;j++){ 237 244 char* string=NULL; 245 string = masscon_definitionstring_s[j]; xDelete<char>(string); 238 246 string = masscon_name_s[j]; xDelete<char>(string); 239 247 string = masscon_namex_s[j]; xDelete<char>(string); 240 248 string = masscon_namey_s[j]; xDelete<char>(string); 241 249 } 250 xDelete<char*>(masscon_definitionstring_s); 242 251 xDelete<char*>(masscon_name_s); 243 252 xDelete<char*>(masscon_namex_s); 244 253 xDelete<char*>(masscon_namey_s); 245 xDelete<int>(masscon_definitionenum_s);246 254 xDelete<IssmDouble>(masscon_alpha_s); 247 255 xDelete<IssmDouble>(masscon_beta_s);
Note:
See TracChangeset
for help on using the changeset viewer.