Index: ../trunk-jpl/src/c/bamg/BamgQuadtree.h =================================================================== --- ../trunk-jpl/src/c/bamg/BamgQuadtree.h (revision 19197) +++ ../trunk-jpl/src/c/bamg/BamgQuadtree.h (revision 19198) @@ -34,6 +34,7 @@ int Id() {_error_("not implemented yet"); }; int ObjectEnum() {_error_("not implemented yet"); }; Object *copy() {_error_("not implemented yet"); }; + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; }; /*BamgQuadtree private Fields*/ Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h =================================================================== --- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h (revision 19197) +++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h (revision 19198) @@ -7,6 +7,9 @@ #define _ENUM_DEFINITIONS_ enum definitions{ + /*General: {{{*/ + FemModelEnum, + /*}}}*/ /*Model fields {{{*/ AutodiffIsautodiffEnum, AutodiffNumDependentsEnum, @@ -454,6 +457,7 @@ FSpressureEnum, /*}}}*/ /*Datasets {{{*/ + DataSetEnum, ConstraintsEnum, LoadsEnum, MaterialsEnum, Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp =================================================================== --- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp (revision 19197) +++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp (revision 19198) @@ -16,6 +16,7 @@ switch(en){ + case FemModelEnum : return "FemModel"; case AutodiffIsautodiffEnum : return "AutodiffIsautodiff"; case AutodiffNumDependentsEnum : return "AutodiffNumDependents"; case AutodiffNumDependentObjectsEnum : return "AutodiffNumDependentObjects"; @@ -453,6 +454,7 @@ case FSApproximationEnum : return "FSApproximation"; case FSvelocityEnum : return "FSvelocity"; case FSpressureEnum : return "FSpressure"; + case DataSetEnum : return "DataSet"; case ConstraintsEnum : return "Constraints"; case LoadsEnum : return "Loads"; case MaterialsEnum : return "Materials"; Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp =================================================================== --- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp (revision 19197) +++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp (revision 19198) @@ -16,7 +16,8 @@ int stage=1; if(stage==1){ - if (strcmp(name,"AutodiffIsautodiff")==0) return AutodiffIsautodiffEnum; + if (strcmp(name,"FemModel")==0) return FemModelEnum; + else if (strcmp(name,"AutodiffIsautodiff")==0) return AutodiffIsautodiffEnum; else if (strcmp(name,"AutodiffNumDependents")==0) return AutodiffNumDependentsEnum; else if (strcmp(name,"AutodiffNumDependentObjects")==0) return AutodiffNumDependentObjectsEnum; else if (strcmp(name,"AutodiffDependentObjectNames")==0) return AutodiffDependentObjectNamesEnum; @@ -135,11 +136,11 @@ else if (strcmp(name,"HydrologydcEplCompressibility")==0) return HydrologydcEplCompressibilityEnum; else if (strcmp(name,"HydrologydcEplPorosity")==0) return HydrologydcEplPorosityEnum; else if (strcmp(name,"HydrologydcEplInitialThickness")==0) return HydrologydcEplInitialThicknessEnum; - else if (strcmp(name,"HydrologydcEplColapseThickness")==0) return HydrologydcEplColapseThicknessEnum; else stage=2; } if(stage==2){ - if (strcmp(name,"HydrologydcEplMaxThickness")==0) return HydrologydcEplMaxThicknessEnum; + if (strcmp(name,"HydrologydcEplColapseThickness")==0) return HydrologydcEplColapseThicknessEnum; + else if (strcmp(name,"HydrologydcEplMaxThickness")==0) return HydrologydcEplMaxThicknessEnum; else if (strcmp(name,"HydrologydcEplThickness")==0) return HydrologydcEplThicknessEnum; else if (strcmp(name,"HydrologydcEplThicknessOld")==0) return HydrologydcEplThicknessOldEnum; else if (strcmp(name,"HydrologydcEplThickComp")==0) return HydrologydcEplThickCompEnum; @@ -258,11 +259,11 @@ else if (strcmp(name,"MeshElements")==0) return MeshElementsEnum; else if (strcmp(name,"MeshLowerelements")==0) return MeshLowerelementsEnum; else if (strcmp(name,"MeshNumberofelements2d")==0) return MeshNumberofelements2dEnum; - else if (strcmp(name,"MeshNumberofelements")==0) return MeshNumberofelementsEnum; else stage=3; } if(stage==3){ - if (strcmp(name,"MeshNumberoflayers")==0) return MeshNumberoflayersEnum; + if (strcmp(name,"MeshNumberofelements")==0) return MeshNumberofelementsEnum; + else if (strcmp(name,"MeshNumberoflayers")==0) return MeshNumberoflayersEnum; else if (strcmp(name,"MeshNumberofvertices2d")==0) return MeshNumberofvertices2dEnum; else if (strcmp(name,"MeshNumberofvertices")==0) return MeshNumberofverticesEnum; else if (strcmp(name,"MeshUpperelements")==0) return MeshUpperelementsEnum; @@ -381,11 +382,11 @@ else if (strcmp(name,"SurfaceforcingsSmbref")==0) return SurfaceforcingsSmbrefEnum; else if (strcmp(name,"SurfaceforcingsBPos")==0) return SurfaceforcingsBPosEnum; else if (strcmp(name,"SurfaceforcingsBNeg")==0) return SurfaceforcingsBNegEnum; - else if (strcmp(name,"SMBhenning")==0) return SMBhenningEnum; else stage=4; } if(stage==4){ - if (strcmp(name,"SMBcomponents")==0) return SMBcomponentsEnum; + if (strcmp(name,"SMBhenning")==0) return SMBhenningEnum; + else if (strcmp(name,"SMBcomponents")==0) return SMBcomponentsEnum; else if (strcmp(name,"SurfaceforcingsAccumulation")==0) return SurfaceforcingsAccumulationEnum; else if (strcmp(name,"SurfaceforcingsEvaporation")==0) return SurfaceforcingsEvaporationEnum; else if (strcmp(name,"SurfaceforcingsRunoff")==0) return SurfaceforcingsRunoffEnum; @@ -462,6 +463,7 @@ else if (strcmp(name,"FSApproximation")==0) return FSApproximationEnum; else if (strcmp(name,"FSvelocity")==0) return FSvelocityEnum; else if (strcmp(name,"FSpressure")==0) return FSpressureEnum; + else if (strcmp(name,"DataSet")==0) return DataSetEnum; else if (strcmp(name,"Constraints")==0) return ConstraintsEnum; else if (strcmp(name,"Loads")==0) return LoadsEnum; else if (strcmp(name,"Materials")==0) return MaterialsEnum; @@ -503,12 +505,12 @@ else if (strcmp(name,"Numericalflux")==0) return NumericalfluxEnum; else if (strcmp(name,"NumericalfluxType")==0) return NumericalfluxTypeEnum; else if (strcmp(name,"Param")==0) return ParamEnum; - else if (strcmp(name,"Pengrid")==0) return PengridEnum; - else if (strcmp(name,"Penpair")==0) return PenpairEnum; else stage=5; } if(stage==5){ - if (strcmp(name,"Profiler")==0) return ProfilerEnum; + if (strcmp(name,"Pengrid")==0) return PengridEnum; + else if (strcmp(name,"Penpair")==0) return PenpairEnum; + else if (strcmp(name,"Profiler")==0) return ProfilerEnum; else if (strcmp(name,"MatrixParam")==0) return MatrixParamEnum; else if (strcmp(name,"Masscon")==0) return MassconEnum; else if (strcmp(name,"MassconName")==0) return MassconNameEnum; @@ -626,12 +628,12 @@ else if (strcmp(name,"StressTensoryz")==0) return StressTensoryzEnum; else if (strcmp(name,"StressTensorzz")==0) return StressTensorzzEnum; else if (strcmp(name,"StressMaxPrincipal")==0) return StressMaxPrincipalEnum; - else if (strcmp(name,"DeviatoricStress")==0) return DeviatoricStressEnum; - else if (strcmp(name,"DeviatoricStressxx")==0) return DeviatoricStressxxEnum; else stage=6; } if(stage==6){ - if (strcmp(name,"DeviatoricStressxy")==0) return DeviatoricStressxyEnum; + if (strcmp(name,"DeviatoricStress")==0) return DeviatoricStressEnum; + else if (strcmp(name,"DeviatoricStressxx")==0) return DeviatoricStressxxEnum; + else if (strcmp(name,"DeviatoricStressxy")==0) return DeviatoricStressxyEnum; else if (strcmp(name,"DeviatoricStressxz")==0) return DeviatoricStressxzEnum; else if (strcmp(name,"DeviatoricStressyy")==0) return DeviatoricStressyyEnum; else if (strcmp(name,"DeviatoricStressyz")==0) return DeviatoricStressyzEnum; @@ -749,12 +751,12 @@ else if (strcmp(name,"Outputdefinition66")==0) return Outputdefinition66Enum; else if (strcmp(name,"Outputdefinition67")==0) return Outputdefinition67Enum; else if (strcmp(name,"Outputdefinition68")==0) return Outputdefinition68Enum; - else if (strcmp(name,"Outputdefinition69")==0) return Outputdefinition69Enum; - else if (strcmp(name,"Outputdefinition70")==0) return Outputdefinition70Enum; else stage=7; } if(stage==7){ - if (strcmp(name,"Outputdefinition71")==0) return Outputdefinition71Enum; + if (strcmp(name,"Outputdefinition69")==0) return Outputdefinition69Enum; + else if (strcmp(name,"Outputdefinition70")==0) return Outputdefinition70Enum; + else if (strcmp(name,"Outputdefinition71")==0) return Outputdefinition71Enum; else if (strcmp(name,"Outputdefinition72")==0) return Outputdefinition72Enum; else if (strcmp(name,"Outputdefinition73")==0) return Outputdefinition73Enum; else if (strcmp(name,"Outputdefinition74")==0) return Outputdefinition74Enum; @@ -872,12 +874,12 @@ else if (strcmp(name,"Sset")==0) return SsetEnum; else if (strcmp(name,"Verbose")==0) return VerboseEnum; else if (strcmp(name,"TriangleInterp")==0) return TriangleInterpEnum; - else if (strcmp(name,"BilinearInterp")==0) return BilinearInterpEnum; - else if (strcmp(name,"NearestInterp")==0) return NearestInterpEnum; else stage=8; } if(stage==8){ - if (strcmp(name,"XY")==0) return XYEnum; + if (strcmp(name,"BilinearInterp")==0) return BilinearInterpEnum; + else if (strcmp(name,"NearestInterp")==0) return NearestInterpEnum; + else if (strcmp(name,"XY")==0) return XYEnum; else if (strcmp(name,"XYZ")==0) return XYZEnum; else if (strcmp(name,"Dense")==0) return DenseEnum; else if (strcmp(name,"MpiDense")==0) return MpiDenseEnum; Index: ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h =================================================================== --- ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h (revision 0) +++ ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h (revision 19198) @@ -0,0 +1,66 @@ +/*\file Marshalling.h + *\brief: macros to help automate the marshalling, demarshalling, and marshalling size routines. + */ + +#ifndef _MARSHALLING_H_ +#define _MARSHALLING_H_ + +enum marshall_directions{ + MARSHALLING_FORWARD, + MARSHALLING_BACKWARDS +}; + +#define MARSHALLING_ENUM(EN) \ + int enum_type=EN; \ + if(marshall_direction==MARSHALLING_FORWARD){\ + if(pmarshalled_data){\ + memcpy(*pmarshalled_data,&enum_type,sizeof(int));\ + *pmarshalled_data+=sizeof(int);\ + }\ + *pmarshalled_data_size+=sizeof(int);\ + } + +#define MARSHALLING(FIELD) \ +\ + if(marshall_direction==MARSHALLING_FORWARD){\ + if(pmarshalled_data){\ + memcpy(*pmarshalled_data,&FIELD,sizeof(FIELD));\ + *pmarshalled_data+=sizeof(FIELD);\ + }\ + *pmarshalled_data_size+=sizeof(FIELD);\ + }\ + else{\ + memcpy(&FIELD,*pmarshalled_data,sizeof(FIELD));\ + *pmarshalled_data+=sizeof(FIELD);\ + } + +#define MARSHALLING_ARRAY(FIELD,TYPE,SIZE) \ +\ + if(marshall_direction==MARSHALLING_FORWARD){\ + if(pmarshalled_data){\ + memcpy(*pmarshalled_data,FIELD,SIZE*sizeof(TYPE));\ + *pmarshalled_data+=SIZE*sizeof(TYPE);\ + }\ + *pmarshalled_data_size+=SIZE*sizeof(TYPE);\ + }\ + else{\ + memcpy(FIELD,*pmarshalled_data,SIZE*sizeof(TYPE));\ + *pmarshalled_data+=SIZE*sizeof(TYPE);\ + } + +#define MARSHALLING_DYNAMIC(FIELD,TYPE,SIZE) \ +\ + if(marshall_direction==MARSHALLING_FORWARD){\ + if(pmarshalled_data){\ + memcpy(*pmarshalled_data,FIELD,SIZE*sizeof(TYPE));\ + *pmarshalled_data+=SIZE*sizeof(TYPE);\ + }\ + *pmarshalled_data_size+=SIZE*sizeof(TYPE);\ + }\ + else{\ + FIELD=xNew(SIZE);\ + memcpy(FIELD,*pmarshalled_data,SIZE*sizeof(TYPE));\ + *pmarshalled_data+=SIZE*sizeof(TYPE);\ + } + +#endif Index: ../trunk-jpl/src/c/shared/io/io.h =================================================================== --- ../trunk-jpl/src/c/shared/io/io.h (revision 19197) +++ ../trunk-jpl/src/c/shared/io/io.h (revision 19198) @@ -11,8 +11,9 @@ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" #endif +#include "./Comm/IssmComm.h" #include "./Disk/diskio.h" #include "./Print/Print.h" -#include "./Comm/IssmComm.h" +#include "./Marshalling/Marshalling.h" #endif /* _IO_H_ */ Index: ../trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp =================================================================== --- ../trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp (revision 19197) +++ ../trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp (revision 19198) @@ -251,7 +251,6 @@ IsIdenticalNode(xnodes[2],ynodes[2],xsegment[0],ysegment[0],tolerance)){ /*ok, segments[0] is common to one of our vertices: */ - //if (el==318 && contouri==9){ _printf_("ok1" << "\n"); } coord1=0; if(edge1==IntersectEnum){coord2=alpha1;} if(edge2==IntersectEnum){coord2=beta1;} Index: ../trunk-jpl/src/c/toolkits/issm/Bucket.h =================================================================== --- ../trunk-jpl/src/c/toolkits/issm/Bucket.h (revision 19197) +++ ../trunk-jpl/src/c/toolkits/issm/Bucket.h (revision 19198) @@ -8,7 +8,7 @@ /*Headers:*/ /*{{{*/ #include "../../datastructures/datastructures.h" -#include "../../shared/shared.h" +#include "../../shared/io/Comm/IssmComm.h" #include "../toolkitsenums.h" /*}}}*/ @@ -128,6 +128,10 @@ else if (this->type==VECTOR_BUCKET) return new Bucket(this->m,this->idxm,this->values,this->mode); else _error_("No Copy of Bucket because its type is invalid."); }; /*}}}*/ + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/ + _error_("not implemented yet!"); + } + /*}}}*/ /*specific routines of Bucket: */ void SpawnBucketsPerCpu(DataSet* bucketsofcpu_i,int rank_i,int* rowranks){ /*{{{*/ Index: ../trunk-jpl/src/c/classes/Contour.h =================================================================== --- ../trunk-jpl/src/c/classes/Contour.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Contour.h (revision 19198) @@ -82,6 +82,11 @@ return (Object*) contour; } /*}}}*/ + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/ + _error_("not implemented yet!"); + } + /*}}}*/ + }; #endif /* _CONTOUR_H_ */ Index: ../trunk-jpl/src/c/classes/Materials/Matice.h =================================================================== --- ../trunk-jpl/src/c/classes/Materials/Matice.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Materials/Matice.h (revision 19198) @@ -39,6 +39,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Update virtual funictions definitions: {{{*/ void InputUpdateFromVector(IssmDouble* vector, int name, int type); Index: ../trunk-jpl/src/c/classes/Materials/Matpar.h =================================================================== --- ../trunk-jpl/src/c/classes/Materials/Matpar.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Materials/Matpar.h (revision 19198) @@ -78,6 +78,7 @@ int Id(); int ObjectEnum(); Object *copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Update virtual functions resolution: {{{*/ void InputUpdateFromVector(IssmDouble* vector, int name, int type); Index: ../trunk-jpl/src/c/classes/DependentObject.h =================================================================== --- ../trunk-jpl/src/c/classes/DependentObject.h (revision 19197) +++ ../trunk-jpl/src/c/classes/DependentObject.h (revision 19198) @@ -31,7 +31,11 @@ int Id(); int ObjectEnum(); Object* copy(void); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/ + _error_("not implemented yet!"); + } /*}}}*/ + /*}}}*/ /*DependentObject methods: */ int NumDependents(void); Index: ../trunk-jpl/src/c/classes/Params/DoubleVecParam.h =================================================================== --- ../trunk-jpl/src/c/classes/Params/DoubleVecParam.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Params/DoubleVecParam.h (revision 19198) @@ -36,6 +36,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Param virtual functions definitions: {{{*/ int InstanceEnum(){return enum_type;} Index: ../trunk-jpl/src/c/classes/Params/GenericParam.h =================================================================== --- ../trunk-jpl/src/c/classes/Params/GenericParam.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Params/GenericParam.h (revision 19198) @@ -51,6 +51,7 @@ // it does not clarify ownership of the newed up instance... // use the default copy constructor instead Object* copy() { return new GenericParam

