Changeset 28263
- Timestamp:
- 05/08/24 17:42:24 (11 months ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Cfdragcoeffabsgrad.h
r27897 r28263 9 9 #include "./Definition.h" 10 10 #include "./FemModel.h" 11 12 IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,int output_enum);13 11 14 12 class Cfdragcoeffabsgrad: public Object, public Definition{ -
issm/trunk-jpl/src/c/classes/Cfdragcoeffabsgradtransient.h
r27902 r28263 9 9 #include "./Definition.h" 10 10 class FemModel; 11 12 IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,int output_enum);13 11 14 12 class Cfdragcoeffabsgradtransient: public Object, public Definition{ -
issm/trunk-jpl/src/c/classes/Cflevelsetmisfit.h
r27728 r28263 9 9 #include "./Definition.h" 10 10 #include "./FemModel.h" 11 12 IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,int output_enum);13 11 14 12 class Cflevelsetmisfit: public Object, public Definition{ -
issm/trunk-jpl/src/c/classes/Cfrheologybbarabsgrad.h
r27920 r28263 9 9 #include "./Definition.h" 10 10 #include "./FemModel.h" 11 12 IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,int output_enum);13 void GetVectorFromInputsx( IssmDouble** pvector, int* pvector_size, FemModel* femmodel,int name);14 11 15 12 class Cfrheologybbarabsgrad: public Object, public Definition{ -
issm/trunk-jpl/src/c/classes/Cfrheologybbarabsgradtransient.h
r27920 r28263 9 9 #include "./Definition.h" 10 10 class FemModel; 11 12 IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,int output_enum);13 11 14 12 class Cfrheologybbarabsgradtransient: public Object, public Definition{ -
issm/trunk-jpl/src/c/classes/Cfsurfacelogvel.h
r27728 r28263 9 9 #include "./Definition.h" 10 10 #include "./FemModel.h" 11 12 IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,int output_enum);13 11 14 12 class Cfsurfacelogvel: public Object, public Definition{ -
issm/trunk-jpl/src/c/classes/Cfsurfacesquare.h
r27728 r28263 9 9 #include "./Definition.h" 10 10 #include "./FemModel.h" 11 12 IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,int output_enum);13 11 14 12 class Cfsurfacesquare: public Object, public Definition{ -
issm/trunk-jpl/src/c/classes/Cfsurfacesquaretransient.h
r27721 r28263 9 9 #include "./Definition.h" 10 10 class FemModel; 11 12 IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,int output_enum);13 11 14 12 class Cfsurfacesquaretransient: public Object, public Definition{ -
issm/trunk-jpl/src/c/classes/DependentObject.cpp
r27728 r28263 72 72 void DependentObject::RecordResponsex(FemModel* femmodel){/*{{{*/ 73 73 74 int ierr; 75 74 76 /*Is this some special type of response for which we need to go in the output definitions? :*/ 75 if (StringToEnumx(this->name,false)==-1){ 76 this->response_value = OutputDefinitionsResponsex(femmodel,this->name); 77 if(StringToEnumx(this->name,false)==-1){ 78 ierr = this->response_value = OutputDefinitionsResponsex(&this->response_value, femmodel, this->name); 79 if(ierr) _error_("Could not find response "<<this->name); 77 80 } 78 81 else{ -
issm/trunk-jpl/src/c/classes/FemModel.cpp
r28094 r28263 2398 2398 /*Intermediaries*/ 2399 2399 bool isvec,results_on_nodes; 2400 int step,output_enum,numonnodes ;2400 int step,output_enum,numonnodes,ierr; 2401 2401 IssmDouble time; 2402 2402 IssmDouble double_result; … … 2422 2422 /*If string is not an enum, it is defined in output definitions*/ 2423 2423 if(output_enum<0){ 2424 double_result = OutputDefinitionsResponsex(this,output_string);2424 ierr = OutputDefinitionsResponsex(&double_result, this,output_string); 2425 2425 if(save_results){ 2426 results->AddResult(new GenericExternalResult<IssmPDouble>(results->Size()+1,output_string,reCast<IssmPDouble>(double_result),step,time)); 2426 if(!ierr){ 2427 results->AddResult(new GenericExternalResult<IssmPDouble>(results->Size()+1,output_string,reCast<IssmPDouble>(double_result),step,time)); 2428 } 2427 2429 continue; 2428 2430 } … … 2431 2433 /*last chance for the output definition, if the enum is one of Outputdefinition[1-10]Enum:*/ 2432 2434 if(output_enum>=Outputdefinition1Enum && output_enum <=Outputdefinition100Enum){ 2433 double_result = OutputDefinitionsResponsex(this,output_enum);2435 ierr = OutputDefinitionsResponsex(&double_result, this, output_enum); 2434 2436 if(save_results){ 2435 results->AddResult(new GenericExternalResult<IssmPDouble>(results->Size()+1,output_string,reCast<IssmPDouble>(double_result),step,time)); 2437 if(!ierr){ 2438 results->AddResult(new GenericExternalResult<IssmPDouble>(results->Size()+1,output_string,reCast<IssmPDouble>(double_result),step,time)); 2439 } 2436 2440 continue; 2437 2441 } … … 2757 2761 default: 2758 2762 if(response_descriptor_enum>=Outputdefinition1Enum && response_descriptor_enum <=Outputdefinition100Enum){ 2759 IssmDouble double_result = OutputDefinitionsResponsex(this,response_descriptor_enum);2760 *responses=double_result;2763 int ierr = OutputDefinitionsResponsex(responses, this,response_descriptor_enum); 2764 if(ierr) _error_("could not evaluate response"); 2761 2765 } 2762 2766 else _error_("response descriptor \"" << EnumToStringx(response_descriptor_enum) << "\" not supported yet!"); -
issm/trunk-jpl/src/c/classes/Massconaxpby.h
r26469 r28263 14 14 #include "./FemModel.h" 15 15 #include "../classes/Params/Parameters.h" 16 IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,const char* output_string);16 int OutputDefinitionsResponsex(IssmDouble* pres, FemModel* femmodel,const char* output_string); 17 17 /*}}}*/ 18 18 class Massconaxpby: public Object, public Definition{ … … 108 108 IssmDouble Response(FemModel* femmodel){/*{{{*/ 109 109 110 int ierr; 110 111 IssmDouble xresponse,yresponse; 111 112 112 113 /*Get response from both masscons: */ 113 xresponse=OutputDefinitionsResponsex(femmodel,this->namex); 114 yresponse=OutputDefinitionsResponsex(femmodel,this->namey); 114 ierr=OutputDefinitionsResponsex(&xresponse,femmodel,this->namex); 115 if(ierr) _error_("not found"); 116 ierr=OutputDefinitionsResponsex(&yresponse,femmodel,this->namey); 117 if(ierr) _error_("not found"); 115 118 116 119 return this->alpha*xresponse+this->beta*yresponse; -
issm/trunk-jpl/src/c/classes/Misfit.cpp
r27102 r28263 19 19 #include "./FemModel.h" 20 20 #include "../modules/SurfaceAreax/SurfaceAreax.h" 21 #include "../modules/OutputDefinitionsResponsex/OutputDefinitionsResponsex.h" 22 #include "../modules/GetVectorFromInputsx/GetVectorFromInputsx.h" 21 23 #include "../classes/Params/Parameters.h" 22 24 #include "../classes/gauss/Gauss.h" … … 226 228 227 229 IssmDouble model, observation; 230 int ierr; 228 231 229 232 /*If we are locked, return time average: */ … … 231 234 232 235 /*First, the global model response: */ 233 model=OutputDefinitionsResponsex(femmodel,this->model_enum); 236 ierr = OutputDefinitionsResponsex(&model, femmodel, this->model_enum); 237 if(ierr) _error_("could not evaluate response"); 238 234 239 /*Now, the observation is buried inside the elements, go fish it in the first element (cludgy, needs fixing): */ 235 240 Element* element = (Element*)femmodel->elements->GetObjectByOffset(0); _assert_(element); -
issm/trunk-jpl/src/c/classes/Misfit.h
r26469 r28263 9 9 #include "./Definition.h" 10 10 #include "./FemModel.h" 11 12 IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,int output_enum);13 void GetVectorFromInputsx( IssmDouble** pvector, int* pvector_size, FemModel* femmodel,int name);14 11 15 12 class Misfit: public Object, public Definition{ -
issm/trunk-jpl/src/c/classes/Nodalvalue.h
r27676 r28263 13 13 14 14 void NodalValuex( IssmDouble* pnodalvalue, int natureofdataenum,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters); 15 IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,int output_enum);16 15 17 16 class Nodalvalue: public Object, public Definition{ -
issm/trunk-jpl/src/c/classes/Numberedcostfunction.h
r26469 r28263 9 9 #include "./Definition.h" 10 10 #include "./FemModel.h" 11 12 IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,int output_enum);13 11 14 12 class Numberedcostfunction: public Object, public Definition{ -
issm/trunk-jpl/src/c/classes/Radar.h
r26918 r28263 9 9 #include "./Definition.h" 10 10 #include "./FemModel.h" 11 12 IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,int output_enum);13 11 14 12 class Radar: public Object, public Definition{ -
issm/trunk-jpl/src/c/modules/OutputDefinitionsResponsex/OutputDefinitionsResponsex.cpp
r25554 r28263 8 8 #include "../../classes/classes.h" 9 9 10 IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,const char* output_string){10 int OutputDefinitionsResponsex(IssmDouble* presponse, FemModel* femmodel,const char* output_string){ 11 11 12 12 /*Ok, go find the output definitions dataset in the parameters, where our responses are hiding: */ … … 21 21 22 22 /*This is the object that we have been chasing for. compute the response and return: */ 23 IssmDouble return_value=definition->Response(femmodel);23 *presponse = definition->Response(femmodel); 24 24 25 /*cleanup :*/25 /*cleanup and return*/ 26 26 xDelete<char>(name); 27 28 /*return:*/ 29 return return_value; 27 return 0; 30 28 } 31 29 xDelete<char>(name); … … 33 31 34 32 /*If we are here, did not find the definition for this response, not good!: */ 35 _error_("Could not find the response for output definition " << output_string << " because could not find the definition itself!"); 33 _printf0_("=================================================================\n"); 34 _printf0_("WARNING: Could not find the output \"" << output_string << "\"\n"); 35 _printf0_(" - either this output is unavailable for this model run \n"); 36 _printf0_(" - or there may be a spelling error in your requested_outputs \n"); 37 _printf0_(" - or there may be a spelling error in an outputdefinition \n"); 38 _printf0_(" object name (unlikely)\n"); 39 _printf0_("=================================================================\n"); 40 41 return 1; 36 42 } 37 43 38 IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,int output_enum){44 int OutputDefinitionsResponsex(IssmDouble* presponse, FemModel* femmodel,int output_enum){ 39 45 40 46 /*Ok, go find the output definitions dataset in the parameters, where our responses are hiding: */ … … 49 55 50 56 /*This is the object that we have been chasing for. compute the response and return: */ 51 IssmDouble return_value=definition->Response(femmodel); 52 53 /*return:*/ 54 return return_value; 57 *presponse = definition->Response(femmodel); 58 return 0; 55 59 } 56 60 } 57 61 58 62 /*If we are here, did not find the definition for this response, not good!: */ 59 _error_("Could not find the response for output definition " << EnumToStringx(output_enum) 60 <<" ("<<output_enum<<")" 61 << " because could not find the definition itself!"); 63 _printf0_("=================================================================\n"); 64 _printf0_("WARNING: Could not find the output \"" << EnumToStringx(output_enum)<< "\"\n"); 65 _printf0_(" - either this output is unavailable for this model run \n"); 66 _printf0_(" - or there may be a spelling error in your requested_outputs \n"); 67 _printf0_(" - or there may be a spelling error in an outputdefinition \n"); 68 _printf0_(" object name (unlikely)\n"); 69 _printf0_("=================================================================\n"); 70 71 return 1; 62 72 } -
issm/trunk-jpl/src/c/modules/OutputDefinitionsResponsex/OutputDefinitionsResponsex.h
r18878 r28263 8 8 9 9 /* local prototypes: */ 10 IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,const char* output_string);11 IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,int output_enum);10 int OutputDefinitionsResponsex(IssmDouble* presponse, FemModel* femmodel,const char* output_string); 11 int OutputDefinitionsResponsex(IssmDouble* presponse, FemModel* femmodel,int output_enum); 12 12 13 13 #endif /* _OUTPUTDEFINITIONSRESPONSEXX_H */
Note:
See TracChangeset
for help on using the changeset viewer.