Ice Sheet System Model  4.18
Code documentation
DoubleParam.h
Go to the documentation of this file.
1 
5 #ifndef _DOUBLEPARAM_H_
6 #define _DOUBLEPARAM_H_
7 
8 /*Headers:*/
9 /*{{{*/
10 #ifdef HAVE_CONFIG_H
11  #include <config.h>
12 #else
13 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
14 #endif
15 
16 #include "./Param.h"
17 #include "../../shared/shared.h"
18 /*}}}*/
19 
20 class DoubleParam: public Param{
21 
22  private:
23  /*just hold 3 values for 3 vertices: */
24  int enum_type;
26 
27  public:
28  /*DoubleParam constructors, destructors: {{{*/
29  DoubleParam();
31  ~DoubleParam();
32  /*}}}*/
33  /*Object virtual functions definitions:{{{ */
34  Param* copy();
35  void DeepEcho();
36  void Echo();
37  int Id();
38  void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
39  int ObjectEnum();
40  /*}}}*/
41  /*Param vritual function definitions: {{{*/
42  void GetParameterValue(bool* pbool);
43  void GetParameterValue(int* pinteger);
44  void GetParameterValue(int** pintarray,int* pM);
45  void GetParameterValue(int** pintarray,int* pM,int* pN);
46  void GetParameterValue(IssmDouble* pIssmDouble){*pIssmDouble=value;};
47  void GetParameterValue(IssmDouble* pdouble,IssmDouble time){*pdouble=value;};
48  void GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}
49  void GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}
50  void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM);
51  void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN);
52  void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
53  void GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
54  void GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
55  void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
56  void GetParameterValue(DataSet** pdataset){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a DataSet");}
57  int InstanceEnum(){return enum_type;}
58 
59  void SetEnum(int enum_in){this->enum_type = enum_in;};
60  void SetValue(bool boolean){this->value=(IssmDouble)boolean;}
61  void SetValue(int integer){this->value=(IssmDouble)integer;}
62  void SetValue(IssmDouble scalar){this->value=(IssmDouble)scalar;}
63  void SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}
64  void SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}
65  void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
66  void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
67  void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
68  void SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
69  void SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
70  void SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
71  void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
72  void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
73  /*}}}*/
74 };
75 #endif /* _DOUBLEPARAM_H */
Matrix< IssmDouble >
DoubleParam::GetParameterValue
void GetParameterValue(IssmDouble ***parray, int *pM, int **pmdims, int **pndims)
Definition: DoubleParam.h:52
IssmDouble
double IssmDouble
Definition: types.h:37
Param
Definition: Param.h:21
DoubleParam::SetValue
void SetValue(IssmDouble *pIssmDoublearray, int M, int N)
Definition: DoubleParam.h:66
DoubleParam::SetValue
void SetValue(IssmDouble **array, int M, int *mdim_array, int *ndim_array)
Definition: DoubleParam.h:72
DoubleParam::GetParameterValue
void GetParameterValue(char **pstring)
Definition: DoubleParam.h:48
DoubleParam::copy
Param * copy()
Definition: DoubleParam.cpp:31
DoubleParam::InstanceEnum
int InstanceEnum()
Definition: DoubleParam.h:57
DoubleParam::SetValue
void SetValue(IssmDouble *IssmDoublearray, int M)
Definition: DoubleParam.h:65
DoubleParam::SetValue
void SetValue(int integer)
Definition: DoubleParam.h:61
DoubleParam::SetValue
void SetValue(Matrix< IssmDouble > *mat)
Definition: DoubleParam.h:70
DoubleParam
Definition: DoubleParam.h:20
DoubleParam::GetParameterValue
void GetParameterValue(DataSet **pdataset)
Definition: DoubleParam.h:56
DoubleParam::DoubleParam
DoubleParam()
Definition: DoubleParam.cpp:15
EnumToStringx
const char * EnumToStringx(int enum_in)
Definition: EnumToStringx.cpp:15
DoubleParam::ObjectEnum
int ObjectEnum()
Definition: DoubleParam.cpp:57
DoubleParam::Id
int Id()
Definition: DoubleParam.cpp:46
Param.h
abstract class for Param object
DoubleParam::SetValue
void SetValue(IssmDouble scalar)
Definition: DoubleParam.h:62
DoubleParam::GetParameterValue
void GetParameterValue(FILE **pfid)
Definition: DoubleParam.h:55
DoubleParam::SetValue
void SetValue(char **stringarray, int M)
Definition: DoubleParam.h:64
DoubleParam::Echo
void Echo()
Definition: DoubleParam.cpp:42
DoubleParam::GetParameterValue
void GetParameterValue(Vector< IssmDouble > **pvec)
Definition: DoubleParam.h:53
DoubleParam::GetParameterValue
void GetParameterValue(Matrix< IssmDouble > **pmat)
Definition: DoubleParam.h:54
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
DoubleParam::GetParameterValue
void GetParameterValue(IssmDouble *pIssmDouble)
Definition: DoubleParam.h:46
DoubleParam::enum_type
int enum_type
Definition: DoubleParam.h:24
DoubleParam::SetValue
void SetValue(int *intarray, int M)
Definition: DoubleParam.h:67
DoubleParam::value
IssmDouble value
Definition: DoubleParam.h:25
DoubleParam::Marshall
void Marshall(char **pmarshalled_data, int *pmarshalled_data_size, int marshall_direction)
Definition: DoubleParam.cpp:48
DoubleParam::~DoubleParam
~DoubleParam()
Definition: DoubleParam.cpp:25
DataSet
Declaration of DataSet class.
Definition: DataSet.h:14
DoubleParam::SetValue
void SetValue(bool boolean)
Definition: DoubleParam.h:60
DoubleParam::SetValue
void SetValue(char *string)
Definition: DoubleParam.h:63
DoubleParam::GetParameterValue
void GetParameterValue(IssmDouble *pdouble, IssmDouble time)
Definition: DoubleParam.h:47
DoubleParam::GetParameterValue
void GetParameterValue(char ***pstringarray, int *pM)
Definition: DoubleParam.h:49
DoubleParam::SetValue
void SetValue(int *pintarray, int M, int N)
Definition: DoubleParam.h:68
Vector< IssmDouble >
DoubleParam::SetEnum
void SetEnum(int enum_in)
Definition: DoubleParam.h:59
DoubleParam::SetValue
void SetValue(Vector< IssmDouble > *vec)
Definition: DoubleParam.h:69
DoubleParam::GetParameterValue
void GetParameterValue(bool *pbool)
Definition: DoubleParam.cpp:69
DoubleParam::SetValue
void SetValue(FILE *fid)
Definition: DoubleParam.h:71
DoubleParam::DeepEcho
void DeepEcho()
Definition: DoubleParam.cpp:37