(*this); }; + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Param vritual function definitions: {{{*/ int InstanceEnum(){return myEnumVal;} Index: ../trunk-jpl/src/c/classes/Params/DoubleMatParam.h =================================================================== --- ../trunk-jpl/src/c/classes/Params/DoubleMatParam.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Params/DoubleMatParam.h (revision 19198) @@ -37,6 +37,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Param vritual function definitions: {{{*/ int InstanceEnum(){return enum_type;} Index: ../trunk-jpl/src/c/classes/Params/FileParam.h =================================================================== --- ../trunk-jpl/src/c/classes/Params/FileParam.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Params/FileParam.h (revision 19198) @@ -35,6 +35,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Param vritual function definitions: {{{*/ int InstanceEnum(){return enum_type;} Index: ../trunk-jpl/src/c/classes/Params/DataSetParam.h =================================================================== --- ../trunk-jpl/src/c/classes/Params/DataSetParam.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Params/DataSetParam.h (revision 19198) @@ -36,6 +36,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Param vritual function definitions: {{{*/ int InstanceEnum(){return enum_type;} Index: ../trunk-jpl/src/c/classes/Params/IntParam.h =================================================================== --- ../trunk-jpl/src/c/classes/Params/IntParam.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Params/IntParam.h (revision 19198) @@ -36,6 +36,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Param vritual function definitions: {{{*/ int InstanceEnum(){return enum_type;} Index: ../trunk-jpl/src/c/classes/Params/VectorParam.h =================================================================== --- ../trunk-jpl/src/c/classes/Params/VectorParam.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Params/VectorParam.h (revision 19198) @@ -36,6 +36,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Param vritual function definitions: {{{*/ int InstanceEnum(){return enum_type;} Index: ../trunk-jpl/src/c/classes/Params/MatrixParam.h =================================================================== --- ../trunk-jpl/src/c/classes/Params/MatrixParam.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Params/MatrixParam.h (revision 19198) @@ -36,6 +36,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Param vritual function definitions: {{{*/ int InstanceEnum(){return enum_type;} Index: ../trunk-jpl/src/c/classes/Params/StringArrayParam.h =================================================================== --- ../trunk-jpl/src/c/classes/Params/StringArrayParam.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Params/StringArrayParam.h (revision 19198) @@ -37,6 +37,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Param vritual function definitions: {{{*/ int InstanceEnum(){return enum_type;} Index: ../trunk-jpl/src/c/classes/Params/TransientParam.h =================================================================== --- ../trunk-jpl/src/c/classes/Params/TransientParam.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Params/TransientParam.h (revision 19198) @@ -37,6 +37,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Param vritual function definitions: {{{*/ int InstanceEnum(){return enum_type;} Index: ../trunk-jpl/src/c/classes/Params/DoubleParam.h =================================================================== --- ../trunk-jpl/src/c/classes/Params/DoubleParam.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Params/DoubleParam.h (revision 19198) @@ -36,6 +36,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Param vritual function definitions: {{{*/ int InstanceEnum(){return enum_type;} Index: ../trunk-jpl/src/c/classes/Params/DoubleMatArrayParam.h =================================================================== --- ../trunk-jpl/src/c/classes/Params/DoubleMatArrayParam.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Params/DoubleMatArrayParam.h (revision 19198) @@ -38,6 +38,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Param vritual function definitions: {{{*/ int InstanceEnum(){return enum_type;} Index: ../trunk-jpl/src/c/classes/Params/IntVecParam.h =================================================================== --- ../trunk-jpl/src/c/classes/Params/IntVecParam.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Params/IntVecParam.h (revision 19198) @@ -37,6 +37,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Param virtual functions definitions: {{{*/ int InstanceEnum(){return enum_type;} Index: ../trunk-jpl/src/c/classes/Params/BoolParam.h =================================================================== --- ../trunk-jpl/src/c/classes/Params/BoolParam.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Params/BoolParam.h (revision 19198) @@ -35,6 +35,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Param vritual function definitions: {{{*/ int InstanceEnum(){return enum_type;} Index: ../trunk-jpl/src/c/classes/Params/IntMatParam.h =================================================================== --- ../trunk-jpl/src/c/classes/Params/IntMatParam.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Params/IntMatParam.h (revision 19198) @@ -37,6 +37,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Param vritual function definitions: {{{*/ int InstanceEnum(){return enum_type;} Index: ../trunk-jpl/src/c/classes/Params/StringParam.h =================================================================== --- ../trunk-jpl/src/c/classes/Params/StringParam.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Params/StringParam.h (revision 19198) @@ -36,6 +36,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Param vritual function definitions: {{{*/ int InstanceEnum(){return enum_type;} Index: ../trunk-jpl/src/c/classes/Masscon.h =================================================================== --- ../trunk-jpl/src/c/classes/Masscon.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Masscon.h (revision 19198) @@ -76,6 +76,10 @@ return (Object*) mf; } /*}}}*/ + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/ + _error_("not implemented yet!"); + } + /*}}}*/ /*Definition virtual function resolutoin: */ char* Name(){/*{{{*/ Index: ../trunk-jpl/src/c/classes/kriging/Observation.h =================================================================== --- ../trunk-jpl/src/c/classes/kriging/Observation.h (revision 19197) +++ ../trunk-jpl/src/c/classes/kriging/Observation.h (revision 19198) @@ -32,7 +32,9 @@ int ObjectEnum(){_error_("Not implemented yet"); }; bool operator==(const Observation& ob) const; Object *copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!");}; + /*Management*/ void WriteXYObs(const Observation& ob, double* px, double* py, double* pobs); void WriteXYObs(double* px,double* py,double* pobs); Index: ../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h =================================================================== --- ../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h (revision 19197) +++ ../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h (revision 19198) @@ -26,7 +26,9 @@ int Id(){_error_("Not implemented yet");}; int ObjectEnum(){_error_("Not implemented yet");}; Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; + /*Variogram functions*/ double SemiVariogram(double deltax,double deltay); double Covariance(double deltax,double deltay); Index: ../trunk-jpl/src/c/classes/kriging/PowerVariogram.h =================================================================== --- ../trunk-jpl/src/c/classes/kriging/PowerVariogram.h (revision 19197) +++ ../trunk-jpl/src/c/classes/kriging/PowerVariogram.h (revision 19198) @@ -26,7 +26,9 @@ int Id(){_error_("Not implemented yet");}; int ObjectEnum(){_error_("Not implemented yet");}; Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; + /*Variogram functions*/ double SemiVariogram(double deltax,double deltay); double Covariance(double deltax,double deltay); Index: ../trunk-jpl/src/c/classes/kriging/Quadtree.h =================================================================== --- ../trunk-jpl/src/c/classes/kriging/Quadtree.h (revision 19197) +++ ../trunk-jpl/src/c/classes/kriging/Quadtree.h (revision 19198) @@ -30,7 +30,9 @@ int Id() {_error_("not implemented yet"); }; int ObjectEnum(){_error_("not implemented yet"); }; Object *copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!");}; + /*Methods*/ int IsWithinRange(double x,double y,double range); void RangeSearch(int *indices,int *pnobs,double x,double y,double range); Index: ../trunk-jpl/src/c/classes/kriging/GaussianVariogram.h =================================================================== --- ../trunk-jpl/src/c/classes/kriging/GaussianVariogram.h (revision 19197) +++ ../trunk-jpl/src/c/classes/kriging/GaussianVariogram.h (revision 19198) @@ -27,6 +27,7 @@ int Id(){_error_("Not implemented yet");}; int ObjectEnum(){_error_("Not implemented yet");}; Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*Variogram functions*/ double SemiVariogram(double deltax,double deltay); Index: ../trunk-jpl/src/c/classes/kriging/SphericalVariogram.h =================================================================== --- ../trunk-jpl/src/c/classes/kriging/SphericalVariogram.h (revision 19197) +++ ../trunk-jpl/src/c/classes/kriging/SphericalVariogram.h (revision 19198) @@ -26,7 +26,9 @@ int Id(){_error_("Not implemented yet");}; int ObjectEnum(){_error_("Not implemented yet");}; Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; + /*Variogram functions*/ double SemiVariogram(double deltax,double deltay); double Covariance(double deltax,double deltay); Index: ../trunk-jpl/src/c/classes/Options/Option.h =================================================================== --- ../trunk-jpl/src/c/classes/Options/Option.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Options/Option.h (revision 19198) @@ -25,7 +25,9 @@ int Id(){_error_("Not implemented yet"); }; int ObjectEnum(){return OptionEnum; }; Object *copy(){_error_("Not implemented yet"); }; + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; + /*virtual functions: */ virtual char* Name()=0; virtual int NumEl()=0; Index: ../trunk-jpl/src/c/classes/Loads/Loads.cpp =================================================================== --- ../trunk-jpl/src/c/classes/Loads/Loads.cpp (revision 19197) +++ ../trunk-jpl/src/c/classes/Loads/Loads.cpp (revision 19198) @@ -14,9 +14,9 @@ #include #include +#include "../../shared/io/Comm/IssmComm.h" #include "./Loads.h" #include "./Load.h" -#include "../../shared/shared.h" using namespace std; /*}}}*/ Index: ../trunk-jpl/src/c/classes/Loads/Riftfront.h =================================================================== --- ../trunk-jpl/src/c/classes/Loads/Riftfront.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Loads/Riftfront.h (revision 19198) @@ -61,6 +61,7 @@ void Echo(); int Id(); int ObjectEnum(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Update virtual functions resolution: {{{*/ void InputUpdateFromConstant(IssmDouble constant, int name); Index: ../trunk-jpl/src/c/classes/Loads/Numericalflux.h =================================================================== --- ../trunk-jpl/src/c/classes/Loads/Numericalflux.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Loads/Numericalflux.h (revision 19198) @@ -44,6 +44,7 @@ void Echo(); int Id(); int ObjectEnum(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Update virtual functions resolution: {{{*/ void InputUpdateFromConstant(IssmDouble constant, int name){/*Do nothing*/}; Index: ../trunk-jpl/src/c/classes/Loads/Penpair.h =================================================================== --- ../trunk-jpl/src/c/classes/Loads/Penpair.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Loads/Penpair.h (revision 19198) @@ -35,6 +35,7 @@ void Echo(); int Id(); int ObjectEnum(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Update virtual functions resolution: {{{*/ void InputUpdateFromConstant(IssmDouble constant, int name); Index: ../trunk-jpl/src/c/classes/Loads/Pengrid.h =================================================================== --- ../trunk-jpl/src/c/classes/Loads/Pengrid.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Loads/Pengrid.h (revision 19198) @@ -54,6 +54,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Update virtual functions resolution: {{{*/ void InputUpdateFromVector(IssmDouble* vector, int name, int type); Index: ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h =================================================================== --- ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h (revision 19197) +++ ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h (revision 19198) @@ -125,7 +125,13 @@ Object* copy(void) { /*{{{*/ return new GenericExternalResult(this->id,this->result_name,this->value,this->step,this->time); } /*}}}*/ + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/ + _error_("not implemented yet!"); + } + /*}}}*/ + + /*GenericExternalResult management: */ void WriteData(FILE* fid,bool io_gather){ /*{{{*/ Index: ../trunk-jpl/src/c/classes/FemModel.cpp =================================================================== --- ../trunk-jpl/src/c/classes/FemModel.cpp (revision 19197) +++ ../trunk-jpl/src/c/classes/FemModel.cpp (revision 19198) @@ -608,6 +608,8 @@ FILE* restartfid=NULL; char* restartfilename = NULL; + int femmodel_size; + char* femmodel_buffer=NULL; /*First, recover the name of the restart file: */ parameters->FindParam(&restartfilename,RestartFileNameEnum); @@ -615,10 +617,21 @@ /*Open file for writing: */ restartfid=pfopen(restartfilename,"wb"); + /*Create buffer to hold marshalled femmodel: */ + this->Marshall(NULL,&femmodel_size,MARSHALLING_FORWARD); + femmodel_buffer=xNew(femmodel_size); + + /*Marshall:*/ + this->Marshall(&femmodel_buffer,&femmodel_size,MARSHALLING_FORWARD); + + /*write buffer: */ + fwrite(femmodel_buffer,femmodel_size,sizeof(IssmPDouble),restartfid); + /*Done, close file :*/ pfclose(restartfid,restartfilename); /*Free ressources: */ + xDelete(femmodel_buffer); xDelete(restartfilename); } @@ -626,7 +639,40 @@ void FemModel::Restart(void){/*{{{*/ } /*}}}*/ +void FemModel::Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ + MARSHALLING_ENUM(FemModelEnum); + + MARSHALLING(solution_type); + MARSHALLING(analysis_counter); + MARSHALLING_DYNAMIC(analysis_type_list,int,analysis_counter); + + if(marshall_direction==MARSHALLING_BACKWARDS){ + profiler=new Profiler; + elements=new Elements(); + nodes=new Nodes(); + vertices=new Vertices(); + constraints=new Constraints(); + loads=new Loads(); + materials=new Materials(); + parameters=new Parameters(); + results=new Results(); + } + + profiler->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); + elements->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); + nodes->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); + vertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); + constraints->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); + loads->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); + materials->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); + parameters->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); + results->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); + + MARSHALLING(comm); +} +/*}}}*/ + /*Modules:*/ int FemModel::UpdateVertexPositionsx(void){ /*{{{*/ Index: ../trunk-jpl/src/c/classes/IndependentObject.h =================================================================== --- ../trunk-jpl/src/c/classes/IndependentObject.h (revision 19197) +++ ../trunk-jpl/src/c/classes/IndependentObject.h (revision 19198) @@ -30,6 +30,7 @@ int Id(); int ObjectEnum(); Object* copy(void); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!");}; /*}}}*/ /*IndependentObject methods: {{{*/ void FetchIndependent(IoModel* iomodel,int* pXcount,IssmPDouble* X); Index: ../trunk-jpl/src/c/classes/Node.h =================================================================== --- ../trunk-jpl/src/c/classes/Node.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Node.h (revision 19198) @@ -49,6 +49,7 @@ int Id(); int ObjectEnum(); Object *copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*Node numerical routines*/ void CreateNodalConstraints(Vector* ys); Index: ../trunk-jpl/src/c/classes/Elements/Element.h =================================================================== --- ../trunk-jpl/src/c/classes/Elements/Element.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Elements/Element.h (revision 19198) @@ -66,6 +66,7 @@ void DeleteInput(int input_enum); void DeleteMaterials(void); IssmDouble Divergence(void); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!");}; void dViscositydBFS(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input); void dViscositydBHO(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input); void dViscositydBSSA(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input); Index: ../trunk-jpl/src/c/classes/Misfit.h =================================================================== --- ../trunk-jpl/src/c/classes/Misfit.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Misfit.h (revision 19198) @@ -103,6 +103,10 @@ return (Object*) mf; } /*}}}*/ + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/ + _error_("not implemented yet!"); + } + /*}}}*/ /*Definition virtual function resolutoin: */ char* Name(){/*{{{*/ Index: ../trunk-jpl/src/c/classes/Inputs/DoubleInput.h =================================================================== --- ../trunk-jpl/src/c/classes/Inputs/DoubleInput.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Inputs/DoubleInput.h (revision 19198) @@ -29,6 +29,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*DoubleInput management: {{{*/ int InstanceEnum(); Index: ../trunk-jpl/src/c/classes/Inputs/SegInput.h =================================================================== --- ../trunk-jpl/src/c/classes/Inputs/SegInput.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Inputs/SegInput.h (revision 19198) @@ -31,6 +31,7 @@ int Id(); int ObjectEnum(); Object *copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*SegInput management:*/ int InstanceEnum(); Index: ../trunk-jpl/src/c/classes/Inputs/TetraInput.h =================================================================== --- ../trunk-jpl/src/c/classes/Inputs/TetraInput.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Inputs/TetraInput.h (revision 19198) @@ -31,6 +31,7 @@ int Id(); int ObjectEnum(); Object *copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*TetraInput management:*/ int InstanceEnum(); Index: ../trunk-jpl/src/c/classes/Inputs/ControlInput.h =================================================================== --- ../trunk-jpl/src/c/classes/Inputs/ControlInput.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Inputs/ControlInput.h (revision 19198) @@ -34,6 +34,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*ControlInput management: {{{*/ int InstanceEnum(); Index: ../trunk-jpl/src/c/classes/Inputs/DatasetInput.h =================================================================== --- ../trunk-jpl/src/c/classes/Inputs/DatasetInput.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Inputs/DatasetInput.h (revision 19198) @@ -31,6 +31,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*DatasetInput management: {{{*/ void AddInput(Input* input,int id); Index: ../trunk-jpl/src/c/classes/Inputs/IntInput.h =================================================================== --- ../trunk-jpl/src/c/classes/Inputs/IntInput.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Inputs/IntInput.h (revision 19198) @@ -30,6 +30,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*IntInput management: {{{*/ int InstanceEnum(); Index: ../trunk-jpl/src/c/classes/Inputs/BoolInput.h =================================================================== --- ../trunk-jpl/src/c/classes/Inputs/BoolInput.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Inputs/BoolInput.h (revision 19198) @@ -26,6 +26,7 @@ int Id(); int ObjectEnum(); Object *copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*BoolInput management: {{{*/ int InstanceEnum(); Index: ../trunk-jpl/src/c/classes/Inputs/TriaInput.h =================================================================== --- ../trunk-jpl/src/c/classes/Inputs/TriaInput.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Inputs/TriaInput.h (revision 19198) @@ -31,6 +31,7 @@ int Id(); int ObjectEnum(); Object *copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*TriaInput management:*/ int InstanceEnum(); Index: ../trunk-jpl/src/c/classes/Inputs/PentaInput.h =================================================================== --- ../trunk-jpl/src/c/classes/Inputs/PentaInput.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Inputs/PentaInput.h (revision 19198) @@ -31,6 +31,7 @@ int Id(); int ObjectEnum(); Object *copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*PentaInput management*/ int InstanceEnum(); Index: ../trunk-jpl/src/c/classes/Inputs/TransientInput.h =================================================================== --- ../trunk-jpl/src/c/classes/Inputs/TransientInput.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Inputs/TransientInput.h (revision 19198) @@ -36,6 +36,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*TransientInput management: {{{*/ int InstanceEnum(); Index: ../trunk-jpl/src/c/classes/Segment.h =================================================================== --- ../trunk-jpl/src/c/classes/Segment.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Segment.h (revision 19198) @@ -70,6 +70,10 @@ return new Segment(this->eid,this->x1,this->y1,this->x2,this->y2); } /*}}}*/ + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/ + _error_("not implemented yet!"); + } + /*}}}*/ }; Index: ../trunk-jpl/src/c/classes/Nodes.cpp =================================================================== --- ../trunk-jpl/src/c/classes/Nodes.cpp (revision 19197) +++ ../trunk-jpl/src/c/classes/Nodes.cpp (revision 19198) @@ -10,8 +10,8 @@ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" #endif +#include "../shared/io/Comm/IssmComm.h" #include "./Nodes.h" -#include "../shared/shared.h" #include "./Node.h" using namespace std; Index: ../trunk-jpl/src/c/classes/Massconaxpby.h =================================================================== --- ../trunk-jpl/src/c/classes/Massconaxpby.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Massconaxpby.h (revision 19198) @@ -87,6 +87,10 @@ return (Object*) mf; } /*}}}*/ + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/ + _error_("not implemented yet!"); + } + /*}}}*/ /*Definition virtual function resolutoin: */ char* Name(){/*{{{*/ Index: ../trunk-jpl/src/c/classes/Vertex.h =================================================================== --- ../trunk-jpl/src/c/classes/Vertex.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Vertex.h (revision 19198) @@ -41,6 +41,8 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; + /*}}}*/ /*Vertex management:*/ int Pid(void); Index: ../trunk-jpl/src/c/classes/Constraints/SpcDynamic.h =================================================================== --- ../trunk-jpl/src/c/classes/Constraints/SpcDynamic.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Constraints/SpcDynamic.h (revision 19198) @@ -34,6 +34,7 @@ void Echo(); int Id(); int ObjectEnum(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*Constraint virtual functions definitions*/ void ActivatePenaltyMethod(void); Index: ../trunk-jpl/src/c/classes/Constraints/SpcStatic.h =================================================================== --- ../trunk-jpl/src/c/classes/Constraints/SpcStatic.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Constraints/SpcStatic.h (revision 19198) @@ -33,6 +33,7 @@ int Id(); int ObjectEnum(); Object* copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Constraint virtual functions definitions: {{{*/ void ActivatePenaltyMethod(void); Index: ../trunk-jpl/src/c/classes/Constraints/SpcTransient.h =================================================================== --- ../trunk-jpl/src/c/classes/Constraints/SpcTransient.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Constraints/SpcTransient.h (revision 19198) @@ -35,6 +35,7 @@ void Echo(); int Id(); int ObjectEnum(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Constraint virtual functions definitions: {{{*/ void ActivatePenaltyMethod(void); Index: ../trunk-jpl/src/c/classes/Profiler.h =================================================================== --- ../trunk-jpl/src/c/classes/Profiler.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Profiler.h (revision 19198) @@ -42,6 +42,7 @@ int Id(); int ObjectEnum(); Object *copy(); + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); }; /*}}}*/ /*Profiler routines {{{*/ void Tag(int tagenum,bool dontmpisync=false); Index: ../trunk-jpl/src/c/classes/Massfluxatgate.h =================================================================== --- ../trunk-jpl/src/c/classes/Massfluxatgate.h (revision 19197) +++ ../trunk-jpl/src/c/classes/Massfluxatgate.h (revision 19198) @@ -120,6 +120,10 @@ return new Massfluxatgate(this->name,this->definitionenum,this->numsegments,this->x1,this->y1,this->x2,this->y2,this->elements); } /*}}}*/ + void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/ + _error_("not implemented yet!"); + } + /*}}}*/ /*Definition virtual function resolutoin: */ char* Name(){/*{{{*/ Index: ../trunk-jpl/src/c/classes/FemModel.h =================================================================== --- ../trunk-jpl/src/c/classes/FemModel.h (revision 19197) +++ ../trunk-jpl/src/c/classes/FemModel.h (revision 19198) @@ -60,6 +60,7 @@ void SetCurrentConfiguration(int configuration_type); void SetCurrentConfiguration(int configuration_type,int analysis_type); void CheckPoint(void); + void Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction); void Restart(void); /*Modules*/ Index: ../trunk-jpl/src/c/datastructures/DataSet.cpp =================================================================== --- ../trunk-jpl/src/c/datastructures/DataSet.cpp (revision 19197) +++ ../trunk-jpl/src/c/datastructures/DataSet.cpp (revision 19198) @@ -18,6 +18,7 @@ #include "../datastructures/datastructures.h" #include "../shared/shared.h" +#include "../classes/classes.h" using namespace std; /*}}}*/ @@ -85,6 +86,66 @@ /*}}}*/ /*Specific methods*/ +void DataSet::Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ + + vector::iterator obj; + int obj_enum; + int i; + + if(marshall_direction==MARSHALLING_FORWARD){ + numsorted=objects.size(); + } + + MARSHALLING_ENUM(DataSetEnum); + MARSHALLING(enum_type); + MARSHALLING(sorted); + MARSHALLING(presorted); + MARSHALLING(numsorted); + MARSHALLING_DYNAMIC(sorted_ids,int,numsorted); + MARSHALLING_DYNAMIC(id_offsets,int,numsorted); + + /*Now branch according to direction of marshalling: */ + if(marshall_direction==MARSHALLING_FORWARD){ + /*Go through our objects, and marshall them into the buffer: */ + for ( obj=this->objects.begin() ; obj < this->objects.end(); obj++ ){ + (*obj)->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); + } + } + else{ + /*This is the heart of the demashalling method. We have a buffer coming + in, and we are supposed to create a dataset out of it. No such thing + as class orientation for buffers, we need to key off the enum of each + object stored in the buffer. */ + for(i=0;inumsorted;i++){ + + /*Recover enum of object first: */ + MARSHALLING_ENUM(obj_enum); + + /*Reset the file pointer to point again to the beginning of the object: */ + *pmarshalled_data-=sizeof(int); + + /*Giant case statement to spin-up the right object, and demarshall into it the information + *stored in the buffer: */ + switch(enum_type){ + case NodeEnum:{ + Node* node=NULL; + node=new Node(); + node->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); + this->AddObject(node);} + break; + case VertexEnum:{ + Vertex* vertex=NULL; + vertex=new Vertex(); + vertex->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); + this->AddObject(vertex);} + break; + default: + _error_("could not recognize enum type: " << EnumToStringx(enum_type)); + } + } + } +} +/*}}}*/ int DataSet::AddObject(Object* object){/*{{{*/ _assert_(this); Index: ../trunk-jpl/src/c/datastructures/DataSet.h =================================================================== --- ../trunk-jpl/src/c/datastructures/DataSet.h (revision 19197) +++ ../trunk-jpl/src/c/datastructures/DataSet.h (revision 19198) @@ -32,6 +32,7 @@ DataSet(); DataSet(int enum_type); ~DataSet(); + void Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction); /*management*/ int GetEnum(); Index: ../trunk-jpl/src/c/datastructures/Object.h =================================================================== --- ../trunk-jpl/src/c/datastructures/Object.h (revision 19197) +++ ../trunk-jpl/src/c/datastructures/Object.h (revision 19198) @@ -20,6 +20,7 @@ virtual int Id()=0; virtual int ObjectEnum()=0; virtual Object* copy()=0; + virtual void Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction)=0; }; #endif Index: ../trunk-jpl/src/m/dev/devpath.py =================================================================== --- ../trunk-jpl/src/m/dev/devpath.py (revision 19197) +++ ../trunk-jpl/src/m/dev/devpath.py (revision 19198) @@ -21,7 +21,7 @@ if root not in sys.path: sys.path.append(root) -sys.path.append(ISSM_DIR + '/lib') +sys.path.append(ISSM_DIR + '/build-fw/lib') sys.path.append(ISSM_DIR + '/src/wrappers/python/.libs') # If using clusters, we need to have the path to the cluster settings directory if(JPL_SVN!=None): Index: ../trunk-jpl/src/m/dev/devpath.m =================================================================== --- ../trunk-jpl/src/m/dev/devpath.m (revision 19197) +++ ../trunk-jpl/src/m/dev/devpath.m (revision 19198) @@ -17,7 +17,7 @@ %ISSM path addpath([ISSM_DIR '/src/m/os/']); %load recursivepath -addpath([ISSM_DIR '/lib']); %load mex +addpath([ISSM_DIR '/build-fw/lib']); %load mex addpath(recursivepath([ISSM_DIR '/src/m'])); addpath(recursivepath([ISSM_DIR '/externalpackages/scotch'])); addpath(recursivepath([ISSM_DIR '/externalpackages/canos'])); Index: ../trunk-jpl/src/m/mesh/bamg.m =================================================================== --- ../trunk-jpl/src/m/mesh/bamg.m (revision 19197) +++ ../trunk-jpl/src/m/mesh/bamg.m (revision 19198) @@ -234,7 +234,10 @@ track=getfieldvalue(options,'tracks'); if all(ischar(track)), A=expread(track); - track=[A.x A.y]; + track=[]; + for i=1:length(A), + track=[track; [A(i).x A(i).y]]; + end else track=double(track); %for some reason, it is of class "single" end Index: ../trunk-jpl/src/m/enum/FemModelEnum.m =================================================================== --- ../trunk-jpl/src/m/enum/FemModelEnum.m (revision 0) +++ ../trunk-jpl/src/m/enum/FemModelEnum.m (revision 19198) @@ -0,0 +1,11 @@ +function macro=FemModelEnum() +%FEMMODELENUM - Enum of FemModel +% +% WARNING: DO NOT MODIFY THIS FILE +% this file has been automatically generated by src/c/shared/Enum/Synchronize.sh +% Please read src/c/shared/Enum/README for more information +% +% Usage: +% macro=FemModelEnum() + +macro=StringToEnum('FemModel'); Index: ../trunk-jpl/src/m/enum/EnumDefinitions.py =================================================================== --- ../trunk-jpl/src/m/enum/EnumDefinitions.py (revision 19197) +++ ../trunk-jpl/src/m/enum/EnumDefinitions.py (revision 19198) @@ -8,6 +8,7 @@ """ +def FemModelEnum(): return StringToEnum("FemModel")[0] def AutodiffIsautodiffEnum(): return StringToEnum("AutodiffIsautodiff")[0] def AutodiffNumDependentsEnum(): return StringToEnum("AutodiffNumDependents")[0] def AutodiffNumDependentObjectsEnum(): return StringToEnum("AutodiffNumDependentObjects")[0] @@ -445,6 +446,7 @@ def FSApproximationEnum(): return StringToEnum("FSApproximation")[0] def FSvelocityEnum(): return StringToEnum("FSvelocity")[0] def FSpressureEnum(): return StringToEnum("FSpressure")[0] +def DataSetEnum(): return StringToEnum("DataSet")[0] def ConstraintsEnum(): return StringToEnum("Constraints")[0] def LoadsEnum(): return StringToEnum("Loads")[0] def MaterialsEnum(): return StringToEnum("Materials")[0] Index: ../trunk-jpl/src/m/enum/DataSetEnum.m =================================================================== --- ../trunk-jpl/src/m/enum/DataSetEnum.m (revision 0) +++ ../trunk-jpl/src/m/enum/DataSetEnum.m (revision 19198) @@ -0,0 +1,11 @@ +function macro=DataSetEnum() +%DATASETENUM - Enum of DataSet +% +% WARNING: DO NOT MODIFY THIS FILE +% this file has been automatically generated by src/c/shared/Enum/Synchronize.sh +% Please read src/c/shared/Enum/README for more information +% +% Usage: +% macro=DataSetEnum() + +macro=StringToEnum('DataSet');