+ MEDFileMesh *__getitem__(PyObject *obj)
+ {
+ static const char msg[]="MEDFileMeshes::__getitem__ : only integer or string with meshname supported !";
+ if(PyInt_Check(obj))
+ {
+ MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+ MEDFileMesh *ret(self->getMeshWithName(convertPyObjectToStr(obj,msg)));
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+
+ MEDFileMeshes *__setitem__(int obj, MEDFileMesh *mesh)
+ {
+ self->setMeshAtPos(obj,mesh);
+ return self;
+ }
+
+ MEDFileMeshesIterator *__iter__()
+ {
+ return self->iterator();
+ }
+
+ int __len__() const
+ {
+ return self->getNumberOfMeshes();
+ }
+
+ MEDFileMesh *getMeshAtPos(int i) const
+ {
+ MEDFileMesh *ret=self->getMeshAtPos(i);
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+ MEDFileMesh *getMeshWithName(const std::string& mname) const
+ {
+ MEDFileMesh *ret=self->getMeshWithName(mname);
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+ }
+ };
+
+ class MEDFileFieldLoc : public RefCountObject
+ {
+ public:
+ std::string getName() const;
+ int getDimension() const;
+ int getNumberOfGaussPoints() const;
+ int getNumberOfPointsInCells() const;
+ const std::vector<double>& getRefCoords() const;
+ const std::vector<double>& getGaussCoords() const;
+ const std::vector<double>& getGaussWeights() const;
+ bool isEqual(const MEDFileFieldLoc& other, double eps) const;
+ %extend
+ {
+ std::string __str__() const
+ {
+ return self->repr();
+ }
+ }
+ };
+
+ class MEDFileFieldGlobsReal
+ {
+ public:
+ void resetContent();
+ void shallowCpyGlobs(const MEDFileFieldGlobsReal& other);
+ void deepCpyGlobs(const MEDFileFieldGlobsReal& other);
+ void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
+ void deepCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
+ void appendGlobs(const MEDFileFieldGlobsReal& other, double eps);
+ void checkGlobsCoherency() const;
+ void checkGlobsPflsPartCoherency() const;
+ void checkGlobsLocsPartCoherency() const;
+ std::vector<std::string> getPfls() const;
+ std::vector<std::string> getLocs() const;
+ bool existsPfl(const std::string& pflName) const;
+ bool existsLoc(const std::string& locName) const;
+ std::string createNewNameOfPfl() const;
+ std::string createNewNameOfLoc() const;
+ std::vector< std::vector<int> > whichAreEqualProfiles() const;
+ std::vector< std::vector<int> > whichAreEqualLocs(double eps) const;
+ virtual std::vector<std::string> getPflsReallyUsed() const;
+ virtual std::vector<std::string> getLocsReallyUsed() const;
+ virtual std::vector<std::string> getPflsReallyUsedMulti() const;
+ virtual std::vector<std::string> getLocsReallyUsedMulti() const;
+ void killProfileIds(const std::vector<int>& pflIds);
+ void killLocalizationIds(const std::vector<int>& locIds);
+ void changePflName(const std::string& oldName, const std::string& newName);
+ void changeLocName(const std::string& oldName, const std::string& newName);
+ int getNbOfGaussPtPerCell(int locId) const;
+ int getLocalizationId(const std::string& loc) const;
+ int getProfileId(const std::string& pfl) const;
+ void killStructureElementsInGlobs();
+ %extend
+ {
+ PyObject *getProfile(const std::string& pflName) const
+ {
+ const DataArrayIdType *ret=self->getProfile(pflName);
+ if(ret)
+ ret->incrRef();
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
+ }
+
+ PyObject *getProfileFromId(int pflId) const
+ {
+ const DataArrayIdType *ret=self->getProfileFromId(pflId);
+ if(ret)
+ ret->incrRef();
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 );
+ }
+
+ PyObject *getLocalizationFromId(int locId) const
+ {
+ const MEDFileFieldLoc *loc=&self->getLocalizationFromId(locId);
+ if(loc)
+ loc->incrRef();
+ return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
+ }
+
+ PyObject *getLocalization(const std::string& locName) const
+ {
+ const MEDFileFieldLoc *loc=&self->getLocalization(locName);
+ if(loc)
+ loc->incrRef();
+ return SWIG_NewPointerObj(SWIG_as_voidptr(loc),SWIGTYPE_p_MEDCoupling__MEDFileFieldLoc, SWIG_POINTER_OWN | 0 );
+ }
+
+ PyObject *zipPflsNames()
+ {
+ std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipPflsNames();
+ return convertVecPairVecStToPy(ret);
+ }
+
+ PyObject *zipLocsNames(double eps)
+ {
+ std::vector< std::pair<std::vector<std::string>, std::string > > ret=self->zipLocsNames(eps);
+ return convertVecPairVecStToPy(ret);
+ }
+
+ void changePflsNames(PyObject *li)
+ {
+ std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
+ self->changePflsNames(v);
+ }
+
+ void changePflsRefsNamesGen(PyObject *li)
+ {
+ std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
+ self->changePflsRefsNamesGen(v);
+ }
+
+ void changePflsNamesInStruct(PyObject *li)
+ {
+ std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
+ self->changePflsNamesInStruct(v);
+ }
+
+ void changeLocsNames(PyObject *li)
+ {
+ std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
+ self->changeLocsNames(v);
+ }
+
+ void changeLocsRefsNamesGen(PyObject *li)
+ {
+ std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
+ self->changeLocsRefsNamesGen(v);
+ }
+
+ void changeLocsNamesInStruct(PyObject *li)
+ {
+ std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
+ self->changeLocsNamesInStruct(v);
+ }
+
+ std::string simpleReprGlobs() const
+ {
+ std::ostringstream oss;
+ self->simpleReprGlobs(oss);
+ return oss.str();
+ }
+ }
+ };
+
+ class MEDFileEntities
+ {
+ public:
+ %extend
+ {
+ static MEDFileEntities *BuildFrom(PyObject *entities)
+ {
+ std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > inp;
+ std::vector< std::pair<int,int> > inp0(convertTimePairIdsFromPy(entities));
+ {
+ std::size_t sz(inp0.size());
+ inp.resize(sz);
+ for(std::size_t i=0;i<sz;i++)
+ inp[i]=std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType>((TypeOfField)inp0[i].first,(INTERP_KERNEL::NormalizedCellType)inp0[i].second);
+ }
+ return MEDFileEntities::BuildFrom(&inp);
+ }
+ }
+ private:
+ MEDFileEntities();
+ };
+
+ class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
+ {
+ public:
+ static MEDFileAnyTypeField1TS *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ static MEDFileAnyTypeField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
+ static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities);
+ void loadArrays();
+ void loadArraysIfNecessary();
+ void unloadArrays();
+ void unloadArraysWithoutDataLoss();
+ int getDimension() const;
+ int getIteration() const;
+ int getOrder() const;
+ std::string getName();
+ void setName(const std::string& name);
+ std::string getMeshName();
+ void setMeshName(const std::string& newMeshName);
+ int getMeshIteration() const;
+ int getMeshOrder() const;
+ int getNumberOfComponents() const;
+ bool isDealingTS(int iteration, int order) const;
+ void setInfo(const std::vector<std::string>& infos);
+ const std::vector<std::string>& getInfo() const;
+ bool presenceOfMultiDiscPerGeoType() const;
+ void setTime(int iteration, int order, double val);
+ virtual MEDFileAnyTypeField1TS *shallowCpy() const;
+ MEDFileAnyTypeField1TS *deepCopy() const;
+ std::string getDtUnit() const;
+ void setDtUnit(const std::string& dtUnit);
+ %extend
+ {
+ PyObject *getTime()
+ {
+ int tmp1,tmp2;
+ double tmp0=self->getTime(tmp1,tmp2);
+ PyObject *res = PyList_New(3);
+ PyList_SetItem(res,0,SWIG_From_int(tmp1));
+ PyList_SetItem(res,1,SWIG_From_int(tmp2));
+ PyList_SetItem(res,2,SWIG_From_double(tmp0));
+ return res;
+ }
+
+ PyObject *getDtIt() const
+ {
+ std::pair<int,int> res=self->getDtIt();
+ PyObject *elt=PyTuple_New(2);
+ PyTuple_SetItem(elt,0,SWIG_From_int(res.first));
+ PyTuple_SetItem(elt,1,SWIG_From_int(res.second));
+ return elt;
+ }
+
+ void setProfileNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false)
+ {
+ self->setProfileNameOnLeaf(0,typ,locId,newPflName,forceRenameOnGlob);
+ }
+
+ void setLocNameOnLeaf(INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false)
+ {
+ self->setLocNameOnLeaf(0,typ,locId,newLocName,forceRenameOnGlob);
+ }
+
+ bool changeMeshNames(PyObject *li)
+ {
+ std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
+ return self->changeMeshNames(modifTab);
+ }
+
+ PyObject *getTypesOfFieldAvailable() const
+ {
+ std::vector<TypeOfField> ret=self->getTypesOfFieldAvailable();
+ PyObject *ret2=PyList_New(ret.size());
+ for(int i=0;i<(int)ret.size();i++)
+ PyList_SetItem(ret2,i,SWIG_From_int(ret[i]));
+ return ret2;
+ }
+
+ PyObject *getNonEmptyLevels(const std::string& mname=std::string()) const
+ {
+ std::vector<int> ret1;
+ int ret0=self->getNonEmptyLevels(mname,ret1);
+ PyObject *elt=PyTuple_New(2);
+ PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
+ PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
+ return elt;
+ }
+
+ PyObject *getFieldSplitedByType(const std::string& mname=std::string()) const
+ {
+ std::vector<INTERP_KERNEL::NormalizedCellType> types;
+ std::vector< std::vector<TypeOfField> > typesF;
+ std::vector< std::vector<std::string> > pfls;
+ std::vector< std::vector<std::string> > locs;
+ std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(mname,types,typesF,pfls,locs);
+ std::size_t sz=ret.size();
+ PyObject *ret2=PyList_New(sz);
+ for(std::size_t i=0;i<sz;i++)
+ {
+ const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
+ const std::vector<TypeOfField>& typesFI=typesF[i];
+ const std::vector<std::string>& pflsI=pfls[i];
+ const std::vector<std::string>& locsI=locs[i];
+ PyObject *elt=PyTuple_New(2);
+ PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
+ std::size_t sz2=ret[i].size();
+ PyObject *elt2=PyList_New(sz2);
+ for(std::size_t j=0;j<sz2;j++)
+ {
+ PyObject *elt3=PyTuple_New(4);
+ PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
+ PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
+ PyTuple_SetItem(elt3,1,elt4);
+ PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
+ PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
+ PyList_SetItem(elt2,j,elt3);
+ }
+ PyTuple_SetItem(elt,1,elt2);
+ PyList_SetItem(ret2,i,elt);
+ }
+ return ret2;
+ }
+
+ PyObject *splitComponents() const
+ {
+ std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitComponents();
+ std::size_t sz=ret.size();
+ PyObject *retPy=PyList_New(sz);
+ for(std::size_t i=0;i<sz;i++)
+ PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
+ return retPy;
+ }
+
+ PyObject *splitDiscretizations() const
+ {
+ std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitDiscretizations();
+ std::size_t sz=ret.size();
+ PyObject *retPy=PyList_New(sz);
+ for(std::size_t i=0;i<sz;i++)
+ PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
+ return retPy;
+ }
+
+ PyObject *splitMultiDiscrPerGeoTypes() const
+ {
+ std::vector< MCAuto< MEDFileAnyTypeField1TS > > ret=self->splitMultiDiscrPerGeoTypes();
+ std::size_t sz=ret.size();
+ PyObject *retPy=PyList_New(sz);
+ for(std::size_t i=0;i<sz;i++)
+ PyList_SetItem(retPy,i,convertMEDFileField1TS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
+ return retPy;
+ }
+
+ MEDFileAnyTypeField1TS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
+ {
+ std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
+ convertToMapIntDataArrayInt(extractDef,extractDefCpp);
+ return self->extractPart(extractDefCpp,mm);
+ }
+ }
+ };
+
+ class MEDFileField1TS : public MEDFileAnyTypeField1TS
+ {
+ public:
+ static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
+ static MEDFileField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ static MEDFileField1TS *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileField1TS *New(DataArrayByte *db);
+ static MEDFileField1TS *New();
+ MEDCoupling::MEDFileInt32Field1TS *convertToInt(bool isDeepCpyGlobs=true) const;
+ void copyTimeInfoFrom(MEDCouplingFieldDouble *mcf);
+ MEDCouplingFieldDouble *field(const MEDFileMesh *mesh) const;
+ MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
+ MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
+ MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
+ //
+ void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
+ void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
+ void setFieldProfileFlatly(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
+ void setProfileNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newPflName, bool forceRenameOnGlob=false);
+ void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false);
+ %extend
+ {
+ MEDFileField1TS(const std::string& fileName, bool loadAll=true)
+ {
+ return MEDFileField1TS::New(fileName,loadAll);
+ }
+
+ MEDFileField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
+ {
+ return MEDFileField1TS::New(fileName,fieldName,loadAll);
+ }
+
+ MEDFileField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
+ {
+ return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll);
+ }
+
+ MEDFileField1TS(DataArrayByte *db)
+ {
+ return MEDFileField1TS::New(db);
+ }
+
+ MEDFileField1TS()
+ {
+ return MEDFileField1TS::New();
+ }
+
+ void copyTinyInfoFrom(const MEDCouplingFieldDouble *field)
+ {
+ const DataArrayDouble *arr=0;
+ if(field)
+ arr=field->getArray();
+ self->copyTinyInfoFrom(field,arr);
+ }
+
+ std::string __str__() const
+ {
+ return self->simpleRepr();
+ }
+
+ PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
+ {
+ return MEDFileField1TS_getFieldWithProfile<double>(self,type,meshDimRelToMax,mesh);
+ }
+
+ PyObject *getFieldSplitedByType2(const std::string& mname=std::string()) const
+ {
+ std::vector<INTERP_KERNEL::NormalizedCellType> types;
+ std::vector< std::vector<TypeOfField> > typesF;
+ std::vector< std::vector<std::string> > pfls;
+ std::vector< std::vector<std::string> > locs;
+ std::vector< std::vector<DataArrayDouble *> > ret=self->getFieldSplitedByType2(mname,types,typesF,pfls,locs);
+ std::size_t sz=ret.size();
+ PyObject *ret2=PyList_New(sz);
+ for(std::size_t i=0;i<sz;i++)
+ {
+ const std::vector<DataArrayDouble *>& dadsI=ret[i];
+ const std::vector<TypeOfField>& typesFI=typesF[i];
+ const std::vector<std::string>& pflsI=pfls[i];
+ const std::vector<std::string>& locsI=locs[i];
+ PyObject *elt=PyTuple_New(2);
+ PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
+ std::size_t sz2=ret[i].size();
+ PyObject *elt2=PyList_New(sz2);
+ for(std::size_t j=0;j<sz2;j++)
+ {
+ PyObject *elt3=PyTuple_New(4);
+ PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
+ PyTuple_SetItem(elt3,1,SWIG_NewPointerObj(SWIG_as_voidptr(dadsI[j]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
+ PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
+ PyList_SetItem(elt2,j,elt3);
+ }
+ PyTuple_SetItem(elt,1,elt2);
+ PyList_SetItem(ret2,i,elt);
+ }
+ return ret2;
+ }
+
+ DataArrayDouble *getUndergroundDataArray() const
+ {
+ DataArrayDouble *ret=self->getUndergroundDataArray();
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+
+ PyObject *getUndergroundDataArrayExt() const
+ {
+ return MEDFileField1TS_getUndergroundDataArrayExt<double>(self);
+ }
+ }
+ };
+
+ class MEDFileInt32Field1TS : public MEDFileAnyTypeField1TS
+ {
+ public:
+ static MEDFileInt32Field1TS *New();
+ static MEDFileInt32Field1TS *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileInt32Field1TS *New(DataArrayByte *db);
+ static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ static MEDFileInt32Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
+ MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
+ //
+ void setFieldNoProfileSBT(const MEDCouplingFieldInt32 *field);
+ void setFieldProfile(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
+ void setFieldProfileFlatly(const MEDCouplingFieldInt32 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
+ void copyTimeInfoFrom(MEDCouplingFieldInt32 *mcf);
+ MEDCouplingFieldInt32 *field(const MEDFileMesh *mesh) const;
+ MEDCouplingFieldInt32 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
+ MEDCouplingFieldInt32 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
+ MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldInt32 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldInt32 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
+ %extend
+ {
+ MEDFileInt32Field1TS()
+ {
+ return MEDFileInt32Field1TS::New();
+ }
+
+ MEDFileInt32Field1TS(const std::string& fileName, bool loadAll=true)
+ {
+ return MEDFileInt32Field1TS::New(fileName,loadAll);
+ }
+
+ MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
+ {
+ return MEDFileInt32Field1TS::New(fileName,fieldName,loadAll);
+ }
+
+ MEDFileInt32Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
+ {
+ return MEDFileInt32Field1TS::New(fileName,fieldName,iteration,order,loadAll);
+ }
+
+ MEDFileInt32Field1TS(DataArrayByte *db)
+ {
+ return MEDFileInt32Field1TS::New(db);
+ }
+
+ std::string __str__() const
+ {
+ return self->simpleRepr();
+ }
+
+ PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
+ {
+ return MEDFileField1TS_getFieldWithProfile<Int32>(self,type,meshDimRelToMax,mesh);
+ }
+
+ DataArrayInt32 *getUndergroundDataArray() const
+ {
+ DataArrayInt32 *ret=self->getUndergroundDataArray();
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+
+ PyObject *getUndergroundDataArrayExt() const
+ {
+ return MEDFileField1TS_getUndergroundDataArrayExt<Int32>(self);
+ }
+ }
+ };
+
+ class MEDFileInt64Field1TS : public MEDFileAnyTypeField1TS
+ {
+ public:
+ static MEDFileInt64Field1TS *New();
+ static MEDFileInt64Field1TS *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileInt64Field1TS *New(DataArrayByte *db);
+ static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ static MEDFileInt64Field1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
+ MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
+ //
+ void setFieldNoProfileSBT(const MEDCouplingFieldInt64 *field);
+ void setFieldProfile(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
+ void setFieldProfileFlatly(const MEDCouplingFieldInt64 *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
+ void copyTimeInfoFrom(MEDCouplingFieldInt64 *mcf);
+ MEDCouplingFieldInt64 *field(const MEDFileMesh *mesh) const;
+ MEDCouplingFieldInt64 *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
+ MEDCouplingFieldInt64 *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
+ MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldInt64 *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldInt64 *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
+ %extend
+ {
+ MEDFileInt64Field1TS()
+ {
+ return MEDFileInt64Field1TS::New();
+ }
+
+ MEDFileInt64Field1TS(const std::string& fileName, bool loadAll=true)
+ {
+ return MEDFileInt64Field1TS::New(fileName,loadAll);
+ }
+
+ MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
+ {
+ return MEDFileInt64Field1TS::New(fileName,fieldName,loadAll);
+ }
+
+ MEDFileInt64Field1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
+ {
+ return MEDFileInt64Field1TS::New(fileName,fieldName,iteration,order,loadAll);
+ }
+
+ MEDFileInt64Field1TS(DataArrayByte *db)
+ {
+ return MEDFileInt64Field1TS::New(db);
+ }
+
+ std::string __str__() const
+ {
+ return self->simpleRepr();
+ }
+
+ PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
+ {
+ return MEDFileField1TS_getFieldWithProfile<Int64>(self,type,meshDimRelToMax,mesh);
+ }
+
+ DataArrayInt64 *getUndergroundDataArray() const
+ {
+ DataArrayInt64 *ret=self->getUndergroundDataArray();
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+
+ PyObject *getUndergroundDataArrayExt() const
+ {
+ return MEDFileField1TS_getUndergroundDataArrayExt<Int64>(self);
+ }
+ }
+ };
+
+ class MEDFileFloatField1TS : public MEDFileAnyTypeField1TS
+ {
+ public:
+ static MEDFileFloatField1TS *New();
+ static MEDFileFloatField1TS *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileFloatField1TS *New(DataArrayByte *db);
+ static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true);
+ MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
+ //
+ void setFieldNoProfileSBT(const MEDCouplingFieldFloat *field);
+ void setFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
+ void setFieldProfileFlatly(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
+ void copyTimeInfoFrom(MEDCouplingFieldFloat *mcf);
+ MEDCouplingFieldFloat *field(const MEDFileMesh *mesh) const;
+ MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const;
+ MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const;
+ MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
+ %extend
+ {
+ MEDFileFloatField1TS()
+ {
+ return MEDFileFloatField1TS::New();
+ }
+
+ MEDFileFloatField1TS(const std::string& fileName, bool loadAll=true)
+ {
+ return MEDFileFloatField1TS::New(fileName,loadAll);
+ }
+
+ MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)
+ {
+ return MEDFileFloatField1TS::New(fileName,fieldName,loadAll);
+ }
+
+ MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true)
+ {
+ return MEDFileFloatField1TS::New(fileName,fieldName,iteration,order,loadAll);
+ }
+
+ MEDFileFloatField1TS(DataArrayByte *db)
+ {
+ return MEDFileFloatField1TS::New(db);
+ }
+
+ std::string __str__() const
+ {
+ return self->simpleRepr();
+ }
+
+ PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const
+ {
+ return MEDFileField1TS_getFieldWithProfile<float>(self,type,meshDimRelToMax,mesh);
+ }
+
+ DataArrayFloat *getUndergroundDataArray() const
+ {
+ DataArrayFloat *ret=self->getUndergroundDataArray();
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+
+ PyObject *getUndergroundDataArrayExt() const
+ {
+ return MEDFileField1TS_getUndergroundDataArrayExt<float>(self);
+ }
+ }
+ };
+
+ class MEDFileAnyTypeFieldMultiTSIterator
+ {
+ public:
+ %extend
+ {
+ PyObject *next()
+ {
+ MEDFileAnyTypeField1TS *ret=self->nextt();
+ if(ret)
+ return convertMEDFileField1TS(ret, SWIG_POINTER_OWN | 0 );
+ else
+ {
+ PyErr_SetString(PyExc_StopIteration,"No more data.");
+ return 0;
+ }
+ }
+ }
+ };
+
+ class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritableStandAlone
+ {
+ public:
+ static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ MEDFileAnyTypeFieldMultiTS *deepCopy() const;
+ virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const;
+ std::string getName() const;
+ void setName(const std::string& name);
+ std::string getDtUnit() const;
+ void setDtUnit(const std::string& dtUnit);
+ std::string getMeshName() const;
+ void setMeshName(const std::string& newMeshName);
+ const std::vector<std::string>& getInfo() const;
+ bool presenceOfMultiDiscPerGeoType() const;
+ int getNumberOfComponents() const;
+ int getNumberOfTS() const;
+ void eraseEmptyTS();
+ int getPosOfTimeStep(int iteration, int order) const;
+ int getPosGivenTime(double time, double eps=1e-8) const;
+ void loadArrays();
+ void loadArraysIfNecessary();
+ void unloadArrays();
+ void unloadArraysWithoutDataLoss();
+ //
+ virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const;
+ MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const;
+ MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const;
+ void pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts);
+ void synchronizeNameScope();
+ MEDFileAnyTypeFieldMultiTS *buildNewEmpty() const;
+ %extend
+ {
+ int __len__() const
+ {
+ return self->getNumberOfTS();
+ }
+
+ int getTimeId(PyObject *elt0) const
+ {
+ if(elt0 && PyInt_Check(elt0))
+ {//fmts[3]
+ int pos=(int)PyInt_AS_LONG(elt0);
+ return pos;
+ }
+ else if(elt0 && PyTuple_Check(elt0))
+ {
+ if(PyTuple_Size(elt0)==2)
+ {
+ PyObject *o0=PyTuple_GetItem(elt0,0);
+ PyObject *o1=PyTuple_GetItem(elt0,1);
+ if(PyInt_Check(o0) && PyInt_Check(o1))
+ {//fmts(1,-1)
+ int iter=(int)PyInt_AS_LONG(o0);
+ int order=(int)PyInt_AS_LONG(o1);
+ return self->getPosOfTimeStep(iter,order);
+ }
+ else
+ throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input param ! input is a tuple of size 2 but two integers are expected in this tuple to request a time steps !");
+ }
+ else
+ throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input param ! input is a tuple of size != 2 ! two integers are expected in this tuple to request a time steps !");
+ }
+ else if(elt0 && PyFloat_Check(elt0))
+ {
+ double val=PyFloat_AS_DOUBLE(elt0);
+ return self->getPosGivenTime(val);
+ }
+ else
+ throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::__getitem__ : invalid input params ! expected fmts[int], fmts[int,int] or fmts[double] to request time step !");
+ }
+
+ PyObject *getIterations() const
+ {
+ std::vector< std::pair<int,int> > res(self->getIterations());
+ return convertVecPairIntToPy(res);
+ }
+
+ PyObject *getTimeSteps() const
+ {
+ std::vector<double> ret1;
+ std::vector< std::pair<int,int> > ret=self->getTimeSteps(ret1);
+ std::size_t sz=ret.size();
+ PyObject *ret2=PyList_New(sz);
+ for(std::size_t i=0;i<sz;i++)
+ {
+ PyObject *elt=PyTuple_New(3);
+ PyTuple_SetItem(elt,0,SWIG_From_int(ret[i].first));
+ PyTuple_SetItem(elt,1,SWIG_From_int(ret[i].second));
+ PyTuple_SetItem(elt,2,SWIG_From_double(ret1[i]));
+ PyList_SetItem(ret2,i,elt);
+ }
+ return ret2;
+ }
+
+ PyObject *getTypesOfFieldAvailable() const
+ {
+ std::vector< std::vector<TypeOfField> > ret=self->getTypesOfFieldAvailable();
+ PyObject *ret2=PyList_New(ret.size());
+ for(int i=0;i<(int)ret.size();i++)
+ {
+ const std::vector<TypeOfField>& rett=ret[i];
+ PyObject *ret3=PyList_New(rett.size());
+ for(int j=0;j<(int)rett.size();j++)
+ PyList_SetItem(ret3,j,SWIG_From_int(rett[j]));
+ PyList_SetItem(ret2,i,ret3);
+ }
+ return ret2;
+ }
+
+ PyObject *getNonEmptyLevels(int iteration, int order, const std::string& mname=std::string()) const
+ {
+ std::vector<int> ret1;
+ int ret0=self->getNonEmptyLevels(iteration,order,mname,ret1);
+ PyObject *elt=PyTuple_New(2);
+ PyTuple_SetItem(elt,0,SWIG_From_int(ret0));
+ PyTuple_SetItem(elt,1,convertIntArrToPyList2(ret1));
+ return elt;
+ }
+
+ PyObject *getFieldSplitedByType(int iteration, int order, const std::string& mname=std::string()) const
+ {
+ std::vector<INTERP_KERNEL::NormalizedCellType> types;
+ std::vector< std::vector<TypeOfField> > typesF;
+ std::vector< std::vector<std::string> > pfls;
+ std::vector< std::vector<std::string> > locs;
+ std::vector< std::vector< std::pair<mcIdType,mcIdType> > > ret=self->getFieldSplitedByType(iteration,order,mname,types,typesF,pfls,locs);
+ std::size_t sz=ret.size();
+ PyObject *ret2=PyList_New(sz);
+ for(std::size_t i=0;i<sz;i++)
+ {
+ const std::vector< std::pair<mcIdType,mcIdType> >& dadsI=ret[i];
+ const std::vector<TypeOfField>& typesFI=typesF[i];
+ const std::vector<std::string>& pflsI=pfls[i];
+ const std::vector<std::string>& locsI=locs[i];
+ PyObject *elt=PyTuple_New(2);
+ PyTuple_SetItem(elt,0,SWIG_From_int(types[i]));
+ std::size_t sz2=ret[i].size();
+ PyObject *elt2=PyList_New(sz2);
+ for(std::size_t j=0;j<sz2;j++)
+ {
+ PyObject *elt3=PyTuple_New(4);
+ PyTuple_SetItem(elt3,0,SWIG_From_int(typesFI[j]));
+ PyObject *elt4=PyTuple_New(2); PyTuple_SetItem(elt4,0,PyInt_FromLong(dadsI[j].first)); PyTuple_SetItem(elt4,1,PyInt_FromLong(dadsI[j].second));
+ PyTuple_SetItem(elt3,1,elt4);
+ PyTuple_SetItem(elt3,2,PyString_FromString(pflsI[j].c_str()));
+ PyTuple_SetItem(elt3,3,PyString_FromString(locsI[j].c_str()));
+ PyList_SetItem(elt2,j,elt3);
+ }
+ PyTuple_SetItem(elt,1,elt2);
+ PyList_SetItem(ret2,i,elt);
+ }
+ return ret2;
+ }
+
+ std::vector<int> getTimeIds(PyObject *elts) const
+ {
+ if(PyList_Check(elts))
+ {
+ std::size_t sz=PyList_Size(elts);
+ std::vector<int> ret(sz);
+ for(std::size_t i=0;i<sz;i++)
+ {
+ PyObject *elt=PyList_GetItem(elts,i);
+ ret[i]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elt);
+ }
+ return ret;
+ }
+ else
+ {
+ std::vector<int> ret(1);
+ ret[0]=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeId(self,elts);
+ return ret;
+ }
+ }
+
+ void __delitem__(PyObject *elts)
+ {
+ if(PySlice_Check(elts))
+ {
+ Py_ssize_t strt=2,stp=2,step=2;
+ GetIndicesOfSlice(elts,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
+ self->eraseTimeStepIds2((int)strt,(int)stp,(int)step);
+ }
+ else
+ {
+ std::vector<int> idsToRemove=MEDCoupling_MEDFileAnyTypeFieldMultiTS_getTimeIds(self,elts);
+ if(!idsToRemove.empty())
+ self->eraseTimeStepIds(&idsToRemove[0],&idsToRemove[0]+idsToRemove.size());
+ }
+ }
+
+ void eraseTimeStepIds(PyObject *li)
+ {
+ mcIdType sw;
+ int pos1;
+ std::vector<int> pos2;
+ DataArrayInt32 *pos3=0;
+ DataArrayIntTuple *pos4=0;
+ convertIntStarLikePyObjToCpp(li,sw,pos1,pos2,pos3,pos4);
+ switch(sw)
+ {
+ case 1:
+ {
+ self->eraseTimeStepIds(&pos1,&pos1+1);
+ return;
+ }
+ case 2:
+ {
+ if(pos2.empty())
+ return;
+ self->eraseTimeStepIds(&pos2[0],&pos2[0]+pos2.size());
+ return ;
+ }
+ case 3:
+ {
+ self->eraseTimeStepIds(pos3->begin(),pos3->end());
+ return ;
+ }
+ default:
+ throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::eraseTimeStepIds : unexpected input array type recognized !");
+ }
+ }
+
+ MEDFileAnyTypeFieldMultiTSIterator *__iter__()
+ {
+ return self->iterator();
+ }
+
+ PyObject *__getitem__(PyObject *elt0) const
+ {
+ if(elt0 && PyList_Check(elt0))
+ {
+ std::size_t sz=PyList_Size(elt0);
+ MCAuto<DataArrayInt32> da=DataArrayInt32::New(); da->alloc(sz,1);
+ int *pt=da->getPointer();
+ for(std::size_t i=0;i<sz;i++,pt++)
+ {
+ PyObject *elt1=PyList_GetItem(elt0,i);
+ *pt=MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt1);
+ }
+ return convertMEDFileFieldMultiTS(self->buildSubPart(da->begin(),da->end()),SWIG_POINTER_OWN | 0);
+ }
+ else if(elt0 && PySlice_Check(elt0))
+ {
+ Py_ssize_t strt=2,stp=2,step=2;
+ GetIndicesOfSlice(elt0,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
+ return convertMEDFileFieldMultiTS(self->buildSubPartSlice((int)strt,(int)stp,(int)step),SWIG_POINTER_OWN | 0);
+ }
+ else
+ return convertMEDFileField1TS(self->getTimeStepAtPos(MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(self,elt0)),SWIG_POINTER_OWN | 0);
+ }
+
+ bool changeMeshNames(PyObject *li)
+ {
+ std::vector< std::pair<std::string,std::string> > modifTab=convertVecPairStStFromPy(li);
+ return self->changeMeshNames(modifTab);
+ }
+
+ PyObject *splitComponents() const
+ {
+ std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitComponents();
+ std::size_t sz=ret.size();
+ PyObject *retPy=PyList_New(sz);
+ for(std::size_t i=0;i<sz;i++)
+ PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
+ return retPy;
+ }
+
+ PyObject *splitDiscretizations() const
+ {
+ std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitDiscretizations();
+ std::size_t sz=ret.size();
+ PyObject *retPy=PyList_New(sz);
+ for(std::size_t i=0;i<sz;i++)
+ PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
+ return retPy;
+ }
+
+ PyObject *splitMultiDiscrPerGeoTypes() const
+ {
+ std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > ret=self->splitMultiDiscrPerGeoTypes();
+ std::size_t sz=ret.size();
+ PyObject *retPy=PyList_New(sz);
+ for(std::size_t i=0;i<sz;i++)
+ PyList_SetItem(retPy,i,convertMEDFileFieldMultiTS(ret[i].retn(), SWIG_POINTER_OWN | 0 ));
+ return retPy;
+ }
+
+ void pushBackTimeSteps(PyObject *li)
+ {
+ void *argp(0);
+ int status(SWIG_ConvertPtr(li,&argp,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,0|0));
+ if(SWIG_IsOK(status))
+ {
+ self->pushBackTimeSteps(reinterpret_cast<MEDFileAnyTypeFieldMultiTS *>(argp));
+ }
+ else
+ {
+ std::vector<MEDFileAnyTypeField1TS *> tmp;
+ convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeField1TS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeField1TS,"MEDFileAnyTypeField1TS",tmp);
+ self->pushBackTimeSteps(tmp);
+ }
+ }
+
+ MEDFileAnyTypeFieldMultiTS *extractPart(PyObject *extractDef, MEDFileMesh *mm) const
+ {
+ std::map<int, MCAuto<DataArrayIdType> > extractDefCpp;
+ convertToMapIntDataArrayInt(extractDef,extractDefCpp);
+ return self->extractPart(extractDefCpp,mm);
+ }
+
+ static PyObject *MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(PyObject *li)
+ {
+ std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
+ convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
+ std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(vectFMTS);
+ std::size_t sz=ret.size();
+ PyObject *retPy=PyList_New(sz);
+ for(std::size_t i=0;i<sz;i++)
+ {
+ std::size_t sz2=ret[i].size();
+ PyObject *ret1Py=PyList_New(sz2);
+ for(std::size_t j=0;j<sz2;j++)
+ {
+ MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
+ if(elt)
+ elt->incrRef();
+ PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
+ }
+ PyList_SetItem(retPy,i,ret1Py);
+ }
+ return retPy;
+ }
+
+ static PyObject *MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(PyObject *li, const MEDFileMesh *mesh)
+ {
+ std::vector<MEDFileAnyTypeFieldMultiTS *> vectFMTS;
+ convertFromPyObjVectorOfObj<MEDCoupling::MEDFileAnyTypeFieldMultiTS *>(li,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",vectFMTS);
+ std::vector< MCAuto<MEDFileFastCellSupportComparator> > ret2;
+ std::vector< std::vector<MEDFileAnyTypeFieldMultiTS *> > ret=MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(vectFMTS,mesh,ret2);
+ if(ret2.size()!=ret.size())
+ {
+ std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport (PyWrap) : internal error ! Size of 2 vectors must match ! (" << ret.size() << "!=" << ret2.size() << ") !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ std::size_t sz=ret.size();
+ PyObject *retPy=PyList_New(sz);
+ for(std::size_t i=0;i<sz;i++)
+ {
+ std::size_t sz2=ret[i].size();
+ PyObject *ret0Py=PyTuple_New(2);
+ PyObject *ret1Py=PyList_New(sz2);
+ for(std::size_t j=0;j<sz2;j++)
+ {
+ MEDFileAnyTypeFieldMultiTS *elt(ret[i][j]);
+ if(elt)
+ elt->incrRef();
+ PyList_SetItem(ret1Py,j,convertMEDFileFieldMultiTS(elt,SWIG_POINTER_OWN | 0 ));
+ }
+ PyTuple_SetItem(ret0Py,0,ret1Py);
+ PyTuple_SetItem(ret0Py,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret2[i].retn()),SWIGTYPE_p_MEDCoupling__MEDFileFastCellSupportComparator, SWIG_POINTER_OWN | 0 ));
+ PyList_SetItem(retPy,i,ret0Py);
+ }
+ return retPy;
+ }
+ }
+ };
+
+ class MEDFileInt32FieldMultiTS;
+ class MEDFileInt64FieldMultiTS;
+
+ class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
+ {
+ public:
+ static MEDFileFieldMultiTS *New();
+ static MEDFileFieldMultiTS *New(const std::string& fileName, bool loadAll=true);
+ static MEDFileFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
+ static MEDFileFieldMultiTS *New(DataArrayByte *db);
+ //
+ MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const;
+ MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const;
+ MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const;
+ MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const;
+ MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const;
+ //
+ void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field);
+ void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayIdType *profile);
+ MEDFileInt32FieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const;
+ %extend
+ {
+ static MEDFileAnyTypeFieldMultiTS *Aggregate(PyObject *fmtssPy, PyObject *dtsPy)
+ {
+ std::vector<const MEDFileAnyTypeFieldMultiTS *> fmtss;
+ convertFromPyObjVectorOfObj<const MEDFileAnyTypeFieldMultiTS *>(fmtssPy,SWIGTYPE_p_MEDCoupling__MEDFileAnyTypeFieldMultiTS,"MEDFileAnyTypeFieldMultiTS",fmtss);
+ std::vector< std::vector< std::pair<mcIdType,mcIdType> > > dts2;
+ convertPyToVectorVectorPairInt(dtsPy,dts2);
+ std::vector< std::vector< std::pair<int,mcIdType> > > dts(MEDVectorVectorMIIterator(0,dts2),MEDVectorVectorMIIterator(dts2.size(),dts2));
+ MCAuto<MEDFileAnyTypeFieldMultiTS> ret = MEDFileFieldMultiTS::Aggregate(fmtss,dts);
+ return ret.retn();
+ }
+
+ MEDFileFieldMultiTS()
+ {
+ return MEDFileFieldMultiTS::New();
+ }
+
+ MEDFileFieldMultiTS(const std::string& fileName, bool loadAll=true)
+ {
+ return MEDFileFieldMultiTS::New(fileName,loadAll);
+ }
+
+ MEDFileFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true)