source: issm/trunk/src/c/objects/InputObjects/BeamVertexInput.cpp@ 3673

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

Redid Params and Inputs

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