source:
issm/oecreview/Archive/24307-24683/ISSM-24343-24344.diff@
24684
Last change on this file since 24684 was 24684, checked in by , 5 years ago | |
---|---|
File size: 7.9 KB |
-
../trunk-jpl/src/c/classes/Inputs2/BoolInput2.cpp
43 43 /*}}}*/ 44 44 void BoolInput2::DeepEcho(void){/*{{{*/ 45 45 46 //_printf_(setw(15)<<" BoolInput2 "<<setw(25)<<left<<EnumToStringx(this->enum_type)<<" "<<(value?"true":"false") << "\n"); 47 _error_("Not implemented"); 46 _printf_("BoolInput2 Echo:\n"); 47 _printf_(" Size: "<<size<<"\n"); 48 printarray(this->values,this->size); 48 49 } 49 50 /*}}}*/ 50 51 void BoolInput2::Echo(void){/*{{{*/ -
../trunk-jpl/src/c/classes/Inputs2/Inputs2.cpp
245 245 return false; 246 246 } 247 247 /*}}}*/ 248 int Inputs2::GetInputObjectEnum(int enum_in){/*{{{*/ 249 250 _assert_(this); 251 252 int index = EnumToIndex(enum_in); 253 if(!this->inputs[index]) _error_("Input "<<EnumToStringx(enum_in)<<" not found"); 254 return this->inputs[index]->ObjectEnum(); 255 } 256 /*}}}*/ 248 257 void Inputs2::GetInputsInterpolations(int* pnuminputs,int** pinterpolations,int** pinputenums){/*{{{*/ 249 258 250 259 /*First count number of inputs*/ -
../trunk-jpl/src/c/classes/Inputs2/Inputs2.h
59 59 DatasetInput2* GetDatasetInput2(int enum_type); 60 60 ControlInput2* GetControlInput2(int enum_type); 61 61 void Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction); 62 int GetInputObjectEnum(int enum_type); 62 63 void GetInputValue(bool* pvalue,int enum_in,int index); 63 64 void GetInputValue(int* pvalue,int enum_in,int index); 64 65 void ResultInterpolation(int* pinterpolation,int*nodesperelement,int* parray_size, int output_enum); -
../trunk-jpl/src/c/classes/Elements/Element.cpp
3281 3281 } 3282 3282 3283 3283 /*If this input is not already in Inputs, maybe it needs to be computed?*/ 3284 Input2* input2 = this->GetInput2(output_enum); 3285 if(!input2) _error_("input "<<EnumToStringx(output_enum)<<" not found in element"); 3284 switch(this->inputs2->GetInputObjectEnum(output_enum)){ 3285 case TriaInput2Enum: 3286 case PentaInput2Enum:{ 3287 Input2* input2 = this->GetInput2(output_enum); 3288 if(!input2) _error_("input "<<EnumToStringx(output_enum)<<" not found in element"); 3289 *pinterpolation = input2->GetResultInterpolation(); 3290 *pnodesperelement = input2->GetResultNumberOfNodes(); 3291 *parray_size = input2->GetResultArraySize(); 3292 } 3293 break; 3294 case BoolInput2Enum: 3295 *pinterpolation = P0Enum; 3296 *pnodesperelement = 1; 3297 *parray_size = 1; 3298 break; 3299 default: 3300 _error_("Input type \""<<EnumToStringx(this->inputs2->GetInputObjectEnum(output_enum))<<"\" not supported yet"); 3301 } 3286 3302 3303 3287 3304 /*Assign output pointer*/ 3288 *pinterpolation = input2->GetResultInterpolation(); 3289 *pnodesperelement = input2->GetResultNumberOfNodes(); 3290 *parray_size = input2->GetResultArraySize(); 3305 3291 3306 return; 3292 3307 }/*}}}*/ 3293 3308 void Element::ResultToPatch(IssmDouble* values,int nodesperelement,int output_enum){/*{{{*/ … … 3310 3325 } /*}}}*/ 3311 3326 void Element::ResultToVector(Vector<IssmDouble>* vector,int output_enum){/*{{{*/ 3312 3327 3328 switch(this->inputs2->GetInputObjectEnum(output_enum)){ 3329 case TriaInput2Enum: 3330 case PentaInput2Enum:{ 3313 3331 3314 Input2* input2=this->GetInput2(output_enum);3315 if(!input2) _error_("input "<<EnumToStringx(output_enum)<<" not found in element");3332 Input2* input2 = this->GetInput2(output_enum); 3333 if(!input2) _error_("input "<<EnumToStringx(output_enum)<<" not found in element"); 3316 3334 3317 switch(input2->GetResultInterpolation()){ 3318 case P0Enum:{ 3319 IssmDouble value; 3320 bool bvalue; 3321 switch(input2->ObjectEnum()){ 3322 case BoolInputEnum: 3323 (xDynamicCast<BoolInput2*>(input2))->GetInput(&bvalue,this->lid); 3324 value=reCast<IssmDouble>(bvalue); 3325 break; 3326 default: 3327 Gauss* gauss = this->NewGauss(); 3328 input2->GetInputValue(&value,gauss); 3329 delete gauss; 3330 } 3331 vector->SetValue(this->Sid(),value,INS_VAL); 3332 break; 3333 } 3334 case P1Enum:{ 3335 const int NUM_VERTICES = this->GetNumberOfVertices(); 3335 switch(input2->GetResultInterpolation()){ 3336 case P0Enum:{ 3337 IssmDouble value; 3338 bool bvalue; 3339 Gauss* gauss = this->NewGauss(); 3340 input2->GetInputValue(&value,gauss); 3341 delete gauss; 3342 vector->SetValue(this->Sid(),value,INS_VAL); 3343 break; 3344 } 3345 case P1Enum:{ 3346 const int NUM_VERTICES = this->GetNumberOfVertices(); 3336 3347 3337 3338 3339 3348 IssmDouble *values = xNew<IssmDouble>(NUM_VERTICES); 3349 int *connectivity= xNew<int>(NUM_VERTICES); 3350 int *sidlist = xNew<int>(NUM_VERTICES); 3340 3351 3341 3342 3343 3344 3352 this->GetVerticesSidList(sidlist); 3353 this->GetVerticesConnectivityList(connectivity); 3354 this->GetInputListOnVertices(values,output_enum); 3355 for(int i=0;i<NUM_VERTICES;i++) values[i] = values[i]/reCast<IssmDouble>(connectivity[i]); 3345 3356 3346 3357 vector->SetValues(NUM_VERTICES,sidlist,values,ADD_VAL); 3347 3358 3348 xDelete<IssmDouble>(values); 3349 xDelete<int>(connectivity); 3350 xDelete<int>(sidlist); 3351 break; 3352 } 3353 default: 3354 _error_("interpolation "<<EnumToStringx(input2->GetResultInterpolation())<<" not supported yet"); 3355 } 3359 xDelete<IssmDouble>(values); 3360 xDelete<int>(connectivity); 3361 xDelete<int>(sidlist); 3362 break; 3363 } 3364 default: 3365 _error_("interpolation "<<EnumToStringx(input2->GetResultInterpolation())<<" not supported yet"); 3366 } 3367 } 3368 break; 3369 case BoolInput2Enum: 3370 bool bvalue; 3371 this->GetInput2Value(&bvalue,output_enum); 3372 vector->SetValue(this->Sid(),reCast<IssmDouble>(bvalue),INS_VAL); 3373 break; 3374 default: 3375 _error_("Input type \""<<EnumToStringx(this->inputs2->GetInputObjectEnum(output_enum))<<"\" not supported yet"); 3376 } 3377 3356 3378 } /*}}}*/ 3357 3379 void Element::SetBoolInput(Inputs2* inputs2,int enum_in,bool value){/*{{{*/ 3358 3380 -
../trunk-jpl/src/c/classes/Elements/Tria.cpp
193 193 /*Call inputs method*/ 194 194 if(!this->inputs2){ 195 195 int* temp = xNew<int>(3); 196 _error_("inputs2 not set"); 196 197 } 197 198 _assert_(this->inputs2); 198 199 switch(interpolation_enum){ -
../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
688 688 } 689 689 } 690 690 } 691 basalelement->AddInput2(HydrologydcEplThicknessSubstepEnum,epl_thickness,basalelement->GetElementType());691 element->AddBasalInput2(HydrologydcEplThicknessSubstepEnum,epl_thickness,basalelement->GetElementType()); 692 692 693 693 if(domaintype!=Domain2DhorizontalEnum){ 694 694 basalelement->DeleteMaterials();
Note:
See TracBrowser
for help on using the repository browser.