source:
issm/oecreview/Archive/22819-23185/ISSM-22970-22971.diff
Last change on this file was 23186, checked in by , 7 years ago | |
---|---|
File size: 6.0 KB |
-
../trunk-jpl/src/c/classes/Cfdragcoeffabsgrad.h
19 19 int definitionenum; 20 20 char* name; 21 21 int weights_enum; 22 IssmDouble datatime;23 22 bool timepassedflag; 24 23 IssmDouble last_time; 25 24 … … 28 27 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 34 33 /*Object virtual function resolutoin: */ -
../trunk-jpl/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp
259 259 int* cfdragcoeffabsgrad_weights_M_s = NULL; 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): */ 265 264 iomodel->FetchMultipleData(&cfdragcoeffabsgrad_name_s,&num_cfdragcoeffabsgrads, "md.cfdragcoeffabsgrad.name"); … … 266 265 iomodel->FetchMultipleData(&cfdragcoeffabsgrad_definitionstring_s,&num_cfdragcoeffabsgrads, "md.cfdragcoeffabsgrad.definitionstring"); 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++){ 272 270 … … 281 279 _error_("cfdragcoeffabsgrad weight size not supported yet"); 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.*/ 287 285 for(int k=0;k<elements->Size();k++){ … … 310 308 xDelete<int>(cfdragcoeffabsgrad_weights_M_s); 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 } 316 313 else if (output_definition_enums[i]==CfsurfacelogvelEnum){ -
../trunk-jpl/src/c/classes/Cfdragcoeffabsgrad.cpp
31 31 this->weights_enum = UNDEF; 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.; 37 36 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; 43 42 … … 45 44 xMemCpy<char>(this->name,in_name,strlen(in_name)+1); 46 45 47 46 this->weights_enum=in_weights_enum; 48 this->datatime=in_datatime;49 47 this->timepassedflag=in_timepassedflag; 50 48 51 49 this->misfit=0; … … 60 58 /*}}}*/ 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; 66 64 return (Object*) mf; … … 73 71 void Cfdragcoeffabsgrad::Echo(void){/*{{{*/ 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 } 79 76 /*}}}*/ … … 106 103 IssmDouble time; 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); 120 112 J+=this->Cfdragcoeffabsgrad_Calculation(element,weights_enum); … … 126 118 127 119 timepassedflag = true; 128 120 return J; 129 }130 else return J;131 121 } 132 122 /*}}}*/ 133 123 IssmDouble Cfdragcoeffabsgrad::Cfdragcoeffabsgrad_Calculation(Element* element, int weights_enum){/*{{{*/
Note:
See TracBrowser
for help on using the repository browser.