Changeset 25506
- Timestamp:
- 09/01/20 13:22:48 (5 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 152 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Cfdragcoeffabsgrad.cpp
r25471 r25506 74 74 /*}}}*/ 75 75 void Cfdragcoeffabsgrad::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/ 76 _error_("not implemented yet!"); 77 } 78 /*}}}*/ 79 void Cfdragcoeffabsgrad::Marshall2(MarshallHandle* marshallhandle){/*{{{*/ 76 80 _error_("not implemented yet!"); 77 81 } -
issm/trunk-jpl/src/c/classes/Cfdragcoeffabsgrad.h
r25471 r25506 35 35 int Id(void); 36 36 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 37 void Marshall2(MarshallHandle* marshallhandle); 37 38 int ObjectEnum(void); 38 39 -
issm/trunk-jpl/src/c/classes/Cfsurfacelogvel.cpp
r25471 r25506 78 78 } 79 79 /*}}}*/ 80 void Cfsurfacelogvel::Marshall2(MarshallHandle* marshallhandle){/*{{{*/ 81 _error_("not implemented yet!"); 82 } 83 /*}}}*/ 80 84 int Cfsurfacelogvel::ObjectEnum(void){/*{{{*/ 81 85 return CfsurfacelogvelEnum; -
issm/trunk-jpl/src/c/classes/Cfsurfacelogvel.h
r25471 r25506 35 35 int Id(void); 36 36 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 37 void Marshall2(MarshallHandle* marshallhandle); 37 38 int ObjectEnum(void); 38 39 -
issm/trunk-jpl/src/c/classes/Cfsurfacesquare.cpp
r25471 r25506 83 83 /*}}}*/ 84 84 void Cfsurfacesquare::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/ 85 _error_("not implemented yet!"); 86 } 87 /*}}}*/ 88 void Cfsurfacesquare::Marshall2(MarshallHandle* marshallhandle){/*{{{*/ 85 89 _error_("not implemented yet!"); 86 90 } -
issm/trunk-jpl/src/c/classes/Cfsurfacesquare.h
r25471 r25506 40 40 int Id(void); 41 41 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 42 void Marshall2(MarshallHandle* marshallhandle); 42 43 int ObjectEnum(void); 43 44 -
issm/trunk-jpl/src/c/classes/Constraints/SpcDynamic.cpp
r23588 r25506 85 85 } 86 86 /*}}}*/ 87 void SpcDynamic::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 88 89 int object_enum = SpcDynamicEnum; 90 marshallhandle->call(object_enum); 91 92 marshallhandle->call(this->id); 93 marshallhandle->call(this->nodeid); 94 marshallhandle->call(this->dof); 95 marshallhandle->call(this->value); 96 marshallhandle->call(this->analysis_type); 97 marshallhandle->call(this->isset); 98 marshallhandle->call(this->penalty); 99 100 } 101 /*}}}*/ 87 102 int SpcDynamic::ObjectEnum(void){/*{{{*/ 88 103 -
issm/trunk-jpl/src/c/classes/Constraints/SpcDynamic.h
r23588 r25506 35 35 int Id(); 36 36 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 37 void Marshall2(MarshallHandle* marshallhandle); 37 38 int ObjectEnum(); 38 39 -
issm/trunk-jpl/src/c/classes/Constraints/SpcStatic.cpp
r25468 r25506 83 83 MARSHALLING(analysis_type); 84 84 MARSHALLING(penalty); 85 86 } 87 /*}}}*/ 88 void SpcStatic::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 89 90 int object_enum = SpcStaticEnum; 91 marshallhandle->call(object_enum); 92 93 marshallhandle->call(this->id); 94 marshallhandle->call(this->nodeid); 95 marshallhandle->call(this->dof); 96 marshallhandle->call(this->value); 97 marshallhandle->call(this->analysis_type); 98 marshallhandle->call(this->penalty); 85 99 86 100 } -
issm/trunk-jpl/src/c/classes/Constraints/SpcStatic.h
r25468 r25506 33 33 void Echo(); 34 34 int Id(); 35 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 35 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 36 void Marshall2(MarshallHandle* marshallhandle); 36 37 int ObjectEnum(); 37 38 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Constraints/SpcTransient.cpp
r23588 r25506 100 100 } 101 101 /*}}}*/ 102 void SpcTransient::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 103 104 int object_enum = SpcTransientEnum; 105 marshallhandle->call(object_enum); 106 107 marshallhandle->call(this->id); 108 marshallhandle->call(this->nodeid); 109 marshallhandle->call(this->dof); 110 marshallhandle->call(this->analysis_type); 111 marshallhandle->call(this->penalty); 112 marshallhandle->call(this->nsteps); 113 if(nsteps){ 114 marshallhandle->call(this->values,nsteps); 115 marshallhandle->call(this->times,nsteps); 116 } 117 else{ 118 this->values=NULL; 119 this->times=NULL; 120 } 121 }/*}}}*/ 102 122 int SpcTransient::ObjectEnum(void){/*{{{*/ 103 123 -
issm/trunk-jpl/src/c/classes/Constraints/SpcTransient.h
r23588 r25506 36 36 int Id(); 37 37 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 38 void Marshall2(MarshallHandle* marshallhandle); 38 39 int ObjectEnum(); 39 40 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Contour.h
r20810 r25506 83 83 } 84 84 /*}}}*/ 85 void Marshall2(MarshallHandle* marshallhandle){/*{{{*/ 86 _error_("not implemented yet!"); 87 } 88 /*}}}*/ 85 89 int ObjectEnum(void){/*{{{*/ 86 90 return ContourEnum; -
issm/trunk-jpl/src/c/classes/DependentObject.h
r22587 r25506 34 34 int Id(); 35 35 int ObjectEnum(); 36 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){_error_("not implemented yet!"); }; 36 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){_error_("not implemented yet!"); }; 37 void Marshall2(MarshallHandle* marshallhandle){_error_("not implemented yet!"); }; 37 38 38 39 /*DependentObject methods: */ -
issm/trunk-jpl/src/c/classes/Elements/Element.cpp
r25497 r25506 2254 2254 MARSHALLING(element_type); 2255 2255 MARSHALLING_DYNAMIC(element_type_list,int,numanalyses); 2256 } 2257 /*}}}*/ 2258 void Element::MarshallElement2(MarshallHandle* marshallhandle,int numanalyses){/*{{{*/ 2259 2260 _assert_(this); 2261 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){ 2262 this->nodes = NULL; 2263 } 2264 2265 int object_enum = ElementEnum; 2266 marshallhandle->call(object_enum); 2267 2268 marshallhandle->call(this->id); 2269 marshallhandle->call(this->sid); 2270 marshallhandle->call(this->lid); 2271 marshallhandle->call(this->element_type); 2272 marshallhandle->call(this->element_type_list,numanalyses); 2256 2273 } 2257 2274 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Elements/Element.h
r25486 r25506 148 148 void MantlePlumeGeothermalFlux(); 149 149 void MarshallElement(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction,int numanalyses); 150 void MarshallElement2(MarshallHandle* marshallhandle,int numanalyses); 150 151 void MigrateGroundingLine(IssmDouble* sheet_ungrounding); 151 152 void MismipFloatingiceMeltingRate(); … … 291 292 virtual void JacobianDeterminantTop(IssmDouble* Jdet,IssmDouble* xyz_list_base,Gauss* gauss)=0; 292 293 virtual void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction)=0; 294 virtual void Marshall2(MarshallHandle* marshallhandle)=0; 293 295 virtual IssmDouble Masscon(IssmDouble* levelset)=0; 294 296 virtual IssmDouble MassFlux(IssmDouble* segment)=0; -
issm/trunk-jpl/src/c/classes/Elements/ElementHook.cpp
r25497 r25506 124 124 } 125 125 /*}}}*/ 126 void ElementHook::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 127 128 int i; 129 bool* hnodesi_null=NULL; /*intermediary needed*/ 130 bool hnodes_null=true; /*this could be NULL on empty constructor*/ 131 bool hneighbors_null=true; /*don't deal with hneighbors, unless explicitely asked to*/ 132 133 _assert_(this); 134 135 /*preliminary, before marshall starts: */ 136 if(marshallhandle->OperationNumber()==MARSHALLING_WRITE || marshallhandle->OperationNumber()==MARSHALLING_SIZE){ 137 if(this->hneighbors)hneighbors_null=false; 138 if(this->hnodes){ 139 hnodes_null=false; 140 hnodesi_null=xNew<bool>(numanalyses); 141 for(i=0;i<numanalyses;i++){ 142 if(this->hnodes[i])hnodesi_null[i]=false; 143 else hnodesi_null[i]=true; 144 } 145 } 146 } 147 148 /*ok, marshall operations: */ 149 int object_enum = ElementHookEnum; 150 marshallhandle->call(object_enum); 151 marshallhandle->call(this->numanalyses); 152 marshallhandle->call(hneighbors_null); 153 marshallhandle->call(hnodes_null); 154 marshallhandle->call(hnodesi_null,numanalyses); 155 156 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){ 157 158 if (!hnodes_null)this->hnodes = new Hook*[numanalyses]; 159 else this->hnodes=NULL; 160 this->hvertices = new Hook(); 161 this->hmaterial = new Hook(); 162 if(!hneighbors_null)this->hneighbors = new Hook(); 163 else this->hneighbors=NULL; 164 165 /*Initialize hnodes: */ 166 if (this->hnodes){ 167 for(int i=0;i<this->numanalyses;i++){ 168 if(!hnodesi_null[i])this->hnodes[i]=new Hook(); 169 else this->hnodes[i]=NULL; 170 } 171 } 172 } 173 174 if (this->hnodes){ 175 for (i=0;i<numanalyses;i++) if(this->hnodes[i])this->hnodes[i]->Marshall2(marshallhandle); 176 } 177 this->hvertices->Marshall2(marshallhandle); 178 this->hmaterial->Marshall2(marshallhandle); 179 if(this->hneighbors)this->hneighbors->Marshall2(marshallhandle); 180 181 /*Free ressources: */ 182 if(hnodesi_null) xDelete<bool>(hnodesi_null); 183 184 } 185 /*}}}*/ 126 186 127 187 void ElementHook::DeepEcho(){/*{{{*/ -
issm/trunk-jpl/src/c/classes/Elements/ElementHook.h
r23644 r25506 23 23 ~ElementHook(); 24 24 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 25 void Marshall2(MarshallHandle* marshallhandle); 25 26 26 27 void DeepEcho(); -
issm/trunk-jpl/src/c/classes/Elements/Elements.h
r25379 r25506 29 29 void SetCurrentConfiguration(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters); 30 30 void ResetHooks(); 31 32 31 }; 33 32 -
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r25488 r25506 158 158 } 159 159 /*}}}*/ 160 void Penta::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 161 162 int object_enum = PentaEnum; 163 marshallhandle->call(object_enum); 164 marshallhandle->call(this->isonsurface); 165 marshallhandle->call(this->isonbase); 166 167 /*Call parent classes: */ 168 ElementHook::Marshall2(marshallhandle); 169 Element::MarshallElement2(marshallhandle,this->numanalyses); 170 PentaRef::Marshall2(marshallhandle); 171 172 vertices = (Vertex**)this->hvertices->deliverp(); 173 material = (Material*)this->hmaterial->delivers(); 174 verticalneighbors = (Penta**)this->hneighbors->deliverp(); 175 }/*}}}*/ 160 176 161 177 /*Other*/ -
issm/trunk-jpl/src/c/classes/Elements/Penta.h
r25442 r25506 41 41 Object *copy(); 42 42 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 43 void Marshall2(MarshallHandle* marshallhandle); 43 44 int ObjectEnum(); 44 45 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Elements/PentaRef.h
r21714 r25506 30 30 void VerticalSegmentIndicesBase(int** pindices,int* pnumseg,int finiteelement); 31 31 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*do nothing */}; 32 void Marshall2(MarshallHandle* marshallhandle){ /*do nothing */}; 32 33 int NumberofNodes(int finiteelement); 33 34 int PressureInterpolation(int fe_stokes); -
issm/trunk-jpl/src/c/classes/Elements/Seg.cpp
r25379 r25506 139 139 } 140 140 /*}}}*/ 141 void Seg::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 142 143 int object_enum = SegEnum; 144 marshallhandle->call(object_enum); 145 146 marshallhandle->call(this->iscollapsed); 147 marshallhandle->call(this->isonsurface); 148 marshallhandle->call(this->isonbase); 149 marshallhandle->call(this->collapsed_ids[0]); 150 marshallhandle->call(this->collapsed_ids[1]); 151 152 /*Call parent classes: */ 153 ElementHook::Marshall2(marshallhandle); 154 Element::MarshallElement2(marshallhandle,this->numanalyses); 155 SegRef::Marshall2(marshallhandle); 156 157 vertices = (Vertex**)this->hvertices->deliverp(); 158 material = (Material*)this->hmaterial->delivers(); 159 160 } 161 /*}}}*/ 141 162 142 163 IssmDouble Seg::CharacteristicLength(void){/*{{{*/ -
issm/trunk-jpl/src/c/classes/Elements/Seg.h
r25442 r25506 39 39 Object *copy(); 40 40 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 41 void Marshall2(MarshallHandle* marshallhandle); 41 42 int ObjectEnum(); 42 43 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Elements/SegRef.h
r20810 r25506 25 25 void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussSeg* gauss,int finiteelement); 26 26 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*do nothing */}; 27 void Marshall2(MarshallHandle* marshallhandle){ /*do nothing */}; 27 28 int NumberofNodes(int finiteelement); 28 29 }; -
issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp
r25379 r25506 128 128 Element::MarshallElement(pmarshalled_data,pmarshalled_data_size,marshall_direction,this->numanalyses); 129 129 TetraRef::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 130 131 vertices = (Vertex**)this->hvertices->deliverp(); 132 material = (Material*)this->hmaterial->delivers(); 133 134 } 135 /*}}}*/ 136 void Tetra::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 137 138 int object_enum = TetraEnum; 139 marshallhandle->call(object_enum); 140 141 marshallhandle->call(this->isonsurface); 142 marshallhandle->call(this->isonbase); 143 144 /*Call parent classes: */ 145 ElementHook::Marshall2(marshallhandle); 146 Element::MarshallElement2(marshallhandle,this->numanalyses); 147 TetraRef::Marshall2(marshallhandle); 130 148 131 149 vertices = (Vertex**)this->hvertices->deliverp(); -
issm/trunk-jpl/src/c/classes/Elements/Tetra.h
r25442 r25506 37 37 Object *copy(); 38 38 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 39 void Marshall2(MarshallHandle* marshallhandle); 39 40 int ObjectEnum(); 40 41 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Elements/TetraRef.h
r20810 r25506 26 26 void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussTetra* gauss,int finiteelement); 27 27 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*do nothing */}; 28 void Marshall2(MarshallHandle* marshallhandle){ /*do nothing */}; 28 29 int NumberofNodes(int finiteelement); 29 30 int PressureInterpolation(int fe_stokes); -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r25445 r25506 155 155 Element::MarshallElement(pmarshalled_data,pmarshalled_data_size,marshall_direction,this->numanalyses); 156 156 TriaRef::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 157 158 vertices = (Vertex**)this->hvertices->deliverp(); 159 material = (Material*)this->hmaterial->delivers(); 160 161 } 162 /*}}}*/ 163 void Tria::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 164 165 int object_enum = TriaEnum; 166 marshallhandle->call(object_enum); 167 168 marshallhandle->call(this->iscollapsed); 169 marshallhandle->call(this->isonsurface); 170 marshallhandle->call(this->isonbase); 171 172 /*Call parent classes: */ 173 ElementHook::Marshall2(marshallhandle); 174 Element::MarshallElement2(marshallhandle,this->numanalyses); 175 TriaRef::Marshall2(marshallhandle); 157 176 158 177 vertices = (Vertex**)this->hvertices->deliverp(); -
issm/trunk-jpl/src/c/classes/Elements/Tria.h
r25442 r25506 40 40 Object *copy(); 41 41 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 42 void Marshall2(MarshallHandle* marshallhandle); 42 43 int ObjectEnum(); 43 44 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Elements/TriaRef.h
r24131 r25506 29 29 void GetSegmentNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list_tria,Gauss* gauss, int index1,int index2,int finiteelement); 30 30 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*do nothing */}; 31 void Marshall2(MarshallHandle* marshallhandle){ /*do nothing */}; 31 32 void NodeOnEdgeIndices(int* pnumindices,int** pindices,int index,int finiteelement); 32 33 int NumberofNodes(int finiteelement); -
issm/trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h
r25497 r25506 171 171 } 172 172 /*}}}*/ 173 void Marshall2(MarshallHandle* marshallhandle){/*{{{*/ 174 _error_("not implemented yet!"); 175 } 176 /*}}}*/ 173 177 174 178 /*GenericExternalResult management: */ -
issm/trunk-jpl/src/c/classes/FemModel.cpp
r25497 r25506 250 250 251 251 /*Initialize: */ 252 femmodel_size=0; 252 femmodel_size=this->Size(); 253 _assert_(femmodel_size); 253 254 254 255 /*Create buffer to hold marshalled femmodel: */ 255 this->Marshall(NULL,&femmodel_size,MARSHALLING_SIZE);256 256 femmodel_buffer=xNew<char>(femmodel_size); 257 257 258 /*Keep track of initial position of femmodel_buffer: */ 258 259 femmodel_buffer_ini=femmodel_buffer; 259 260 260 261 /*Marshall:*/ 261 this->Marshall(&femmodel_buffer,NULL,MARSHALLING_WRITE); 262 //this->Marshall(&femmodel_buffer,NULL,MARSHALLING_WRITE); 263 WriteCheckpointFunctor* marshallhandle = new WriteCheckpointFunctor(&femmodel_buffer); 264 this->Marshall2(marshallhandle); 265 delete marshallhandle; 262 266 263 267 /*Reset position of buffer: */ … … 273 277 xDelete<char>(femmodel_buffer); 274 278 xDelete<char>(restartfilename); 275 276 279 } 277 280 /*}}}*/ … … 567 570 } 568 571 /*}}}*/ 572 void FemModel::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 573 574 /*Allocate new fields if necessary*/ 575 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){ 576 delete this->materials; 577 delete this->parameters; 578 delete this->inputs; 579 if(this->constraints_list && this->nummodels){ 580 for(int i=0;i<this->nummodels;i++) delete this->constraints_list[i]; 581 xDelete<Constraints*>(constraints_list); 582 } 583 if(this->loads_list && this->nummodels){ 584 for(int i=0;i<this->nummodels;i++) delete this->loads_list[i]; 585 xDelete<Loads*>(loads_list); 586 } 587 if(this->nodes_list && this->nummodels){ 588 for(int i=0;i<this->nummodels;i++) delete this->nodes_list[i]; 589 xDelete<Nodes*>(nodes_list); 590 } 591 delete this->results; 592 delete this->vertices; 593 delete this->elements; 594 xDelete<int>(this->analysis_type_list); 595 596 this->materials = new Materials(); 597 this->parameters = new Parameters(); 598 this->inputs = new Inputs(); 599 this->results = new Results(); 600 this->vertices = new Vertices(); 601 this->elements = new Elements(); 602 } 603 604 int obj_enum = FemModelEnum; 605 marshallhandle->call(obj_enum); 606 607 marshallhandle->call(this->solution_type); 608 marshallhandle->call(this->analysis_counter); 609 marshallhandle->call(this->nummodels); 610 marshallhandle->call(this->analysis_type_list,nummodels); 611 612 this->materials->Marshall2(marshallhandle); 613 this->parameters->Marshall2(marshallhandle); 614 this->inputs->Marshall2(marshallhandle); 615 this->results->Marshall2(marshallhandle); 616 this->vertices->Marshall2(marshallhandle); 617 this->elements->Marshall2(marshallhandle); 618 619 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){ 620 this->constraints_list = xNew<Constraints*>(this->nummodels); 621 for(int i=0;i<nummodels;i++) this->constraints_list[i] = new Constraints(); 622 this->loads_list = xNew<Loads*>(this->nummodels); 623 for(int i=0;i<nummodels;i++) this->loads_list[i] = new Loads(); 624 this->nodes_list = xNew<Nodes*>(this->nummodels); 625 for(int i=0;i<nummodels;i++) this->nodes_list[i] = new Nodes(); 626 } 627 628 for(int i=0;i<nummodels;i++){ 629 this->constraints_list[i]->Marshall2(marshallhandle); 630 this->loads_list[i]->Marshall2(marshallhandle); 631 this->nodes_list[i]->Marshall2(marshallhandle); 632 } 633 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){ 634 /*reset hooks for elements, loads and nodes:*/ 635 this->elements->ResetHooks(); 636 this->materials->ResetHooks(); 637 638 /*do the post-processing of the datasets to get an FemModel that can actually run analyses:*/ 639 for(int i=0;i<nummodels;i++){ 640 this->loads_list[i]->ResetHooks(); 641 int analysis_type=this->analysis_type_list[i]; 642 SetCurrentConfiguration(analysis_type); 643 SpcNodesx(this->nodes_list[i],this->constraints_list[i],this->parameters); 644 NodesDofx(this->nodes_list[i],this->parameters); 645 ConfigureObjectsx(this->elements,this->loads_list[i],this->nodes_list[i],this->vertices,this->materials,this->parameters,this->inputs); 646 } 647 648 /*Reset current configuration*/ 649 SetCurrentConfiguration(this->analysis_type_list[this->analysis_counter]); 650 } 651 } 652 /*}}}*/ 569 653 void FemModel::Restart(){ /*{{{*/ 570 654 … … 609 693 610 694 /*Create new FemModel by demarshalling the buffer: */ 611 this->Marshall(&femmodel_buffer,NULL,MARSHALLING_LOAD); 695 //this->Marshall(&femmodel_buffer,NULL,MARSHALLING_LOAD); 696 LoadCheckpointFunctor* marshallhandle = new LoadCheckpointFunctor(&femmodel_buffer); 697 this->Marshall2(marshallhandle); 698 delete marshallhandle; 612 699 613 700 /*Reset position of buffer: */ … … 677 764 /*}}}*/ 678 765 int FemModel::Size(){ /*{{{*/ 679 int femmodel_size; 680 681 this->Marshall(NULL,&femmodel_size,MARSHALLING_SIZE); 682 766 767 SizeCheckpointFunctor* marshallhandle = new SizeCheckpointFunctor(); 768 this->Marshall2(marshallhandle); 769 int femmodel_size = marshallhandle->MarshalledSize(); 770 771 /*Cleanup and return*/ 772 delete marshallhandle; 683 773 return femmodel_size; 684 774 } -
issm/trunk-jpl/src/c/classes/FemModel.h
r25489 r25506 82 82 void InitFromFids(char* rootpath, FILE* IOMODEL, FILE* toolkitsoptionsfid, int in_solution_type, bool trace, IssmPDouble* X=NULL); 83 83 void Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction); 84 void Marshall2(MarshallHandle* marshallhandle); 84 85 void Restart(void); 85 86 void RestartAD(int step); -
issm/trunk-jpl/src/c/classes/Hook.cpp
r25497 r25506 137 137 MARSHALLING_DYNAMIC(offsets,int,num); 138 138 MARSHALLING_DYNAMIC(objects,Object*,num); 139 } 140 141 } 142 /*}}}*/ 143 void Hook::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 144 145 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD) reset(); 146 147 int object_enum = HookEnum; 148 marshallhandle->call(object_enum); 149 marshallhandle->call(this->num); 150 if (num<=0){ 151 /*Empty hook*/ 152 this->ids = NULL; 153 this->objects = NULL; 154 this->offsets = NULL; 155 this->num = 0; 156 } 157 else{ 158 marshallhandle->call(this->ids,num); 159 marshallhandle->call(this->offsets,num); 160 marshallhandle->call(this->objects,num); 139 161 } 140 162 -
issm/trunk-jpl/src/c/classes/Hook.h
r20810 r25506 34 34 void DeepEcho(void); 35 35 void Echo(void); 36 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 36 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 37 void Marshall2(MarshallHandle* marshallhandle); 37 38 /*}}}*/ 38 39 /*Hook management: {{{*/ -
issm/trunk-jpl/src/c/classes/Inputs/ArrayInput.cpp
r25379 r25506 95 95 } 96 96 /*}}}*/ 97 void ArrayInput::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 98 99 int object_enum = ArrayInputEnum; 100 marshallhandle->call(object_enum); 101 marshallhandle->call(this->numberofelements_local); 102 if(this->numberofelements_local){ 103 marshallhandle->call(this->N,this->numberofelements_local); 104 for(int i=0;i<this->numberofelements_local;i++){ 105 if(this->values[i]){ 106 marshallhandle->call(this->values[i],this->N[i]); 107 } 108 } 109 } 110 else{ 111 this->N = NULL; 112 this->values = NULL; 113 } 114 115 } 116 /*}}}*/ 97 117 int ArrayInput::ObjectEnum(void){/*{{{*/ 98 118 return ArrayInputEnum; -
issm/trunk-jpl/src/c/classes/Inputs/ArrayInput.h
r25379 r25506 24 24 int Id(); 25 25 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 26 void Marshall2(MarshallHandle* marshallhandle); 26 27 int ObjectEnum(); 27 28 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Inputs/BoolInput.cpp
r25379 r25506 66 66 } 67 67 /*}}}*/ 68 void BoolInput::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 69 70 int object_enum = BoolInputEnum; 71 marshallhandle->call(object_enum); 72 73 marshallhandle->call(this->size); 74 if(this->size > 0){ 75 marshallhandle->call(this->values,this->size); 76 } 77 else this->values = NULL; 78 79 } 80 /*}}}*/ 68 81 int BoolInput::ObjectEnum(void){/*{{{*/ 69 82 -
issm/trunk-jpl/src/c/classes/Inputs/BoolInput.h
r25379 r25506 23 23 int Id(); 24 24 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 25 void Marshall2(MarshallHandle* marshallhandle); 25 26 int ObjectEnum(); 26 27 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Inputs/ControlInput.cpp
r25406 r25506 121 121 122 122 MARSHALLING_ENUM(ControlInputEnum); 123 _error_("Not implemented"); 124 } 125 /*}}}*/ 126 void ControlInput::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 127 128 int object_enum = ControlInputEnum; 129 marshallhandle->call(object_enum); 123 130 _error_("Not implemented"); 124 131 } -
issm/trunk-jpl/src/c/classes/Inputs/ControlInput.h
r25406 r25506 37 37 int Id(); 38 38 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 39 void Marshall2(MarshallHandle* marshallhandle); 39 40 int ObjectEnum(); 40 41 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp
r25497 r25506 95 95 } 96 96 /*}}}*/ 97 void DatasetInput::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 98 99 int object_enum = DatasetInputEnum; 100 marshallhandle->call(object_enum); 101 102 marshallhandle->call(this->numids); 103 marshallhandle->call(this->numberofelements_local); 104 marshallhandle->call(this->numberofvertices_local); 105 marshallhandle->call(this->ids,numids); 106 //if (marshallhandle->OperationNumber() == MARSHALLING_LOAD) inputs = new Inputs(); 107 //inputs->Marshall2(marshallhandle); 108 _error_("not implemented"); 109 110 } 111 /*}}}*/ 97 112 int DatasetInput::ObjectEnum(void){/*{{{*/ 98 113 return DatasetInputEnum; -
issm/trunk-jpl/src/c/classes/Inputs/DatasetInput.h
r25379 r25506 35 35 int Id(); 36 36 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 37 void Marshall2(MarshallHandle* marshallhandle); 37 38 int ObjectEnum(); 38 39 void SetTriaInput(int interp_in,int numinds,int* rows,IssmDouble* values_in); -
issm/trunk-jpl/src/c/classes/Inputs/DoubleInput.cpp
r25379 r25506 66 66 } 67 67 /*}}}*/ 68 void DoubleInput::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 69 70 int object_enum = DoubleInputEnum; 71 marshallhandle->call(object_enum); 72 73 marshallhandle->call(this->size); 74 if(this->size > 0){ 75 marshallhandle->call(this->values,this->size); 76 } 77 else this->values = NULL; 78 79 } 80 /*}}}*/ 68 81 int DoubleInput::ObjectEnum(void){/*{{{*/ 69 82 -
issm/trunk-jpl/src/c/classes/Inputs/DoubleInput.h
r25379 r25506 23 23 int Id(); 24 24 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 25 void Marshall2(MarshallHandle* marshallhandle); 25 26 int ObjectEnum(); 26 27 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Inputs/ElementInput.h
r25379 r25506 30 30 virtual int Id()=0; 31 31 virtual void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction)=0; 32 virtual void Marshall2(MarshallHandle* marshallhandle)=0; 32 33 virtual int ObjectEnum()=0; 33 34 /*Other*/ -
issm/trunk-jpl/src/c/classes/Inputs/Inputs.cpp
r25497 r25506 144 144 } 145 145 /*}}}*/ 146 void Inputs::Marshall2(MarshallHandle* marshallhandle){/*{{{*/ 147 148 int num_inputs=0; 149 int index; 150 151 int object_enum = ArrayInputEnum; 152 marshallhandle->call(object_enum); 153 154 if(marshallhandle->OperationNumber()==MARSHALLING_WRITE || marshallhandle->OperationNumber()==MARSHALLING_SIZE){ 155 156 /*Marshall num_inputs first*/ 157 for(int i=0;i<NUMINPUTS;i++){ 158 if(this->inputs[i]) num_inputs++; 159 } 160 marshallhandle->call(num_inputs); 161 162 /*Marshall Parameters one by one now*/ 163 for(int i=0;i<NUMINPUTS;i++){ 164 if(this->inputs[i]){ 165 object_enum = this->inputs[i]->ObjectEnum(); 166 marshallhandle->call(i); 167 marshallhandle->call(object_enum); 168 this->inputs[i]->Marshall2(marshallhandle); 169 } 170 } 171 } 172 else{ 173 174 /*Get number of inputs marshalled*/ 175 marshallhandle->call(num_inputs); 176 177 /*Recover input2eters one by one*/ 178 for(int i=0;i<num_inputs;i++){ 179 180 /*Recover enum of object first: */ 181 marshallhandle->call(index); 182 marshallhandle->call(object_enum); 183 184 if(object_enum==BoolInputEnum){ 185 BoolInput* boolinput2=new BoolInput(); 186 boolinput2->Marshall2(marshallhandle); 187 this->inputs[index]=boolinput2; 188 } 189 else if(object_enum==IntInputEnum){ 190 IntInput* intinput2=new IntInput(); 191 intinput2->Marshall2(marshallhandle); 192 this->inputs[index]=intinput2; 193 } 194 else if(object_enum==TriaInputEnum){ 195 TriaInput* triainput2=new TriaInput(); 196 triainput2->Marshall2(marshallhandle); 197 this->inputs[index]=triainput2; 198 } 199 else if(object_enum==PentaInputEnum){ 200 PentaInput* pentainput2=new PentaInput(); 201 pentainput2->Marshall2(marshallhandle); 202 this->inputs[index]=pentainput2; 203 } 204 else{ 205 _error_("input "<<EnumToStringx(object_enum)<<" not supported"); 206 } 207 } 208 } 209 } 210 /*}}}*/ 146 211 147 212 void Inputs::AddInput(Input* newinput){/*{{{*/ -
issm/trunk-jpl/src/c/classes/Inputs/Inputs.h
r25406 r25506 64 64 ControlInput* GetControlInput(int enum_type); 65 65 void Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction); 66 void Marshall2(MarshallHandle* marshallhandle); 66 67 int GetInputObjectEnum(int enum_type); 67 68 void GetInputValue(bool* pvalue,int enum_in,int index); -
issm/trunk-jpl/src/c/classes/Inputs/IntInput.cpp
r25379 r25506 66 66 } 67 67 /*}}}*/ 68 void IntInput::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 69 70 int object_enum = IntInputEnum; 71 marshallhandle->call(object_enum); 72 73 marshallhandle->call(this->size); 74 if(this->size > 0){ 75 marshallhandle->call(this->values,this->size); 76 } 77 else this->values = NULL; 78 79 } 80 /*}}}*/ 68 81 int IntInput::ObjectEnum(void){/*{{{*/ 69 82 -
issm/trunk-jpl/src/c/classes/Inputs/IntInput.h
r25379 r25506 23 23 int Id(); 24 24 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 25 void Marshall2(MarshallHandle* marshallhandle); 25 26 int ObjectEnum(); 26 27 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Inputs/PentaInput.cpp
r25497 r25506 146 146 } 147 147 /*}}}*/ 148 void PentaInput::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 149 150 int object_enum = PentaInputEnum; 151 marshallhandle->call(object_enum); 152 153 marshallhandle->call(this->numberofelements_local); 154 marshallhandle->call(this->numberofvertices_local); 155 marshallhandle->call(this->interpolation); 156 marshallhandle->call(this->M); 157 marshallhandle->call(this->N); 158 this->isserved = false; 159 this->isserved_collapsed = 0; 160 if(this->M*this->N){ 161 marshallhandle->call(this->values,this->M*this->N); 162 } 163 else this->values = NULL; 164 165 if(marshallhandle->OperationNumber() == MARSHALLING_LOAD){ 166 this->element_values = xNewZeroInit<IssmDouble>(PentaRef::NumberofNodes(this->interpolation)); 167 } 168 } 169 /*}}}*/ 148 170 int PentaInput::ObjectEnum(void){/*{{{*/ 149 171 return PentaInputEnum; -
issm/trunk-jpl/src/c/classes/Inputs/PentaInput.h
r25379 r25506 22 22 int Id(); 23 23 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 24 void Marshall2(MarshallHandle* marshallhandle); 24 25 int ObjectEnum(); 25 26 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Inputs/SegInput.cpp
r25497 r25506 128 128 } 129 129 /*}}}*/ 130 void SegInput::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 131 132 int object_enum = SegInputEnum; 133 marshallhandle->call(object_enum); 134 135 marshallhandle->call(this->numberofelements_local); 136 marshallhandle->call(this->numberofvertices_local); 137 marshallhandle->call(this->interpolation); 138 marshallhandle->call(this->M); 139 marshallhandle->call(this->N); 140 this->isserved = false; 141 if(this->M*this->N){ 142 marshallhandle->call(this->values,this->M*this->N); 143 } 144 else this->values = NULL; 145 146 if(marshallhandle->OperationNumber() == MARSHALLING_LOAD){ 147 this->element_values = xNewZeroInit<IssmDouble>(SegRef::NumberofNodes(this->interpolation)); 148 } 149 150 } 151 /*}}}*/ 130 152 int SegInput::ObjectEnum(void){/*{{{*/ 131 153 return SegInputEnum; -
issm/trunk-jpl/src/c/classes/Inputs/SegInput.h
r25379 r25506 20 20 int Id(); 21 21 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 22 void Marshall2(MarshallHandle* marshallhandle); 22 23 int ObjectEnum(); 23 24 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp
r25497 r25506 130 130 MARSHALLING_DYNAMIC(this->timesteps,IssmDouble,numtimesteps); 131 131 //inputs->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 132 _error_("not implemented"); 133 } 134 /*}}}*/ 135 void TransientInput::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 136 137 if (marshallhandle->OperationNumber() == MARSHALLING_LOAD){ 138 _error_("not implmented"); 139 //inputs = new Inputs(); 140 } 141 142 int object_enum = TransientInputEnum; 143 marshallhandle->call(object_enum); 144 145 marshallhandle->call(this->enum_type); 146 marshallhandle->call(this->numtimesteps); 147 marshallhandle->call(this->timesteps,numtimesteps); 148 //inputs->Marshall2(marshallhandle); 132 149 _error_("not implemented"); 133 150 } -
issm/trunk-jpl/src/c/classes/Inputs/TransientInput.h
r25406 r25506 44 44 int Id(); 45 45 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 46 void Marshall2(MarshallHandle* marshallhandle); 46 47 int ObjectEnum(); 47 48 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Inputs/TriaInput.cpp
r25497 r25506 133 133 } 134 134 /*}}}*/ 135 void TriaInput::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 136 137 int object_enum = TriaInputEnum; 138 marshallhandle->call(object_enum); 139 140 marshallhandle->call(this->numberofelements_local); 141 marshallhandle->call(this->numberofvertices_local); 142 marshallhandle->call(this->interpolation); 143 marshallhandle->call(this->M); 144 marshallhandle->call(this->N); 145 this->isserved = false; 146 this->isserved_collapsed = 0; 147 if(this->M*this->N){ 148 marshallhandle->call(this->values,this->M*this->N); 149 } 150 else this->values = NULL; 151 152 if(marshallhandle->OperationNumber() == MARSHALLING_LOAD){ 153 this->element_values = xNewZeroInit<IssmDouble>(TriaRef::NumberofNodes(this->interpolation)); 154 } 155 156 } 157 /*}}}*/ 135 158 int TriaInput::ObjectEnum(void){/*{{{*/ 136 159 return TriaInputEnum; -
issm/trunk-jpl/src/c/classes/Inputs/TriaInput.h
r25379 r25506 23 23 int Id(); 24 24 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 25 void Marshall2(MarshallHandle* marshallhandle); 25 26 int ObjectEnum(); 26 27 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Loads/Channel.cpp
r25497 r25506 170 170 element =(Element*)this->helement->delivers(); 171 171 172 } 173 /*}}}*/ 174 void Channel::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 175 176 _assert_(this); 177 178 /*ok, marshall operations: */ 179 int object_enum; 180 marshallhandle->call(object_enum); 181 marshallhandle->call(this->id); 182 marshallhandle->call(this->S); 183 184 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){ 185 this->hnodes = new Hook(); 186 this->hvertices = new Hook(); 187 this->helement = new Hook(); 188 } 189 190 this->hnodes->Marshall2(marshallhandle); 191 this->helement->Marshall2(marshallhandle); 192 this->hvertices->Marshall2(marshallhandle); 193 194 /*corresponding fields*/ 195 nodes =(Node**)this->hnodes->deliverp(); 196 vertices =(Vertex**)this->hvertices->deliverp(); 197 element =(Element*)this->helement->delivers(); 172 198 } 173 199 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Loads/Channel.h
r25386 r25506 49 49 void Echo(); 50 50 int Id(); 51 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 51 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 52 void Marshall2(MarshallHandle* marshallhandle); 52 53 int ObjectEnum(); 53 54 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Loads/Loads.cpp
r24630 r25506 82 82 83 83 DataSet::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 84 } 85 /*}}}*/ 86 void Loads::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 87 88 int object_enum = LoadsEnum; 89 marshallhandle->call(object_enum); 90 marshallhandle->call(this->numrifts); 91 marshallhandle->call(this->numpenalties); 92 93 DataSet::Marshall2(marshallhandle); 84 94 } 85 95 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Loads/Loads.h
r24630 r25506 28 28 Loads* Copy(); 29 29 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 30 void Marshall2(MarshallHandle* marshallhandle); 30 31 31 32 /*numerics*/ -
issm/trunk-jpl/src/c/classes/Loads/Moulin.cpp
r25497 r25506 126 126 this->hvertex->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 127 127 this->helement->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 128 129 /*corresponding fields*/ 130 node =(Node*)this->hnode->delivers(); 131 vertex =(Vertex*)this->hvertex->delivers(); 132 element=(Element*)this->helement->delivers(); 133 } 134 /*}}}*/ 135 void Moulin::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 136 137 _assert_(this); 138 139 /*ok, marshall operations: */ 140 int object_enum = MoulinEnum; 141 marshallhandle->call(object_enum); 142 marshallhandle->call(this->id); 143 144 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){ 145 this->hnode = new Hook(); 146 this->hvertex = new Hook(); 147 this->helement = new Hook(); 148 } 149 150 this->hnode->Marshall2(marshallhandle); 151 this->hvertex->Marshall2(marshallhandle); 152 this->helement->Marshall2(marshallhandle); 128 153 129 154 /*corresponding fields*/ -
issm/trunk-jpl/src/c/classes/Loads/Moulin.h
r25386 r25506 49 49 void Echo(); 50 50 int Id(); 51 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 51 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 52 void Marshall2(MarshallHandle* marshallhandle); 52 53 int ObjectEnum(); 53 54 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Loads/Neumannflux.cpp
r25497 r25506 142 142 this->helement->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 143 143 this->hvertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 144 145 /*corresponding fields*/ 146 nodes =(Node**)this->hnodes->deliverp(); 147 vertices =(Vertex**)this->hvertices->deliverp(); 148 element =(Element*)this->helement->delivers(); 149 150 } 151 /*}}}*/ 152 void Neumannflux::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 153 154 _assert_(this); 155 156 /*ok, marshall operations: */ 157 int object_enum=NeumannfluxEnum; 158 marshallhandle->call(object_enum); 159 marshallhandle->call(this->id); 160 161 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){ 162 this->hnodes = new Hook(); 163 this->hvertices = new Hook(); 164 this->helement = new Hook(); 165 } 166 167 this->hnodes->Marshall2(marshallhandle); 168 this->helement->Marshall2(marshallhandle); 169 this->hvertices->Marshall2(marshallhandle); 144 170 145 171 /*corresponding fields*/ -
issm/trunk-jpl/src/c/classes/Loads/Neumannflux.h
r25386 r25506 42 42 void Echo(); 43 43 int Id(); 44 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 44 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 45 void Marshall2(MarshallHandle* marshallhandle); 45 46 int ObjectEnum(); 46 47 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp
r25497 r25506 220 220 this->helement->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 221 221 this->hvertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 222 223 /*corresponding fields*/ 224 nodes =(Node**)this->hnodes->deliverp(); 225 vertices =(Vertex**)this->hvertices->deliverp(); 226 element =(Element*)this->helement->delivers(); 227 228 } 229 /*}}}*/ 230 void Numericalflux::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 231 232 _assert_(this); 233 234 /*ok, marshall operations: */ 235 int object_enum = NumericalfluxEnum; 236 marshallhandle->call(object_enum); 237 marshallhandle->call(this->id); 238 marshallhandle->call(this->flux_type); 239 marshallhandle->call(this->flux_degree); 240 241 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){ 242 this->hnodes = new Hook(); 243 this->hvertices = new Hook(); 244 this->helement = new Hook(); 245 } 246 247 this->hnodes->Marshall2(marshallhandle); 248 this->helement->Marshall2(marshallhandle); 249 this->hvertices->Marshall2(marshallhandle); 222 250 223 251 /*corresponding fields*/ -
issm/trunk-jpl/src/c/classes/Loads/Numericalflux.h
r25386 r25506 44 44 void Echo(); 45 45 int Id(); 46 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 46 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 47 void Marshall2(MarshallHandle* marshallhandle); 47 48 int ObjectEnum(); 48 49 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp
r25497 r25506 144 144 } 145 145 /*}}}*/ 146 void Pengrid::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 147 148 _assert_(this); 149 150 /*ok, marshall operations: */ 151 int object_enum = PengridEnum; 152 marshallhandle->call(object_enum); 153 marshallhandle->call(this->id); 154 155 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){ 156 this->hnode = new Hook(); 157 this->helement = new Hook(); 158 } 159 160 this->hnode->Marshall2(marshallhandle); 161 this->helement->Marshall2(marshallhandle); 162 163 /*corresponding fields*/ 164 node =(Node*)this->hnode->delivers(); 165 element=(Element*)this->helement->delivers(); 166 167 marshallhandle->call(this->active); 168 marshallhandle->call(this->zigzag_counter); 169 }/*}}}*/ 146 170 int Pengrid::ObjectEnum(void){/*{{{*/ 147 171 -
issm/trunk-jpl/src/c/classes/Loads/Pengrid.h
r25386 r25506 51 51 void Echo(); 52 52 int Id(); 53 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 53 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 54 void Marshall2(MarshallHandle* marshallhandle); 54 55 int ObjectEnum(); 55 56 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Loads/Penpair.cpp
r25497 r25506 100 100 nodes = (Node**)this->hnodes->deliverp(); 101 101 102 } 103 /*}}}*/ 104 void Penpair::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 105 106 _assert_(this); 107 108 /*ok, marshall operations: */ 109 int object_enum = PenpairEnum; 110 marshallhandle->call(object_enum); 111 marshallhandle->call(this->id); 112 113 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){ 114 this->hnodes = new Hook(); 115 } 116 this->hnodes->Marshall2(marshallhandle); 117 118 /*corresponding fields*/ 119 nodes = (Node**)this->hnodes->deliverp(); 102 120 } 103 121 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Loads/Penpair.h
r25386 r25506 30 30 /*}}}*/ 31 31 /*Object virtual functions definitions:{{{ */ 32 Object* copy();32 Object* copy(); 33 33 void DeepEcho(); 34 34 void Echo(); 35 35 int Id(); 36 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 36 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 37 void Marshall2(MarshallHandle* marshallhandle); 37 38 int ObjectEnum(); 38 39 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp
r25497 r25506 229 229 } 230 230 /*}}}*/ 231 void Riftfront::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 232 233 _assert_(this); 234 235 /*ok, marshall operations: */ 236 int object_enum = RiftfrontEnum; 237 marshallhandle->call(object_enum); 238 marshallhandle->call(this->id); 239 marshallhandle->call(this->type); 240 marshallhandle->call(this->fill); 241 marshallhandle->call(this->friction); 242 marshallhandle->call(this->fractionincrement); 243 marshallhandle->call(this->shelf); 244 245 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){ 246 this->hnodes = new Hook(); 247 this->hvertices = new Hook(); 248 this->helements = new Hook(); 249 } 250 251 this->hnodes->Marshall2(marshallhandle); 252 this->hvertices->Marshall2(marshallhandle); 253 this->helements->Marshall2(marshallhandle); 254 255 /*corresponding fields*/ 256 nodes =(Node**)this->hnodes->deliverp(); 257 vertices =(Vertex**)this->hvertices->deliverp(); 258 elements =(Element**)this->helements->deliverp(); 259 260 marshallhandle->call(this->penalty_lock); 261 marshallhandle->call(this->active); 262 marshallhandle->call(this->frozen); 263 marshallhandle->call(this->state); 264 marshallhandle->call(this->counter); 265 marshallhandle->call(this->prestable); 266 marshallhandle->call(this->material_converged); 267 marshallhandle->call(this->normal[0]); 268 marshallhandle->call(this->normal[1]); 269 marshallhandle->call(this->length); 270 marshallhandle->call(this->fraction); 271 }/*}}}*/ 231 272 int Riftfront::ObjectEnum(void){/*{{{*/ 232 273 -
issm/trunk-jpl/src/c/classes/Loads/Riftfront.h
r25386 r25506 61 61 int Id(); 62 62 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 63 void Marshall2(MarshallHandle* marshallhandle); 63 64 int ObjectEnum(); 64 65 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Masscon.h
r20810 r25506 77 77 } 78 78 /*}}}*/ 79 void Marshall2(MarshallHandle* marshallhandle){/*{{{*/ 80 _error_("not implemented yet!"); 81 } 82 /*}}}*/ 79 83 int ObjectEnum(void){/*{{{*/ 80 84 return MassconEnum; -
issm/trunk-jpl/src/c/classes/Massconaxpby.h
r20810 r25506 88 88 } 89 89 /*}}}*/ 90 void Marshall2(MarshallHandle* marshallhandle){/*{{{*/ 91 _error_("not implemented yet!"); 92 } 93 /*}}}*/ 90 94 int ObjectEnum(void){/*{{{*/ 91 95 return MassconaxpbyEnum; -
issm/trunk-jpl/src/c/classes/Massfluxatgate.h
r21808 r25506 127 127 } 128 128 /*}}}*/ 129 void Marshall2(MarshallHandle* marshallhandle){/*{{{*/ 130 131 int object_enum = MassfluxatgateEnum; 132 marshallhandle->call(object_enum); 133 134 marshallhandle->call(this->definitionenum); 135 marshallhandle->call(this->name); 136 marshallhandle->call(this->numsegments); 137 marshallhandle->call(this->x1,this->numsegments); 138 marshallhandle->call(this->x2,this->numsegments); 139 marshallhandle->call(this->y1,this->numsegments); 140 marshallhandle->call(this->y2,this->numsegments); 141 marshallhandle->call(this->elements,this->numsegments); 142 } 143 /*}}}*/ 129 144 /*Definition virtual function resolutoin: */ 130 145 int DefinitionEnum(){/*{{{*/ -
issm/trunk-jpl/src/c/classes/Materials/Matestar.cpp
r25497 r25506 108 108 MARSHALLING(mid); 109 109 this->helement->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 110 this->element=(Element*)this->helement->delivers(); 111 112 } 113 /*}}}*/ 114 void Matestar::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 115 116 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD)helement=new Hook(); 117 118 int object_enum = MatestarEnum; 119 marshallhandle->call(object_enum); 120 121 marshallhandle->call(this->mid); 122 this->helement->Marshall2(marshallhandle); 110 123 this->element=(Element*)this->helement->delivers(); 111 124 -
issm/trunk-jpl/src/c/classes/Materials/Matestar.h
r25379 r25506 41 41 void Echo(); 42 42 int Id(); 43 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 43 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 44 void Marshall2(MarshallHandle* marshallhandle); 44 45 int ObjectEnum(); 45 46 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Materials/Matice.cpp
r25497 r25506 172 172 } 173 173 /*}}}*/ 174 void Matice::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 175 176 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD)helement=new Hook(); 177 178 int object_enum = MaticeEnum; 179 marshallhandle->call(object_enum); 180 181 marshallhandle->call(this->mid); 182 marshallhandle->call(this->isdamaged); 183 marshallhandle->call(this->isenhanced); 184 this->helement->Marshall2(marshallhandle); 185 this->element=(Element*)this->helement->delivers(); 186 }/*}}}*/ 174 187 int Matice::ObjectEnum(void){/*{{{*/ 175 188 -
issm/trunk-jpl/src/c/classes/Materials/Matice.h
r25379 r25506 45 45 void Echo(); 46 46 int Id(); 47 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 47 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 48 void Marshall2(MarshallHandle* marshallhandle); 48 49 int ObjectEnum(); 49 50 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Materials/Matlitho.cpp
r23524 r25506 175 175 } 176 176 /*}}}*/ 177 void Matlitho::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 178 179 int object_enum = MatlithoEnum; 180 marshallhandle->call(object_enum); 181 182 marshallhandle->call(this->numlayers); 183 if(numlayers) { 184 marshallhandle->call(this->radius,numlayers+1); 185 marshallhandle->call(this->viscosity,numlayers); 186 marshallhandle->call(this->lame_lambda,numlayers); 187 marshallhandle->call(this->lame_mu,numlayers); 188 marshallhandle->call(this->burgers_viscosity,numlayers); 189 marshallhandle->call(this->burgers_mu,numlayers); 190 marshallhandle->call(this->density,numlayers); 191 marshallhandle->call(this->isburgers,numlayers); 192 marshallhandle->call(this->issolid,numlayers); 193 } 194 else{ 195 radius = NULL; 196 viscosity = NULL; 197 lame_lambda = NULL; 198 lame_mu = NULL; 199 burgers_viscosity = NULL; 200 burgers_mu = NULL; 201 density = NULL; 202 isburgers = NULL; 203 issolid = NULL; 204 } 205 206 } 207 /*}}}*/ 177 208 int Matlitho::ObjectEnum(void){/*{{{*/ 178 209 -
issm/trunk-jpl/src/c/classes/Materials/Matlitho.h
r25379 r25506 37 37 void Echo(); 38 38 int Id(); 39 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 39 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 40 void Marshall2(MarshallHandle* marshallhandle); 40 41 int ObjectEnum(); 41 42 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Misfit.cpp
r25471 r25506 93 93 } 94 94 /*}}}*/ 95 void Misfit::Marshall2(MarshallHandle* marshallhandle){/*{{{*/ 96 _error_("not implemented yet!"); 97 } 98 /*}}}*/ 95 99 int Misfit::ObjectEnum(void){/*{{{*/ 96 100 return MisfitEnum; -
issm/trunk-jpl/src/c/classes/Misfit.h
r22441 r25506 39 39 int Id(void); 40 40 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 41 void Marshall2(MarshallHandle* marshallhandle); 41 42 int ObjectEnum(void); 42 43 -
issm/trunk-jpl/src/c/classes/Nodalvalue.cpp
r24379 r25506 67 67 } 68 68 /*}}}*/ 69 void Nodalvalue::Marshall2(MarshallHandle* marshallhandle){/*{{{*/ 70 _error_("not implemented yet!"); 71 } 72 /*}}}*/ 69 73 int Nodalvalue::ObjectEnum(void){/*{{{*/ 70 74 return NodalvalueEnum; -
issm/trunk-jpl/src/c/classes/Nodalvalue.h
r22441 r25506 23 23 char* name; 24 24 int node; 25 25 26 26 /*Nodalvalue constructors, destructors :*/ 27 Nodalvalue();28 Nodalvalue(char* in_name, int in_definitionenum, int in_model_enum, int in_node);29 ~Nodalvalue();27 Nodalvalue(); 28 Nodalvalue(char* in_name, int in_definitionenum, int in_model_enum, int in_node); 29 ~Nodalvalue(); 30 30 31 /*Object virtual function resolutoin: */ 32 Object* copy(); 33 void DeepEcho(void); 34 void Echo(void); 35 int Id(void); 36 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 37 int ObjectEnum(void); 31 /*Object virtual function resolutoin: */ 32 Object* copy(); 33 void DeepEcho(void); 34 void Echo(void); 35 int Id(void); 36 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 37 void Marshall2(MarshallHandle* marshallhandle); 38 int ObjectEnum(void); 38 39 39 /*Definition virtual function resolutoin: */40 int DefinitionEnum();41 char* Name();42 IssmDouble Response(FemModel* femmodel);40 /*Definition virtual function resolutoin: */ 41 int DefinitionEnum(); 42 char* Name(); 43 IssmDouble Response(FemModel* femmodel); 43 44 }; 44 45 -
issm/trunk-jpl/src/c/classes/Node.cpp
r25481 r25506 68 68 this->svalues = xNew<IssmDouble>(this->gsize); 69 69 this->gdoflist = xNew<int>(this->gsize); 70 this->gdoflist_local = xNew <int>(this->gsize);70 this->gdoflist_local = xNewZeroInit<int>(this->gsize); 71 71 this->fsize = -1; 72 72 this->ssize = -1; … … 277 277 MARSHALLING_DYNAMIC(fdoflist_local,int,fsize); 278 278 MARSHALLING_DYNAMIC(sdoflist_local,int,ssize); 279 } /*}}}*/ 280 void Node::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 281 282 int object_enum = NodeEnum; 283 marshallhandle->call(object_enum); 284 285 marshallhandle->call(this->id); 286 marshallhandle->call(this->sid); 287 marshallhandle->call(this->lid); 288 marshallhandle->call(this->pid); 289 marshallhandle->call(this->indexingupdate); 290 marshallhandle->call(this->analysis_enum); 291 292 for(int k=0;k<3;k++) for(int l=0;l<3;l++) marshallhandle->call(this->coord_system[k][l]); 293 294 marshallhandle->call(this->gsize); 295 marshallhandle->call(this->fsize); 296 marshallhandle->call(this->ssize); 297 marshallhandle->call(this->clone); 298 marshallhandle->call(this->active); 299 marshallhandle->call(this->freeze); 300 marshallhandle->call(this->f_set,gsize); 301 marshallhandle->call(this->s_set,gsize); 302 marshallhandle->call(this->svalues,gsize); 303 marshallhandle->call(this->doftype,gsize); 304 marshallhandle->call(this->gdoflist,gsize); 305 marshallhandle->call(this->fdoflist,fsize); 306 marshallhandle->call(this->sdoflist,ssize); 307 marshallhandle->call(this->gdoflist_local,gsize); 308 marshallhandle->call(this->fdoflist_local,fsize); 309 marshallhandle->call(this->sdoflist_local,ssize); 279 310 } /*}}}*/ 280 311 -
issm/trunk-jpl/src/c/classes/Node.h
r23642 r25506 77 77 int Id(); 78 78 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 79 void Marshall2(MarshallHandle* marshallhandle); 79 80 int ObjectEnum(); 80 81 -
issm/trunk-jpl/src/c/classes/Nodes.cpp
r25497 r25506 134 134 if(this->common_recv[i]) MARSHALLING_DYNAMIC(this->common_recv_ids[i],int,this->common_recv[i]); 135 135 if(this->common_send[i]) MARSHALLING_DYNAMIC(this->common_send_ids[i],int,this->common_send[i]); 136 } 137 } 138 /*}}}*/ 139 void Nodes::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 140 141 int object_enum = NodesEnum; 142 marshallhandle->call(object_enum); 143 144 marshallhandle->call(numberofnodes); 145 marshallhandle->call(numberofnodes_local); 146 marshallhandle->call(numberofmasters_local); 147 148 /*Check that restart is compatible!*/ 149 int num_procs=IssmComm::GetSize(); 150 int test = num_procs; 151 marshallhandle->call(test); 152 if(test!=num_procs) _error_("number of cores is not the same as before"); 153 154 DataSet::Marshall2(marshallhandle); 155 156 if(marshallhandle->OperationNumber() == MARSHALLING_LOAD){ 157 this->common_recv_ids = xNew<int*>(num_procs); 158 this->common_send_ids = xNew<int*>(num_procs); 159 for(int i=0;i<num_procs;i++){ 160 this->common_recv_ids[i] = NULL; 161 this->common_send_ids[i] = NULL; 162 } 163 } 164 165 /*Stop here if no nodes*/ 166 if(this->Size()==0) return; 167 168 marshallhandle->call(this->common_recv,num_procs); 169 marshallhandle->call(this->common_send,num_procs); 170 for(int i=0;i<num_procs;i++){ 171 if(this->common_recv[i]) marshallhandle->call(this->common_recv_ids[i],this->common_recv[i]); 172 if(this->common_send[i]) marshallhandle->call(this->common_send_ids[i],this->common_send[i]); 136 173 } 137 174 } -
issm/trunk-jpl/src/c/classes/Nodes.h
r23926 r25506 10 10 class Nodes; 11 11 class Materials; 12 class MarshallHandle; 12 13 13 14 /*!\brief Declaration of Nodes class. … … 36 37 Nodes* Copy(); 37 38 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 39 void Marshall2(MarshallHandle* marshallhandle); 38 40 39 41 /*numerics*/ -
issm/trunk-jpl/src/c/classes/Numberedcostfunction.cpp
r25426 r25506 90 90 } 91 91 /*}}}*/ 92 void Numberedcostfunction::Marshall2(MarshallHandle* marshallhandle){/*{{{*/ 93 _error_("not implemented yet!"); 94 } 95 /*}}}*/ 92 96 int Numberedcostfunction::ObjectEnum(void){/*{{{*/ 93 97 return NumberedcostfunctionEnum; -
issm/trunk-jpl/src/c/classes/Numberedcostfunction.h
r22441 r25506 15 15 class Numberedcostfunction: public Object, public Definition{ 16 16 17 public:17 public: 18 18 19 int definitionenum;20 char* name;21 int number_cost_functions;22 int* cost_functions_list;19 int definitionenum; 20 char* name; 21 int number_cost_functions; 22 int* cost_functions_list; 23 23 24 /*Numberedcostfunction constructors, destructors :*/25 Numberedcostfunction();26 Numberedcostfunction(char* in_name, int in_definitionenum,int number_cost_functions_in,int* cost_functions_list_in);27 ~Numberedcostfunction();24 /*Numberedcostfunction constructors, destructors :*/ 25 Numberedcostfunction(); 26 Numberedcostfunction(char* in_name, int in_definitionenum,int number_cost_functions_in,int* cost_functions_list_in); 27 ~Numberedcostfunction(); 28 28 29 /*Object virtual function resolutoin: */ 30 Object* copy(); 31 void DeepEcho(void); 32 void Echo(void); 33 int Id(void); 34 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 35 int ObjectEnum(void); 29 /*Object virtual function resolutoin: */ 30 Object* copy(); 31 void DeepEcho(void); 32 void Echo(void); 33 int Id(void); 34 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 35 void Marshall2(MarshallHandle* marshallhandle); 36 int ObjectEnum(void); 36 37 37 /*Definition virtual function resolutoin: */38 int DefinitionEnum();39 char* Name();40 IssmDouble Response(FemModel* femmodel);38 /*Definition virtual function resolutoin: */ 39 int DefinitionEnum(); 40 char* Name(); 41 IssmDouble Response(FemModel* femmodel); 41 42 }; 42 43 -
issm/trunk-jpl/src/c/classes/Options/Option.h
r23649 r25506 26 26 int Id(){_error_("Not implemented yet"); }; 27 27 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; 28 void Marshall2(MarshallHandle* marshallhandle){ _error_("not implemented yet!"); }; 28 29 int ObjectEnum(){return OptionEnum;}; 29 30 -
issm/trunk-jpl/src/c/classes/Params/BoolParam.cpp
r23066 r25506 57 57 } 58 58 /*}}}*/ 59 void BoolParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 60 61 int object_enum = BoolParamEnum; 62 marshallhandle->call(object_enum); 63 marshallhandle->call(this->enum_type); 64 marshallhandle->call(this->value); 65 66 }/*}}}*/ 59 67 int BoolParam::ObjectEnum(void){/*{{{*/ 60 68 -
issm/trunk-jpl/src/c/classes/Params/BoolParam.h
r22628 r25506 36 36 int Id(); 37 37 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 38 void Marshall2(MarshallHandle* marshallhandle); 38 39 int ObjectEnum(); 39 40 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Params/DataSetParam.cpp
r25497 r25506 62 62 } 63 63 /*}}}*/ 64 void DataSetParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 65 66 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD)value=new DataSet(); 67 68 int object_enum=DataSetParamEnum; 69 marshallhandle->call(object_enum); 70 marshallhandle->call(this->enum_type); 71 value->Marshall2(marshallhandle); 72 73 } 74 /*}}}*/ 64 75 int DataSetParam::ObjectEnum(void){/*{{{*/ 65 76 -
issm/trunk-jpl/src/c/classes/Params/DataSetParam.h
r22628 r25506 37 37 int Id(); 38 38 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 39 void Marshall2(MarshallHandle* marshallhandle); 39 40 int ObjectEnum(); 40 41 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Params/DoubleMatArrayParam.cpp
r25497 r25506 138 138 } 139 139 /*}}}*/ 140 void DoubleMatArrayParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 141 142 int object_enum = DoubleMatArrayParamEnum; 143 marshallhandle->call(object_enum); 144 145 marshallhandle->call(this->enum_type); 146 marshallhandle->call(this->M); 147 if(M){ 148 marshallhandle->call(this->mdim_array,M); 149 marshallhandle->call(this->ndim_array,M); 150 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD && M) array=xNew<IssmDouble*>(M); 151 for(int i=0;i<M;i++){ 152 marshallhandle->call(this->array[i],mdim_array[i]*ndim_array[i]); 153 } 154 } 155 else{ 156 array=NULL; 157 mdim_array=NULL; 158 ndim_array=NULL; 159 } 160 } 161 /*}}}*/ 140 162 int DoubleMatArrayParam::ObjectEnum(void){/*{{{*/ 141 163 -
issm/trunk-jpl/src/c/classes/Params/DoubleMatArrayParam.h
r22628 r25506 39 39 int Id(); 40 40 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 41 void Marshall2(MarshallHandle* marshallhandle); 41 42 int ObjectEnum(); 42 43 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Params/DoubleMatParam.cpp
r23066 r25506 83 83 } 84 84 /*}}}*/ 85 void DoubleMatParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 86 87 int object_enum = DoubleMatParamEnum; 88 marshallhandle->call(object_enum); 89 90 marshallhandle->call(this->enum_type); 91 marshallhandle->call(this->M); 92 marshallhandle->call(this->N); 93 marshallhandle->call(this->value,M*N); 94 } 95 /*}}}*/ 85 96 86 97 /*DoubleMatParam virtual functions definitions: */ -
issm/trunk-jpl/src/c/classes/Params/DoubleMatParam.h
r22628 r25506 39 39 Param* copy(); 40 40 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 41 void Marshall2(MarshallHandle* marshallhandle); 41 42 /*}}}*/ 42 43 /*Param vritual function definitions: {{{*/ -
issm/trunk-jpl/src/c/classes/Params/DoubleParam.cpp
r20827 r25506 55 55 } 56 56 /*}}}*/ 57 void DoubleParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 58 59 int object_enum = DoubleParamEnum; 60 marshallhandle->call(object_enum); 61 marshallhandle->call(this->enum_type); 62 marshallhandle->call(this->value); 63 64 } 65 /*}}}*/ 57 66 int DoubleParam::ObjectEnum(void){/*{{{*/ 58 67 -
issm/trunk-jpl/src/c/classes/Params/DoubleParam.h
r22643 r25506 37 37 int Id(); 38 38 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 39 void Marshall2(MarshallHandle* marshallhandle); 39 40 int ObjectEnum(); 40 41 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Params/DoubleVecParam.cpp
r23066 r25506 69 69 } 70 70 /*}}}*/ 71 void DoubleVecParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 72 73 int object_enum = DoubleVecParamEnum; 74 marshallhandle->call(object_enum); 75 76 marshallhandle->call(this->enum_type); 77 marshallhandle->call(this->M); 78 marshallhandle->call(this->values,this->M); 79 80 } 81 /*}}}*/ 71 82 int DoubleVecParam::ObjectEnum(void){/*{{{*/ 72 83 -
issm/trunk-jpl/src/c/classes/Params/DoubleVecParam.h
r22628 r25506 37 37 int Id(); 38 38 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 39 void Marshall2(MarshallHandle* marshallhandle); 39 40 int ObjectEnum(); 40 41 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Params/FileParam.cpp
r25497 r25506 59 59 } 60 60 /*}}}*/ 61 void FileParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 62 63 int object_enum = FileParamEnum; 64 marshallhandle->call(object_enum); 65 66 marshallhandle->call(this->enum_type); 67 marshallhandle->call(this->value); 68 69 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){ 70 this->value=NULL; //meaningless file pointer! 71 } 72 73 } 74 /*}}}*/ 61 75 int FileParam::ObjectEnum(void){/*{{{*/ 62 76 -
issm/trunk-jpl/src/c/classes/Params/FileParam.h
r22628 r25506 36 36 int Id(); 37 37 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 38 void Marshall2(MarshallHandle* marshallhandle); 38 39 int ObjectEnum(); 39 40 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Params/GenericParam.h
r22628 r25506 56 56 /*Nothing for now*/ 57 57 } 58 void Marshall2(MarshallHandle* marshallhandle){ 59 _printf_(" WARNING: parameter "<<EnumToStringx(this->myEnumVal)<<" is a GenericParam and cannot be marshalled\n"); 60 /*Nothing for now*/ 61 } 58 62 int ObjectEnum() {return GenericParamEnum;}; 59 63 -
issm/trunk-jpl/src/c/classes/Params/IntMatParam.cpp
r20827 r25506 77 77 } 78 78 /*}}}*/ 79 void IntMatParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 80 81 int object_enum = IntMatParamEnum; 82 marshallhandle->call(object_enum); 83 84 marshallhandle->call(this->enum_type); 85 marshallhandle->call(this->M); 86 marshallhandle->call(this->N); 87 marshallhandle->call(this->value,M*N); 88 } 89 /*}}}*/ 79 90 int IntMatParam::ObjectEnum(void){/*{{{*/ 80 91 -
issm/trunk-jpl/src/c/classes/Params/IntMatParam.h
r22628 r25506 38 38 int Id(); 39 39 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 40 void Marshall2(MarshallHandle* marshallhandle); 40 41 int ObjectEnum(); 41 42 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Params/IntParam.cpp
r23066 r25506 58 58 } 59 59 /*}}}*/ 60 void IntParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 61 62 int object_enum = IntParamEnum; 63 marshallhandle->call(object_enum); 64 65 marshallhandle->call(this->enum_type); 66 marshallhandle->call(this->value); 67 }/*}}}*/ 60 68 int IntParam::ObjectEnum(void){/*{{{*/ 61 69 -
issm/trunk-jpl/src/c/classes/Params/IntParam.h
r22628 r25506 37 37 int Id(); 38 38 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 39 void Marshall2(MarshallHandle* marshallhandle); 39 40 int ObjectEnum(); 40 41 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Params/IntVecParam.cpp
r22557 r25506 83 83 } 84 84 /*}}}*/ 85 void IntVecParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 86 87 int object_enum = IntVecParamEnum; 88 marshallhandle->call(object_enum); 89 90 marshallhandle->call(this->enum_type); 91 marshallhandle->call(this->M); 92 if(M){ 93 marshallhandle->call(this->values,M); 94 } 95 else{ 96 this->values=NULL; 97 } 98 99 } 100 /*}}}*/ 85 101 int IntVecParam::ObjectEnum(void){/*{{{*/ 86 102 -
issm/trunk-jpl/src/c/classes/Params/IntVecParam.h
r22628 r25506 38 38 int Id(); 39 39 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 40 void Marshall2(MarshallHandle* marshallhandle); 40 41 int ObjectEnum(); 41 42 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Params/MatrixParam.h
r22628 r25506 37 37 int Id(); 38 38 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; 39 void Marshall2(MarshallHandle* marshallhandle){ _error_("not implemented yet!"); }; 39 40 int ObjectEnum(); 40 41 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Params/Param.h
r22628 r25506 45 45 virtual void GetParameterValue(DataSet** pdataset)=0; 46 46 virtual int InstanceEnum()=0; 47 virtual void Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction)=0; 47 virtual void Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction)=0; 48 virtual void Marshall2(MarshallHandle* marshallhandle)=0; 48 49 virtual int ObjectEnum()=0; 49 50 -
issm/trunk-jpl/src/c/classes/Params/Parameters.cpp
r25497 r25506 239 239 } 240 240 /*}}}*/ 241 void Parameters::Marshall2(MarshallHandle* marshallhandle){/*{{{*/ 242 243 int num_params=0; 244 int obj_enum= ParametersEnum; 245 marshallhandle->call(obj_enum); 246 247 if(marshallhandle->OperationNumber()==MARSHALLING_WRITE || marshallhandle->OperationNumber()==MARSHALLING_SIZE){ 248 249 /*Marshall num_params first*/ 250 for(int i=0;i<NUMPARAMS;i++){ 251 if(this->params[i]) num_params++; 252 } 253 marshallhandle->call(num_params); 254 255 /*Marshall Parameters one by one now*/ 256 for(int i=0;i<NUMPARAMS;i++){ 257 if(this->params[i]){ 258 obj_enum = this->params[i]->ObjectEnum(); 259 marshallhandle->call(obj_enum); 260 this->params[i]->Marshall2(marshallhandle); 261 } 262 } 263 264 } 265 else{ 266 267 /*Get number of params marshalled*/ 268 marshallhandle->call(num_params); 269 270 /*Recover parameters one by one*/ 271 for(int i=0;i<num_params;i++){ 272 273 /*Recover enum of object first: */ 274 marshallhandle->call(obj_enum); 275 276 if(obj_enum==DoubleParamEnum){ 277 DoubleParam* doubleparam=NULL; 278 doubleparam=new DoubleParam(); 279 doubleparam->Marshall2(marshallhandle); 280 this->AddObject(doubleparam); 281 } 282 else if(obj_enum==IntParamEnum){ 283 IntParam* intparam=NULL; 284 intparam=new IntParam(); 285 intparam->Marshall2(marshallhandle); 286 this->AddObject(intparam); 287 } 288 else if(obj_enum==IntMatParamEnum){ 289 IntMatParam* intmparam=NULL; 290 intmparam=new IntMatParam(); 291 intmparam->Marshall2(marshallhandle); 292 this->AddObject(intmparam); 293 } 294 else if(obj_enum==IntVecParamEnum){ 295 IntVecParam* intvparam=NULL; 296 intvparam=new IntVecParam(); 297 intvparam->Marshall2(marshallhandle); 298 this->AddObject(intvparam); 299 } 300 else if(obj_enum==BoolParamEnum){ 301 BoolParam* boolparam=NULL; 302 boolparam=new BoolParam(); 303 boolparam->Marshall2(marshallhandle); 304 this->AddObject(boolparam); 305 } 306 else if(obj_enum==DataSetParamEnum){ 307 DataSetParam* dsparam=NULL; 308 dsparam=new DataSetParam(); 309 dsparam->Marshall2(marshallhandle); 310 this->AddObject(dsparam); 311 } 312 else if(obj_enum==DoubleMatArrayParamEnum){ 313 DoubleMatArrayParam* dmaparam=NULL; 314 dmaparam=new DoubleMatArrayParam(); 315 dmaparam->Marshall2(marshallhandle); 316 this->AddObject(dmaparam); 317 } 318 else if(obj_enum==DoubleMatParamEnum){ 319 DoubleMatParam* dmparam=NULL; 320 dmparam=new DoubleMatParam(); 321 dmparam->Marshall2(marshallhandle); 322 this->AddObject(dmparam); 323 } 324 else if(obj_enum==DoubleVecParamEnum){ 325 DoubleVecParam* dvparam=NULL; 326 dvparam=new DoubleVecParam(); 327 dvparam->Marshall2(marshallhandle); 328 this->AddObject(dvparam); 329 } 330 else if(obj_enum==FileParamEnum){ 331 FileParam* fileparam=NULL; 332 fileparam=new FileParam(); 333 fileparam->Marshall2(marshallhandle); 334 delete fileparam; 335 /* FIXME: No need to add this object, the pointer is not valid 336 The FemModel should reset all FileParams in the restart function */ 337 } 338 else if(obj_enum==StringParamEnum){ 339 StringParam* sparam=NULL; 340 sparam=new StringParam(); 341 sparam->Marshall2(marshallhandle); 342 this->AddObject(sparam); 343 } 344 else if(obj_enum==StringArrayParamEnum){ 345 StringArrayParam* saparam=NULL; 346 saparam=new StringArrayParam(); 347 saparam->Marshall2(marshallhandle); 348 this->AddObject(saparam); 349 } 350 else if(obj_enum==TransientParamEnum){ 351 TransientParam* transparam=NULL; 352 transparam=new TransientParam(); 353 transparam->Marshall2(marshallhandle); 354 this->AddObject(transparam); 355 } 356 else if(obj_enum==TransientArrayParamEnum){ 357 TransientArrayParam* transarrayparam=NULL; 358 transarrayparam=new TransientArrayParam(); 359 transarrayparam->Marshall2(marshallhandle); 360 this->AddObject(transarrayparam); 361 } 362 else if(obj_enum==GenericParamEnum){ 363 /*Skip for now (we don't want to Marhsall Comms)*/ 364 } 365 } 366 } 367 } 368 /*}}}*/ 241 369 242 370 /*Object management*/ -
issm/trunk-jpl/src/c/classes/Params/Parameters.h
r24152 r25506 36 36 bool Exist(int enum_type); 37 37 void Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction); 38 void Marshall2(MarshallHandle* marshallhandle); 38 39 39 40 void FindParam(bool* pinteger,int enum_type); -
issm/trunk-jpl/src/c/classes/Params/StringArrayParam.cpp
r25497 r25506 99 99 } 100 100 /*}}}*/ 101 void StringArrayParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 102 103 int* sizes=NULL; 104 105 if(marshallhandle->OperationNumber()==MARSHALLING_WRITE || marshallhandle->OperationNumber()==MARSHALLING_SIZE){ 106 if(this->numstrings)sizes=xNew<int>(this->numstrings); 107 for(int i=0;i<numstrings;i++)sizes[i]=strlen(this->value[i])+1; 108 } 109 110 int object_enum = StringArrayParamEnum; 111 marshallhandle->call(object_enum); 112 113 marshallhandle->call(this->enum_type); 114 marshallhandle->call(this->numstrings); 115 116 if(this->numstrings){ 117 marshallhandle->call(sizes,this->numstrings); 118 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){ 119 this->value=xNew<char*>(this->numstrings); 120 } 121 for(int i=0;i<numstrings;i++){ 122 marshallhandle->call(this->value[i],sizes[i]); 123 } 124 } 125 else{ 126 value=NULL; 127 } 128 129 //cleanup sizes array 130 if(sizes) xDelete<int>(sizes); 131 132 } 133 /*}}}*/ 101 134 int StringArrayParam::ObjectEnum(void){/*{{{*/ 102 135 -
issm/trunk-jpl/src/c/classes/Params/StringArrayParam.h
r22628 r25506 37 37 int Id(); 38 38 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 39 void Marshall2(MarshallHandle* marshallhandle); 39 40 int ObjectEnum(); 40 41 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Params/StringParam.cpp
r25497 r25506 63 63 } 64 64 /*}}}*/ 65 void StringParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 66 67 int size = 0; 68 if(marshallhandle->OperationNumber()==MARSHALLING_WRITE || marshallhandle->OperationNumber() == MARSHALLING_SIZE){ 69 size=strlen(value)+1; 70 } 71 72 int object_enum = StringParamEnum; 73 marshallhandle->call(object_enum); 74 75 marshallhandle->call(this->enum_type); 76 marshallhandle->call(size); 77 marshallhandle->call(this->value,size); 78 } 79 /*}}}*/ 65 80 int StringParam::ObjectEnum(void){/*{{{*/ 66 81 -
issm/trunk-jpl/src/c/classes/Params/StringParam.h
r22628 r25506 37 37 int Id(); 38 38 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 39 void Marshall2(MarshallHandle* marshallhandle); 39 40 int ObjectEnum(); 40 41 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Params/TransientArrayParam.cpp
r25497 r25506 89 89 90 90 }/*}}}*/ 91 void TransientArrayParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 92 93 int object_enum = TransientArrayParamEnum; 94 marshallhandle->call(object_enum); 95 96 marshallhandle->call(this->enum_type); 97 marshallhandle->call(this->interpolation); 98 marshallhandle->call(this->M); 99 marshallhandle->call(this->N); 100 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){ 101 values = xNew<IssmDouble>(M*N); 102 timesteps = xNew<IssmDouble>(N); 103 } 104 marshallhandle->call(this->values,M*N); 105 marshallhandle->call(this->timesteps,N); 106 107 }/*}}}*/ 91 108 int TransientArrayParam::ObjectEnum(void){/*{{{*/ 92 109 -
issm/trunk-jpl/src/c/classes/Params/TransientArrayParam.h
r22628 r25506 40 40 int Id(); 41 41 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 42 void Marshall2(MarshallHandle* marshallhandle); 42 43 int ObjectEnum(); 43 44 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Params/TransientParam.cpp
r25497 r25506 84 84 } 85 85 /*}}}*/ 86 void TransientParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 87 88 int object_enum = TransientParamEnum; 89 marshallhandle->call(object_enum); 90 91 marshallhandle->call(this->enum_type); 92 marshallhandle->call(this->interpolation); 93 marshallhandle->call(this->N); 94 if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){ 95 values=xNew<IssmDouble>(N); 96 timesteps=xNew<IssmDouble>(N); 97 } 98 marshallhandle->call(this->values,N); 99 marshallhandle->call(this->timesteps,N); 100 101 } 102 /*}}}*/ 86 103 int TransientParam::ObjectEnum(void){/*{{{*/ 87 104 -
issm/trunk-jpl/src/c/classes/Params/TransientParam.h
r22628 r25506 39 39 int Id(); 40 40 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 41 void Marshall2(MarshallHandle* marshallhandle); 41 42 int ObjectEnum(); 42 43 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Params/VectorParam.cpp
r20827 r25506 58 58 } 59 59 /*}}}*/ 60 int 60 int VectorParam::Id(void){ return -1; }/*{{{*/ 61 61 /*}}}*/ 62 62 int VectorParam::ObjectEnum(void){/*{{{*/ -
issm/trunk-jpl/src/c/classes/Params/VectorParam.h
r22628 r25506 37 37 int Id(); 38 38 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; 39 void Marshall2(MarshallHandle* marshallhandle){ _error_("not implemented yet!"); }; 39 40 int ObjectEnum(); 40 41 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Profiler.cpp
r23221 r25506 80 80 81 81 } /*}}}*/ 82 void Profiler::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 83 84 IssmPDouble* pointer = NULL; 85 bool* bpointer = NULL; 86 87 int object_enum = ProfilerEnum; 88 marshallhandle->call(object_enum); 89 pointer = &this->time[0]; 90 marshallhandle->call(pointer,MAXPROFSIZE); 91 pointer = &this->flops[0]; 92 marshallhandle->call(pointer,MAXPROFSIZE); 93 pointer = &this->memory[0]; 94 marshallhandle->call(pointer,MAXPROFSIZE); 95 bpointer = &this->running[0]; 96 marshallhandle->call(bpointer,MAXPROFSIZE); 97 98 } /*}}}*/ 82 99 int Profiler::ObjectEnum(void){/*{{{*/ 83 100 return ProfilerEnum; -
issm/trunk-jpl/src/c/classes/Profiler.h
r23473 r25506 53 53 int Id(); 54 54 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 55 void Marshall2(MarshallHandle* marshallhandle); 55 56 int ObjectEnum(); 56 57 -
issm/trunk-jpl/src/c/classes/Radar.cpp
r25379 r25506 59 59 /*}}}*/ 60 60 void Radar::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/ 61 _error_("not implemented yet!"); 62 } 63 /*}}}*/ 64 void Radar::Marshall2(MarshallHandle* marshallhandle){/*{{{*/ 61 65 _error_("not implemented yet!"); 62 66 } -
issm/trunk-jpl/src/c/classes/Radar.h
r24211 r25506 28 28 void DeepEcho(void); 29 29 void Echo(void); 30 int Id(void);30 int Id(void); 31 31 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 32 void Marshall2(MarshallHandle* marshallhandle); 32 33 int ObjectEnum(void); 33 34 -
issm/trunk-jpl/src/c/classes/Regionaloutput.cpp
r23066 r25506 64 64 /*}}}*/ 65 65 void Regionaloutput::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/ 66 _error_("not implemented yet!"); 67 } 68 /*}}}*/ 69 void Regionaloutput::Marshall2(MarshallHandle* marshallhandle){/*{{{*/ 66 70 _error_("not implemented yet!"); 67 71 } -
issm/trunk-jpl/src/c/classes/Regionaloutput.h
r22441 r25506 22 22 IssmDouble* mask; 23 23 int M; 24 25 /*Regionalicevolume: constructors, destructors :*/26 Regionaloutput();27 Regionaloutput(char* in_name, int in_definitionenum, char* in_outputname, IssmDouble* maskin, int Min);28 ~Regionaloutput();29 24 30 /*Object virtual function resolutoin: */ 31 Object* copy(); 32 void DeepEcho(void); 33 void Echo(void); 34 int Id(void); 35 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 36 int ObjectEnum(void); 25 /*Regionalicevolume: constructors, destructors :*/ 26 Regionaloutput(); 27 Regionaloutput(char* in_name, int in_definitionenum, char* in_outputname, IssmDouble* maskin, int Min); 28 ~Regionaloutput(); 37 29 38 /*Definition virtual function resolutoin: */ 39 int DefinitionEnum(); 40 char* Name(); 41 IssmDouble Response(FemModel* femmodel); 30 /*Object virtual function resolutoin: */ 31 Object* copy(); 32 void DeepEcho(void); 33 void Echo(void); 34 int Id(void); 35 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 36 void Marshall2(MarshallHandle* marshallhandle); 37 int ObjectEnum(void); 38 39 /*Definition virtual function resolutoin: */ 40 int DefinitionEnum(); 41 char* Name(); 42 IssmDouble Response(FemModel* femmodel); 42 43 }; 43 44 #endif /* _REGIONALOUTPUT_H_ */ -
issm/trunk-jpl/src/c/classes/Segment.h
r20810 r25506 69 69 } 70 70 /*}}}*/ 71 void Marshall2(MarshallHandle* marshallhandle){/*{{{*/ 72 _error_("not implemented yet!"); 73 } 74 /*}}}*/ 71 75 int ObjectEnum(void){/*{{{*/ 72 76 -
issm/trunk-jpl/src/c/classes/Vertex.cpp
r23640 r25506 128 128 MARSHALLING(sigma); 129 129 MARSHALLING(connectivity); 130 131 } 132 /*}}}*/ 133 void Vertex::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 134 135 int object_enum = VertexEnum; 136 marshallhandle->call(object_enum); 137 138 marshallhandle->call(this->clone); 139 marshallhandle->call(this->domaintype); 140 marshallhandle->call(this->id); 141 marshallhandle->call(this->sid); 142 marshallhandle->call(this->pid); 143 marshallhandle->call(this->lid); 144 marshallhandle->call(this->x); 145 marshallhandle->call(this->y); 146 marshallhandle->call(this->z); 147 marshallhandle->call(this->sigma); 148 marshallhandle->call(this->connectivity); 130 149 131 150 } -
issm/trunk-jpl/src/c/classes/Vertex.h
r23640 r25506 47 47 Object* copy(); 48 48 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 49 void Marshall2(MarshallHandle* marshallhandle); 49 50 50 51 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Vertices.cpp
r25497 r25506 133 133 } 134 134 /*}}}*/ 135 void Vertices::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 136 137 int object_enum = VerticesEnum; 138 marshallhandle->call(object_enum); 139 140 /*Check compatibility*/ 141 int num_procs=IssmComm::GetSize(); 142 int test = num_procs; 143 marshallhandle->call(test); 144 if(test!=num_procs) _error_("number of cores is not the same as before"); 145 146 marshallhandle->call(this->numberofvertices); 147 marshallhandle->call(this->numberofvertices_local); 148 marshallhandle->call(this->numberofmasters_local); 149 150 marshallhandle->call(this->common_recv,num_procs); 151 marshallhandle->call(this->common_send,num_procs); 152 if(marshallhandle->OperationNumber() == MARSHALLING_LOAD){ 153 this->common_recv_ids = xNew<int*>(num_procs); 154 this->common_send_ids = xNew<int*>(num_procs); 155 } 156 for(int i=0;i<num_procs;i++){ 157 marshallhandle->call(this->common_recv_ids[i],this->common_recv[i]); 158 marshallhandle->call(this->common_send_ids[i],this->common_send[i]); 159 } 160 DataSet::Marshall2(marshallhandle); 161 } 162 /*}}}*/ 135 163 void Vertices::LatLonList(IssmDouble** plat,IssmDouble** plon){/*{{{*/ 136 164 -
issm/trunk-jpl/src/c/classes/Vertices.h
r24335 r25506 32 32 Vertices* Copy(); 33 33 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 34 void Marshall2(MarshallHandle* marshallhandle); 34 35 35 36 /*numerics:*/ -
issm/trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h
r20827 r25506 27 27 int Id(){_error_("Not implemented yet");}; 28 28 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; 29 void Marshall2(MarshallHandle* marshallhandle){ _error_("not implemented yet!"); }; 29 30 int ObjectEnum(){_error_("Not implemented yet");}; 30 31 -
issm/trunk-jpl/src/c/classes/kriging/GaussianVariogram.h
r20827 r25506 28 28 int Id(){_error_("Not implemented yet");}; 29 29 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; 30 void Marshall2(MarshallHandle* marshallhandle){ _error_("not implemented yet!"); }; 30 31 int ObjectEnum(){_error_("Not implemented yet");}; 31 32 -
issm/trunk-jpl/src/c/classes/kriging/Observation.h
r20827 r25506 31 31 int Id() {_error_("Not implemented yet"); }; 32 32 void print() const; 33 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!");}; 33 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!");}; 34 void Marshall2(MarshallHandle* marshallhandle){ _error_("not implemented yet!");}; 34 35 int ObjectEnum(){_error_("Not implemented yet"); }; 35 36 -
issm/trunk-jpl/src/c/classes/kriging/PowerVariogram.h
r20827 r25506 27 27 int Id(){_error_("Not implemented yet");}; 28 28 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; 29 void Marshall2(MarshallHandle* marshallhandle){ _error_("not implemented yet!"); }; 29 30 int ObjectEnum(){_error_("Not implemented yet");}; 30 31 -
issm/trunk-jpl/src/c/classes/kriging/Quadtree.h
r20827 r25506 30 30 void Echo(); 31 31 int Id() {_error_("not implemented yet"); }; 32 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!");}; 32 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!");}; 33 void Marshall2(MarshallHandle* marshallhandle){ _error_("not implemented yet!");}; 33 34 int ObjectEnum(){_error_("not implemented yet"); }; 34 35 -
issm/trunk-jpl/src/c/classes/kriging/SphericalVariogram.h
r20827 r25506 26 26 void Echo(); 27 27 int Id(){_error_("Not implemented yet");}; 28 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; 28 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; 29 void Marshall2(MarshallHandle* marshallhandle){ _error_("not implemented yet!"); }; 29 30 int ObjectEnum(){_error_("Not implemented yet");}; 30 31 -
issm/trunk-jpl/src/c/datastructures/DataSet.cpp
r25497 r25506 242 242 GenericExternalResult<double>* result=new GenericExternalResult<double>(); 243 243 result->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 244 result->Echo(); 244 this->AddObject(result); 245 } 246 else _error_("could not recognize enum type: " << obj_enum << ": " << EnumToStringx(obj_enum) ); 247 } 248 } 249 } 250 /*}}}*/ 251 void DataSet::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/ 252 253 vector<Object*>::iterator obj; 254 int obj_size=0; 255 int obj_enum=0; 256 int i; 257 258 if(marshallhandle->OperationNumber()==MARSHALLING_WRITE || marshallhandle->OperationNumber()==MARSHALLING_SIZE){ 259 obj_size=objects.size(); 260 } 261 else{ 262 clear(); 263 } 264 265 int object_enum = DataSetEnum; 266 marshallhandle->call(object_enum); 267 268 marshallhandle->call(this->enum_type); 269 marshallhandle->call(this->sorted); 270 marshallhandle->call(this->presorted); 271 marshallhandle->call(this->numsorted); 272 273 /*Now branch according to direction of marshalling: */ 274 if(marshallhandle->OperationNumber()==MARSHALLING_WRITE || marshallhandle->OperationNumber()==MARSHALLING_SIZE){ 275 if(!(this->sorted && numsorted>0 && this->id_offsets)){ 276 this->sorted_ids=NULL; 277 this->id_offsets=NULL; 278 } 279 marshallhandle->call(this->sorted_ids,numsorted); 280 marshallhandle->call(this->id_offsets,numsorted); 281 marshallhandle->call(obj_size); 282 283 /*Go through our objects, and marshall them into the buffer: */ 284 for( obj=this->objects.begin() ; obj < this->objects.end(); obj++ ){ 285 obj_enum=(*obj)->ObjectEnum(); 286 marshallhandle->call(obj_enum); 287 (*obj)->Marshall2(marshallhandle); 288 } 289 } 290 else{ 291 292 marshallhandle->call(this->sorted_ids,numsorted); 293 marshallhandle->call(this->id_offsets,numsorted); 294 if (!(this->sorted && numsorted>0)){ 295 sorted_ids=NULL; 296 id_offsets=NULL; 297 } 298 marshallhandle->call(obj_size); 299 300 /*This is the heart of the demashalling method. We have a buffer coming 301 in, and we are supposed to create a dataset out of it. No such thing 302 as class orientation for buffers, we need to key off the enum of each 303 object stored in the buffer. */ 304 for(i=0;i<obj_size;i++){ 305 306 /*Recover enum of object first: */ 307 marshallhandle->call(obj_enum); 308 309 /*Giant case statement to spin-up the right object, and demarshall into it the information 310 *stored in the buffer: */ 311 if(obj_enum==NodeEnum){ 312 Node* node=NULL; 313 node=new Node(); 314 node->Marshall2(marshallhandle); 315 this->AddObject(node); 316 } 317 else if(obj_enum==VertexEnum){ 318 Vertex* vertex=NULL; 319 vertex=new Vertex(); 320 vertex->Marshall2(marshallhandle); 321 this->AddObject(vertex); 322 } 323 else if(obj_enum==MaticeEnum){ 324 Matice* matice=NULL; 325 matice=new Matice(); 326 matice->Marshall2(marshallhandle); 327 this->AddObject(matice); 328 } 329 else if(obj_enum==MatestarEnum){ 330 Matestar* matestar=NULL; 331 matestar=new Matestar(); 332 matestar->Marshall2(marshallhandle); 333 this->AddObject(matestar); 334 } 335 else if(obj_enum==SpcStaticEnum){ 336 SpcStatic* spcstatic=NULL; 337 spcstatic=new SpcStatic(); 338 spcstatic->Marshall2(marshallhandle); 339 this->AddObject(spcstatic); 340 } 341 else if(obj_enum==SpcDynamicEnum){ 342 SpcDynamic* spcdynamic=NULL; 343 spcdynamic=new SpcDynamic(); 344 spcdynamic->Marshall2(marshallhandle); 345 this->AddObject(spcdynamic); 346 } 347 else if(obj_enum==SpcTransientEnum){ 348 SpcTransient* spctransient=NULL; 349 spctransient=new SpcTransient(); 350 spctransient->Marshall2(marshallhandle); 351 this->AddObject(spctransient); 352 } 353 else if(obj_enum==TriaEnum){ 354 Tria* tria=NULL; 355 tria=new Tria(); 356 tria->Marshall2(marshallhandle); 357 this->AddObject(tria); 358 } 359 else if(obj_enum==PentaEnum){ 360 Penta* penta=NULL; 361 penta=new Penta(); 362 penta->Marshall2(marshallhandle); 363 this->AddObject(penta); 364 } 365 else if(obj_enum==TetraEnum){ 366 Tetra* tetra=NULL; 367 tetra=new Tetra(); 368 tetra->Marshall2(marshallhandle); 369 this->AddObject(tetra); 370 } 371 else if(obj_enum==SegEnum){ 372 Seg* seg=NULL; 373 seg=new Seg(); 374 seg->Marshall2(marshallhandle); 375 this->AddObject(seg); 376 } 377 else if(obj_enum==RiftfrontEnum){ 378 Riftfront* rift=NULL; 379 rift=new Riftfront(); 380 rift->Marshall2(marshallhandle); 381 this->AddObject(rift); 382 } 383 else if(obj_enum==NumericalfluxEnum){ 384 Numericalflux* numflux=NULL; 385 numflux=new Numericalflux(); 386 numflux->Marshall2(marshallhandle); 387 this->AddObject(numflux); 388 } 389 else if(obj_enum==PengridEnum){ 390 Pengrid* pengrid=NULL; 391 pengrid=new Pengrid(); 392 pengrid->Marshall2(marshallhandle); 393 this->AddObject(pengrid); 394 } 395 else if(obj_enum==PenpairEnum){ 396 Penpair* penpair=NULL; 397 penpair=new Penpair(); 398 penpair->Marshall2(marshallhandle); 399 this->AddObject(penpair); 400 } 401 else if(obj_enum==DoubleExternalResultEnum){ 402 GenericExternalResult<double>* result=new GenericExternalResult<double>(); 403 result->Marshall2(marshallhandle); 245 404 this->AddObject(result); 246 405 } … … 334 493 Object* DataSet::GetObjectByOffset(int offset){/*{{{*/ 335 494 495 if(this->Size()<=offset) this->Echo(); 496 336 497 /*Check index in debugging mode*/ 337 498 _assert_(this!=NULL); -
issm/trunk-jpl/src/c/datastructures/DataSet.h
r19198 r25506 7 7 /*forward declarations */ 8 8 class Object; 9 class MarshallHandle; 9 10 10 11 /*! \brief Declaration of DataSet class … … 34 35 ~DataSet(); 35 36 void Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction); 37 void Marshall2(MarshallHandle* marshallhandle); 36 38 37 39 /*management*/ -
issm/trunk-jpl/src/c/datastructures/Object.h
r19198 r25506 22 22 virtual Object* copy()=0; 23 23 virtual void Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction)=0; 24 virtual void Marshall2(MarshallHandle* marshallhandle)=0; 24 25 25 26 }; -
issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h
r25497 r25506 6 6 #define _MARSHALLING_H_ 7 7 8 enum marshall_directions{ 8 #include <string.h> 9 #include "../../Exceptions/exceptions.h" 10 #include "../../MemOps/MemOps.h" 11 #include "../../Numerics/recast.h" 12 13 /*Define Marshall operation Enums first*/ 14 enum MarshallOpEnum{ 9 15 MARSHALLING_WRITE, 10 16 MARSHALLING_LOAD, 11 MARSHALLING_SIZE 17 MARSHALLING_SIZE, 12 18 }; 19 20 /*Define virtual Marshall Handle*/ 21 class MarshallHandle{ 22 public: 23 MarshallOpEnum operation_enum; 24 MarshallHandle(MarshallOpEnum op_in) : operation_enum(op_in){} 25 ~MarshallHandle(){} 26 virtual void Echo(void)=0; 27 int OperationNumber(){return operation_enum;} 28 template<typename T> void call(T & value); 29 template<typename T> void call(T* & value,int size); 30 }; 31 32 /*Make sure to pass all fields by reference!*/ 33 class WriteCheckpointFunctor: public MarshallHandle{ 34 public: 35 char** pmarshalled_data; 36 WriteCheckpointFunctor(char** pmarshalled_data_in) : MarshallHandle(MARSHALLING_WRITE),pmarshalled_data(pmarshalled_data_in){} 37 template<typename T> void call(T & value){ 38 memcpy(*pmarshalled_data,&value,sizeof(T)); 39 *pmarshalled_data+=sizeof(T); 40 } 41 void Echo(void){ 42 printf("WriteCheckpointFunctor Echo:\n"); 43 printf(" pmarshalled_data: %p\n",pmarshalled_data); 44 } 45 template<typename T> void call(T* & value,int size){ 46 bool pointer_null = true; 47 if(value) pointer_null = false; 48 call(pointer_null); 49 if(value){ 50 memcpy(*pmarshalled_data,value,size*sizeof(T)); 51 *pmarshalled_data+=size*sizeof(T); 52 } 53 } 54 }; 55 56 class LoadCheckpointFunctor: public MarshallHandle{ 57 public: 58 char** pmarshalled_data; 59 LoadCheckpointFunctor(char** pmarshalled_data_in) : MarshallHandle(MARSHALLING_LOAD),pmarshalled_data(pmarshalled_data_in){} 60 void Echo(void){ 61 printf("LoadCheckpointFunctor Echo:\n"); 62 printf(" pmarshalled_data: %p\n",pmarshalled_data); 63 } 64 template<typename T> void call(T & value){ 65 memcpy(&value,*pmarshalled_data,sizeof(T)); 66 *pmarshalled_data+=sizeof(T); 67 } 68 template<typename T> void call(T* & value,int size){ 69 bool pointer_null; 70 call(pointer_null); 71 if(!pointer_null){ 72 value=xNew<T>(size); 73 memcpy(value,*pmarshalled_data,size*sizeof(T)); 74 *pmarshalled_data+=size*sizeof(T); 75 } 76 else{ 77 value = NULL; 78 } 79 } 80 }; 81 82 class SizeCheckpointFunctor: public MarshallHandle{ 83 public: 84 int marshalled_data_size; 85 SizeCheckpointFunctor(void) : MarshallHandle(MARSHALLING_SIZE),marshalled_data_size(0){} 86 int MarshalledSize(void){return this->marshalled_data_size;}; 87 void Echo(void){ 88 printf("SizeCheckpointFunctor Echo:\n"); 89 printf(" marshalled_data_size: %i\n",marshalled_data_size); 90 } 91 template<typename T> void call(T & value){ 92 marshalled_data_size+=sizeof(T); 93 } 94 template<typename T> void call(T* & value,int size){ 95 bool pointer_null = true; 96 if(value) pointer_null = false; 97 this->call(pointer_null); 98 if(!pointer_null){ 99 marshalled_data_size+=size*sizeof(T); 100 } 101 } 102 }; 103 104 template<typename T> void MarshallHandle::call(T & value){ 105 switch(OperationNumber()){ 106 case MARSHALLING_WRITE:{WriteCheckpointFunctor* temp = xDynamicCast<WriteCheckpointFunctor*>(this); temp->call(value); break;} 107 case MARSHALLING_LOAD: {LoadCheckpointFunctor* temp = xDynamicCast<LoadCheckpointFunctor*>(this); temp->call(value); break;} 108 case MARSHALLING_SIZE: {SizeCheckpointFunctor* temp = xDynamicCast<SizeCheckpointFunctor*>(this); temp->call(value); break;} 109 default: _error_("not supported yet"); 110 } 111 } 112 template<typename T> void MarshallHandle::call(T* & value,int size){ 113 switch(OperationNumber()){ 114 case MARSHALLING_WRITE:{WriteCheckpointFunctor* temp = xDynamicCast<WriteCheckpointFunctor*>(this); temp->call(value,size); break;} 115 case MARSHALLING_LOAD: {LoadCheckpointFunctor* temp = xDynamicCast<LoadCheckpointFunctor*>(this); temp->call(value,size); break;} 116 case MARSHALLING_SIZE: {SizeCheckpointFunctor* temp = xDynamicCast<SizeCheckpointFunctor*>(this); temp->call(value,size); break;} 117 default: _error_("not supported yet"); 118 } 119 } 13 120 14 121 #define MARSHALLING_ENUM(EN)\ -
issm/trunk-jpl/src/c/toolkits/issm/Bucket.h
r19198 r25506 133 133 } 134 134 /*}}}*/ 135 void Marshall2(MarshallHandle* marshallhandle){/*{{{*/ 136 _error_("not implemented yet!"); 137 } 138 /*}}}*/ 135 139 136 140 /*specific routines of Bucket: */
Note:
See TracChangeset
for help on using the changeset viewer.