Ice Sheet System Model  4.18
Code documentation
Data Structures | Functions
Numberedcostfunction.h File Reference

: header file for Numberedcostfunction object More...

#include "./Definition.h"
#include "./FemModel.h"

Go to the source code of this file.

Data Structures

class  Numberedcostfunction
 

Functions

IssmDouble OutputDefinitionsResponsex (FemModel *femmodel, int output_enum)
 

Detailed Description

: header file for Numberedcostfunction object

Definition in file Numberedcostfunction.h.

Function Documentation

◆ OutputDefinitionsResponsex()

IssmDouble OutputDefinitionsResponsex ( FemModel femmodel,
int  output_enum 
)

Definition at line 38 of file OutputDefinitionsResponsex.cpp.

38  {
39 
40  /*Ok, go find the output definitions dataset in the parameters, where our responses are hiding: */
42 
43  /*Now, go through the output definitions, and retrieve the object which corresponds to our requested response, output_enum: */
44  for(int i=0;i<output_definitions->Size();i++){
45 
46  //Definition* definition=xDynamicCast<Definition*>(output_definitions->GetObjectByOffset(i));
47  Definition* definition=dynamic_cast<Definition*>(output_definitions->GetObjectByOffset(i));
48 
49  int en = definition->DefinitionEnum();
50  if(en==output_enum){
51 
52  /*This is the object that we have been chasing for. compute the response and return: */
53  IssmDouble return_value=definition->Response(femmodel);
54 
55  /*return:*/
56  return return_value;
57  }
58  }
59 
60  /*If we are here, did not find the definition for this response, not good!: */
61  _error_("Could not find the response for output definition " << EnumToStringx(output_enum)
62  <<" ("<<output_enum<<")"
63  << " because could not find the definition itself!");
64 }
DataSet::Size
int Size()
Definition: DataSet.cpp:399
Definition::Response
virtual IssmDouble Response(FemModel *)=0
IssmDouble
double IssmDouble
Definition: types.h:37
FemModel::parameters
Parameters * parameters
Definition: FemModel.h:46
OutputdefinitionEnum
@ OutputdefinitionEnum
Definition: EnumDefinitions.h:285
EnumToStringx
const char * EnumToStringx(int enum_in)
Definition: EnumToStringx.cpp:15
Definition
Definition: Definition.h:10
DataSetParam
Definition: DataSetParam.h:20
Definition::DefinitionEnum
virtual int DefinitionEnum()=0
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
DataSet::GetObjectByOffset
Object * GetObjectByOffset(int offset)
Definition: DataSet.cpp:334
Parameters::FindParamObject
Param * FindParamObject(int enum_type)
Definition: Parameters.cpp:588
DataSet
Declaration of DataSet class.
Definition: DataSet.h:14
femmodel
FemModel * femmodel
Definition: esmfbinders.cpp:16