source: issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp@ 3775

Last change on this file since 3775 was 3775, checked in by Eric.Larour, 15 years ago

Created include.h header file

File size: 6.1 KB
Line 
1/*!\file PentaVertexInput.c
2 * \brief: implementation of the PentaVertexInput object
3 */
4
5#ifdef HAVE_CONFIG_H
6 #include "config.h"
7#else
8#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
9#endif
10
11#include "stdio.h"
12#include <string.h>
13#include "../objects.h"
14#include "../../EnumDefinitions/EnumDefinitions.h"
15#include "../../shared/shared.h"
16#include "../../DataSet/DataSet.h"
17#include "../../include/include.h"
18#include "../../include/include.h"
19
20/*Object constructors and destructor*/
21/*FUNCTION PentaVertexInput::PentaVertexInput(){{{1*/
22PentaVertexInput::PentaVertexInput(){
23 return;
24}
25/*}}}*/
26/*FUNCTION PentaVertexInput::PentaVertexInput(double* values){{{1*/
27PentaVertexInput::PentaVertexInput(int in_enum_type,double* in_values){
28
29 enum_type=in_enum_type;
30 values[0]=in_values[0];
31 values[1]=in_values[1];
32 values[2]=in_values[2];
33 values[3]=in_values[3];
34 values[4]=in_values[4];
35 values[5]=in_values[5];
36}
37/*}}}*/
38/*FUNCTION PentaVertexInput::~PentaVertexInput(){{{1*/
39PentaVertexInput::~PentaVertexInput(){
40 return;
41}
42/*}}}*/
43
44/*Object management*/
45/*FUNCTION PentaVertexInput::copy{{{1*/
46Object* PentaVertexInput::copy() {
47
48 return new PentaVertexInput(this->enum_type,this->values);
49
50}
51/*}}}*/
52/*FUNCTION PentaVertexInput::DeepEcho{{{1*/
53void PentaVertexInput::DeepEcho(void){
54
55 printf("PentaVertexInput:\n");
56 printf(" enum: %i\n",this->enum_type);
57 printf(" %g|%g|%g|%g|%g|%g\n",this->values[0],this->values[1],this->values[2],this->values[3],this->values[4],this->values[5]);
58}
59/*}}}*/
60/*FUNCTION PentaVertexInput::Demarshall{{{1*/
61void PentaVertexInput::Demarshall(char** pmarshalled_dataset){
62
63 char* marshalled_dataset=NULL;
64 int i;
65
66 /*recover marshalled_dataset: */
67 marshalled_dataset=*pmarshalled_dataset;
68
69 /*this time, no need to get enum type, the pointer directly points to the beginning of the
70 *object data (thanks to DataSet::Demarshall):*/
71 memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
72 memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
73
74 /*return: */
75 *pmarshalled_dataset=marshalled_dataset;
76 return;
77}
78/*}}}*/
79/*FUNCTION PentaVertexInput::Echo {{{1*/
80void PentaVertexInput::Echo(void){
81 this->DeepEcho();
82}
83/*}}}*/
84/*FUNCTION PentaVertexInput::Enum{{{1*/
85int PentaVertexInput::Enum(void){
86
87 return PentaVertexInputEnum;
88
89}
90/*}}}*/
91/*FUNCTION PentaVertexInput::EnumType{{{1*/
92int PentaVertexInput::EnumType(void){
93
94 return this->enum_type;
95
96}
97/*}}}*/
98/*FUNCTION PentaVertexInput::Id{{{1*/
99int PentaVertexInput::Id(void){ return -1; }
100/*}}}*/
101/*FUNCTION PentaVertexInput::Marshall{{{1*/
102void PentaVertexInput::Marshall(char** pmarshalled_dataset){
103
104 char* marshalled_dataset=NULL;
105 int enum_value=0;
106
107 /*recover marshalled_dataset: */
108 marshalled_dataset=*pmarshalled_dataset;
109
110 /*get enum value of PentaVertexInput: */
111 enum_value=PentaVertexInputEnum;
112
113 /*marshall enum: */
114 memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
115
116 /*marshall PentaVertexInput data: */
117 memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
118 memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
119
120 *pmarshalled_dataset=marshalled_dataset;
121}
122/*}}}*/
123/*FUNCTION PentaVertexInput::MarshallSize{{{1*/
124int PentaVertexInput::MarshallSize(){
125
126 return sizeof(values)+
127 +sizeof(enum_type)+
128 +sizeof(int); //sizeof(int) for enum value
129}
130/*}}}*/
131/*FUNCTION PentaVertexInput::MyRank{{{1*/
132int PentaVertexInput::MyRank(void){
133 extern int my_rank;
134 return my_rank;
135}
136/*}}}*/
137
138/*Object functions*/
139/*FUNCTION PentaVertexInput::GetParameterValue(bool* pvalue) {{{1*/
140void PentaVertexInput::GetParameterValue(bool* pvalue){ISSMERROR(" not supported yet!");}
141/*}}}*/
142/*FUNCTION PentaVertexInput::GetParameterValue(int* pvalue){{{1*/
143void PentaVertexInput::GetParameterValue(int* pvalue){ISSMERROR(" not supported yet!");}
144/*}}}*/
145/*FUNCTION PentaVertexInput::GetParameterValue(double* pvalue){{{1*/
146void PentaVertexInput::GetParameterValue(double* pvalue){ISSMERROR(" not supported yet!");}
147/*}}}*/
148/*FUNCTION PentaVertexInput::GetParameterValue(double* pvalue,Node* node){{{1*/
149void PentaVertexInput::GetParameterValue(double* pvalue,Node* node){ISSMERROR(" not supported yet!");}
150/*}}}*/
151/*FUNCTION PentaVertexInput::GetParameterValue(double* pvalue,Node* node1,Node* node2,double gauss_coord){{{1*/
152void PentaVertexInput::GetParameterValue(double* pvalue,Node* node1,Node* node2,double gauss_coord){ISSMERROR(" not supported yet!");}
153/*}}}*/
154/*FUNCTION PentaVertexInput::GetParameterValue(double* pvalue,double* gauss){{{1*/
155void PentaVertexInput::GetParameterValue(double* pvalue,double* gauss){ISSMERROR(" not supported yet!");}
156/*}}}*/
157/*FUNCTION PentaVertexInput::GetParameterValue(double* pvalue,double* gauss,double defaultvalue){{{1*/
158void PentaVertexInput::GetParameterValue(double* pvalue,double* gauss,double defaultvalue){ISSMERROR(" not supported yet!");}
159/*}}}*/
160/*FUNCTION PentaVertexInput::GetParameterValues(double* values,double* gauss_pointers, int numgauss){{{1*/
161void PentaVertexInput::GetParameterValues(double* values,double* gauss_pointers, int numgauss){ISSMERROR(" not supported yet!");}
162/*}}}*/
163/*FUNCTION PentaVertexInput::GetParameterDerivativeValue(double* derivativevalues, double* xyz_list, double* gauss){{{1*/
164void PentaVertexInput::GetParameterDerivativeValue(double* derivativevalues, double* xyz_list, double* gauss){ISSMERROR(" not supported yet!");}
165/*}}}*/
166/*FUNCTION PentaVertexInput::GetStrainRate(double* epsilon,Input* yinput, double* xyz_list, double* gauss){{{1*/
167void PentaVertexInput::GetStrainRate(double* epsilon,Input* yinput,double* xyz_list, double* gauss){ISSMERROR(" not supported yet!");}
168/*}}}*/
169/*FUNCTION PentaVertexInput::GetStrainRateStokes(double* epsilon,Input* yinput, Input* zinput, double* xyz_list, double* gauss){{{1*/
170void PentaVertexInput::GetStrainRateStokes(double* epsilon,Input* yinput,Input* zinput, double* xyz_list, double* gauss){ISSMERROR(" not supported yet!");}
171/*}}}*/
172/*FUNCTION PentaVertexInput::ChangeEnum(int newenumtype){{{1*/
173void PentaVertexInput::ChangeEnum(int newenumtype){
174 this->enum_type=newenumtype;
175}
176/*}}}*/
Note: See TracBrowser for help on using the repository browser.