Changeset 22587
- Timestamp:
- 03/20/18 17:10:19 (7 years ago)
- Location:
- issm/trunk-jpl/src/c/classes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/DependentObject.cpp
r20810 r22587 18 18 this->type=0; 19 19 this->index=-1; 20 this->response_value=0.; 20 21 } 21 22 /*}}}*/ … … 27 28 if(in_type!=0 && in_type!=1)_error_("cannot create an DependentObject of type " << in_type); 28 29 if(in_type==1)_error_("not implemented yet!"); 30 this->response_value=0.; 31 32 } 33 /*}}}*/ 34 DependentObject::DependentObject(char* in_name, int in_type,int in_index,IssmDouble in_response){/*{{{*/ 35 36 this->name=xNew<char>(strlen(in_name)+1); xMemCpy<char>(this->name,in_name,strlen(in_name)+1); 37 this->type=in_type; 38 this->index=in_index; 39 if(in_type!=0 && in_type!=1)_error_("cannot create an DependentObject of type " << in_type); 40 if(in_type==1)_error_("not implemented yet!"); 41 this->response_value=in_response; 29 42 30 43 } … … 37 50 /*Object virtual functions definitions:*/ 38 51 Object* DependentObject::copy(void) { /*{{{*/ 39 return new DependentObject(name,type,index );52 return new DependentObject(name,type,index,response_value); 40 53 } /*}}}*/ 41 54 void DependentObject::DeepEcho(void){/*{{{*/ … … 85 98 } 86 99 else femmodel->Responsex(poutput_value,this->name); 87 88 100 } 89 101 /*}}}*/ 102 IssmDouble DependentObject::GetValue(void){/*{{{*/ 103 return this->response_value; 104 } 105 /*}}}*/ 106 void DependentObject::AddValue(IssmDouble in_value){/*{{{*/ 107 this->response_value+=in_value; 108 } 109 /*}}}*/ 110 void DependentObject::ResetResponseValue(){/*{{{*/ 111 this->response_value=0.; 112 } 113 /*}}}*/ -
issm/trunk-jpl/src/c/classes/DependentObject.h
r20810 r22587 20 20 int type; /*0: scalar, 1: vertex*/ 21 21 int index; /*0: scalar, 1: vertex*/ 22 IssmDouble response_value; 22 23 23 /*DependentObject constructors, destructors {{{*/24 /*DependentObject constructors, destructors */ 24 25 DependentObject(); 25 26 DependentObject(char* name, int type,int index); 27 DependentObject(char* name, int type,int index,IssmDouble in_response); 26 28 ~DependentObject(); 27 /*}}}*/ 28 /*Object virtual functions definitions :{{{*/29 30 /*Object virtual functions definitions*/ 29 31 Object* copy(void); 30 32 void DeepEcho(); … … 32 34 int Id(); 33 35 int ObjectEnum(); 34 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/ 35 _error_("not implemented yet!"); 36 } 37 /*}}}*/ 38 /*}}}*/ 36 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){_error_("not implemented yet!"); }; 39 37 40 38 /*DependentObject methods: */ 41 39 int NumDependents(void); 42 40 void Responsex(IssmDouble* poutput_value,FemModel* femmodel); 41 IssmDouble GetValue(void); 42 void AddValue(IssmDouble in_value); 43 void ResetResponseValue(void); 43 44 44 45 };
Note:
See TracChangeset
for help on using the changeset viewer.