[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*/
|
---|
| 22 | BeamVertexInput::BeamVertexInput(){
|
---|
| 23 | return;
|
---|
| 24 | }
|
---|
| 25 | /*}}}*/
|
---|
| 26 | /*FUNCTION BeamVertexInput::BeamVertexInput(double* values){{{1*/
|
---|
| 27 | BeamVertexInput::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*/
|
---|
| 35 | BeamVertexInput::~BeamVertexInput(){
|
---|
| 36 | return;
|
---|
| 37 | }
|
---|
| 38 | /*}}}*/
|
---|
| 39 |
|
---|
| 40 | /*Object management*/
|
---|
| 41 | /*FUNCTION BeamVertexInput::copy{{{1*/
|
---|
| 42 | Object* BeamVertexInput::copy() {
|
---|
| 43 |
|
---|
| 44 | return new BeamVertexInput(this->enum_type,this->values);
|
---|
| 45 |
|
---|
| 46 | }
|
---|
| 47 | /*}}}*/
|
---|
| 48 | /*FUNCTION BeamVertexInput::DeepEcho{{{1*/
|
---|
| 49 | void 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*/
|
---|
| 57 | void 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*/
|
---|
| 76 | void BeamVertexInput::Echo(void){
|
---|
| 77 | this->DeepEcho();
|
---|
| 78 | }
|
---|
| 79 | /*}}}*/
|
---|
| 80 | /*FUNCTION BeamVertexInput::Enum{{{1*/
|
---|
| 81 | int BeamVertexInput::Enum(void){
|
---|
| 82 |
|
---|
| 83 | return BeamVertexInputEnum;
|
---|
| 84 |
|
---|
| 85 | }
|
---|
| 86 | /*}}}*/
|
---|
| 87 | /*FUNCTION BeamVertexInput::EnumType{{{1*/
|
---|
| 88 | int BeamVertexInput::EnumType(void){
|
---|
| 89 |
|
---|
| 90 | return this->enum_type;
|
---|
| 91 |
|
---|
| 92 | }
|
---|
| 93 | /*}}}*/
|
---|
| 94 | /*FUNCTION BeamVertexInput::Id{{{1*/
|
---|
| 95 | int BeamVertexInput::Id(void){ return -1; }
|
---|
| 96 | /*}}}*/
|
---|
| 97 | /*FUNCTION BeamVertexInput::Marshall{{{1*/
|
---|
| 98 | void 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*/
|
---|
| 120 | int 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*/
|
---|
| 128 | int 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*/
|
---|
| 136 | void BeamVertexInput::GetParameterValue(bool* pvalue){ISSMERROR(" not supported yet!");}
|
---|
| 137 | /*}}}*/
|
---|
| 138 | /*FUNCTION BeamVertexInput::GetParameterValue(int* pvalue){{{1*/
|
---|
| 139 | void BeamVertexInput::GetParameterValue(int* pvalue){ISSMERROR(" not supported yet!");}
|
---|
| 140 | /*}}}*/
|
---|
| 141 | /*FUNCTION BeamVertexInput::GetParameterValue(double* pvalue){{{1*/
|
---|
| 142 | void BeamVertexInput::GetParameterValue(double* pvalue){ISSMERROR(" not supported yet!");}
|
---|
| 143 | /*}}}*/
|
---|
| 144 | /*FUNCTION BeamVertexInput::GetParameterValue(double* pvalue,Node* node){{{1*/
|
---|
| 145 | void 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*/
|
---|
| 148 | void 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*/
|
---|
| 151 | void BeamVertexInput::GetParameterValue(double* pvalue,double* gauss){ISSMERROR(" not supported yet!");}
|
---|
| 152 | /*}}}*/
|
---|
| 153 | /*FUNCTION BeamVertexInput::GetParameterValue(double* pvalue,double* gauss,double defaultvalue){{{1*/
|
---|
| 154 | void 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*/
|
---|
| 157 | void 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*/
|
---|
| 160 | void 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*/
|
---|
| 163 | void 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*/
|
---|
| 166 | void BeamVertexInput::GetStrainRateStokes(double* epsilon,Input* yinput,Input* zinput, double* xyz_list, double* gauss){ISSMERROR(" not supported yet!");}
|
---|
| 167 | /*}}}*/
|
---|