Ice Sheet System Model  4.18
Code documentation
Massconaxpby.h
Go to the documentation of this file.
1 
5 #ifndef _MASSCON_AXPBY_H_
6 #define _MASSCON_AXPBY_H_
7 
8 /*Headers:*/
9 /*{{{*/
10 #include "./Definition.h"
11 #include "../datastructures/datastructures.h"
12 #include "./Elements/Element.h"
13 #include "./Elements/Elements.h"
14 #include "./FemModel.h"
15 #include "../classes/Params/Parameters.h"
16 IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,const char* output_string);
17 /*}}}*/
18 class Massconaxpby: public Object, public Definition{
19 
20  public:
21 
23  char* name;
24  char* namex;
25  char* namey;
28 
29  /*Massconaxpby constructors, destructors :*/
30  Massconaxpby(){/*{{{*/
31 
32  this->definitionenum = -1;
33  this->name = NULL;
34  this->namex = NULL;
35  this->namey = NULL;
36  this->alpha=UNDEF;
37  this->beta=UNDEF;
38 
39  }
40  /*}}}*/
41  Massconaxpby(char* in_name,int in_definitionenum, char* in_namex, char* in_namey, IssmDouble in_alpha,IssmDouble in_beta){ /*{{{*/
42 
43  this->definitionenum = in_definitionenum;
44  this->name = xNew<char>(strlen(in_name)+1);
45  xMemCpy<char>(this->name,in_name,strlen(in_name)+1);
46 
47  this->namex = xNew<char>(strlen(in_namex)+1);
48  xMemCpy<char>(this->namex,in_namex,strlen(in_namex)+1);
49 
50  this->namey = xNew<char>(strlen(in_namey)+1);
51  xMemCpy<char>(this->namey,in_namey,strlen(in_namey)+1);
52 
53  this->alpha=in_alpha;
54  this->beta=in_beta;
55 
56  }
57  /*}}}*/
58  ~Massconaxpby(){/*{{{*/
59  if(this->name)xDelete(this->name);
60  if(this->namex)xDelete(this->namex);
61  if(this->namey)xDelete(this->namey);
62  }
63  /*}}}*/
64  /*Object virtual function resolutoin: */
65  Object* copy() {/*{{{*/
66  Massconaxpby* mf = new Massconaxpby(this->name,this->definitionenum,this->namex,this->namey, this->alpha, this->beta);
67  return (Object*) mf;
68  }
69  /*}}}*/
70  void DeepEcho(void){/*{{{*/
71  this->Echo();
72  }
73  /*}}}*/
74  void Echo(void){/*{{{*/
75  _printf_(" Massconaxpby: " << this->name << " " << this->definitionenum << "\n");
76  _printf_(" namex: " << this->namex << "\n");
77  _printf_(" namey: " << this->namey << "\n");
78  _printf_(" alpha: " << this->alpha << "\n");
79  _printf_(" beta: " << this->beta << "\n");
80  }
81  /*}}}*/
82  int Id(void){/*{{{*/
83  return -1;
84  }
85  /*}}}*/
86  void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
87  _error_("not implemented yet!");
88  }
89  /*}}}*/
90  int ObjectEnum(void){/*{{{*/
91  return MassconaxpbyEnum;
92  }
93  /*}}}*/
94  /*Definition virtual function resolutoin: */
95  int DefinitionEnum(){/*{{{*/
96 
97  return this->definitionenum;
98  }
99  /*}}}*/
100  char* Name(){/*{{{*/
101 
102  char* name2=xNew<char>(strlen(this->name)+1);
103  xMemCpy(name2,this->name,strlen(this->name)+1);
104 
105  return name2;
106  }
107  /*}}}*/
109 
110  IssmDouble xresponse,yresponse;
111 
112  /*Get response from both masscons: */
113  xresponse=OutputDefinitionsResponsex(femmodel,this->namex);
114  yresponse=OutputDefinitionsResponsex(femmodel,this->namey);
115 
116  return this->alpha*xresponse+this->beta*yresponse;
117  }
118  /*}}}*/
119 };
120 
121 #endif /* _MASSCON_H_ */
IssmDouble
double IssmDouble
Definition: types.h:37
Massconaxpby::Name
char * Name()
Definition: Massconaxpby.h:100
_printf_
#define _printf_(StreamArgs)
Definition: Print.h:22
Massconaxpby::Echo
void Echo(void)
Definition: Massconaxpby.h:74
Massconaxpby::Marshall
void Marshall(char **pmarshalled_data, int *pmarshalled_data_size, int marshall_direction)
Definition: Massconaxpby.h:86
Massconaxpby::DeepEcho
void DeepEcho(void)
Definition: Massconaxpby.h:70
Massconaxpby::definitionenum
int definitionenum
Definition: Massconaxpby.h:22
Elements.h
Massconaxpby::Massconaxpby
Massconaxpby(char *in_name, int in_definitionenum, char *in_namex, char *in_namey, IssmDouble in_alpha, IssmDouble in_beta)
Definition: Massconaxpby.h:41
Element.h
abstract class for Element object This class is a place holder for the Tria and the Penta elements....
Object
Definition: Object.h:13
Massconaxpby::beta
IssmDouble beta
Definition: Massconaxpby.h:27
Massconaxpby::namey
char * namey
Definition: Massconaxpby.h:25
xDelete
void xDelete(T **&aT_pp)
Definition: MemOps.h:97
Massconaxpby::ObjectEnum
int ObjectEnum(void)
Definition: Massconaxpby.h:90
Massconaxpby::Response
IssmDouble Response(FemModel *femmodel)
Definition: Massconaxpby.h:108
MassconaxpbyEnum
@ MassconaxpbyEnum
Definition: EnumDefinitions.h:1161
Massconaxpby::name
char * name
Definition: Massconaxpby.h:23
UNDEF
#define UNDEF
Definition: constants.h:8
Definition
Definition: Definition.h:10
FemModel
Definition: FemModel.h:31
Massconaxpby::Id
int Id(void)
Definition: Massconaxpby.h:82
Massconaxpby::alpha
IssmDouble alpha
Definition: Massconaxpby.h:26
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
FemModel.h
Massconaxpby::namex
char * namex
Definition: Massconaxpby.h:24
Massconaxpby
Definition: Massconaxpby.h:18
Massconaxpby::copy
Object * copy()
Definition: Massconaxpby.h:65
Definition.h
xMemCpy
T * xMemCpy(T *dest, const T *src, unsigned int size)
Definition: MemOps.h:152
Massconaxpby::Massconaxpby
Massconaxpby()
Definition: Massconaxpby.h:30
OutputDefinitionsResponsex
IssmDouble OutputDefinitionsResponsex(FemModel *femmodel, const char *output_string)
Definition: OutputDefinitionsResponsex.cpp:10
Massconaxpby::~Massconaxpby
~Massconaxpby()
Definition: Massconaxpby.h:58
Massconaxpby::DefinitionEnum
int DefinitionEnum()
Definition: Massconaxpby.h:95
femmodel
FemModel * femmodel
Definition: esmfbinders.cpp:16