Changeset 19254
- Timestamp:
- 04/03/15 18:53:41 (10 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 64 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/classes/Constraints/SpcDynamic.cpp ¶
r18931 r19254 77 77 } 78 78 /*}}}*/ 79 void SpcDynamic::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 80 81 MARSHALLING_ENUM(SpcDynamicEnum); 82 83 MARSHALLING(sid); 84 MARSHALLING(nodeid); 85 MARSHALLING(dof); 86 MARSHALLING(value); 87 MARSHALLING(analysis_type); 88 MARSHALLING(isset); 89 MARSHALLING(penalty); 90 91 } 92 /*}}}*/ 79 93 80 94 /*Constraint virtual functions definitions: */ -
TabularUnified issm/trunk-jpl/src/c/classes/Constraints/SpcDynamic.h ¶
r19198 r19254 35 35 int Id(); 36 36 int ObjectEnum(); 37 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };37 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 38 38 39 39 /*Constraint virtual functions definitions*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Constraints/SpcStatic.cpp ¶
r19216 r19254 79 79 } 80 80 /*}}}*/ 81 void 81 void SpcStatic::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 82 82 83 83 MARSHALLING_ENUM(SpcStaticEnum); -
TabularUnified issm/trunk-jpl/src/c/classes/Constraints/SpcTransient.cpp ¶
r18966 r19254 85 85 } 86 86 /*}}}*/ 87 void SpcTransient::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 88 89 MARSHALLING_ENUM(SpcStaticEnum); 90 91 MARSHALLING(sid); 92 MARSHALLING(nodeid); 93 MARSHALLING(dof); 94 MARSHALLING(analysis_type); 95 MARSHALLING(penalty); 96 MARSHALLING(nsteps); 97 if(nsteps){ 98 MARSHALLING_DYNAMIC(values,IssmDouble,nsteps); 99 MARSHALLING_DYNAMIC(times,IssmDouble,nsteps); 100 } 101 else{ 102 values=NULL; 103 times=NULL; 104 } 105 106 } 107 /*}}}*/ 87 108 88 109 /*Constraint virtual functions definitions:*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Constraints/SpcTransient.h ¶
r19198 r19254 36 36 int Id(); 37 37 int ObjectEnum(); 38 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };38 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 39 39 /*}}}*/ 40 40 /*Constraint virtual functions definitions: {{{*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Element.cpp ¶
r19241 r19254 1528 1528 1529 1529 _assert_(this); 1530 if(marshall_direction==MARSHALLING_BACKWARD) inputs=new Inputs(); 1530 if(marshall_direction==MARSHALLING_BACKWARD){ 1531 inputs=new Inputs(); 1532 nodes = NULL; 1533 } 1531 1534 1532 1535 MARSHALLING_ENUM(ElementEnum); … … 1536 1539 MARSHALLING(element_type); 1537 1540 MARSHALLING_DYNAMIC(element_type_list,int,numanalyses); 1541 inputs->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 1538 1542 1539 1543 } -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/ElementHook.cpp ¶
r19237 r19254 126 126 } 127 127 this->hvertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 128 this->hmat par->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);128 this->hmaterial->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 129 129 this->hmatpar->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 130 130 if(this->hneighbors)this->hneighbors->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 131 131 132 132 /*Free ressources: */ 133 xDelete<bool>(hnodesi_null);133 if(hnodesi_null) xDelete<bool>(hnodesi_null); 134 134 135 135 } -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Penta.cpp ¶
r19237 r19254 120 120 121 121 return penta; 122 123 } 124 /*}}}*/ 125 void Penta::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 126 127 MARSHALLING_ENUM(PentaEnum); 128 129 /*Call parent classes: */ 130 ElementHook::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 131 Element::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction,this->numanalyses); 132 PentaRef::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 133 134 vertices = (Vertex**)this->hvertices->deliverp(); 135 material = (Material*)this->hmaterial->delivers(); 136 matpar = (Matpar*)this->hmatpar->delivers(); 137 verticalneighbors = (Penta**)this->hneighbors->deliverp(); 122 138 123 139 } -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Penta.h ¶
r19237 r19254 42 42 Object *copy(); 43 43 int ObjectEnum(); 44 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction) { _error_("not implemented yet!");};44 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 45 45 /*}}}*/ 46 46 /*Penta routines:{{{*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/PentaRef.h ¶
r18925 r19254 33 33 int TensorInterpolation(int fe_stokes); 34 34 int VelocityInterpolation(int fe_stokes); 35 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*do nothing */}; 35 36 }; 36 37 #endif -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Seg.cpp ¶
r18924 r19254 47 47 /*}}}*/ 48 48 Object* Seg::copy(){/*{{{*/ 49 _error_("not implemented yet"); 49 50 int i; 51 Seg* seg=NULL; 52 53 seg=new Seg(); 54 55 //deal with TriaRef mother class 56 int nanalyses = this->numanalyses; 57 if(nanalyses > 0){ 58 seg->element_type_list=xNew<int>(nanalyses); 59 for(i=0;i<nanalyses;i++){ 60 if (this->element_type_list[i]) seg->element_type_list[i]=this->element_type_list[i]; 61 else seg->element_type_list[i] = 0; 62 } 63 } 64 else seg->element_type_list = NULL; 65 seg->element_type=this->element_type; 66 seg->numanalyses=nanalyses; 67 68 //deal with ElementHook mother class 69 if (this->hnodes){ 70 seg->hnodes=xNew<Hook*>(seg->numanalyses); 71 for(i=0;i<seg->numanalyses;i++){ 72 if (this->hnodes[i]) seg->hnodes[i] = (Hook*)(this->hnodes[i]->copy()); 73 else seg->hnodes[i] = NULL; 74 } 75 } 76 else seg->hnodes = NULL; 77 78 seg->hvertices = (Hook*)this->hvertices->copy(); 79 seg->hmaterial = (Hook*)this->hmaterial->copy(); 80 seg->hmatpar = (Hook*)this->hmatpar->copy(); 81 seg->hneighbors = NULL; 82 83 /*deal with Element fields: */ 84 seg->id = this->id; 85 seg->sid = this->sid; 86 if(this->inputs) seg->inputs = (Inputs*)(this->inputs->Copy()); 87 else seg->inputs=new Inputs(); 88 89 /*point parameters: */ 90 seg->parameters=this->parameters; 91 92 /*recover objects: */ 93 if (this->nodes){ 94 unsigned int num_nodes = 3; 95 seg->nodes = xNew<Node*>(num_nodes); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes. 96 for(i=0;i<num_nodes;i++) if(this->nodes[i]) seg->nodes[i]=this->nodes[i]; else seg->nodes[i] = NULL; 97 } 98 else seg->nodes = NULL; 99 100 seg->vertices = (Vertex**)this->hvertices->deliverp(); 101 seg->material = (Material*)this->hmaterial->delivers(); 102 seg->matpar = (Matpar*)this->hmatpar->delivers(); 103 104 return seg; 105 106 107 } 108 /*}}}*/ 109 void Seg::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 110 111 MARSHALLING_ENUM(SegEnum); 112 113 /*Call parent classes: */ 114 ElementHook::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 115 Element::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction,this->numanalyses); 116 SegRef::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 117 118 vertices = (Vertex**)this->hvertices->deliverp(); 119 material = (Material*)this->hmaterial->delivers(); 120 matpar = (Matpar*)this->hmatpar->delivers(); 121 50 122 } 51 123 /*}}}*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Seg.h ¶
r19237 r19254 38 38 int ObjectEnum(); 39 39 Object *copy(); 40 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction) { _error_("not implemented yet!");};40 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 41 41 /*}}}*/ 42 42 /*Element virtual functions definitions: {{{*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/SegRef.h ¶
r18925 r19254 25 25 void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussSeg* gauss,int finiteelement); 26 26 int NumberofNodes(int finiteelement); 27 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*do nothing */}; 27 28 }; 28 29 #endif -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp ¶
r18923 r19254 92 92 93 93 /*recover objects: */ 94 unsigned int num_nodes = 3;94 unsigned int num_nodes = 4; 95 95 tetra->nodes = xNew<Node*>(num_nodes); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes. 96 96 for(i=0;i<num_nodes;i++) if(this->nodes[i]) tetra->nodes[i]=this->nodes[i]; else tetra->nodes[i] = NULL; … … 101 101 102 102 return tetra; 103 } 104 /*}}}*/ 105 void Tetra::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 106 107 MARSHALLING_ENUM(TetraEnum); 108 109 /*Call parent classes: */ 110 ElementHook::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 111 Element::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction,this->numanalyses); 112 TetraRef::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 113 114 vertices = (Vertex**)this->hvertices->deliverp(); 115 material = (Material*)this->hmaterial->delivers(); 116 matpar = (Matpar*)this->hmatpar->delivers(); 117 103 118 } 104 119 /*}}}*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tetra.h ¶
r19237 r19254 38 38 int ObjectEnum(); 39 39 Object *copy(); 40 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction) { _error_("not implemented yet!");};40 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 41 41 /*}}}*/ 42 42 /*Element virtual functions definitions: {{{*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/TetraRef.h ¶
r18925 r19254 29 29 int TensorInterpolation(int fe_stokes); 30 30 int VelocityInterpolation(int fe_stokes); 31 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*do nothing */}; 31 32 }; 32 33 #endif -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tria.cpp ¶
r19237 r19254 107 107 else tria->nodes = NULL; 108 108 109 110 109 tria->vertices = (Vertex**)this->hvertices->deliverp(); 111 110 tria->material = (Material*)this->hmaterial->delivers(); … … 130 129 } 131 130 /*}}}*/ 132 133 131 134 132 /*Other*/ -
TabularUnified issm/trunk-jpl/src/c/classes/FemModel.cpp ¶
r19240 r19254 84 84 xDelete<char>(outbinfilename); 85 85 xDelete<char>(petscfilename); 86 xDelete<char>(restartfilename); 86 87 xDelete<char>(rootpath); 87 88 … … 625 626 this->Marshall(NULL,&femmodel_size,MARSHALLING_SIZE); 626 627 femmodel_buffer=xNew<char>(femmodel_size); 627 628 628 /*Keep track of initial position of femmodel_buffer: */ 629 629 femmodel_buffer_ini=femmodel_buffer; … … 662 662 restartfid=pfopen(restartfilename,"r",false); 663 663 664 if(restartfid==NULL)return; //could not find the file, so no restart possible. 664 if(restartfid==NULL){ 665 xDelete<char>(restartfilename); 666 return; //could not find the file, so no restart possible. 667 } 665 668 666 669 /*Figure out size of buffer to be read: */ … … 673 676 674 677 /*Read buffer from file: */ 675 fread_return=fread(femmodel_buffer,femmodel_size, 1,restartfid); if(fread_return!=1)_error_("error reading the buffer from marshalled file!");678 fread_return=fread(femmodel_buffer,femmodel_size,sizeof(char),restartfid); if(fread_return!=1)_error_("error reading the buffer from marshalled file!"); 676 679 femmodel_buffer_ini=femmodel_buffer; //keep track of the initial position, so as to free later. 677 680 678 681 /*Create new FemModel by demarshalling the buffer: */ 679 682 this->Marshall(&femmodel_buffer,NULL,MARSHALLING_BACKWARD); 683 684 /*Reset position of buffer: */ 685 femmodel_buffer=femmodel_buffer_ini; 680 686 681 687 /*Done, close file :*/ … … 690 696 void FemModel::Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 691 697 698 int i; 699 int analysis_type; 700 692 701 if(marshall_direction==MARSHALLING_BACKWARD){ 693 delete profiler; profiler=new Profiler; 694 delete elements; elements=new Elements(); 695 delete nodes; nodes=new Nodes(); 696 delete vertices; vertices=new Vertices(); 697 delete constraints; constraints=new Constraints(); 702 delete profiler; profiler=new Profiler(); 698 703 delete loads; loads=new Loads(); 699 704 delete materials; materials=new Materials(); 700 705 delete parameters; parameters=new Parameters(); 706 delete constraints; constraints=new Constraints(); 701 707 delete results; results=new Results(); 708 delete nodes; nodes=new Nodes(); 709 delete vertices; vertices=new Vertices(); 710 delete elements; elements=new Elements(); 702 711 xDelete<int>(analysis_type_list); 703 712 } … … 707 716 MARSHALLING(solution_type); 708 717 MARSHALLING(analysis_counter); 709 MARSHALLING_DYNAMIC(analysis_type_list,int,analysis_counter); 718 MARSHALLING(nummodels); 719 MARSHALLING_DYNAMIC(analysis_type_list,int,nummodels); 710 720 711 721 profiler->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 712 elements->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);713 nodes->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);714 vertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);715 constraints->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);716 722 loads->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 717 723 materials->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 718 724 parameters->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 725 constraints->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 719 726 results->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 727 nodes->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 728 vertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 729 elements->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 730 731 if(marshall_direction==MARSHALLING_BACKWARD){ 732 //reset hooks for elements, loads and nodes: 733 elements->ResetHooks(); 734 loads->ResetHooks(); 735 materials->ResetHooks(); 736 737 //do the post-processing of the datasets to get an FemModel that can actually run analyses: 738 for(i=0;i<nummodels;i++){ 739 analysis_type=analysis_type_list[i]; 740 SetCurrentConfiguration(analysis_type); 741 if(i==0) VerticesDofx(vertices,parameters); //only call once, we only have one set of vertices 742 SpcNodesx(nodes,constraints,parameters,analysis_type); 743 NodesDofx(nodes,parameters,analysis_type); 744 ConfigureObjectsx(elements,loads,nodes,vertices,materials,parameters); 745 } 746 } 720 747 721 748 } -
TabularUnified issm/trunk-jpl/src/c/classes/Hook.cpp ¶
r19238 r19254 126 126 MARSHALLING_ENUM(HookEnum); 127 127 MARSHALLING(num); 128 MARSHALLING_DYNAMIC(ids,int,num); 129 MARSHALLING_DYNAMIC(offsets,int,num); 128 if (num<=0){ 129 /*Empty hook*/ 130 this->ids = NULL; 131 this->objects = NULL; 132 this->offsets = NULL; 133 this->num = 0; 134 } 135 else{ 136 MARSHALLING_DYNAMIC(ids,int,num); 137 MARSHALLING_DYNAMIC(offsets,int,num); 138 MARSHALLING_DYNAMIC(objects,Object*,num); 139 } 130 140 131 141 } -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/BoolInput.cpp ¶
r18450 r19254 38 38 } 39 39 /*}}}*/ 40 int 40 int BoolInput::Id(void){ return -1; }/*{{{*/ 41 41 /*}}}*/ 42 int BoolInput::ObjectEnum(void){/*{{{*/42 int BoolInput::ObjectEnum(void){/*{{{*/ 43 43 44 44 return BoolInputEnum; … … 49 49 50 50 return new BoolInput(this->enum_type,this->value); 51 52 } 53 /*}}}*/ 54 void BoolInput::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 55 56 MARSHALLING_ENUM(BoolInputEnum); 57 58 MARSHALLING(enum_type); 59 MARSHALLING(value); 51 60 52 61 } -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/BoolInput.h ¶
r19198 r19254 27 27 int ObjectEnum(); 28 28 Object *copy(); 29 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction) { _error_("not implemented yet!"); };29 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 30 30 /*}}}*/ 31 31 /*BoolInput management: {{{*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/ControlInput.cpp ¶
r18521 r19254 71 71 } 72 72 /*}}}*/ 73 int 74 /*}}}*/ 75 int ControlInput::ObjectEnum(void){/*{{{*/73 int ControlInput::Id(void){ return -1; }/*{{{*/ 74 /*}}}*/ 75 int ControlInput::ObjectEnum(void){/*{{{*/ 76 76 77 77 return ControlInputEnum; … … 96 96 } 97 97 /*}}}*/ 98 void ControlInput::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 99 100 MARSHALLING_ENUM(ControlInputEnum); 101 102 MARSHALLING(enum_type); 103 MARSHALLING(control_id); 104 105 if (marshall_direction == MARSHALLING_BACKWARD){ 106 switch(enum_type){ 107 case TriaInputEnum: 108 values =new TriaInput(); 109 savedvalues=new TriaInput(); 110 minvalues =new TriaInput(); 111 maxvalues =new TriaInput(); 112 gradient =new TriaInput(); 113 break; 114 case PentaInputEnum: 115 values =new PentaInput(); 116 savedvalues=new PentaInput(); 117 minvalues =new PentaInput(); 118 maxvalues =new PentaInput(); 119 gradient =new PentaInput(); 120 break; 121 default: 122 _error_("Input of Enum " << EnumToStringx(enum_type) << " not supported yet by ControlInput"); 123 } 124 } 125 if(values) this->values->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 126 if(savedvalues) this->savedvalues->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 127 if(minvalues) this->minvalues->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 128 if(maxvalues) this->maxvalues->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 129 if(gradient) this->gradient->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 130 } 131 /*}}}*/ 98 132 99 133 /*ControlInput management*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/ControlInput.h ¶
r19198 r19254 35 35 int ObjectEnum(); 36 36 Object* copy(); 37 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction) { _error_("not implemented yet!"); };37 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 38 38 /*}}}*/ 39 39 /*ControlInput management: {{{*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp ¶
r18521 r19254 71 71 72 72 return (Object*)output; 73 } 74 /*}}}*/ 75 void DatasetInput::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 76 77 MARSHALLING_ENUM(DatasetInputEnum); 78 79 MARSHALLING(enum_type); 80 MARSHALLING(numids); 81 MARSHALLING_DYNAMIC(ids,int,numids) 82 if (marshall_direction == MARSHALLING_BACKWARD) inputs = new Inputs(); 83 inputs->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 84 73 85 } 74 86 /*}}}*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/DatasetInput.h ¶
r19198 r19254 32 32 int ObjectEnum(); 33 33 Object* copy(); 34 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction) { _error_("not implemented yet!"); };34 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 35 35 /*}}}*/ 36 36 /*DatasetInput management: {{{*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/DoubleInput.cpp ¶
r18064 r19254 52 52 } 53 53 /*}}}*/ 54 void DoubleInput::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 55 56 MARSHALLING_ENUM(DoubleInputEnum); 57 58 MARSHALLING(enum_type); 59 MARSHALLING(value); 60 61 } 62 /*}}}*/ 54 63 55 64 /*DoubleInput management*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/DoubleInput.h ¶
r19198 r19254 30 30 int ObjectEnum(); 31 31 Object* copy(); 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); 33 33 /*}}}*/ 34 34 /*DoubleInput management: {{{*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/IntInput.cpp ¶
r18064 r19254 34 34 } 35 35 /*}}}*/ 36 int 36 int IntInput::Id(void){ return -1; }/*{{{*/ 37 37 /*}}}*/ 38 int IntInput::ObjectEnum(void){/*{{{*/38 int IntInput::ObjectEnum(void){/*{{{*/ 39 39 40 40 return IntInputEnum; … … 45 45 46 46 return new IntInput(this->enum_type,this->value); 47 48 } 49 /*}}}*/ 50 void IntInput::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 51 52 MARSHALLING_ENUM(IntInputEnum); 53 54 MARSHALLING(enum_type); 55 MARSHALLING(value); 47 56 48 57 } -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/IntInput.h ¶
r19198 r19254 31 31 int ObjectEnum(); 32 32 Object* copy(); 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); 34 34 /*}}}*/ 35 35 /*IntInput management: {{{*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/PentaInput.cpp ¶
r18472 r19254 28 28 if (numnodes > 0){ 29 29 this->values=xNew<IssmDouble>((unsigned int)numnodes); 30 for(int i=0;i< this->NumberofNodes(this->interpolation_type);i++) values[i]=in_values[i];30 for(int i=0;i<numnodes;i++) values[i]=in_values[i]; 31 31 } 32 32 else{ … … 53 53 } 54 54 /*}}}*/ 55 int 56 /*}}}*/ 57 int PentaInput::ObjectEnum(void){/*{{{*/55 int PentaInput::Id(void){ return -1; }/*{{{*/ 56 /*}}}*/ 57 int PentaInput::ObjectEnum(void){/*{{{*/ 58 58 59 59 return PentaInputEnum; … … 65 65 return new PentaInput(this->enum_type,this->values,this->interpolation_type); 66 66 67 } 68 /*}}}*/ 69 void PentaInput::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 70 71 MARSHALLING_ENUM(PentaInputEnum); 72 73 MARSHALLING(enum_type); 74 MARSHALLING(interpolation_type); 75 76 int numnodes = this->NumberofNodes(this->interpolation_type); 77 if(numnodes > 0){ 78 MARSHALLING_DYNAMIC(this->values,IssmDouble,numnodes) 79 } 80 else this->values = NULL; 67 81 } 68 82 /*}}}*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/PentaInput.h ¶
r19198 r19254 32 32 int ObjectEnum(); 33 33 Object *copy(); 34 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction) { _error_("not implemented yet!"); };34 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 35 35 36 36 /*PentaInput management*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/SegInput.cpp ¶
r18078 r19254 45 45 } 46 46 /*}}}*/ 47 int 47 int SegInput::Id(void){ return -1; }/*{{{*/ 48 48 /*}}}*/ 49 int SegInput::ObjectEnum(void){/*{{{*/49 int SegInput::ObjectEnum(void){/*{{{*/ 50 50 51 51 return SegInputEnum; … … 57 57 return new SegInput(this->enum_type,this->values,this->interpolation_type); 58 58 59 } 60 /*}}}*/ 61 void SegInput::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 62 63 MARSHALLING_ENUM(SegInputEnum); 64 65 MARSHALLING(enum_type); 66 MARSHALLING(interpolation_type); 67 68 int numnodes = this->NumberofNodes(this->interpolation_type); 69 if(numnodes > 0){ 70 MARSHALLING_DYNAMIC(this->values,IssmDouble,numnodes) 71 } 72 else this->values = NULL; 59 73 } 60 74 /*}}}*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/SegInput.h ¶
r19198 r19254 32 32 int ObjectEnum(); 33 33 Object *copy(); 34 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction) { _error_("not implemented yet!"); };34 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 35 35 36 36 /*SegInput management:*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/TetraInput.cpp ¶
r18237 r19254 28 28 if (numnodes > 0){ 29 29 this->values=xNew<IssmDouble>((unsigned int)numnodes); 30 for(int i=0;i< this->NumberofNodes(this->interpolation_type);i++) values[i]=in_values[i];30 for(int i=0;i<numnodes;i++) values[i]=in_values[i]; 31 31 } 32 32 else{ … … 53 53 } 54 54 /*}}}*/ 55 int 56 /*}}}*/ 57 int TetraInput::ObjectEnum(void){/*{{{*/55 int TetraInput::Id(void){ return -1; }/*{{{*/ 56 /*}}}*/ 57 int TetraInput::ObjectEnum(void){/*{{{*/ 58 58 59 59 return TetraInputEnum; … … 65 65 return new TetraInput(this->enum_type,this->values,this->interpolation_type); 66 66 67 } 68 /*}}}*/ 69 void TetraInput::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 70 71 MARSHALLING_ENUM(TetraInputEnum); 72 73 MARSHALLING(enum_type); 74 MARSHALLING(interpolation_type); 75 76 int numnodes = this->NumberofNodes(this->interpolation_type); 77 if(numnodes > 0){ 78 MARSHALLING_DYNAMIC(this->values,IssmDouble,numnodes) 79 } 80 else this->values = NULL; 67 81 } 68 82 /*}}}*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/TetraInput.h ¶
r19198 r19254 32 32 int ObjectEnum(); 33 33 Object *copy(); 34 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction) { _error_("not implemented yet!"); };34 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 35 35 36 36 /*TetraInput management:*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp ¶
r18450 r19254 102 102 return (Object*)output; 103 103 104 } 105 /*}}}*/ 106 void TransientInput::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 107 108 if (marshall_direction == MARSHALLING_BACKWARD) inputs = new Inputs(); 109 110 MARSHALLING_ENUM(TransientInputEnum); 111 112 MARSHALLING(enum_type); 113 MARSHALLING(numtimesteps); 114 MARSHALLING_DYNAMIC(this->timesteps,IssmDouble,numtimesteps); 115 inputs->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 104 116 } 105 117 /*}}}*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/TransientInput.h ¶
r19198 r19254 37 37 int ObjectEnum(); 38 38 Object* copy(); 39 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction) { _error_("not implemented yet!"); };39 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 40 40 /*}}}*/ 41 41 /*TransientInput management: {{{*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/TriaInput.cpp ¶
r18237 r19254 28 28 if (numnodes > 0){ 29 29 this->values=xNew<IssmDouble>((unsigned int)numnodes); 30 for(int i=0;i< this->NumberofNodes(this->interpolation_type);i++) values[i]=in_values[i];30 for(int i=0;i<numnodes;i++) values[i]=in_values[i]; 31 31 } 32 32 else{ … … 64 64 return new TriaInput(this->enum_type,this->values,this->interpolation_type); 65 65 66 } 67 /*}}}*/ 68 void TriaInput::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 69 70 MARSHALLING_ENUM(TriaInputEnum); 71 72 MARSHALLING(enum_type); 73 MARSHALLING(interpolation_type); 74 75 int numnodes = this->NumberofNodes(this->interpolation_type); 76 if(numnodes > 0){ 77 MARSHALLING_DYNAMIC(this->values,IssmDouble,numnodes) 78 } 79 else this->values = NULL; 66 80 } 67 81 /*}}}*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/TriaInput.h ¶
r19198 r19254 32 32 int ObjectEnum(); 33 33 Object *copy(); 34 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction) { _error_("not implemented yet!"); };34 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 35 35 36 36 /*TriaInput management:*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp ¶
r18926 r19254 156 156 157 157 return numericalflux; 158 } 159 /*}}}*/ 160 void Numericalflux::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 161 162 _assert_(this); 163 164 /*ok, marshall operations: */ 165 MARSHALLING_ENUM(NumericalfluxEnum); 166 MARSHALLING(id); 167 MARSHALLING(analysis_type); 168 MARSHALLING(flux_type); 169 170 if(marshall_direction==MARSHALLING_BACKWARD){ 171 this->hnodes = new Hook(); 172 this->hvertices = new Hook(); 173 this->helement = new Hook(); 174 } 175 176 this->hnodes->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 177 this->helement->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 178 this->hvertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 179 180 /*corresponding fields*/ 181 nodes =(Node**)this->hnodes->deliverp(); 182 vertices =(Vertex**)this->hvertices->deliverp(); 183 element =(Element*)this->helement->delivers(); 184 158 185 } 159 186 /*}}}*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Loads/Numericalflux.h ¶
r19198 r19254 45 45 int Id(); 46 46 int ObjectEnum(); 47 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction) { _error_("not implemented yet!"); };47 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 48 48 /*}}}*/ 49 49 /*Update virtual functions resolution: {{{*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp ¶
r18946 r19254 105 105 106 106 //let's not forget internals 107 pengrid->active=this->active =0;108 pengrid->zigzag_counter=this->zigzag_counter =0;107 pengrid->active=this->active; 108 pengrid->zigzag_counter=this->zigzag_counter; 109 109 110 110 return pengrid; 111 112 } 113 /*}}}*/ 114 void Pengrid::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 115 116 _assert_(this); 117 118 /*ok, marshall operations: */ 119 MARSHALLING_ENUM(PengridEnum); 120 MARSHALLING(id); 121 MARSHALLING(analysis_type); 122 123 if(marshall_direction==MARSHALLING_BACKWARD){ 124 this->hnode = new Hook(); 125 this->helement = new Hook(); 126 this->hmatpar = new Hook(); 127 } 128 129 this->hnode->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 130 this->helement->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 131 this->hmatpar->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 132 133 /*corresponding fields*/ 134 node =(Node*)this->hnode->delivers(); 135 matpar =(Matpar*)this->hmatpar->delivers(); 136 element=(Element*)this->helement->delivers(); 137 138 MARSHALLING(active); 139 MARSHALLING(zigzag_counter); 111 140 112 141 } -
TabularUnified issm/trunk-jpl/src/c/classes/Loads/Pengrid.h ¶
r19198 r19254 55 55 int ObjectEnum(); 56 56 Object* copy(); 57 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction) { _error_("not implemented yet!"); };57 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 58 58 /*}}}*/ 59 59 /*Update virtual functions resolution: {{{*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Loads/Penpair.cpp ¶
r18926 r19254 63 63 64 64 return penpair; 65 66 } 67 /*}}}*/ 68 void Penpair::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 69 70 _assert_(this); 71 72 /*ok, marshall operations: */ 73 MARSHALLING_ENUM(PenpairEnum); 74 MARSHALLING(id); 75 MARSHALLING(analysis_type); 76 77 if(marshall_direction==MARSHALLING_BACKWARD){ 78 this->hnodes = new Hook(); 79 } 80 this->hnodes->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 81 82 /*corresponding fields*/ 83 nodes = (Node**)this->hnodes->deliverp(); 65 84 66 85 } -
TabularUnified issm/trunk-jpl/src/c/classes/Loads/Penpair.h ¶
r19198 r19254 36 36 int Id(); 37 37 int ObjectEnum(); 38 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction) { _error_("not implemented yet!"); };38 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 39 39 /*}}}*/ 40 40 /*Update virtual functions resolution: {{{*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp ¶
r18946 r19254 150 150 151 151 return riftfront; 152 153 } 154 /*}}}*/ 155 void Riftfront::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 156 157 _assert_(this); 158 159 /*ok, marshall operations: */ 160 MARSHALLING_ENUM(RiftfrontEnum); 161 MARSHALLING(id); 162 MARSHALLING(analysis_type); 163 MARSHALLING(type); 164 MARSHALLING(fill); 165 MARSHALLING(friction); 166 MARSHALLING(fractionincrement); 167 MARSHALLING(shelf); 168 169 if(marshall_direction==MARSHALLING_BACKWARD){ 170 this->hnodes = new Hook(); 171 this->hmatpar = new Hook(); 172 this->helements = new Hook(); 173 } 174 175 this->hnodes->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 176 this->hmatpar->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 177 this->helements->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 178 179 /*corresponding fields*/ 180 nodes =(Node**)this->hnodes->deliverp(); 181 matpar =(Matpar*)this->hmatpar->delivers(); 182 elements =(Element**)this->helements->deliverp(); 183 184 MARSHALLING(penalty_lock); 185 MARSHALLING(active); 186 MARSHALLING(frozen); 187 MARSHALLING(state); 188 MARSHALLING(counter); 189 MARSHALLING(prestable); 190 MARSHALLING(material_converged); 191 MARSHALLING(normal[0]); 192 MARSHALLING(normal[1]); 193 MARSHALLING(length); 194 MARSHALLING(fraction); 152 195 153 196 } -
TabularUnified issm/trunk-jpl/src/c/classes/Loads/Riftfront.h ¶
r19198 r19254 62 62 int Id(); 63 63 int ObjectEnum(); 64 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction) { _error_("not implemented yet!"); };64 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 65 65 /*}}}*/ 66 66 /*Update virtual functions resolution: {{{*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Materials/Matice.cpp ¶
r19216 r19254 122 122 } 123 123 /*}}}*/ 124 void 124 void Matice::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 125 125 126 126 if(marshall_direction==MARSHALLING_BACKWARD)helement=new Hook(); … … 130 130 MARSHALLING(isdamaged); 131 131 this->helement->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 132 132 this->element=(Element*)this->helement->delivers(); 133 133 134 134 } -
TabularUnified issm/trunk-jpl/src/c/classes/Params/BoolParam.cpp ¶
r19216 r19254 63 63 } 64 64 /*}}}*/ 65 66 65 -
TabularUnified issm/trunk-jpl/src/c/classes/Params/DoubleMatArrayParam.cpp ¶
r19222 r19254 128 128 MARSHALLING(enum_type); 129 129 MARSHALLING(M); 130 MARSHALLING_DYNAMIC(mdim_array,int,M); 131 MARSHALLING_DYNAMIC(ndim_array,int,M); 132 133 if(marshall_direction==MARSHALLING_BACKWARD)if(M)array=xNew<IssmDouble*>(M); 134 135 for(int i=0;i<M;i++){ 136 MARSHALLING_DYNAMIC(array[i],IssmDouble,mdim_array[i]*ndim_array[i]); 137 } 138 130 if(M){ 131 MARSHALLING_DYNAMIC(mdim_array,int,M); 132 MARSHALLING_DYNAMIC(ndim_array,int,M); 133 if(marshall_direction==MARSHALLING_BACKWARD && M) array=xNew<IssmDouble*>(M); 134 for(int i=0;i<M;i++){ 135 MARSHALLING_DYNAMIC(array[i],IssmDouble,mdim_array[i]*ndim_array[i]); 136 } 137 } 138 else{ 139 array=NULL; 140 mdim_array=NULL; 141 ndim_array=NULL; 142 } 139 143 140 144 } -
TabularUnified issm/trunk-jpl/src/c/classes/Params/DoubleVecParam.cpp ¶
r19217 r19254 25 25 M=in_M; 26 26 27 values=xNew<IssmDouble>(M); 28 xMemCpy<IssmDouble>(values,in_values,M); 27 if(M){ 28 values=xNew<IssmDouble>(M); 29 xMemCpy<IssmDouble>(values,in_values,M); 30 } 31 else values=NULL; 29 32 } 30 33 /*}}}*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Params/FileParam.cpp ¶
r19222 r19254 41 41 } 42 42 /*}}}*/ 43 int 43 int FileParam::Id(void){ return -1; }/*{{{*/ 44 44 /*}}}*/ 45 int FileParam::ObjectEnum(void){/*{{{*/45 int FileParam::ObjectEnum(void){/*{{{*/ 46 46 47 47 return FileParamEnum; -
TabularUnified issm/trunk-jpl/src/c/classes/Params/GenericParam.h ¶
r19198 r19254 52 52 // use the default copy constructor instead 53 53 Object* copy() { return new GenericParam<P>(*this); }; 54 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };54 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; 55 55 /*}}}*/ 56 56 /*Param vritual function definitions: {{{*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Params/IntMatParam.cpp ¶
r19222 r19254 59 59 } 60 60 /*}}}*/ 61 int 61 int IntMatParam::Id(void){ return -1; }/*{{{*/ 62 62 /*}}}*/ 63 int IntMatParam::ObjectEnum(void){/*{{{*/63 int IntMatParam::ObjectEnum(void){/*{{{*/ 64 64 65 65 return IntMatParamEnum; … … 83 83 } 84 84 /*}}}*/ 85 86 85 87 86 /*IntMatParam virtual functions definitions: */ -
TabularUnified issm/trunk-jpl/src/c/classes/Params/IntParam.cpp ¶
r19215 r19254 41 41 } 42 42 /*}}}*/ 43 int 43 int IntParam::Id(void){ return -1; }/*{{{*/ 44 44 /*}}}*/ 45 int IntParam::ObjectEnum(void){/*{{{*/45 int IntParam::ObjectEnum(void){/*{{{*/ 46 46 47 47 return IntParamEnum; -
TabularUnified issm/trunk-jpl/src/c/classes/Params/IntVecParam.cpp ¶
r19222 r19254 71 71 } 72 72 /*}}}*/ 73 int 73 int IntVecParam::Id(void){ return -1; }/*{{{*/ 74 74 /*}}}*/ 75 int IntVecParam::ObjectEnum(void){/*{{{*/75 int IntVecParam::ObjectEnum(void){/*{{{*/ 76 76 77 77 return IntVecParamEnum; … … 91 91 MARSHALLING(enum_type); 92 92 MARSHALLING(M); 93 MARSHALLING_DYNAMIC(values,int,M); 93 if(M) { 94 MARSHALLING_DYNAMIC(values,int,M); 95 } 96 else values=NULL; 94 97 95 98 } -
TabularUnified issm/trunk-jpl/src/c/classes/Params/MatrixParam.cpp ¶
r18064 r19254 50 50 } 51 51 /*}}}*/ 52 int 52 int MatrixParam::Id(void){ return -1; }/*{{{*/ 53 53 /*}}}*/ 54 54 int MatrixParam::ObjectEnum(void){/*{{{*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Params/Parameters.cpp ¶
r18521 r19254 465 465 466 466 param=xDynamicCast<Param*>(*object); 467 if(param ->InstanceEnum()==enum_type){467 if(param && param->InstanceEnum()==enum_type){ 468 468 return (*object); 469 469 } -
TabularUnified issm/trunk-jpl/src/c/classes/Params/StringArrayParam.cpp ¶
r19217 r19254 88 88 if(numstrings)sizes=xNew<int>(numstrings); 89 89 for(int i=0;i<numstrings;i++)sizes[i]=strlen(value[i])+1; 90 } 90 } 91 91 92 92 MARSHALLING_ENUM(StringArrayParamEnum); … … 97 97 if(numstrings){ 98 98 MARSHALLING_DYNAMIC(sizes,int,numstrings); 99 100 99 if(marshall_direction==MARSHALLING_BACKWARD) value=xNew<char*>(numstrings); 101 102 100 for(int i=0;i<numstrings;i++)MARSHALLING_DYNAMIC(value[i],char,sizes[i]); 103 101 } 102 else value=NULL; 103 104 //cleanup sizes array 105 if(sizes) xDelete<int>(sizes); 104 106 105 107 } -
TabularUnified issm/trunk-jpl/src/c/classes/Params/StringParam.cpp ¶
r19222 r19254 67 67 MARSHALLING_DYNAMIC(value,char,size); 68 68 69 70 69 } 71 70 /*}}}*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Params/TransientParam.cpp ¶
r19236 r19254 74 74 } 75 75 /*}}}*/ 76 void TransientParam::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 77 78 MARSHALLING_ENUM(TransientParamEnum); 79 80 MARSHALLING(enum_type); 81 MARSHALLING(interpolation); 82 MARSHALLING(N); 83 if(marshall_direction==MARSHALLING_BACKWARD){ 84 values=xNew<IssmDouble>(N); 85 timesteps=xNew<IssmDouble>(N); 86 } 87 MARSHALLING_ARRAY(values,IssmDouble,N); 88 MARSHALLING_ARRAY(timesteps,IssmDouble,N); 89 90 } 91 /*}}}*/ 76 92 77 93 /*TransientParam virtual functions definitions: */ -
TabularUnified issm/trunk-jpl/src/c/classes/Params/TransientParam.h ¶
r19236 r19254 39 39 int ObjectEnum(); 40 40 Object* copy(); 41 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction) { _error_("not implemented yet!"); };41 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction); 42 42 /*}}}*/ 43 43 /*Param vritual function definitions: {{{*/ -
TabularUnified issm/trunk-jpl/src/c/datastructures/DataSet.cpp ¶
r19240 r19254 90 90 91 91 vector<Object*>::iterator obj; 92 int obj_enum; 92 int obj_size=0; 93 int obj_enum=0; 93 94 int i; 94 95 95 96 if(marshall_direction==MARSHALLING_FORWARD || marshall_direction==MARSHALLING_SIZE){ 96 numsorted=objects.size(); 97 obj_size=objects.size(); 98 } 99 else{ 100 clear(); 97 101 } 98 102 … … 102 106 MARSHALLING(presorted); 103 107 MARSHALLING(numsorted); 104 MARSHALLING_DYNAMIC(sorted_ids,int,numsorted);105 MARSHALLING_DYNAMIC(id_offsets,int,numsorted);106 108 107 109 /*Now branch according to direction of marshalling: */ 108 110 if(marshall_direction==MARSHALLING_FORWARD || marshall_direction==MARSHALLING_SIZE){ 111 if(!(this->sorted && numsorted>0 && this->id_offsets)){ 112 sorted_ids=NULL; 113 id_offsets=NULL; 114 } 115 MARSHALLING_DYNAMIC(sorted_ids,int,numsorted); 116 MARSHALLING_DYNAMIC(id_offsets,int,numsorted); 117 MARSHALLING(obj_size); 118 109 119 /*Go through our objects, and marshall them into the buffer: */ 110 120 for ( obj=this->objects.begin() ; obj < this->objects.end(); obj++ ){ 121 obj_enum=(*obj)->ObjectEnum(); 122 MARSHALLING(obj_enum); 111 123 (*obj)->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 112 124 } 113 125 } 114 126 else{ 127 128 MARSHALLING_DYNAMIC(sorted_ids,int,numsorted); 129 MARSHALLING_DYNAMIC(id_offsets,int,numsorted); 130 if (!(this->sorted && numsorted>0)){ 131 sorted_ids=NULL; 132 id_offsets=NULL; 133 } 134 MARSHALLING(obj_size); 135 115 136 /*This is the heart of the demashalling method. We have a buffer coming 116 137 in, and we are supposed to create a dataset out of it. No such thing 117 138 as class orientation for buffers, we need to key off the enum of each 118 139 object stored in the buffer. */ 119 for(i=0;i< this->numsorted;i++){140 for(i=0;i<obj_size;i++){ 120 141 121 142 /*Recover enum of object first: */ 122 MARSHALLING_ENUM(obj_enum); 123 /*Reset the file pointer to point again to the beginning of the object: */ 124 *pmarshalled_data-=sizeof(int); 143 MARSHALLING(obj_enum); 125 144 126 145 /*Giant case statement to spin-up the right object, and demarshall into it the information 127 146 *stored in the buffer: */ 128 147 if(obj_enum==NodeEnum){ 129 130 131 132 148 Node* node=NULL; 149 node=new Node(); 150 node->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 151 this->AddObject(node); 133 152 } 134 153 else if(obj_enum==VertexEnum){ … … 137 156 vertex->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 138 157 this->AddObject(vertex); 139 break;140 158 } 141 159 else if(obj_enum==DoubleParamEnum){ … … 144 162 doubleparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 145 163 this->AddObject(doubleparam); 146 break;147 164 } 148 165 else if(obj_enum==IntParamEnum){ … … 151 168 intparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 152 169 this->AddObject(intparam); 153 break; 154 } 155 else _error_("could not recognize enum type: " << obj_enum); 170 } 171 else if(obj_enum==IntMatParamEnum){ 172 IntMatParam* intmparam=NULL; 173 intmparam=new IntMatParam(); 174 intmparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 175 this->AddObject(intmparam); 176 } 177 else if(obj_enum==IntVecParamEnum){ 178 IntVecParam* intvparam=NULL; 179 intvparam=new IntVecParam(); 180 intvparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 181 this->AddObject(intvparam); 182 } 183 else if(obj_enum==BoolParamEnum){ 184 BoolParam* boolparam=NULL; 185 boolparam=new BoolParam(); 186 boolparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 187 this->AddObject(boolparam); 188 } 189 else if(obj_enum==DataSetParamEnum){ 190 DataSetParam* dsparam=NULL; 191 dsparam=new DataSetParam(); 192 dsparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 193 this->AddObject(dsparam); 194 } 195 else if(obj_enum==DoubleMatArrayParamEnum){ 196 DoubleMatArrayParam* dmaparam=NULL; 197 dmaparam=new DoubleMatArrayParam(); 198 dmaparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 199 this->AddObject(dmaparam); 200 } 201 else if(obj_enum==DoubleMatParamEnum){ 202 DoubleMatParam* dmparam=NULL; 203 dmparam=new DoubleMatParam(); 204 dmparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 205 this->AddObject(dmparam); 206 } 207 else if(obj_enum==DoubleVecParamEnum){ 208 DoubleVecParam* dvparam=NULL; 209 dvparam=new DoubleVecParam(); 210 dvparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 211 this->AddObject(dvparam); 212 } 213 else if(obj_enum==FileParamEnum){ 214 FileParam* fileparam=NULL; 215 fileparam=new FileParam(); 216 fileparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 217 this->AddObject(fileparam); 218 } 219 else if(obj_enum==StringParamEnum){ 220 StringParam* sparam=NULL; 221 sparam=new StringParam(); 222 sparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 223 this->AddObject(sparam); 224 } 225 else if(obj_enum==StringArrayParamEnum){ 226 StringArrayParam* saparam=NULL; 227 saparam=new StringArrayParam(); 228 saparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 229 this->AddObject(saparam); 230 } 231 else if(obj_enum==TransientParamEnum){ 232 TransientParam* transparam=NULL; 233 transparam=new TransientParam(); 234 transparam->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 235 this->AddObject(transparam); 236 } 237 else if(obj_enum==MaticeEnum){ 238 Matice* matice=NULL; 239 matice=new Matice(); 240 matice->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 241 this->AddObject(matice); 242 } 243 else if(obj_enum==MatparEnum){ 244 Matpar* matpar=NULL; 245 matpar=new Matpar(); 246 matpar->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 247 this->AddObject(matpar); 248 } 249 else if(obj_enum==SpcStaticEnum){ 250 SpcStatic* spcstatic=NULL; 251 spcstatic=new SpcStatic(); 252 spcstatic->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 253 this->AddObject(spcstatic); 254 } 255 else if(obj_enum==SpcDynamicEnum){ 256 SpcDynamic* spcdynamic=NULL; 257 spcdynamic=new SpcDynamic(); 258 spcdynamic->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 259 this->AddObject(spcdynamic); 260 } 261 else if(obj_enum==SpcTransientEnum){ 262 SpcTransient* spctransient=NULL; 263 spctransient=new SpcTransient(); 264 spctransient->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 265 this->AddObject(spctransient); 266 } 267 else if(obj_enum==TriaEnum){ 268 Tria* tria=NULL; 269 tria=new Tria(); 270 tria->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 271 this->AddObject(tria); 272 } 273 else if(obj_enum==PentaEnum){ 274 Penta* penta=NULL; 275 penta=new Penta(); 276 penta->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 277 this->AddObject(penta); 278 } 279 else if(obj_enum==TetraEnum){ 280 Tetra* tetra=NULL; 281 tetra=new Tetra(); 282 tetra->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 283 this->AddObject(tetra); 284 } 285 else if(obj_enum==SegEnum){ 286 Seg* seg=NULL; 287 seg=new Seg(); 288 seg->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 289 this->AddObject(seg); 290 } 291 else if(obj_enum==BoolInputEnum){ 292 BoolInput* boolinput=NULL; 293 boolinput=new BoolInput(); 294 boolinput->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 295 this->AddObject(boolinput); 296 } 297 else if(obj_enum==DoubleInputEnum){ 298 DoubleInput* doubleinput=NULL; 299 doubleinput=new DoubleInput(); 300 doubleinput->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 301 this->AddObject(doubleinput); 302 } 303 else if(obj_enum==IntInputEnum){ 304 IntInput* intinput=NULL; 305 intinput=new IntInput(); 306 intinput->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 307 this->AddObject(intinput); 308 } 309 else if(obj_enum==ControlInputEnum){ 310 ControlInput* cinput=NULL; 311 cinput=new ControlInput(); 312 cinput->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 313 this->AddObject(cinput); 314 } 315 else if(obj_enum==TransientInputEnum){ 316 TransientInput* transinput=NULL; 317 transinput=new TransientInput(); 318 transinput->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 319 this->AddObject(transinput); 320 } 321 else if(obj_enum==TriaInputEnum){ 322 TriaInput* triainput=NULL; 323 triainput=new TriaInput(); 324 triainput->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 325 this->AddObject(triainput); 326 } 327 else if(obj_enum==PentaInputEnum){ 328 PentaInput* pentainput=NULL; 329 pentainput=new PentaInput(); 330 pentainput->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 331 this->AddObject(pentainput); 332 } 333 else if(obj_enum==TetraInputEnum){ 334 TetraInput* tetrainput=NULL; 335 tetrainput=new TetraInput(); 336 tetrainput->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 337 this->AddObject(tetrainput); 338 } 339 else if(obj_enum==SegInputEnum){ 340 SegInput* seginput=NULL; 341 seginput=new SegInput(); 342 seginput->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 343 this->AddObject(seginput); 344 } 345 else if(obj_enum==RiftfrontEnum){ 346 Riftfront* rift=NULL; 347 rift=new Riftfront(); 348 rift->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 349 this->AddObject(rift); 350 } 351 else if(obj_enum==NumericalfluxEnum){ 352 Numericalflux* numflux=NULL; 353 numflux=new Numericalflux(); 354 numflux->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 355 this->AddObject(numflux); 356 } 357 else if(obj_enum==PengridEnum){ 358 Pengrid* pengrid=NULL; 359 pengrid=new Pengrid(); 360 pengrid->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 361 this->AddObject(pengrid); 362 } 363 else if(obj_enum==PenpairEnum){ 364 Penpair* penpair=NULL; 365 penpair=new Penpair(); 366 penpair->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 367 this->AddObject(penpair); 368 } 369 else _error_("could not recognize enum type: " << obj_enum << ": " << EnumToStringx(obj_enum) ); 156 370 } 157 371 } -
TabularUnified issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h ¶
r19240 r19254 13 13 14 14 #define MARSHALLING_ENUM(EN)\ 15 int enum_type=EN;\15 int type_enum=EN;\ 16 16 if(marshall_direction==MARSHALLING_FORWARD){\ 17 memcpy(*pmarshalled_data,& enum_type,sizeof(int));\17 memcpy(*pmarshalled_data,&type_enum,sizeof(int));\ 18 18 *pmarshalled_data+=sizeof(int);\ 19 19 }\
Note:
See TracChangeset
for help on using the changeset viewer.