+ bool ret1;
+ MEDCoupling1DGTUMesh *ret0=self->copyWithNodalConnectivityPacked(ret1);
+ PyObject *ret=PyTuple_New(2);
+ PyObject *ret1Py=ret1?Py_True:Py_False; Py_XINCREF(ret1Py);
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,ret1Py);
+ return ret;
+ }
+
+ static MEDCoupling1DGTUMesh *Merge1DGTUMeshes(PyObject *li) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
+ convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
+ return MEDCoupling1DGTUMesh::Merge1DGTUMeshes(tmp);
+ }
+
+ static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(PyObject *li) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector<const ParaMEDMEM::MEDCoupling1DGTUMesh *> tmp;
+ convertFromPyObjVectorOfObj<const ParaMEDMEM::MEDCoupling1DGTUMesh *>(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp);
+ return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp);
+ }
+
+ static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector<int>& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector<const ParaMEDMEM::DataArrayInt *> tmp;
+ convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayInt *>(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp);
+ return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt);
+ }
+ }
+ };
+
+ //== MEDCoupling1DGTUMeshEnd
+
+ class MEDCouplingStructuredMesh : public ParaMEDMEM::MEDCouplingMesh
+ {
+ public:
+ int getCellIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
+ int getNodeIdFromPos(int i, int j, int k) const throw(INTERP_KERNEL::Exception);
+ int getNumberOfCellsOfSubLevelMesh() const throw(INTERP_KERNEL::Exception);
+ int getSpaceDimensionOnNodeStruct() const throw(INTERP_KERNEL::Exception);
+ virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
+ std::vector<int> getCellGridStructure() const throw(INTERP_KERNEL::Exception);
+ MEDCoupling1SGTUMesh *build1SGTUnstructured() const throw(INTERP_KERNEL::Exception);
+ static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
+ MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const throw(INTERP_KERNEL::Exception);
+ static int DeduceNumberOfGivenStructure(const std::vector<int>& st) throw(INTERP_KERNEL::Exception);
+ static std::vector<int> GetSplitVectFromStruct(const std::vector<int>& strct) throw(INTERP_KERNEL::Exception);
+ %extend
+ {
+ virtual MEDCouplingStructuredMesh *buildStructuredSubPart(PyObject *cellPart) const throw(INTERP_KERNEL::Exception)
+ {
+ int tmpp1=-1,tmpp2=-1;
+ std::vector<int> tmp=fillArrayWithPyListInt2(cellPart,tmpp1,tmpp2);
+ std::vector< std::pair<int,int> > inp;
+ if(tmpp2==2)
+ {
+ inp.resize(tmpp1);
+ for(int i=0;i<tmpp1;i++)
+ { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
+ }
+ else if(tmpp2==1)
+ {
+ if(tmpp1%2!=0)
+ throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size ! Must be even size !");
+ inp.resize(tmpp1/2);
+ for(int i=0;i<tmpp1/2;i++)
+ { inp[i].first=tmp[2*i]; inp[i].second=tmp[2*i+1]; }
+ }
+ else
+ throw INTERP_KERNEL::Exception("Wrap of MEDCouplingStructuredMesh.buildStructuredSubPart : invalid input size !");
+ return self->buildStructuredSubPart(inp);
+ }
+
+ static DataArrayInt *BuildExplicitIdsFrom(PyObject *st, PyObject *part) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< std::pair<int,int> > inp;
+ convertPyToVectorPairInt(part,inp);
+ //
+ int szArr,sw,iTypppArr;
+ std::vector<int> stdvecTyyppArr;
+ const int *tmp4=convertObjToPossibleCpp1_Safe(st,sw,szArr,iTypppArr,stdvecTyyppArr);
+ std::vector<int> tmp5(tmp4,tmp4+szArr);
+ //
+ return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
+ }
+
+ static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< std::pair<int,int> > inp;
+ convertPyToVectorPairInt(part,inp);
+ return MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(inp);
+ }
+
+ static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
+ {
+ int szArr,sw,iTypppArr;
+ std::vector<int> stdvecTyyppArr;
+ const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
+ }
+
+ static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(PyObject *li) throw(INTERP_KERNEL::Exception)
+ {
+ int szArr,sw,iTypppArr;
+ std::vector<int> stdvecTyyppArr;
+ const int *tmp(convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr));
+ return MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh(tmp,tmp+szArr);
+ }
+
+ static std::vector<int> GetDimensionsFromCompactFrmt(PyObject *partCompactFormat) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< std::pair<int,int> > inp;
+ convertPyToVectorPairInt(partCompactFormat,inp);
+ return MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(inp);
+ }
+
+ static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
+ {
+ int szArr,sw,iTypppArr;
+ std::vector<int> stdvecTyyppArr;
+ const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ int szArr2,sw2,iTypppArr2;
+ std::vector<int> stdvecTyyppArr2;
+ const int *tmp2=convertObjToPossibleCpp1_Safe(st,sw2,szArr2,iTypppArr2,stdvecTyyppArr2);
+ std::vector<int> tmp3(tmp2,tmp2+szArr2);
+ std::vector< std::pair<int,int> > partCompactFormat;
+ bool ret0=MEDCouplingStructuredMesh::IsPartStructured(tmp,tmp+szArr,tmp3,partCompactFormat);
+ PyObject *ret=PyTuple_New(2);
+ PyObject *ret0Py=ret0?Py_True:Py_False; Py_XINCREF(ret0Py);
+ PyTuple_SetItem(ret,0,ret0Py);
+ PyObject *ret1Py=PyList_New(partCompactFormat.size());
+ for(std::size_t i=0;i<partCompactFormat.size();i++)
+ {
+ PyObject *tmp4=PyTuple_New(2);
+ PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
+ PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
+ PyList_SetItem(ret1Py,i,tmp4);
+ }
+ PyTuple_SetItem(ret,1,ret1Py);
+ return ret;
+ }
+ }
+ };
+
+ //== MEDCouplingCMesh
+
+ class MEDCouplingCMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
+ {
+ public:
+ static MEDCouplingCMesh *New() throw(INTERP_KERNEL::Exception);
+ static MEDCouplingCMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
+ MEDCouplingCMesh *clone(bool recDeepCpy) const;
+ void setCoords(const DataArrayDouble *coordsX,
+ const DataArrayDouble *coordsY=0,
+ const DataArrayDouble *coordsZ=0) throw(INTERP_KERNEL::Exception);
+ void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
+ %extend {
+ MEDCouplingCMesh() throw(INTERP_KERNEL::Exception)
+ {
+ return MEDCouplingCMesh::New();
+ }
+ MEDCouplingCMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDCouplingCMesh::New(meshName);
+ }
+ std::string __str__() const throw(INTERP_KERNEL::Exception)
+ {
+ return self->simpleRepr();
+ }
+ std::string __repr__() const throw(INTERP_KERNEL::Exception)
+ {
+ std::ostringstream oss;
+ self->reprQuickOverview(oss);
+ return oss.str();
+ }
+ DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception)
+ {
+ DataArrayDouble *ret=self->getCoordsAt(i);
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+ }
+ };
+
+ //== MEDCouplingCMesh End
+
+ //== MEDCouplingCurveLinearMesh
+
+ class MEDCouplingCurveLinearMesh : public ParaMEDMEM::MEDCouplingStructuredMesh
+ {
+ public:
+ static MEDCouplingCurveLinearMesh *New() throw(INTERP_KERNEL::Exception);
+ static MEDCouplingCurveLinearMesh *New(const std::string& meshName) throw(INTERP_KERNEL::Exception);
+ MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
+ void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
+ %extend {
+ MEDCouplingCurveLinearMesh() throw(INTERP_KERNEL::Exception)
+ {
+ return MEDCouplingCurveLinearMesh::New();
+ }
+ MEDCouplingCurveLinearMesh(const std::string& meshName) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDCouplingCurveLinearMesh::New(meshName);