Changeset 22971
- Timestamp:
- 07/18/18 14:28:01 (7 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Cfdragcoeffabsgrad.cpp
r22612 r22971 32 32 this->misfit=0; 33 33 this->lock=0; 34 this->datatime=0.;35 34 this->timepassedflag = false; 36 35 this->last_time = 0.; … … 38 37 } 39 38 /*}}}*/ 40 Cfdragcoeffabsgrad::Cfdragcoeffabsgrad(char* in_name, int in_definitionenum, int in_weights_enum, IssmDouble in_datatime,bool in_timepassedflag){/*{{{*/39 Cfdragcoeffabsgrad::Cfdragcoeffabsgrad(char* in_name, int in_definitionenum, int in_weights_enum, bool in_timepassedflag){/*{{{*/ 41 40 42 41 this->definitionenum=in_definitionenum; … … 46 45 47 46 this->weights_enum=in_weights_enum; 48 this->datatime=in_datatime;49 47 this->timepassedflag=in_timepassedflag; 50 48 … … 61 59 /*Object virtual function resolutoin: */ 62 60 Object* Cfdragcoeffabsgrad::copy() {/*{{{*/ 63 Cfdragcoeffabsgrad* mf = new Cfdragcoeffabsgrad(this->name,this->definitionenum, this->weights_enum,this-> datatime,this->timepassedflag);61 Cfdragcoeffabsgrad* mf = new Cfdragcoeffabsgrad(this->name,this->definitionenum, this->weights_enum,this->timepassedflag); 64 62 mf->misfit=this->misfit; 65 63 mf->lock=this->lock; … … 74 72 _printf_(" Cfdragcoeffabsgrad: " << name << " " << this->definitionenum << "\n"); 75 73 _printf_(" weights_enum: " << weights_enum << " " << EnumToStringx(weights_enum) << "\n"); 76 _printf_(" datatime: " << datatime << "\n");77 74 _printf_(" timepassedflag: "<<timepassedflag<<"\n"); 78 75 } … … 107 104 108 105 /*recover time parameters: */ 109 femmodel->parameters->FindParam(&time,TimeEnum);110 if(time < last_time) timepassedflag = false;111 last_time = time;112 113 106 int i; 114 107 IssmDouble J=0.; 115 108 IssmDouble J_sum=0.; 116 109 117 if(datatime<=time && !timepassedflag){118 110 for(i=0;i<femmodel->elements->Size();i++){ 119 111 Element* element=(Element*)femmodel->elements->GetObjectByOffset(i); … … 127 119 timepassedflag = true; 128 120 return J; 129 }130 else return J;131 121 } 132 122 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Cfdragcoeffabsgrad.h
r22612 r22971 20 20 char* name; 21 21 int weights_enum; 22 IssmDouble datatime;23 22 bool timepassedflag; 24 23 IssmDouble last_time; … … 29 28 /*Cfdragcoeffabsgrad constructors, destructors :*/ 30 29 Cfdragcoeffabsgrad(); 31 Cfdragcoeffabsgrad(char* in_name, int in_definitionenum, int in_weights_enum, IssmDouble in_datatime,bool timepassedflag);30 Cfdragcoeffabsgrad(char* in_name, int in_definitionenum, int in_weights_enum, bool timepassedflag); 32 31 ~Cfdragcoeffabsgrad(); 33 32 -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp
r22764 r22971 260 260 int* cfdragcoeffabsgrad_weights_N_s = NULL; 261 261 char** cfdragcoeffabsgrad_weights_string_s = NULL; 262 int* cfdragcoeffabsgrad_datatime_s = NULL;263 262 264 263 /*Fetch name, model_string, observation, observation_string, etc ... (see src/m/classes/cfdragcoeffabsgrad.m): */ … … 267 266 iomodel->FetchMultipleData(&cfdragcoeffabsgrad_weights_s,&cfdragcoeffabsgrad_weights_M_s,&cfdragcoeffabsgrad_weights_N_s,&num_cfdragcoeffabsgrads, "md.cfdragcoeffabsgrad.weights"); 268 267 iomodel->FetchMultipleData(&cfdragcoeffabsgrad_weights_string_s,&num_cfdragcoeffabsgrads, "md.cfdragcoeffabsgrad.weights_string"); 269 iomodel->FetchMultipleData(&cfdragcoeffabsgrad_datatime_s,&num_cfdragcoeffabsgrads, "md.cfdragcoeffabsgrad.datatime");270 268 271 269 for(j=0;j<num_cfdragcoeffabsgrads;j++){ … … 282 280 283 281 /*First create a cfdragcoeffabsgrad object for that specific string (cfdragcoeffabsgrad_model_string_s[j]):*/ 284 output_definitions->AddObject(new Cfdragcoeffabsgrad(cfdragcoeffabsgrad_name_s[j],StringToEnumx(cfdragcoeffabsgrad_definitionstring_s[j]),StringToEnumx(cfdragcoeffabsgrad_weights_string_s[j]), cfdragcoeffabsgrad_datatime_s[j],false));282 output_definitions->AddObject(new Cfdragcoeffabsgrad(cfdragcoeffabsgrad_name_s[j],StringToEnumx(cfdragcoeffabsgrad_definitionstring_s[j]),StringToEnumx(cfdragcoeffabsgrad_weights_string_s[j]),false)); 285 283 286 284 /*Now, for this particular cfdragcoeffabsgrad object, make sure we plug into the elements: the observation, and the weights.*/ … … 311 309 xDelete<int>(cfdragcoeffabsgrad_weights_N_s); 312 310 xDelete<char*>(cfdragcoeffabsgrad_weights_string_s); 313 xDelete<int>(cfdragcoeffabsgrad_datatime_s);314 311 /*}}}*/ 315 312 }
Note:
See TracChangeset
for help on using the changeset viewer.