+ {
+ std::string __str__() const
+ {
+ std::ostringstream oss;
+ self->reprAll(oss);
+ return oss.str();
+ }
+
+ std::string __repr__() const
+ {
+ std::ostringstream oss; oss << "MEDFileMeshReadSelector C++ instance at " << self << " (with code=" << self->getCode() << ").";
+ return oss.str();
+ }
+ }
+ };
+
+ class MEDFileJointCorrespondence : public RefCountObject, public MEDFileWritable
+ {
+ public:
+ static MEDFileJointCorrespondence *New();
+ static MEDFileJointCorrespondence *New(DataArrayInt* correspondence) // nodes
+ ;
+ static MEDFileJointCorrespondence *New(DataArrayInt* correspondence, // cells
+ INTERP_KERNEL::NormalizedCellType loc_geo_type,
+ INTERP_KERNEL::NormalizedCellType rem_geo_type)
+ ;
+ std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
+ MEDFileJointCorrespondence *deepCopy() const;
+ MEDFileJointCorrespondence *shallowCpy() const;
+ void setIsNodal(bool isNodal);
+ bool getIsNodal() const;
+ bool isEqual(const MEDFileJointCorrespondence *other) const;
+ void setLocalGeometryType(INTERP_KERNEL::NormalizedCellType type);
+ INTERP_KERNEL::NormalizedCellType getLocalGeometryType() const;
+ void setRemoteGeometryType(INTERP_KERNEL::NormalizedCellType type);
+ INTERP_KERNEL::NormalizedCellType getRemoteGeometryType() const;
+ void setCorrespondence(DataArrayInt *corr);
+ void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName, int order, int iteration) const;
+ std::string simpleRepr() const;
+ %extend
+ {
+ MEDFileJointCorrespondence()
+ {
+ return MEDFileJointCorrespondence::New();
+ }
+ MEDFileJointCorrespondence(DataArrayInt* correspondence)
+ {
+ return MEDFileJointCorrespondence::New(correspondence);
+ }
+ MEDFileJointCorrespondence(DataArrayInt* correspondence, // cells
+ INTERP_KERNEL::NormalizedCellType loc_geo_type,
+ INTERP_KERNEL::NormalizedCellType rem_geo_type)
+ {
+ return MEDFileJointCorrespondence::New(correspondence, loc_geo_type, rem_geo_type);
+ }
+
+ std::string __str__() const
+ {
+ return self->simpleRepr();
+ }
+
+ DataArrayInt *getCorrespondence() const
+ {
+ const DataArrayInt *ret(self->getCorrespondence());
+ if(ret)
+ ret->incrRef();
+ return const_cast<DataArrayInt *>(ret);
+ }
+ }
+ };
+
+ class MEDFileJointOneStep : public RefCountObject, public MEDFileWritable
+ {
+ public:
+ static MEDFileJointOneStep *New(int dt=-1, int it=-1);
+ static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1);
+ MEDFileJointOneStep *deepCopy() const;
+ MEDFileJointOneStep *shallowCpy() const;
+ bool isEqual(const MEDFileJointOneStep *other) const;
+ void setOrder(int order);
+ int getOrder() const;
+ void setIteration(int it);
+ int getIteration() const;
+ void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
+ int getNumberOfCorrespondences() const;
+ void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const;
+ std::string simpleRepr() const;
+ %extend
+ {
+ MEDFileJointOneStep()
+ {
+ return MEDFileJointOneStep::New();
+ }
+
+ MEDFileJointOneStep(const std::string& fileName, const std::string& mName, const std::string& jointName, int number)
+ {
+ return MEDFileJointOneStep::New(fileName,mName,jointName,number);
+ }
+
+ std::string __str__() const
+ {
+ return self->simpleRepr();
+ }
+
+ MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const
+ {
+ MEDFileJointCorrespondence *ret(self->getCorrespondenceAtPos(i));
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+
+ MEDFileJointCorrespondence *__getitem__(int i) const
+ {
+ return MEDCoupling_MEDFileJointOneStep_getCorrespondenceAtPos(self,i);
+ }
+ }
+ };
+
+ class MEDFileJoint : public RefCountObject, public MEDFileWritableStandAlone
+ {
+ public:
+ static MEDFileJoint *New();
+ static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num);
+ static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum);
+ MEDFileJoint *deepCopy() const;
+ MEDFileJoint *shallowCpy() const;
+ bool isEqual(const MEDFileJoint *other) const;
+ void setLocalMeshName(const std::string& name);
+ std::string getLocalMeshName() const;
+ void setRemoteMeshName(const std::string& name);
+ std::string getRemoteMeshName() const;
+ void setDescription(const std::string& name);
+ std::string getDescription() const;
+ void setJointName(const std::string& name);
+ std::string getJointName() const;
+ bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
+ void setDomainNumber(const int& number);
+ int getDomainNumber() const;
+ void pushStep(MEDFileJointOneStep* step);
+ int getNumberOfSteps() const;
+ std::string simpleRepr() const;
+ %extend
+ {
+ MEDFileJoint()
+ {
+ return MEDFileJoint::New();
+ }
+
+ MEDFileJoint(const std::string& fileName, const std::string& mName, int num)
+ {
+ return MEDFileJoint::New(fileName,mName,num);
+ }
+
+ MEDFileJoint(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum)
+ {
+ return MEDFileJoint::New(jointName,locMeshName,remoteMeshName,remoteMeshNum);
+ }
+
+ std::string __str__() const
+ {
+ return self->simpleRepr();
+ }
+
+ MEDFileJointOneStep *getStepAtPos(int i) const
+ {
+ MEDFileJointOneStep *ret(self->getStepAtPos(i));
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+
+ MEDFileJointOneStep *__getitem__(int i)
+ {
+ return MEDCoupling_MEDFileJoint_getStepAtPos(self,i);
+ }
+ }
+ };
+
+ class MEDFileJoints : public RefCountObject, public MEDFileWritableStandAlone
+ {
+ public:
+ static MEDFileJoints *New();
+ static MEDFileJoints *New(const std::string& fileName, const std::string& meshName);
+ MEDFileJoints *deepCopy() const;
+ std::string simpleRepr() const;
+ std::string getMeshName() const;
+ int getNumberOfJoints() const;
+ std::vector<std::string> getJointsNames() const;
+ bool changeJointNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
+ void resize(int newSize);
+ void pushJoint(MEDFileJoint *joint);
+ void setJointAtPos(int i, MEDFileJoint *joint);
+ void destroyJointAtPos(int i);
+ %extend
+ {
+ MEDFileJoints()
+ {
+ return MEDFileJoints::New();
+ }
+
+ MEDFileJoints(const std::string& fileName, const std::string& meshName)
+ {
+ return MEDFileJoints::New(fileName,meshName);
+ }
+
+ std::string __str__() const
+ {
+ return self->simpleRepr();
+ }
+
+ MEDFileJoint *__getitem__(PyObject *obj)
+ {
+ static const char msg[]="MEDFileJoints::__getitem__ : only integer or string with meshname supported !";
+ if(PyInt_Check(obj))
+ {
+ MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+ MEDFileJoint *ret(self->getJointWithName(convertPyObjectToStr(obj,msg)));
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+
+ int __len__() const
+ {
+ return self->getNumberOfJoints();
+ }
+
+ MEDFileJoint *getJointAtPos(int i) const
+ {
+ MEDFileJoint *ret=self->getJointAtPos(i);
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+
+ MEDFileJoint *getJointWithName(const std::string& paramName) const
+ {
+ MEDFileJoint *ret=self->getJointWithName(paramName);
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+ }
+ };
+
+ class MEDFileEquivalenceBase : public RefCountObject, public MEDFileWritableStandAlone
+ {
+ private:
+ MEDFileEquivalenceBase();
+ };
+
+ class MEDFileEquivalenceData : public MEDFileEquivalenceBase
+ {
+ private:
+ MEDFileEquivalenceData();
+ public:
+ void setArray(DataArrayInt *data);
+ %extend
+ {
+ DataArrayInt *getArray()
+ {
+ DataArrayInt *ret(self->getArray());
+ if(ret) ret->incrRef();
+ return ret;
+ }
+ }
+ };
+
+ class MEDFileEquivalenceNode : public MEDFileEquivalenceData
+ {
+ private:
+ MEDFileEquivalenceNode();
+ };
+
+ class MEDFileEquivalenceCell : public MEDFileEquivalenceBase
+ {
+ private:
+ MEDFileEquivalenceCell();
+ public:
+ void clear();
+ std::size_t size() const;
+ void setArray(int meshDimRelToMax, DataArrayInt *da);
+ void setArrayForType(INTERP_KERNEL::NormalizedCellType type, DataArrayInt *da);
+ %extend
+ {
+ DataArrayInt *getArray(INTERP_KERNEL::NormalizedCellType type)
+ {
+ DataArrayInt *ret(self->getArray(type));
+ if(ret) ret->incrRef();
+ return ret;
+ }
+
+ PyObject *getTypes() const
+ {
+ std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getTypes());
+ std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
+ PyObject *res=PyList_New(result.size());
+ for(int i=0;iL!=result.end(); i++, iL++)
+ PyList_SetItem(res,i,PyInt_FromLong(*iL));
+ return res;
+ }
+ }
+ };
+
+ class MEDFileEquivalencePair : public RefCountObject, public MEDFileWritableStandAlone
+ {
+ private:
+ MEDFileEquivalencePair();
+ public:
+ std::string getName() const;
+ void setName(const std::string& name);
+ std::string getDescription() const;
+ void setDescription(const std::string& descr);
+ void setArray(int meshDimRelToMaxExt, DataArrayInt *da);;
+ %extend
+ {
+ MEDFileEquivalenceCell *initCell()
+ {
+ MEDFileEquivalenceCell *ret(self->initCell());
+ if(ret) ret->incrRef();
+ return ret;
+ }
+
+ MEDFileEquivalenceNode *initNode()
+ {
+ MEDFileEquivalenceNode *ret(self->initNode());
+ if(ret) ret->incrRef();
+ return ret;
+ }
+
+ MEDFileEquivalenceCell *getCell()
+ {
+ MEDFileEquivalenceCell *ret(self->getCell());
+ if(ret) ret->incrRef();
+ return ret;
+ }
+
+ MEDFileEquivalenceNode *getNode()
+ {
+ MEDFileEquivalenceNode *ret(self->getNode());
+ if(ret) ret->incrRef();
+ return ret;
+ }
+ }
+ };
+
+ class MEDFileEquivalences : public RefCountObject, public MEDFileWritableStandAlone
+ {
+ private:
+ MEDFileEquivalences();
+ public:
+ int size() const;
+ std::vector<std::string> getEquivalenceNames() const;
+ void killEquivalenceWithName(const std::string& name);
+ void killEquivalenceAt(int i);
+ void clear();
+ %extend
+ {
+ MEDFileEquivalencePair *getEquivalence(int i)
+ {
+ MEDFileEquivalencePair *ret(self->getEquivalence(i));
+ if(ret) ret->incrRef();
+ return ret;
+ }
+ MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name)
+ {
+ MEDFileEquivalencePair *ret(self->getEquivalenceWithName(name));
+ if(ret) ret->incrRef();
+ return ret;
+ }
+
+ MEDFileEquivalencePair *appendEmptyEquivalenceWithName(const std::string& name)
+ {
+ MEDFileEquivalencePair *ret(self->appendEmptyEquivalenceWithName(name));
+ if(ret) ret->incrRef();
+ return ret;
+ }
+ }
+ };
+
+ class MEDFileMesh : public RefCountObject, public MEDFileWritableStandAlone
+ {
+ public:
+ static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
+ static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
+ static MEDFileMesh *New(DataArrayByte *db);
+ virtual MEDFileMesh *createNewEmpty() const;
+ virtual MEDFileMesh *deepCopy() const;
+ virtual MEDFileMesh *shallowCpy() const;
+ virtual void clearNonDiscrAttributes() const;
+ void setName(const std::string& name);
+ std::string getName();
+ std::string getUnivName() const;
+ bool getUnivNameWrStatus() const;
+ void setUnivNameWrStatus(bool newStatus);
+ void setDescription(const std::string& name);
+ std::string getDescription() const;
+ void setOrder(int order);
+ int getOrder() const;
+ void setIteration(int it);
+ int getIteration();
+ void setTimeValue(double time);
+ void setTime(int dt, int it, double time);
+ double getTimeValue() const;
+ void setTimeUnit(const std::string& unit);
+ std::string getTimeUnit() const;
+ void setAxisType(MEDCouplingAxisType at);
+ MEDCouplingAxisType getAxisType() const;
+ virtual int getNumberOfNodes() const;
+ virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const;
+ virtual bool hasImplicitPart() const;
+ virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const;
+ virtual void releaseImplicitPartIfAny() const;
+ virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const;
+ virtual std::vector<int> getFamArrNonEmptyLevelsExt() const;
+ virtual std::vector<int> getNumArrNonEmptyLevelsExt() const;
+ virtual std::vector<int> getNameArrNonEmptyLevelsExt() const;
+ virtual std::vector<int> getDistributionOfTypes(int meshDimRelToMax) const;
+ virtual MEDFileMesh *cartesianize() const;
+ std::vector<int> getNonEmptyLevels() const;
+ std::vector<int> getNonEmptyLevelsExt() const;
+ int getSizeAtLevel(int meshDimRelToMaxExt) const;
+ //
+ bool existsGroup(const std::string& groupName) const;
+ bool existsFamily(int famId) const;
+ bool existsFamily(const std::string& familyName) const;
+ void setFamilyId(const std::string& familyName, int id);
+ void setFamilyIdUnique(const std::string& familyName, int id);
+ void addFamily(const std::string& familyName, int id);
+ void addFamilyOnGrp(const std::string& grpName, const std::string& famName);
+ virtual void createGroupOnAll(int meshDimRelToMaxExt, const std::string& groupName);
+ virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs);
+ void copyFamGrpMapsFrom(const MEDFileMesh& other);
+ void clearGrpMap();
+ void clearFamMap();
+ void clearFamGrpMaps();
+ const std::map<std::string,int>& getFamilyInfo() const;
+ const std::map<std::string, std::vector<std::string> >& getGroupInfo() const;
+ std::vector<std::string> getFamiliesOnGroup(const std::string& name) const;
+ std::vector<std::string> getFamiliesOnGroups(const std::vector<std::string>& grps) const;
+ std::vector<int> getFamiliesIdsOnGroup(const std::string& name) const;
+ void setFamiliesOnGroup(const std::string& name, const std::vector<std::string>& fams);
+ void setFamiliesIdsOnGroup(const std::string& name, const std::vector<int>& famIds);
+ std::vector<std::string> getGroupsOnFamily(const std::string& name) const;
+ void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps);
+ std::vector<std::string> getGroupsNames() const;
+ std::vector<std::string> getFamiliesNames() const;
+ std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const;
+ std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const;
+ std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const;
+ std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const;
+ std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const;
+ std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const;
+ std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const;
+ std::vector<int> getFamNonEmptyLevels(const std::string& fam) const;
+ std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const;
+ std::vector<std::string> getFamiliesNamesWithFilePointOfView() const;
+ static std::string GetMagicFamilyStr();
+ void assignFamilyNameWithGroupName();
+ std::vector<std::string> removeEmptyGroups();
+ void removeGroupAtLevel(int meshDimRelToMaxExt, const std::string& name);
+ void removeGroup(const std::string& name);
+ void removeFamily(const std::string& name);
+ std::vector<std::string> removeOrphanGroups();
+ std::vector<std::string> removeOrphanFamilies();
+ void removeFamiliesReferedByNoGroups();
+ void rearrangeFamilies();
+ void zipFamilies();
+ void checkOrphanFamilyZero() const;
+ void changeGroupName(const std::string& oldName, const std::string& newName);
+ void changeFamilyName(const std::string& oldName, const std::string& newName);
+ void changeFamilyId(int oldId, int newId);
+ void changeAllGroupsContainingFamily(const std::string& familyNameToChange, const std::vector<std::string>& newFamiliesNames);
+ void setFamilyInfo(const std::map<std::string,int>& info);
+ void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
+ int getFamilyId(const std::string& name) const;
+ int getMaxAbsFamilyId() const;
+ int getMaxFamilyId() const;
+ int getMinFamilyId() const;
+ int getTheMaxAbsFamilyId() const;
+ int getTheMaxFamilyId() const;
+ int getTheMinFamilyId() const;
+ virtual int getMaxAbsFamilyIdInArrays() const;
+ virtual int getMaxFamilyIdInArrays() const;
+ virtual int getMinFamilyIdInArrays() const;
+ DataArrayInt *getAllFamiliesIdsReferenced() const;
+ DataArrayInt *computeAllFamilyIdsInUse() const;
+ std::vector<int> getFamiliesIds(const std::vector<std::string>& famNames) const;
+ std::string getFamilyNameGivenId(int id) const;
+ bool ensureDifferentFamIdsPerLevel();
+ void normalizeFamIdsTrio();
+ void normalizeFamIdsMEDFile();
+ virtual int getMeshDimension() const;
+ virtual std::string simpleRepr() const;
+ virtual std::string advancedRepr() const;
+ //
+ virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const;
+ virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr);
+ virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr);
+ virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr);
+ virtual void setGlobalNumFieldAtLevel(int meshDimRelToMaxExt, DataArrayInt *globalNumArr);
+ virtual void addNodeGroup(const DataArrayInt *ids);
+ virtual void addGroup(int meshDimRelToMaxExt, const DataArrayInt *ids);
+ virtual DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
+ virtual DataArrayInt *getGroupsArr(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
+ virtual DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
+ virtual DataArrayInt *getFamilyArr(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
+ virtual DataArrayInt *getNodeGroupArr(const std::string& grp, bool renum=false) const;
+ virtual DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
+ virtual DataArrayInt *getNodeFamilyArr(const std::string& fam, bool renum=false) const;
+ virtual DataArrayInt *getNodeFamiliesArr(const std::vector<std::string>& fams, bool renum=false) const;
+ int getNumberOfJoints();
+ MEDFileJoints *getJoints();
+ void setJoints( MEDFileJoints* joints );
+ void initializeEquivalences();
+ void killEquivalences();
+ bool presenceOfStructureElements() const;
+ void killStructureElements();
+ %extend
+ {
+ std::string __str__() const
+ {
+ return self->simpleRepr();
+ }
+
+ MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const
+ {
+ return self->getMeshAtLevel(meshDimRelToMaxExt,false);
+ }
+
+ 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;
+ }
+
+ virtual PyObject *isEqual(const MEDFileMesh *other, double eps) const
+ {
+ std::string what;
+ bool ret0=self->isEqual(other,eps,what);
+ PyObject *res=PyList_New(2);
+ PyObject *ret0Py=ret0?Py_True:Py_False;
+ Py_XINCREF(ret0Py);
+ PyList_SetItem(res,0,ret0Py);
+ PyList_SetItem(res,1,PyString_FromString(what.c_str()));
+ return res;
+ }
+
+ void setGroupsAtLevel(int meshDimRelToMaxExt, PyObject *li, bool renum=false)
+ {
+ std::vector<const DataArrayInt *> grps;
+ convertFromPyObjVectorOfObj<const MEDCoupling::DataArrayInt *>(li,SWIGTYPE_p_MEDCoupling__DataArrayInt,"DataArrayInt",grps);
+ self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum);
+ }
+
+ PyObject *areFamsEqual(const MEDFileMesh *other) const
+ {
+ std::string what;
+ bool ret0=self->areFamsEqual(other,what);
+ PyObject *res=PyList_New(2);
+ PyObject *ret0Py=ret0?Py_True:Py_False;
+ Py_XINCREF(ret0Py);
+ PyList_SetItem(res,0,ret0Py);
+ PyList_SetItem(res,1,PyString_FromString(what.c_str()));
+ return res;
+ }
+
+ PyObject *areGrpsEqual(const MEDFileMesh *other) const
+ {
+ std::string what;
+ bool ret0=self->areGrpsEqual(other,what);
+ PyObject *res=PyList_New(2);
+ PyObject *ret0Py=ret0?Py_True:Py_False;
+ Py_XINCREF(ret0Py);
+ PyList_SetItem(res,0,ret0Py);
+ PyList_SetItem(res,1,PyString_FromString(what.c_str()));
+ return res;
+ }
+
+ PyObject *getAllGeoTypes() const
+ {
+ std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getAllGeoTypes());
+ std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
+ PyObject *res=PyList_New(result.size());
+ for(int i=0;iL!=result.end(); i++, iL++)
+ PyList_SetItem(res,i,PyInt_FromLong(*iL));
+ return res;
+ }
+
+ PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const
+ {
+ std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
+ std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
+ PyObject *res=PyList_New(result.size());
+ for(int i=0;iL!=result.end(); i++, iL++)
+ PyList_SetItem(res,i,PyInt_FromLong(*iL));
+ return res;
+ }
+
+ PyObject *getFamilyFieldAtLevel(int meshDimRelToMaxExt) const
+ {
+ const DataArrayInt *tmp=self->getFamilyFieldAtLevel(meshDimRelToMaxExt);
+ if(tmp)
+ tmp->incrRef();
+ return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ }
+
+ PyObject *getOrCreateAndGetFamilyFieldAtLevel(int meshDimRelToMaxExt)
+ {
+ const DataArrayInt *tmp=self->getOrCreateAndGetFamilyFieldAtLevel(meshDimRelToMaxExt);
+ if(tmp)
+ tmp->incrRef();
+ return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ }
+
+ PyObject *getNumberFieldAtLevel(int meshDimRelToMaxExt) const
+ {
+ const DataArrayInt *tmp=self->getNumberFieldAtLevel(meshDimRelToMaxExt);
+ if(tmp)
+ tmp->incrRef();
+ return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ }
+
+ PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const
+ {
+ const DataArrayInt *tmp=self->getRevNumberFieldAtLevel(meshDimRelToMaxExt);
+ if(tmp)
+ tmp->incrRef();
+ return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ }
+
+ PyObject *getNameFieldAtLevel(int meshDimRelToMaxExt) const
+ {
+ const DataArrayAsciiChar *tmp=self->getNameFieldAtLevel(meshDimRelToMaxExt);
+ if(tmp)
+ tmp->incrRef();
+ return SWIG_NewPointerObj(SWIG_as_voidptr(tmp),SWIGTYPE_p_MEDCoupling__DataArrayAsciiChar, SWIG_POINTER_OWN | 0 );
+ }
+
+ PyObject *findOrCreateAndGiveFamilyWithId(int id, bool& created)
+ {
+ bool ret1;
+ std::string ret0=self->findOrCreateAndGiveFamilyWithId(id,ret1);
+ PyObject *ret=PyTuple_New(2);
+ PyTuple_SetItem(ret,0,PyString_FromString(ret0.c_str()));
+ PyTuple_SetItem(ret,1,SWIG_From_bool(ret1));
+ return ret;
+ }
+
+ PyObject *unPolyze()
+ {
+ DataArrayInt *ret3=0;
+ std::vector<int> ret1,ret2;
+ bool ret0=self->unPolyze(ret1,ret2,ret3);
+ PyObject *ret=PyTuple_New(4);
+ PyTuple_SetItem(ret,0,SWIG_From_bool(ret0));
+ //
+ PyObject *retLev1_0=PyList_New((int)ret1.size()/3);
+ for(int j=0;j<(int)ret1.size()/3;j++)
+ {
+ PyObject *retLev2=PyList_New(3);
+ PyList_SetItem(retLev2,0,SWIG_From_int(ret1[3*j]));
+ PyList_SetItem(retLev2,1,SWIG_From_int(ret1[3*j+1]));
+ PyList_SetItem(retLev2,2,SWIG_From_int(ret1[3*j+2]));
+ PyList_SetItem(retLev1_0,j,retLev2);
+ }
+ PyTuple_SetItem(ret,1,retLev1_0);
+ //
+ PyObject *retLev1_1=PyList_New((int)ret2.size()/3);
+ for(int j=0;j<(int)ret2.size()/3;j++)
+ {
+ PyObject *retLev2=PyList_New(3);
+ PyList_SetItem(retLev2,0,SWIG_From_int(ret2[3*j]));
+ PyList_SetItem(retLev2,1,SWIG_From_int(ret2[3*j+1]));
+ PyList_SetItem(retLev2,2,SWIG_From_int(ret2[3*j+2]));
+ PyList_SetItem(retLev1_1,j,retLev2);
+ }
+ PyTuple_SetItem(ret,2,retLev1_1);
+ //
+ PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(ret3),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ return ret;
+ }
+
+ MEDFileEquivalences *getEquivalences()
+ {
+ MEDFileEquivalences *ret(self->getEquivalences());
+ if(ret) ret->incrRef();
+ return ret;
+ }
+
+ virtual DataArrayInt *getGlobalNumFieldAtLevel(int meshDimRelToMaxExt) const
+ {
+ MCAuto<DataArrayInt> ret(self->getGlobalNumFieldAtLevel(meshDimRelToMaxExt));
+ return ret.retn();
+ }
+ }
+ };
+
+ class MEDFileUMesh : public MEDFileMesh
+ {
+ public:
+ static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
+ static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
+ static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem);
+ static MEDFileUMesh *New(DataArrayByte *db);
+ static MEDFileUMesh *New();
+ static const char *GetSpeStr4ExtMesh();
+ ~MEDFileUMesh();
+ int getSpaceDimension() const;
+ int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
+ void checkConsistency() const;
+ void checkSMESHConsistency() const;
+ void clearNodeAndCellNumbers();
+ //
+ MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
+ MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
+ MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const;
+ MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector<std::string>& fams, bool renum=false) const;
+ DataArrayInt *getNodeGroupsArr(const std::vector<std::string>& grps, bool renum=false) const;
+ MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const;
+ MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const;
+ MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const;
+ MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const;
+ void forceComputationOfParts() const;
+ //
+ void setFamilyNameAttachedOnId(int id, const std::string& newFamName);
+ void setCoords(DataArrayDouble *coords);
+ void setCoordsForced(DataArrayDouble *coords);
+ void eraseGroupsAtLevel(int meshDimRelToMaxExt);
+ void removeMeshAtLevel(int meshDimRelToMax);
+ void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m);
+ void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false);
+ void optimizeFamilies();
+ DataArrayInt *zipCoords();
+ DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
+ DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
+ MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const;
+ MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const;
+ MEDFileUMesh *quadraticToLinear(double eps=1e-12) const;
+ MEDCouplingMappedExtrudedMesh *convertToExtrudedMesh() const;
+ %extend
+ {
+ MEDFileUMesh(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0)
+ {
+ return MEDFileUMesh::New(fileName,mName,dt,it,mrs);
+ }
+
+ MEDFileUMesh(const std::string& fileName, MEDFileMeshReadSelector *mrs=0)
+ {
+ return MEDFileUMesh::New(fileName,mrs);
+ }
+
+ MEDFileUMesh(const MEDCouplingMappedExtrudedMesh *mem)
+ {
+ return MEDFileUMesh::New(mem);
+ }
+
+ MEDFileUMesh(DataArrayByte *db)
+ {
+ return MEDFileUMesh::New(db);
+ }