source: issm/oecreview/Archive/19101-20495/ISSM-19197-19198.diff@ 20498

Last change on this file since 20498 was 20498, checked in by Mathieu Morlighem, 9 years ago

CHG: done with Archive/19101-20495

File size: 56.8 KB
RevLine 
[20498]1Index: ../trunk-jpl/src/c/bamg/BamgQuadtree.h
2===================================================================
3--- ../trunk-jpl/src/c/bamg/BamgQuadtree.h (revision 19197)
4+++ ../trunk-jpl/src/c/bamg/BamgQuadtree.h (revision 19198)
5@@ -34,6 +34,7 @@
6 int Id() {_error_("not implemented yet"); };
7 int ObjectEnum() {_error_("not implemented yet"); };
8 Object *copy() {_error_("not implemented yet"); };
9+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
10 };
11
12 /*BamgQuadtree private Fields*/
13Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
14===================================================================
15--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h (revision 19197)
16+++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h (revision 19198)
17@@ -7,6 +7,9 @@
18 #define _ENUM_DEFINITIONS_
19
20 enum definitions{
21+ /*General: {{{*/
22+ FemModelEnum,
23+ /*}}}*/
24 /*Model fields {{{*/
25 AutodiffIsautodiffEnum,
26 AutodiffNumDependentsEnum,
27@@ -454,6 +457,7 @@
28 FSpressureEnum,
29 /*}}}*/
30 /*Datasets {{{*/
31+ DataSetEnum,
32 ConstraintsEnum,
33 LoadsEnum,
34 MaterialsEnum,
35Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
36===================================================================
37--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp (revision 19197)
38+++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp (revision 19198)
39@@ -16,6 +16,7 @@
40
41 switch(en){
42
43+ case FemModelEnum : return "FemModel";
44 case AutodiffIsautodiffEnum : return "AutodiffIsautodiff";
45 case AutodiffNumDependentsEnum : return "AutodiffNumDependents";
46 case AutodiffNumDependentObjectsEnum : return "AutodiffNumDependentObjects";
47@@ -453,6 +454,7 @@
48 case FSApproximationEnum : return "FSApproximation";
49 case FSvelocityEnum : return "FSvelocity";
50 case FSpressureEnum : return "FSpressure";
51+ case DataSetEnum : return "DataSet";
52 case ConstraintsEnum : return "Constraints";
53 case LoadsEnum : return "Loads";
54 case MaterialsEnum : return "Materials";
55Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
56===================================================================
57--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp (revision 19197)
58+++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp (revision 19198)
59@@ -16,7 +16,8 @@
60 int stage=1;
61
62 if(stage==1){
63- if (strcmp(name,"AutodiffIsautodiff")==0) return AutodiffIsautodiffEnum;
64+ if (strcmp(name,"FemModel")==0) return FemModelEnum;
65+ else if (strcmp(name,"AutodiffIsautodiff")==0) return AutodiffIsautodiffEnum;
66 else if (strcmp(name,"AutodiffNumDependents")==0) return AutodiffNumDependentsEnum;
67 else if (strcmp(name,"AutodiffNumDependentObjects")==0) return AutodiffNumDependentObjectsEnum;
68 else if (strcmp(name,"AutodiffDependentObjectNames")==0) return AutodiffDependentObjectNamesEnum;
69@@ -135,11 +136,11 @@
70 else if (strcmp(name,"HydrologydcEplCompressibility")==0) return HydrologydcEplCompressibilityEnum;
71 else if (strcmp(name,"HydrologydcEplPorosity")==0) return HydrologydcEplPorosityEnum;
72 else if (strcmp(name,"HydrologydcEplInitialThickness")==0) return HydrologydcEplInitialThicknessEnum;
73- else if (strcmp(name,"HydrologydcEplColapseThickness")==0) return HydrologydcEplColapseThicknessEnum;
74 else stage=2;
75 }
76 if(stage==2){
77- if (strcmp(name,"HydrologydcEplMaxThickness")==0) return HydrologydcEplMaxThicknessEnum;
78+ if (strcmp(name,"HydrologydcEplColapseThickness")==0) return HydrologydcEplColapseThicknessEnum;
79+ else if (strcmp(name,"HydrologydcEplMaxThickness")==0) return HydrologydcEplMaxThicknessEnum;
80 else if (strcmp(name,"HydrologydcEplThickness")==0) return HydrologydcEplThicknessEnum;
81 else if (strcmp(name,"HydrologydcEplThicknessOld")==0) return HydrologydcEplThicknessOldEnum;
82 else if (strcmp(name,"HydrologydcEplThickComp")==0) return HydrologydcEplThickCompEnum;
83@@ -258,11 +259,11 @@
84 else if (strcmp(name,"MeshElements")==0) return MeshElementsEnum;
85 else if (strcmp(name,"MeshLowerelements")==0) return MeshLowerelementsEnum;
86 else if (strcmp(name,"MeshNumberofelements2d")==0) return MeshNumberofelements2dEnum;
87- else if (strcmp(name,"MeshNumberofelements")==0) return MeshNumberofelementsEnum;
88 else stage=3;
89 }
90 if(stage==3){
91- if (strcmp(name,"MeshNumberoflayers")==0) return MeshNumberoflayersEnum;
92+ if (strcmp(name,"MeshNumberofelements")==0) return MeshNumberofelementsEnum;
93+ else if (strcmp(name,"MeshNumberoflayers")==0) return MeshNumberoflayersEnum;
94 else if (strcmp(name,"MeshNumberofvertices2d")==0) return MeshNumberofvertices2dEnum;
95 else if (strcmp(name,"MeshNumberofvertices")==0) return MeshNumberofverticesEnum;
96 else if (strcmp(name,"MeshUpperelements")==0) return MeshUpperelementsEnum;
97@@ -381,11 +382,11 @@
98 else if (strcmp(name,"SurfaceforcingsSmbref")==0) return SurfaceforcingsSmbrefEnum;
99 else if (strcmp(name,"SurfaceforcingsBPos")==0) return SurfaceforcingsBPosEnum;
100 else if (strcmp(name,"SurfaceforcingsBNeg")==0) return SurfaceforcingsBNegEnum;
101- else if (strcmp(name,"SMBhenning")==0) return SMBhenningEnum;
102 else stage=4;
103 }
104 if(stage==4){
105- if (strcmp(name,"SMBcomponents")==0) return SMBcomponentsEnum;
106+ if (strcmp(name,"SMBhenning")==0) return SMBhenningEnum;
107+ else if (strcmp(name,"SMBcomponents")==0) return SMBcomponentsEnum;
108 else if (strcmp(name,"SurfaceforcingsAccumulation")==0) return SurfaceforcingsAccumulationEnum;
109 else if (strcmp(name,"SurfaceforcingsEvaporation")==0) return SurfaceforcingsEvaporationEnum;
110 else if (strcmp(name,"SurfaceforcingsRunoff")==0) return SurfaceforcingsRunoffEnum;
111@@ -462,6 +463,7 @@
112 else if (strcmp(name,"FSApproximation")==0) return FSApproximationEnum;
113 else if (strcmp(name,"FSvelocity")==0) return FSvelocityEnum;
114 else if (strcmp(name,"FSpressure")==0) return FSpressureEnum;
115+ else if (strcmp(name,"DataSet")==0) return DataSetEnum;
116 else if (strcmp(name,"Constraints")==0) return ConstraintsEnum;
117 else if (strcmp(name,"Loads")==0) return LoadsEnum;
118 else if (strcmp(name,"Materials")==0) return MaterialsEnum;
119@@ -503,12 +505,12 @@
120 else if (strcmp(name,"Numericalflux")==0) return NumericalfluxEnum;
121 else if (strcmp(name,"NumericalfluxType")==0) return NumericalfluxTypeEnum;
122 else if (strcmp(name,"Param")==0) return ParamEnum;
123- else if (strcmp(name,"Pengrid")==0) return PengridEnum;
124- else if (strcmp(name,"Penpair")==0) return PenpairEnum;
125 else stage=5;
126 }
127 if(stage==5){
128- if (strcmp(name,"Profiler")==0) return ProfilerEnum;
129+ if (strcmp(name,"Pengrid")==0) return PengridEnum;
130+ else if (strcmp(name,"Penpair")==0) return PenpairEnum;
131+ else if (strcmp(name,"Profiler")==0) return ProfilerEnum;
132 else if (strcmp(name,"MatrixParam")==0) return MatrixParamEnum;
133 else if (strcmp(name,"Masscon")==0) return MassconEnum;
134 else if (strcmp(name,"MassconName")==0) return MassconNameEnum;
135@@ -626,12 +628,12 @@
136 else if (strcmp(name,"StressTensoryz")==0) return StressTensoryzEnum;
137 else if (strcmp(name,"StressTensorzz")==0) return StressTensorzzEnum;
138 else if (strcmp(name,"StressMaxPrincipal")==0) return StressMaxPrincipalEnum;
139- else if (strcmp(name,"DeviatoricStress")==0) return DeviatoricStressEnum;
140- else if (strcmp(name,"DeviatoricStressxx")==0) return DeviatoricStressxxEnum;
141 else stage=6;
142 }
143 if(stage==6){
144- if (strcmp(name,"DeviatoricStressxy")==0) return DeviatoricStressxyEnum;
145+ if (strcmp(name,"DeviatoricStress")==0) return DeviatoricStressEnum;
146+ else if (strcmp(name,"DeviatoricStressxx")==0) return DeviatoricStressxxEnum;
147+ else if (strcmp(name,"DeviatoricStressxy")==0) return DeviatoricStressxyEnum;
148 else if (strcmp(name,"DeviatoricStressxz")==0) return DeviatoricStressxzEnum;
149 else if (strcmp(name,"DeviatoricStressyy")==0) return DeviatoricStressyyEnum;
150 else if (strcmp(name,"DeviatoricStressyz")==0) return DeviatoricStressyzEnum;
151@@ -749,12 +751,12 @@
152 else if (strcmp(name,"Outputdefinition66")==0) return Outputdefinition66Enum;
153 else if (strcmp(name,"Outputdefinition67")==0) return Outputdefinition67Enum;
154 else if (strcmp(name,"Outputdefinition68")==0) return Outputdefinition68Enum;
155- else if (strcmp(name,"Outputdefinition69")==0) return Outputdefinition69Enum;
156- else if (strcmp(name,"Outputdefinition70")==0) return Outputdefinition70Enum;
157 else stage=7;
158 }
159 if(stage==7){
160- if (strcmp(name,"Outputdefinition71")==0) return Outputdefinition71Enum;
161+ if (strcmp(name,"Outputdefinition69")==0) return Outputdefinition69Enum;
162+ else if (strcmp(name,"Outputdefinition70")==0) return Outputdefinition70Enum;
163+ else if (strcmp(name,"Outputdefinition71")==0) return Outputdefinition71Enum;
164 else if (strcmp(name,"Outputdefinition72")==0) return Outputdefinition72Enum;
165 else if (strcmp(name,"Outputdefinition73")==0) return Outputdefinition73Enum;
166 else if (strcmp(name,"Outputdefinition74")==0) return Outputdefinition74Enum;
167@@ -872,12 +874,12 @@
168 else if (strcmp(name,"Sset")==0) return SsetEnum;
169 else if (strcmp(name,"Verbose")==0) return VerboseEnum;
170 else if (strcmp(name,"TriangleInterp")==0) return TriangleInterpEnum;
171- else if (strcmp(name,"BilinearInterp")==0) return BilinearInterpEnum;
172- else if (strcmp(name,"NearestInterp")==0) return NearestInterpEnum;
173 else stage=8;
174 }
175 if(stage==8){
176- if (strcmp(name,"XY")==0) return XYEnum;
177+ if (strcmp(name,"BilinearInterp")==0) return BilinearInterpEnum;
178+ else if (strcmp(name,"NearestInterp")==0) return NearestInterpEnum;
179+ else if (strcmp(name,"XY")==0) return XYEnum;
180 else if (strcmp(name,"XYZ")==0) return XYZEnum;
181 else if (strcmp(name,"Dense")==0) return DenseEnum;
182 else if (strcmp(name,"MpiDense")==0) return MpiDenseEnum;
183Index: ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h
184===================================================================
185--- ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h (revision 0)
186+++ ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h (revision 19198)
187@@ -0,0 +1,66 @@
188+/*\file Marshalling.h
189+ *\brief: macros to help automate the marshalling, demarshalling, and marshalling size routines.
190+ */
191+
192+#ifndef _MARSHALLING_H_
193+#define _MARSHALLING_H_
194+
195+enum marshall_directions{
196+ MARSHALLING_FORWARD,
197+ MARSHALLING_BACKWARDS
198+};
199+
200+#define MARSHALLING_ENUM(EN) \
201+ int enum_type=EN; \
202+ if(marshall_direction==MARSHALLING_FORWARD){\
203+ if(pmarshalled_data){\
204+ memcpy(*pmarshalled_data,&enum_type,sizeof(int));\
205+ *pmarshalled_data+=sizeof(int);\
206+ }\
207+ *pmarshalled_data_size+=sizeof(int);\
208+ }
209+
210+#define MARSHALLING(FIELD) \
211+\
212+ if(marshall_direction==MARSHALLING_FORWARD){\
213+ if(pmarshalled_data){\
214+ memcpy(*pmarshalled_data,&FIELD,sizeof(FIELD));\
215+ *pmarshalled_data+=sizeof(FIELD);\
216+ }\
217+ *pmarshalled_data_size+=sizeof(FIELD);\
218+ }\
219+ else{\
220+ memcpy(&FIELD,*pmarshalled_data,sizeof(FIELD));\
221+ *pmarshalled_data+=sizeof(FIELD);\
222+ }
223+
224+#define MARSHALLING_ARRAY(FIELD,TYPE,SIZE) \
225+\
226+ if(marshall_direction==MARSHALLING_FORWARD){\
227+ if(pmarshalled_data){\
228+ memcpy(*pmarshalled_data,FIELD,SIZE*sizeof(TYPE));\
229+ *pmarshalled_data+=SIZE*sizeof(TYPE);\
230+ }\
231+ *pmarshalled_data_size+=SIZE*sizeof(TYPE);\
232+ }\
233+ else{\
234+ memcpy(FIELD,*pmarshalled_data,SIZE*sizeof(TYPE));\
235+ *pmarshalled_data+=SIZE*sizeof(TYPE);\
236+ }
237+
238+#define MARSHALLING_DYNAMIC(FIELD,TYPE,SIZE) \
239+\
240+ if(marshall_direction==MARSHALLING_FORWARD){\
241+ if(pmarshalled_data){\
242+ memcpy(*pmarshalled_data,FIELD,SIZE*sizeof(TYPE));\
243+ *pmarshalled_data+=SIZE*sizeof(TYPE);\
244+ }\
245+ *pmarshalled_data_size+=SIZE*sizeof(TYPE);\
246+ }\
247+ else{\
248+ FIELD=xNew<TYPE>(SIZE);\
249+ memcpy(FIELD,*pmarshalled_data,SIZE*sizeof(TYPE));\
250+ *pmarshalled_data+=SIZE*sizeof(TYPE);\
251+ }
252+
253+#endif
254Index: ../trunk-jpl/src/c/shared/io/io.h
255===================================================================
256--- ../trunk-jpl/src/c/shared/io/io.h (revision 19197)
257+++ ../trunk-jpl/src/c/shared/io/io.h (revision 19198)
258@@ -11,8 +11,9 @@
259 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
260 #endif
261
262+#include "./Comm/IssmComm.h"
263 #include "./Disk/diskio.h"
264 #include "./Print/Print.h"
265-#include "./Comm/IssmComm.h"
266+#include "./Marshalling/Marshalling.h"
267
268 #endif /* _IO_H_ */
269Index: ../trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp
270===================================================================
271--- ../trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp (revision 19197)
272+++ ../trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp (revision 19198)
273@@ -251,7 +251,6 @@
274 IsIdenticalNode(xnodes[2],ynodes[2],xsegment[0],ysegment[0],tolerance)){
275
276 /*ok, segments[0] is common to one of our vertices: */
277- //if (el==318 && contouri==9){ _printf_("ok1" << "\n"); }
278 coord1=0;
279 if(edge1==IntersectEnum){coord2=alpha1;}
280 if(edge2==IntersectEnum){coord2=beta1;}
281Index: ../trunk-jpl/src/c/toolkits/issm/Bucket.h
282===================================================================
283--- ../trunk-jpl/src/c/toolkits/issm/Bucket.h (revision 19197)
284+++ ../trunk-jpl/src/c/toolkits/issm/Bucket.h (revision 19198)
285@@ -8,7 +8,7 @@
286 /*Headers:*/
287 /*{{{*/
288 #include "../../datastructures/datastructures.h"
289-#include "../../shared/shared.h"
290+#include "../../shared/io/Comm/IssmComm.h"
291 #include "../toolkitsenums.h"
292 /*}}}*/
293
294@@ -128,6 +128,10 @@
295 else if (this->type==VECTOR_BUCKET) return new Bucket(this->m,this->idxm,this->values,this->mode);
296 else _error_("No Copy of Bucket because its type is invalid."); };
297 /*}}}*/
298+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
299+ _error_("not implemented yet!");
300+ }
301+ /*}}}*/
302
303 /*specific routines of Bucket: */
304 void SpawnBucketsPerCpu(DataSet* bucketsofcpu_i,int rank_i,int* rowranks){ /*{{{*/
305Index: ../trunk-jpl/src/c/classes/Contour.h
306===================================================================
307--- ../trunk-jpl/src/c/classes/Contour.h (revision 19197)
308+++ ../trunk-jpl/src/c/classes/Contour.h (revision 19198)
309@@ -82,6 +82,11 @@
310 return (Object*) contour;
311 }
312 /*}}}*/
313+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
314+ _error_("not implemented yet!");
315+ }
316+ /*}}}*/
317+
318 };
319
320 #endif /* _CONTOUR_H_ */
321Index: ../trunk-jpl/src/c/classes/Materials/Matice.h
322===================================================================
323--- ../trunk-jpl/src/c/classes/Materials/Matice.h (revision 19197)
324+++ ../trunk-jpl/src/c/classes/Materials/Matice.h (revision 19198)
325@@ -39,6 +39,7 @@
326 int Id();
327 int ObjectEnum();
328 Object* copy();
329+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
330 /*}}}*/
331 /*Update virtual funictions definitions: {{{*/
332 void InputUpdateFromVector(IssmDouble* vector, int name, int type);
333Index: ../trunk-jpl/src/c/classes/Materials/Matpar.h
334===================================================================
335--- ../trunk-jpl/src/c/classes/Materials/Matpar.h (revision 19197)
336+++ ../trunk-jpl/src/c/classes/Materials/Matpar.h (revision 19198)
337@@ -78,6 +78,7 @@
338 int Id();
339 int ObjectEnum();
340 Object *copy();
341+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
342 /*}}}*/
343 /*Update virtual functions resolution: {{{*/
344 void InputUpdateFromVector(IssmDouble* vector, int name, int type);
345Index: ../trunk-jpl/src/c/classes/DependentObject.h
346===================================================================
347--- ../trunk-jpl/src/c/classes/DependentObject.h (revision 19197)
348+++ ../trunk-jpl/src/c/classes/DependentObject.h (revision 19198)
349@@ -31,7 +31,11 @@
350 int Id();
351 int ObjectEnum();
352 Object* copy(void);
353+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
354+ _error_("not implemented yet!");
355+ }
356 /*}}}*/
357+ /*}}}*/
358
359 /*DependentObject methods: */
360 int NumDependents(void);
361Index: ../trunk-jpl/src/c/classes/Params/DoubleVecParam.h
362===================================================================
363--- ../trunk-jpl/src/c/classes/Params/DoubleVecParam.h (revision 19197)
364+++ ../trunk-jpl/src/c/classes/Params/DoubleVecParam.h (revision 19198)
365@@ -36,6 +36,7 @@
366 int Id();
367 int ObjectEnum();
368 Object* copy();
369+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
370 /*}}}*/
371 /*Param virtual functions definitions: {{{*/
372 int InstanceEnum(){return enum_type;}
373Index: ../trunk-jpl/src/c/classes/Params/GenericParam.h
374===================================================================
375--- ../trunk-jpl/src/c/classes/Params/GenericParam.h (revision 19197)
376+++ ../trunk-jpl/src/c/classes/Params/GenericParam.h (revision 19198)
377@@ -51,6 +51,7 @@
378 // it does not clarify ownership of the newed up instance...
379 // use the default copy constructor instead
380 Object* copy() { return new GenericParam<P>(*this); };
381+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
382 /*}}}*/
383 /*Param vritual function definitions: {{{*/
384 int InstanceEnum(){return myEnumVal;}
385Index: ../trunk-jpl/src/c/classes/Params/DoubleMatParam.h
386===================================================================
387--- ../trunk-jpl/src/c/classes/Params/DoubleMatParam.h (revision 19197)
388+++ ../trunk-jpl/src/c/classes/Params/DoubleMatParam.h (revision 19198)
389@@ -37,6 +37,7 @@
390 int Id();
391 int ObjectEnum();
392 Object* copy();
393+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
394 /*}}}*/
395 /*Param vritual function definitions: {{{*/
396 int InstanceEnum(){return enum_type;}
397Index: ../trunk-jpl/src/c/classes/Params/FileParam.h
398===================================================================
399--- ../trunk-jpl/src/c/classes/Params/FileParam.h (revision 19197)
400+++ ../trunk-jpl/src/c/classes/Params/FileParam.h (revision 19198)
401@@ -35,6 +35,7 @@
402 int Id();
403 int ObjectEnum();
404 Object* copy();
405+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
406 /*}}}*/
407 /*Param vritual function definitions: {{{*/
408 int InstanceEnum(){return enum_type;}
409Index: ../trunk-jpl/src/c/classes/Params/DataSetParam.h
410===================================================================
411--- ../trunk-jpl/src/c/classes/Params/DataSetParam.h (revision 19197)
412+++ ../trunk-jpl/src/c/classes/Params/DataSetParam.h (revision 19198)
413@@ -36,6 +36,7 @@
414 int Id();
415 int ObjectEnum();
416 Object* copy();
417+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
418 /*}}}*/
419 /*Param vritual function definitions: {{{*/
420 int InstanceEnum(){return enum_type;}
421Index: ../trunk-jpl/src/c/classes/Params/IntParam.h
422===================================================================
423--- ../trunk-jpl/src/c/classes/Params/IntParam.h (revision 19197)
424+++ ../trunk-jpl/src/c/classes/Params/IntParam.h (revision 19198)
425@@ -36,6 +36,7 @@
426 int Id();
427 int ObjectEnum();
428 Object* copy();
429+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
430 /*}}}*/
431 /*Param vritual function definitions: {{{*/
432 int InstanceEnum(){return enum_type;}
433Index: ../trunk-jpl/src/c/classes/Params/VectorParam.h
434===================================================================
435--- ../trunk-jpl/src/c/classes/Params/VectorParam.h (revision 19197)
436+++ ../trunk-jpl/src/c/classes/Params/VectorParam.h (revision 19198)
437@@ -36,6 +36,7 @@
438 int Id();
439 int ObjectEnum();
440 Object* copy();
441+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
442 /*}}}*/
443 /*Param vritual function definitions: {{{*/
444 int InstanceEnum(){return enum_type;}
445Index: ../trunk-jpl/src/c/classes/Params/MatrixParam.h
446===================================================================
447--- ../trunk-jpl/src/c/classes/Params/MatrixParam.h (revision 19197)
448+++ ../trunk-jpl/src/c/classes/Params/MatrixParam.h (revision 19198)
449@@ -36,6 +36,7 @@
450 int Id();
451 int ObjectEnum();
452 Object* copy();
453+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
454 /*}}}*/
455 /*Param vritual function definitions: {{{*/
456 int InstanceEnum(){return enum_type;}
457Index: ../trunk-jpl/src/c/classes/Params/StringArrayParam.h
458===================================================================
459--- ../trunk-jpl/src/c/classes/Params/StringArrayParam.h (revision 19197)
460+++ ../trunk-jpl/src/c/classes/Params/StringArrayParam.h (revision 19198)
461@@ -37,6 +37,7 @@
462 int Id();
463 int ObjectEnum();
464 Object* copy();
465+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
466 /*}}}*/
467 /*Param vritual function definitions: {{{*/
468 int InstanceEnum(){return enum_type;}
469Index: ../trunk-jpl/src/c/classes/Params/TransientParam.h
470===================================================================
471--- ../trunk-jpl/src/c/classes/Params/TransientParam.h (revision 19197)
472+++ ../trunk-jpl/src/c/classes/Params/TransientParam.h (revision 19198)
473@@ -37,6 +37,7 @@
474 int Id();
475 int ObjectEnum();
476 Object* copy();
477+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
478 /*}}}*/
479 /*Param vritual function definitions: {{{*/
480 int InstanceEnum(){return enum_type;}
481Index: ../trunk-jpl/src/c/classes/Params/DoubleParam.h
482===================================================================
483--- ../trunk-jpl/src/c/classes/Params/DoubleParam.h (revision 19197)
484+++ ../trunk-jpl/src/c/classes/Params/DoubleParam.h (revision 19198)
485@@ -36,6 +36,7 @@
486 int Id();
487 int ObjectEnum();
488 Object* copy();
489+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
490 /*}}}*/
491 /*Param vritual function definitions: {{{*/
492 int InstanceEnum(){return enum_type;}
493Index: ../trunk-jpl/src/c/classes/Params/DoubleMatArrayParam.h
494===================================================================
495--- ../trunk-jpl/src/c/classes/Params/DoubleMatArrayParam.h (revision 19197)
496+++ ../trunk-jpl/src/c/classes/Params/DoubleMatArrayParam.h (revision 19198)
497@@ -38,6 +38,7 @@
498 int Id();
499 int ObjectEnum();
500 Object* copy();
501+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
502 /*}}}*/
503 /*Param vritual function definitions: {{{*/
504 int InstanceEnum(){return enum_type;}
505Index: ../trunk-jpl/src/c/classes/Params/IntVecParam.h
506===================================================================
507--- ../trunk-jpl/src/c/classes/Params/IntVecParam.h (revision 19197)
508+++ ../trunk-jpl/src/c/classes/Params/IntVecParam.h (revision 19198)
509@@ -37,6 +37,7 @@
510 int Id();
511 int ObjectEnum();
512 Object* copy();
513+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
514 /*}}}*/
515 /*Param virtual functions definitions: {{{*/
516 int InstanceEnum(){return enum_type;}
517Index: ../trunk-jpl/src/c/classes/Params/BoolParam.h
518===================================================================
519--- ../trunk-jpl/src/c/classes/Params/BoolParam.h (revision 19197)
520+++ ../trunk-jpl/src/c/classes/Params/BoolParam.h (revision 19198)
521@@ -35,6 +35,7 @@
522 int Id();
523 int ObjectEnum();
524 Object* copy();
525+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
526 /*}}}*/
527 /*Param vritual function definitions: {{{*/
528 int InstanceEnum(){return enum_type;}
529Index: ../trunk-jpl/src/c/classes/Params/IntMatParam.h
530===================================================================
531--- ../trunk-jpl/src/c/classes/Params/IntMatParam.h (revision 19197)
532+++ ../trunk-jpl/src/c/classes/Params/IntMatParam.h (revision 19198)
533@@ -37,6 +37,7 @@
534 int Id();
535 int ObjectEnum();
536 Object* copy();
537+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
538 /*}}}*/
539 /*Param vritual function definitions: {{{*/
540 int InstanceEnum(){return enum_type;}
541Index: ../trunk-jpl/src/c/classes/Params/StringParam.h
542===================================================================
543--- ../trunk-jpl/src/c/classes/Params/StringParam.h (revision 19197)
544+++ ../trunk-jpl/src/c/classes/Params/StringParam.h (revision 19198)
545@@ -36,6 +36,7 @@
546 int Id();
547 int ObjectEnum();
548 Object* copy();
549+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
550 /*}}}*/
551 /*Param vritual function definitions: {{{*/
552 int InstanceEnum(){return enum_type;}
553Index: ../trunk-jpl/src/c/classes/Masscon.h
554===================================================================
555--- ../trunk-jpl/src/c/classes/Masscon.h (revision 19197)
556+++ ../trunk-jpl/src/c/classes/Masscon.h (revision 19198)
557@@ -76,6 +76,10 @@
558 return (Object*) mf;
559 }
560 /*}}}*/
561+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
562+ _error_("not implemented yet!");
563+ }
564+ /*}}}*/
565 /*Definition virtual function resolutoin: */
566 char* Name(){/*{{{*/
567
568Index: ../trunk-jpl/src/c/classes/kriging/Observation.h
569===================================================================
570--- ../trunk-jpl/src/c/classes/kriging/Observation.h (revision 19197)
571+++ ../trunk-jpl/src/c/classes/kriging/Observation.h (revision 19198)
572@@ -32,7 +32,9 @@
573 int ObjectEnum(){_error_("Not implemented yet"); };
574 bool operator==(const Observation& ob) const;
575 Object *copy();
576+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!");};
577
578+
579 /*Management*/
580 void WriteXYObs(const Observation& ob, double* px, double* py, double* pobs);
581 void WriteXYObs(double* px,double* py,double* pobs);
582Index: ../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h
583===================================================================
584--- ../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h (revision 19197)
585+++ ../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h (revision 19198)
586@@ -26,7 +26,9 @@
587 int Id(){_error_("Not implemented yet");};
588 int ObjectEnum(){_error_("Not implemented yet");};
589 Object* copy();
590+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
591
592+
593 /*Variogram functions*/
594 double SemiVariogram(double deltax,double deltay);
595 double Covariance(double deltax,double deltay);
596Index: ../trunk-jpl/src/c/classes/kriging/PowerVariogram.h
597===================================================================
598--- ../trunk-jpl/src/c/classes/kriging/PowerVariogram.h (revision 19197)
599+++ ../trunk-jpl/src/c/classes/kriging/PowerVariogram.h (revision 19198)
600@@ -26,7 +26,9 @@
601 int Id(){_error_("Not implemented yet");};
602 int ObjectEnum(){_error_("Not implemented yet");};
603 Object* copy();
604+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
605
606+
607 /*Variogram functions*/
608 double SemiVariogram(double deltax,double deltay);
609 double Covariance(double deltax,double deltay);
610Index: ../trunk-jpl/src/c/classes/kriging/Quadtree.h
611===================================================================
612--- ../trunk-jpl/src/c/classes/kriging/Quadtree.h (revision 19197)
613+++ ../trunk-jpl/src/c/classes/kriging/Quadtree.h (revision 19198)
614@@ -30,7 +30,9 @@
615 int Id() {_error_("not implemented yet"); };
616 int ObjectEnum(){_error_("not implemented yet"); };
617 Object *copy();
618+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!");};
619
620+
621 /*Methods*/
622 int IsWithinRange(double x,double y,double range);
623 void RangeSearch(int *indices,int *pnobs,double x,double y,double range);
624Index: ../trunk-jpl/src/c/classes/kriging/GaussianVariogram.h
625===================================================================
626--- ../trunk-jpl/src/c/classes/kriging/GaussianVariogram.h (revision 19197)
627+++ ../trunk-jpl/src/c/classes/kriging/GaussianVariogram.h (revision 19198)
628@@ -27,6 +27,7 @@
629 int Id(){_error_("Not implemented yet");};
630 int ObjectEnum(){_error_("Not implemented yet");};
631 Object* copy();
632+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
633
634 /*Variogram functions*/
635 double SemiVariogram(double deltax,double deltay);
636Index: ../trunk-jpl/src/c/classes/kriging/SphericalVariogram.h
637===================================================================
638--- ../trunk-jpl/src/c/classes/kriging/SphericalVariogram.h (revision 19197)
639+++ ../trunk-jpl/src/c/classes/kriging/SphericalVariogram.h (revision 19198)
640@@ -26,7 +26,9 @@
641 int Id(){_error_("Not implemented yet");};
642 int ObjectEnum(){_error_("Not implemented yet");};
643 Object* copy();
644+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
645
646+
647 /*Variogram functions*/
648 double SemiVariogram(double deltax,double deltay);
649 double Covariance(double deltax,double deltay);
650Index: ../trunk-jpl/src/c/classes/Options/Option.h
651===================================================================
652--- ../trunk-jpl/src/c/classes/Options/Option.h (revision 19197)
653+++ ../trunk-jpl/src/c/classes/Options/Option.h (revision 19198)
654@@ -25,7 +25,9 @@
655 int Id(){_error_("Not implemented yet"); };
656 int ObjectEnum(){return OptionEnum; };
657 Object *copy(){_error_("Not implemented yet"); };
658+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
659
660+
661 /*virtual functions: */
662 virtual char* Name()=0;
663 virtual int NumEl()=0;
664Index: ../trunk-jpl/src/c/classes/Loads/Loads.cpp
665===================================================================
666--- ../trunk-jpl/src/c/classes/Loads/Loads.cpp (revision 19197)
667+++ ../trunk-jpl/src/c/classes/Loads/Loads.cpp (revision 19198)
668@@ -14,9 +14,9 @@
669 #include <functional>
670 #include <algorithm>
671
672+#include "../../shared/io/Comm/IssmComm.h"
673 #include "./Loads.h"
674 #include "./Load.h"
675-#include "../../shared/shared.h"
676
677 using namespace std;
678 /*}}}*/
679Index: ../trunk-jpl/src/c/classes/Loads/Riftfront.h
680===================================================================
681--- ../trunk-jpl/src/c/classes/Loads/Riftfront.h (revision 19197)
682+++ ../trunk-jpl/src/c/classes/Loads/Riftfront.h (revision 19198)
683@@ -61,6 +61,7 @@
684 void Echo();
685 int Id();
686 int ObjectEnum();
687+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
688 /*}}}*/
689 /*Update virtual functions resolution: {{{*/
690 void InputUpdateFromConstant(IssmDouble constant, int name);
691Index: ../trunk-jpl/src/c/classes/Loads/Numericalflux.h
692===================================================================
693--- ../trunk-jpl/src/c/classes/Loads/Numericalflux.h (revision 19197)
694+++ ../trunk-jpl/src/c/classes/Loads/Numericalflux.h (revision 19198)
695@@ -44,6 +44,7 @@
696 void Echo();
697 int Id();
698 int ObjectEnum();
699+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
700 /*}}}*/
701 /*Update virtual functions resolution: {{{*/
702 void InputUpdateFromConstant(IssmDouble constant, int name){/*Do nothing*/};
703Index: ../trunk-jpl/src/c/classes/Loads/Penpair.h
704===================================================================
705--- ../trunk-jpl/src/c/classes/Loads/Penpair.h (revision 19197)
706+++ ../trunk-jpl/src/c/classes/Loads/Penpair.h (revision 19198)
707@@ -35,6 +35,7 @@
708 void Echo();
709 int Id();
710 int ObjectEnum();
711+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
712 /*}}}*/
713 /*Update virtual functions resolution: {{{*/
714 void InputUpdateFromConstant(IssmDouble constant, int name);
715Index: ../trunk-jpl/src/c/classes/Loads/Pengrid.h
716===================================================================
717--- ../trunk-jpl/src/c/classes/Loads/Pengrid.h (revision 19197)
718+++ ../trunk-jpl/src/c/classes/Loads/Pengrid.h (revision 19198)
719@@ -54,6 +54,7 @@
720 int Id();
721 int ObjectEnum();
722 Object* copy();
723+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
724 /*}}}*/
725 /*Update virtual functions resolution: {{{*/
726 void InputUpdateFromVector(IssmDouble* vector, int name, int type);
727Index: ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h
728===================================================================
729--- ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h (revision 19197)
730+++ ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h (revision 19198)
731@@ -125,7 +125,13 @@
732 Object* copy(void) { /*{{{*/
733 return new GenericExternalResult<ResultType>(this->id,this->result_name,this->value,this->step,this->time);
734 } /*}}}*/
735+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
736+ _error_("not implemented yet!");
737+ }
738+ /*}}}*/
739
740+
741+
742 /*GenericExternalResult management: */
743 void WriteData(FILE* fid,bool io_gather){ /*{{{*/
744
745Index: ../trunk-jpl/src/c/classes/FemModel.cpp
746===================================================================
747--- ../trunk-jpl/src/c/classes/FemModel.cpp (revision 19197)
748+++ ../trunk-jpl/src/c/classes/FemModel.cpp (revision 19198)
749@@ -608,6 +608,8 @@
750
751 FILE* restartfid=NULL;
752 char* restartfilename = NULL;
753+ int femmodel_size;
754+ char* femmodel_buffer=NULL;
755
756 /*First, recover the name of the restart file: */
757 parameters->FindParam(&restartfilename,RestartFileNameEnum);
758@@ -615,10 +617,21 @@
759 /*Open file for writing: */
760 restartfid=pfopen(restartfilename,"wb");
761
762+ /*Create buffer to hold marshalled femmodel: */
763+ this->Marshall(NULL,&femmodel_size,MARSHALLING_FORWARD);
764+ femmodel_buffer=xNew<char>(femmodel_size);
765+
766+ /*Marshall:*/
767+ this->Marshall(&femmodel_buffer,&femmodel_size,MARSHALLING_FORWARD);
768+
769+ /*write buffer: */
770+ fwrite(femmodel_buffer,femmodel_size,sizeof(IssmPDouble),restartfid);
771+
772 /*Done, close file :*/
773 pfclose(restartfid,restartfilename);
774
775 /*Free ressources: */
776+ xDelete<char>(femmodel_buffer);
777 xDelete<char>(restartfilename);
778
779 }
780@@ -626,7 +639,40 @@
781 void FemModel::Restart(void){/*{{{*/
782 }
783 /*}}}*/
784+void FemModel::Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
785
786+ MARSHALLING_ENUM(FemModelEnum);
787+
788+ MARSHALLING(solution_type);
789+ MARSHALLING(analysis_counter);
790+ MARSHALLING_DYNAMIC(analysis_type_list,int,analysis_counter);
791+
792+ if(marshall_direction==MARSHALLING_BACKWARDS){
793+ profiler=new Profiler;
794+ elements=new Elements();
795+ nodes=new Nodes();
796+ vertices=new Vertices();
797+ constraints=new Constraints();
798+ loads=new Loads();
799+ materials=new Materials();
800+ parameters=new Parameters();
801+ results=new Results();
802+ }
803+
804+ profiler->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
805+ elements->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
806+ nodes->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
807+ vertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
808+ constraints->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
809+ loads->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
810+ materials->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
811+ parameters->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
812+ results->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
813+
814+ MARSHALLING(comm);
815+}
816+/*}}}*/
817+
818 /*Modules:*/
819 int FemModel::UpdateVertexPositionsx(void){ /*{{{*/
820
821Index: ../trunk-jpl/src/c/classes/IndependentObject.h
822===================================================================
823--- ../trunk-jpl/src/c/classes/IndependentObject.h (revision 19197)
824+++ ../trunk-jpl/src/c/classes/IndependentObject.h (revision 19198)
825@@ -30,6 +30,7 @@
826 int Id();
827 int ObjectEnum();
828 Object* copy(void);
829+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!");};
830 /*}}}*/
831 /*IndependentObject methods: {{{*/
832 void FetchIndependent(IoModel* iomodel,int* pXcount,IssmPDouble* X);
833Index: ../trunk-jpl/src/c/classes/Node.h
834===================================================================
835--- ../trunk-jpl/src/c/classes/Node.h (revision 19197)
836+++ ../trunk-jpl/src/c/classes/Node.h (revision 19198)
837@@ -49,6 +49,7 @@
838 int Id();
839 int ObjectEnum();
840 Object *copy();
841+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
842
843 /*Node numerical routines*/
844 void CreateNodalConstraints(Vector<IssmDouble>* ys);
845Index: ../trunk-jpl/src/c/classes/Elements/Element.h
846===================================================================
847--- ../trunk-jpl/src/c/classes/Elements/Element.h (revision 19197)
848+++ ../trunk-jpl/src/c/classes/Elements/Element.h (revision 19198)
849@@ -66,6 +66,7 @@
850 void DeleteInput(int input_enum);
851 void DeleteMaterials(void);
852 IssmDouble Divergence(void);
853+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!");};
854 void dViscositydBFS(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input);
855 void dViscositydBHO(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
856 void dViscositydBSSA(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
857Index: ../trunk-jpl/src/c/classes/Misfit.h
858===================================================================
859--- ../trunk-jpl/src/c/classes/Misfit.h (revision 19197)
860+++ ../trunk-jpl/src/c/classes/Misfit.h (revision 19198)
861@@ -103,6 +103,10 @@
862 return (Object*) mf;
863 }
864 /*}}}*/
865+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
866+ _error_("not implemented yet!");
867+ }
868+ /*}}}*/
869 /*Definition virtual function resolutoin: */
870 char* Name(){/*{{{*/
871
872Index: ../trunk-jpl/src/c/classes/Inputs/DoubleInput.h
873===================================================================
874--- ../trunk-jpl/src/c/classes/Inputs/DoubleInput.h (revision 19197)
875+++ ../trunk-jpl/src/c/classes/Inputs/DoubleInput.h (revision 19198)
876@@ -29,6 +29,7 @@
877 int Id();
878 int ObjectEnum();
879 Object* copy();
880+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
881 /*}}}*/
882 /*DoubleInput management: {{{*/
883 int InstanceEnum();
884Index: ../trunk-jpl/src/c/classes/Inputs/SegInput.h
885===================================================================
886--- ../trunk-jpl/src/c/classes/Inputs/SegInput.h (revision 19197)
887+++ ../trunk-jpl/src/c/classes/Inputs/SegInput.h (revision 19198)
888@@ -31,6 +31,7 @@
889 int Id();
890 int ObjectEnum();
891 Object *copy();
892+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
893
894 /*SegInput management:*/
895 int InstanceEnum();
896Index: ../trunk-jpl/src/c/classes/Inputs/TetraInput.h
897===================================================================
898--- ../trunk-jpl/src/c/classes/Inputs/TetraInput.h (revision 19197)
899+++ ../trunk-jpl/src/c/classes/Inputs/TetraInput.h (revision 19198)
900@@ -31,6 +31,7 @@
901 int Id();
902 int ObjectEnum();
903 Object *copy();
904+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
905
906 /*TetraInput management:*/
907 int InstanceEnum();
908Index: ../trunk-jpl/src/c/classes/Inputs/ControlInput.h
909===================================================================
910--- ../trunk-jpl/src/c/classes/Inputs/ControlInput.h (revision 19197)
911+++ ../trunk-jpl/src/c/classes/Inputs/ControlInput.h (revision 19198)
912@@ -34,6 +34,7 @@
913 int Id();
914 int ObjectEnum();
915 Object* copy();
916+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
917 /*}}}*/
918 /*ControlInput management: {{{*/
919 int InstanceEnum();
920Index: ../trunk-jpl/src/c/classes/Inputs/DatasetInput.h
921===================================================================
922--- ../trunk-jpl/src/c/classes/Inputs/DatasetInput.h (revision 19197)
923+++ ../trunk-jpl/src/c/classes/Inputs/DatasetInput.h (revision 19198)
924@@ -31,6 +31,7 @@
925 int Id();
926 int ObjectEnum();
927 Object* copy();
928+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
929 /*}}}*/
930 /*DatasetInput management: {{{*/
931 void AddInput(Input* input,int id);
932Index: ../trunk-jpl/src/c/classes/Inputs/IntInput.h
933===================================================================
934--- ../trunk-jpl/src/c/classes/Inputs/IntInput.h (revision 19197)
935+++ ../trunk-jpl/src/c/classes/Inputs/IntInput.h (revision 19198)
936@@ -30,6 +30,7 @@
937 int Id();
938 int ObjectEnum();
939 Object* copy();
940+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
941 /*}}}*/
942 /*IntInput management: {{{*/
943 int InstanceEnum();
944Index: ../trunk-jpl/src/c/classes/Inputs/BoolInput.h
945===================================================================
946--- ../trunk-jpl/src/c/classes/Inputs/BoolInput.h (revision 19197)
947+++ ../trunk-jpl/src/c/classes/Inputs/BoolInput.h (revision 19198)
948@@ -26,6 +26,7 @@
949 int Id();
950 int ObjectEnum();
951 Object *copy();
952+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
953 /*}}}*/
954 /*BoolInput management: {{{*/
955 int InstanceEnum();
956Index: ../trunk-jpl/src/c/classes/Inputs/TriaInput.h
957===================================================================
958--- ../trunk-jpl/src/c/classes/Inputs/TriaInput.h (revision 19197)
959+++ ../trunk-jpl/src/c/classes/Inputs/TriaInput.h (revision 19198)
960@@ -31,6 +31,7 @@
961 int Id();
962 int ObjectEnum();
963 Object *copy();
964+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
965
966 /*TriaInput management:*/
967 int InstanceEnum();
968Index: ../trunk-jpl/src/c/classes/Inputs/PentaInput.h
969===================================================================
970--- ../trunk-jpl/src/c/classes/Inputs/PentaInput.h (revision 19197)
971+++ ../trunk-jpl/src/c/classes/Inputs/PentaInput.h (revision 19198)
972@@ -31,6 +31,7 @@
973 int Id();
974 int ObjectEnum();
975 Object *copy();
976+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
977
978 /*PentaInput management*/
979 int InstanceEnum();
980Index: ../trunk-jpl/src/c/classes/Inputs/TransientInput.h
981===================================================================
982--- ../trunk-jpl/src/c/classes/Inputs/TransientInput.h (revision 19197)
983+++ ../trunk-jpl/src/c/classes/Inputs/TransientInput.h (revision 19198)
984@@ -36,6 +36,7 @@
985 int Id();
986 int ObjectEnum();
987 Object* copy();
988+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
989 /*}}}*/
990 /*TransientInput management: {{{*/
991 int InstanceEnum();
992Index: ../trunk-jpl/src/c/classes/Segment.h
993===================================================================
994--- ../trunk-jpl/src/c/classes/Segment.h (revision 19197)
995+++ ../trunk-jpl/src/c/classes/Segment.h (revision 19198)
996@@ -70,6 +70,10 @@
997 return new Segment(this->eid,this->x1,this->y1,this->x2,this->y2);
998 }
999 /*}}}*/
1000+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
1001+ _error_("not implemented yet!");
1002+ }
1003+ /*}}}*/
1004
1005 };
1006
1007Index: ../trunk-jpl/src/c/classes/Nodes.cpp
1008===================================================================
1009--- ../trunk-jpl/src/c/classes/Nodes.cpp (revision 19197)
1010+++ ../trunk-jpl/src/c/classes/Nodes.cpp (revision 19198)
1011@@ -10,8 +10,8 @@
1012 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
1013 #endif
1014
1015+#include "../shared/io/Comm/IssmComm.h"
1016 #include "./Nodes.h"
1017-#include "../shared/shared.h"
1018 #include "./Node.h"
1019
1020 using namespace std;
1021Index: ../trunk-jpl/src/c/classes/Massconaxpby.h
1022===================================================================
1023--- ../trunk-jpl/src/c/classes/Massconaxpby.h (revision 19197)
1024+++ ../trunk-jpl/src/c/classes/Massconaxpby.h (revision 19198)
1025@@ -87,6 +87,10 @@
1026 return (Object*) mf;
1027 }
1028 /*}}}*/
1029+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
1030+ _error_("not implemented yet!");
1031+ }
1032+ /*}}}*/
1033 /*Definition virtual function resolutoin: */
1034 char* Name(){/*{{{*/
1035
1036Index: ../trunk-jpl/src/c/classes/Vertex.h
1037===================================================================
1038--- ../trunk-jpl/src/c/classes/Vertex.h (revision 19197)
1039+++ ../trunk-jpl/src/c/classes/Vertex.h (revision 19198)
1040@@ -41,6 +41,8 @@
1041 int Id();
1042 int ObjectEnum();
1043 Object* copy();
1044+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
1045+
1046 /*}}}*/
1047 /*Vertex management:*/
1048 int Pid(void);
1049Index: ../trunk-jpl/src/c/classes/Constraints/SpcDynamic.h
1050===================================================================
1051--- ../trunk-jpl/src/c/classes/Constraints/SpcDynamic.h (revision 19197)
1052+++ ../trunk-jpl/src/c/classes/Constraints/SpcDynamic.h (revision 19198)
1053@@ -34,6 +34,7 @@
1054 void Echo();
1055 int Id();
1056 int ObjectEnum();
1057+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
1058
1059 /*Constraint virtual functions definitions*/
1060 void ActivatePenaltyMethod(void);
1061Index: ../trunk-jpl/src/c/classes/Constraints/SpcStatic.h
1062===================================================================
1063--- ../trunk-jpl/src/c/classes/Constraints/SpcStatic.h (revision 19197)
1064+++ ../trunk-jpl/src/c/classes/Constraints/SpcStatic.h (revision 19198)
1065@@ -33,6 +33,7 @@
1066 int Id();
1067 int ObjectEnum();
1068 Object* copy();
1069+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
1070 /*}}}*/
1071 /*Constraint virtual functions definitions: {{{*/
1072 void ActivatePenaltyMethod(void);
1073Index: ../trunk-jpl/src/c/classes/Constraints/SpcTransient.h
1074===================================================================
1075--- ../trunk-jpl/src/c/classes/Constraints/SpcTransient.h (revision 19197)
1076+++ ../trunk-jpl/src/c/classes/Constraints/SpcTransient.h (revision 19198)
1077@@ -35,6 +35,7 @@
1078 void Echo();
1079 int Id();
1080 int ObjectEnum();
1081+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
1082 /*}}}*/
1083 /*Constraint virtual functions definitions: {{{*/
1084 void ActivatePenaltyMethod(void);
1085Index: ../trunk-jpl/src/c/classes/Profiler.h
1086===================================================================
1087--- ../trunk-jpl/src/c/classes/Profiler.h (revision 19197)
1088+++ ../trunk-jpl/src/c/classes/Profiler.h (revision 19198)
1089@@ -42,6 +42,7 @@
1090 int Id();
1091 int ObjectEnum();
1092 Object *copy();
1093+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
1094 /*}}}*/
1095 /*Profiler routines {{{*/
1096 void Tag(int tagenum,bool dontmpisync=false);
1097Index: ../trunk-jpl/src/c/classes/Massfluxatgate.h
1098===================================================================
1099--- ../trunk-jpl/src/c/classes/Massfluxatgate.h (revision 19197)
1100+++ ../trunk-jpl/src/c/classes/Massfluxatgate.h (revision 19198)
1101@@ -120,6 +120,10 @@
1102 return new Massfluxatgate(this->name,this->definitionenum,this->numsegments,this->x1,this->y1,this->x2,this->y2,this->elements);
1103 }
1104 /*}}}*/
1105+ void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
1106+ _error_("not implemented yet!");
1107+ }
1108+ /*}}}*/
1109 /*Definition virtual function resolutoin: */
1110 char* Name(){/*{{{*/
1111
1112Index: ../trunk-jpl/src/c/classes/FemModel.h
1113===================================================================
1114--- ../trunk-jpl/src/c/classes/FemModel.h (revision 19197)
1115+++ ../trunk-jpl/src/c/classes/FemModel.h (revision 19198)
1116@@ -60,6 +60,7 @@
1117 void SetCurrentConfiguration(int configuration_type);
1118 void SetCurrentConfiguration(int configuration_type,int analysis_type);
1119 void CheckPoint(void);
1120+ void Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction);
1121 void Restart(void);
1122
1123 /*Modules*/
1124Index: ../trunk-jpl/src/c/datastructures/DataSet.cpp
1125===================================================================
1126--- ../trunk-jpl/src/c/datastructures/DataSet.cpp (revision 19197)
1127+++ ../trunk-jpl/src/c/datastructures/DataSet.cpp (revision 19198)
1128@@ -18,6 +18,7 @@
1129
1130 #include "../datastructures/datastructures.h"
1131 #include "../shared/shared.h"
1132+#include "../classes/classes.h"
1133
1134 using namespace std;
1135 /*}}}*/
1136@@ -85,6 +86,66 @@
1137 /*}}}*/
1138
1139 /*Specific methods*/
1140+void DataSet::Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
1141+
1142+ vector<Object*>::iterator obj;
1143+ int obj_enum;
1144+ int i;
1145+
1146+ if(marshall_direction==MARSHALLING_FORWARD){
1147+ numsorted=objects.size();
1148+ }
1149+
1150+ MARSHALLING_ENUM(DataSetEnum);
1151+ MARSHALLING(enum_type);
1152+ MARSHALLING(sorted);
1153+ MARSHALLING(presorted);
1154+ MARSHALLING(numsorted);
1155+ MARSHALLING_DYNAMIC(sorted_ids,int,numsorted);
1156+ MARSHALLING_DYNAMIC(id_offsets,int,numsorted);
1157+
1158+ /*Now branch according to direction of marshalling: */
1159+ if(marshall_direction==MARSHALLING_FORWARD){
1160+ /*Go through our objects, and marshall them into the buffer: */
1161+ for ( obj=this->objects.begin() ; obj < this->objects.end(); obj++ ){
1162+ (*obj)->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
1163+ }
1164+ }
1165+ else{
1166+ /*This is the heart of the demashalling method. We have a buffer coming
1167+ in, and we are supposed to create a dataset out of it. No such thing
1168+ as class orientation for buffers, we need to key off the enum of each
1169+ object stored in the buffer. */
1170+ for(i=0;i<this->numsorted;i++){
1171+
1172+ /*Recover enum of object first: */
1173+ MARSHALLING_ENUM(obj_enum);
1174+
1175+ /*Reset the file pointer to point again to the beginning of the object: */
1176+ *pmarshalled_data-=sizeof(int);
1177+
1178+ /*Giant case statement to spin-up the right object, and demarshall into it the information
1179+ *stored in the buffer: */
1180+ switch(enum_type){
1181+ case NodeEnum:{
1182+ Node* node=NULL;
1183+ node=new Node();
1184+ node->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
1185+ this->AddObject(node);}
1186+ break;
1187+ case VertexEnum:{
1188+ Vertex* vertex=NULL;
1189+ vertex=new Vertex();
1190+ vertex->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
1191+ this->AddObject(vertex);}
1192+ break;
1193+ default:
1194+ _error_("could not recognize enum type: " << EnumToStringx(enum_type));
1195+ }
1196+ }
1197+ }
1198+}
1199+/*}}}*/
1200 int DataSet::AddObject(Object* object){/*{{{*/
1201
1202 _assert_(this);
1203Index: ../trunk-jpl/src/c/datastructures/DataSet.h
1204===================================================================
1205--- ../trunk-jpl/src/c/datastructures/DataSet.h (revision 19197)
1206+++ ../trunk-jpl/src/c/datastructures/DataSet.h (revision 19198)
1207@@ -32,6 +32,7 @@
1208 DataSet();
1209 DataSet(int enum_type);
1210 ~DataSet();
1211+ void Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction);
1212
1213 /*management*/
1214 int GetEnum();
1215Index: ../trunk-jpl/src/c/datastructures/Object.h
1216===================================================================
1217--- ../trunk-jpl/src/c/datastructures/Object.h (revision 19197)
1218+++ ../trunk-jpl/src/c/datastructures/Object.h (revision 19198)
1219@@ -20,6 +20,7 @@
1220 virtual int Id()=0;
1221 virtual int ObjectEnum()=0;
1222 virtual Object* copy()=0;
1223+ virtual void Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction)=0;
1224
1225 };
1226 #endif
1227Index: ../trunk-jpl/src/m/dev/devpath.py
1228===================================================================
1229--- ../trunk-jpl/src/m/dev/devpath.py (revision 19197)
1230+++ ../trunk-jpl/src/m/dev/devpath.py (revision 19198)
1231@@ -21,7 +21,7 @@
1232 if root not in sys.path:
1233 sys.path.append(root)
1234
1235-sys.path.append(ISSM_DIR + '/lib')
1236+sys.path.append(ISSM_DIR + '/build-fw/lib')
1237 sys.path.append(ISSM_DIR + '/src/wrappers/python/.libs')
1238 # If using clusters, we need to have the path to the cluster settings directory
1239 if(JPL_SVN!=None):
1240Index: ../trunk-jpl/src/m/dev/devpath.m
1241===================================================================
1242--- ../trunk-jpl/src/m/dev/devpath.m (revision 19197)
1243+++ ../trunk-jpl/src/m/dev/devpath.m (revision 19198)
1244@@ -17,7 +17,7 @@
1245
1246 %ISSM path
1247 addpath([ISSM_DIR '/src/m/os/']); %load recursivepath
1248-addpath([ISSM_DIR '/lib']); %load mex
1249+addpath([ISSM_DIR '/build-fw/lib']); %load mex
1250 addpath(recursivepath([ISSM_DIR '/src/m']));
1251 addpath(recursivepath([ISSM_DIR '/externalpackages/scotch']));
1252 addpath(recursivepath([ISSM_DIR '/externalpackages/canos']));
1253Index: ../trunk-jpl/src/m/mesh/bamg.m
1254===================================================================
1255--- ../trunk-jpl/src/m/mesh/bamg.m (revision 19197)
1256+++ ../trunk-jpl/src/m/mesh/bamg.m (revision 19198)
1257@@ -234,7 +234,10 @@
1258 track=getfieldvalue(options,'tracks');
1259 if all(ischar(track)),
1260 A=expread(track);
1261- track=[A.x A.y];
1262+ track=[];
1263+ for i=1:length(A),
1264+ track=[track; [A(i).x A(i).y]];
1265+ end
1266 else
1267 track=double(track); %for some reason, it is of class "single"
1268 end
1269Index: ../trunk-jpl/src/m/enum/FemModelEnum.m
1270===================================================================
1271--- ../trunk-jpl/src/m/enum/FemModelEnum.m (revision 0)
1272+++ ../trunk-jpl/src/m/enum/FemModelEnum.m (revision 19198)
1273@@ -0,0 +1,11 @@
1274+function macro=FemModelEnum()
1275+%FEMMODELENUM - Enum of FemModel
1276+%
1277+% WARNING: DO NOT MODIFY THIS FILE
1278+% this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
1279+% Please read src/c/shared/Enum/README for more information
1280+%
1281+% Usage:
1282+% macro=FemModelEnum()
1283+
1284+macro=StringToEnum('FemModel');
1285Index: ../trunk-jpl/src/m/enum/EnumDefinitions.py
1286===================================================================
1287--- ../trunk-jpl/src/m/enum/EnumDefinitions.py (revision 19197)
1288+++ ../trunk-jpl/src/m/enum/EnumDefinitions.py (revision 19198)
1289@@ -8,6 +8,7 @@
1290
1291 """
1292
1293+def FemModelEnum(): return StringToEnum("FemModel")[0]
1294 def AutodiffIsautodiffEnum(): return StringToEnum("AutodiffIsautodiff")[0]
1295 def AutodiffNumDependentsEnum(): return StringToEnum("AutodiffNumDependents")[0]
1296 def AutodiffNumDependentObjectsEnum(): return StringToEnum("AutodiffNumDependentObjects")[0]
1297@@ -445,6 +446,7 @@
1298 def FSApproximationEnum(): return StringToEnum("FSApproximation")[0]
1299 def FSvelocityEnum(): return StringToEnum("FSvelocity")[0]
1300 def FSpressureEnum(): return StringToEnum("FSpressure")[0]
1301+def DataSetEnum(): return StringToEnum("DataSet")[0]
1302 def ConstraintsEnum(): return StringToEnum("Constraints")[0]
1303 def LoadsEnum(): return StringToEnum("Loads")[0]
1304 def MaterialsEnum(): return StringToEnum("Materials")[0]
1305Index: ../trunk-jpl/src/m/enum/DataSetEnum.m
1306===================================================================
1307--- ../trunk-jpl/src/m/enum/DataSetEnum.m (revision 0)
1308+++ ../trunk-jpl/src/m/enum/DataSetEnum.m (revision 19198)
1309@@ -0,0 +1,11 @@
1310+function macro=DataSetEnum()
1311+%DATASETENUM - Enum of DataSet
1312+%
1313+% WARNING: DO NOT MODIFY THIS FILE
1314+% this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
1315+% Please read src/c/shared/Enum/README for more information
1316+%
1317+% Usage:
1318+% macro=DataSetEnum()
1319+
1320+macro=StringToEnum('DataSet');
Note: See TracBrowser for help on using the repository browser.