source: issm/trunk/src/c/classes/Massconaxpby.h@ 19105

Last change on this file since 19105 was 19105, checked in by Mathieu Morlighem, 10 years ago

merged trunk-jpl and trunk for revision 19103

File size: 2.9 KB
Line 
1/*!\file Massconaxpby.h
2 * \brief: header file for Massconaxpby object
3 */
4
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"
16IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,const char* output_string);
17/*}}}*/
18class Massconaxpby: public Object, public Definition{
19
20 public:
21
22 int definitionenum;
23 char* name;
24 char* namex;
25 char* namey;
26 IssmDouble alpha;
27 IssmDouble beta;
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 void Echo(void){/*{{{*/
66 _printf_(" Massconaxpby: " << this->name << " " << this->definitionenum << "\n");
67 _printf_(" namex: " << this->namex << "\n");
68 _printf_(" namey: " << this->namey << "\n");
69 _printf_(" alpha: " << this->alpha << "\n");
70 _printf_(" beta: " << this->beta << "\n");
71 }
72 /*}}}*/
73 void DeepEcho(void){/*{{{*/
74 this->Echo();
75 }
76 /*}}}*/
77 int Id(void){/*{{{*/
78 return -1;
79 }
80 /*}}}*/
81 int ObjectEnum(void){/*{{{*/
82 return MassconaxpbyEnum;
83 }
84 /*}}}*/
85 Object* copy() {/*{{{*/
86 Massconaxpby* mf = new Massconaxpby(this->name,this->definitionenum,this->namex,this->namey, this->alpha, this->beta);
87 return (Object*) mf;
88 }
89 /*}}}*/
90 /*Definition virtual function resolutoin: */
91 char* Name(){/*{{{*/
92
93 char* name2=xNew<char>(strlen(this->name)+1);
94 xMemCpy(name2,this->name,strlen(this->name)+1);
95
96 return name2;
97 }
98 /*}}}*/
99 int DefinitionEnum(){/*{{{*/
100
101 return this->definitionenum;
102 }
103 /*}}}*/
104 IssmDouble Response(FemModel* femmodel){/*{{{*/
105
106 IssmDouble xresponse,yresponse;
107
108 /*Get response from both masscons: */
109 xresponse=OutputDefinitionsResponsex(femmodel,this->namex);
110 yresponse=OutputDefinitionsResponsex(femmodel,this->namey);
111
112 return this->alpha*xresponse+this->beta*yresponse;
113 }
114 /*}}}*/
115};
116
117#endif /* _MASSCON_H_ */
Note: See TracBrowser for help on using the repository browser.