From 7fc13e546d61c65f725e76727c5a99b1f7282b82 Mon Sep 17 00:00:00 2001 From: ageay Date: Fri, 21 Jun 2013 08:26:49 +0000 Subject: [PATCH] nearly ready for the single geo type in MEDLoader --- src/MEDCoupling/MEDCoupling1GTUMesh.cxx | 105 ++++++++++++++++++++++- src/MEDCoupling/MEDCoupling1GTUMesh.hxx | 1 + src/MEDCoupling/MEDCouplingPointSet.cxx | 15 +++- src/MEDCoupling/MEDCouplingUMesh.cxx | 93 +++++++++++++++----- src/MEDCoupling/MEDCouplingUMesh.hxx | 2 + src/MEDCoupling_Swig/MEDCouplingCommon.i | 76 ++++++++++++++++ 6 files changed, 265 insertions(+), 27 deletions(-) diff --git a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx index 87f1ebe29..2f88693ad 100644 --- a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx +++ b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx @@ -905,13 +905,17 @@ MEDCoupling1SGTUMesh *MEDCoupling1SGTUMesh::Merge1SGTUMeshes(std::vector& a) throw(INTERP_KERNEL::Exception) { if(a.empty()) throw INTERP_KERNEL::Exception("MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords : input array must be NON EMPTY !"); std::vector::const_iterator it=a.begin(); if(!(*it)) - throw INTERP_KERNEL::Exception("MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords : presence of null instance !"); + throw INTERP_KERNEL::Exception("MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords : null instance in the first element of input vector !"); std::vector ncs(a.size()); int nbOfCells=(*it)->getNumberOfCells(); const DataArrayDouble *coords=(*it)->getCoords(); @@ -921,6 +925,8 @@ MEDCoupling1SGTUMesh *MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(std::ve it++; for(int i=1;it!=a.end();i++,it++) { + if(!(*it)) + throw INTERP_KERNEL::Exception("MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords : presence of a null instance in the input vector !"); if(cm!=&((*it)->getCellModel())) throw INTERP_KERNEL::Exception("Geometric types mismatches, Merge1SGTUMeshes impossible !"); (*it)->getNumberOfCells();//to check that all is OK @@ -934,6 +940,9 @@ MEDCoupling1SGTUMesh *MEDCoupling1SGTUMesh::Merge1SGTUMeshesOnSameCoords(std::ve return ret.retn(); } +/*! + * Assume that all instances in \a a are non null. If null it leads to a crash. That's why this method is assigned to be low level (LL) + */ MEDCoupling1SGTUMesh *MEDCoupling1SGTUMesh::Merge1SGTUMeshesLL(std::vector& a) throw(INTERP_KERNEL::Exception) { if(a.empty()) @@ -2330,13 +2339,17 @@ MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::Merge1DGTUMeshes(std::vector& a) throw(INTERP_KERNEL::Exception) { if(a.empty()) throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords : input array must be NON EMPTY !"); std::vector::const_iterator it=a.begin(); if(!(*it)) - throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords : presence of null instance !"); + throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords : null instance in the first element of input vector !"); std::vector< MEDCouplingAutoRefCountObjectPtr > objs(a.size()); std::vector ncs(a.size()),ncis(a.size()); int nbOfCells=(*it)->getNumberOfCells(); @@ -2348,6 +2361,8 @@ MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(std::ve it++; for(int i=1;it!=a.end();i++,it++) { + if(!(*it)) + throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords : presence of null instance !"); if(cm!=&((*it)->getCellModel())) throw INTERP_KERNEL::Exception("Geometric types mismatches, Merge1DGTUMeshes impossible !"); (*it)->getNumberOfCells();//to check that all is OK @@ -2363,9 +2378,43 @@ MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(std::ve return ret.retn(); } +/*! + * Assume that all instances in \a a are non null. If null it leads to a crash. That's why this method is assigned to be low level (LL) + */ MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::Merge1DGTUMeshesLL(std::vector& a) throw(INTERP_KERNEL::Exception) { - //tony + if(a.empty()) + throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::Merge1DGTUMeshes : input array must be NON EMPTY !"); + std::vector< MEDCouplingAutoRefCountObjectPtr > objs(a.size()); + std::vector ncs(a.size()),ncis(a.size()); + std::vector::const_iterator it=a.begin(); + std::vector nbNodesPerElt(a.size()); + int nbOfCells=(*it)->getNumberOfCells(); + bool tmp; + objs[0]=(*it)->copyWithNodalConnectivityPacked(tmp); + ncs[0]=objs[0]->getNodalConnectivity(); ncis[0]=objs[0]->getNodalConnectivityIndex(); + nbNodesPerElt[0]=0; + int prevNbOfNodes=(*it)->getNumberOfNodes(); + const INTERP_KERNEL::CellModel *cm=&((*it)->getCellModel()); + it++; + for(int i=1;it!=a.end();i++,it++) + { + if(cm!=&((*it)->getCellModel())) + throw INTERP_KERNEL::Exception("Geometric types mismatches, Merge1DGTUMeshes impossible !"); + objs[i]=(*it)->copyWithNodalConnectivityPacked(tmp); + ncs[i]=objs[i]->getNodalConnectivity(); ncis[i]=objs[i]->getNodalConnectivityIndex(); + nbOfCells+=(*it)->getNumberOfCells(); + nbNodesPerElt[i]=nbNodesPerElt[i-1]+prevNbOfNodes; + prevNbOfNodes=(*it)->getNumberOfNodes(); + } + std::vector aps(a.size()); + std::copy(a.begin(),a.end(),aps.begin()); + MEDCouplingAutoRefCountObjectPtr pts=MergeNodesArray(aps); + MEDCouplingAutoRefCountObjectPtr ret(new MEDCoupling1DGTUMesh("merge",*cm)); + ret->setCoords(pts); + ret->_conn=AggregateNodalConnAndShiftNodeIds(ncs,nbNodesPerElt); + ret->_conn_indx=DataArrayInt::AggregateIndexes(ncis); + return ret.retn(); } MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception) @@ -2398,3 +2447,53 @@ MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::buildSetInstanceFromThis(int spaceDi ret->setCoords(_coords); return ret.retn(); } + +/*! + * This method performs an aggregation of \a nodalConns (as DataArrayInt::Aggregate does) but in addition of that a shift is applied on the + * values contained in \a nodalConns using corresponding offset specified in input \a offsetInNodeIdsPerElt. + * But it also manage the values -1, that have a semantic in MEDCoupling1DGTUMesh class (separator for polyhedron). + * + * \param [in] nodalConns - a list of nodal connectivity arrays same size than \a offsetInNodeIdsPerElt. + * \param [in] offsetInNodeIdsPerElt - a list of offsets to apply. + * \return DataArrayInt * - A new object (to be managed by the caller) that is the result of the aggregation. + * \throw If \a nodalConns or \a offsetInNodeIdsPerElt are empty. + * \throw If \a nodalConns and \a offsetInNodeIdsPerElt have not the same size. + * \throw If presence of null pointer in \a nodalConns. + * \throw If presence of not allocated or array with not exactly one component in \a nodalConns. + */ +DataArrayInt *MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(const std::vector& nodalConns, const std::vector& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception) +{ + std::size_t sz1(nodalConns.size()),sz2(offsetInNodeIdsPerElt.size()); + if(sz1!=sz2) + throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds : input vectors do not have the same size !"); + if(sz1==0) + throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds : empty vectors in input !"); + int nbOfTuples=0; + for(std::vector::const_iterator it=nodalConns.begin();it!=nodalConns.end();it++) + { + if(!(*it)) + throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds : presence of null pointer in input vector !"); + if(!(*it)->isAllocated()) + throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds : presence of non allocated array in input vector !"); + if((*it)->getNumberOfComponents()!=1) + throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds : presence of array with not exactly one component !"); + nbOfTuples+=(*it)->getNumberOfTuples(); + } + MEDCouplingAutoRefCountObjectPtr ret=DataArrayInt::New(); ret->alloc(nbOfTuples,1); + int *pt=ret->getPointer(); + int i=0; + for(std::vector::const_iterator it=nodalConns.begin();it!=nodalConns.end();it++,i++) + { + int curNbt=(*it)->getNumberOfTuples(); + const int *inPt=(*it)->begin(); + int offset=offsetInNodeIdsPerElt[i]; + for(int j=0;j& a) throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT static MEDCoupling1DGTUMesh *Merge1DGTUMeshesOnSameCoords(std::vector& a) throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT static DataArrayInt *AggregateNodalConnAndShiftNodeIds(const std::vector& nodalConns, const std::vector& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception); MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception); private: MEDCOUPLING_EXPORT MEDCoupling1DGTUMesh(const char *name, const INTERP_KERNEL::CellModel& cm); diff --git a/src/MEDCoupling/MEDCouplingPointSet.cxx b/src/MEDCoupling/MEDCouplingPointSet.cxx index 1f9f0189b..f8c5f4183 100644 --- a/src/MEDCoupling/MEDCouplingPointSet.cxx +++ b/src/MEDCoupling/MEDCouplingPointSet.cxx @@ -782,18 +782,25 @@ DataArrayDouble *MEDCouplingPointSet::MergeNodesArray(const std::vector coo(ms.size()); int spaceDim=(*it)->getSpaceDimension(); coo[0]=(*it++)->getCoords(); + if(!coo[0]->isAllocated()) + throw INTERP_KERNEL::Exception("MEDCouplingPointSet::MergeNodesArray : first element in coordinates is not allocated !"); for(int i=1;it!=ms.end();it++,i++) { const DataArrayDouble *tmp=(*it)->getCoords(); if(tmp) { - if((*it)->getSpaceDimension()==spaceDim) - coo[i]=tmp; + if(tmp->isAllocated()) + { + if((*it)->getSpaceDimension()==spaceDim) + coo[i]=tmp; + else + throw INTERP_KERNEL::Exception("MEDCouplingPointSet::MergeNodesArray : Mismatch in SpaceDim !"); + } else - throw INTERP_KERNEL::Exception("Mismatch in SpaceDim during call of MergeNodesArray !"); + throw INTERP_KERNEL::Exception("MEDCouplingPointSet::MergeNodesArray : Presence of a non allocated array !"); } else - throw INTERP_KERNEL::Exception("Empty coords detected during call of MergeNodesArray !"); + throw INTERP_KERNEL::Exception("MEDCouplingPointSet::MergeNodesArray : Empty coords detected !"); } return DataArrayDouble::Aggregate(coo); } diff --git a/src/MEDCoupling/MEDCouplingUMesh.cxx b/src/MEDCoupling/MEDCouplingUMesh.cxx index 26fd3a45b..7053039d2 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh.cxx @@ -6693,34 +6693,87 @@ MEDCoupling1GTUMesh *MEDCouplingUMesh::convertIntoSingleGeoTypeMesh() const thro if(_types.size()!=1) throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertIntoSingleGeoTypeMesh : current mesh does not contain exactly one geometric type !"); INTERP_KERNEL::NormalizedCellType typ=*_types.begin(); - int typi=(int)typ; MEDCouplingAutoRefCountObjectPtr ret=MEDCoupling1GTUMesh::New(getName(),typ); ret->setCoords(getCoords()); MEDCoupling1SGTUMesh *retC=dynamic_cast((MEDCoupling1GTUMesh*)ret); if(retC) + retC->setNodalConnectivity(convertNodalConnectivityToStaticGeoTypeMesh()); + else { - int nbCells=getNumberOfCells(); - int nbNodesPerCell=retC->getNumberOfNodesPerCell(); - MEDCouplingAutoRefCountObjectPtr connOut=DataArrayInt::New(); connOut->alloc(nbCells*nbNodesPerCell,1); - int *outPtr=connOut->getPointer(); - const int *conn=_nodal_connec->begin(); - const int *connI=_nodal_connec_index->begin(); - nbNodesPerCell++; - for(int i=0;i((MEDCoupling1GTUMesh*)ret); + if(!retD) + throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertIntoSingleGeoTypeMesh : Internal error !"); + DataArrayInt *c=0,*ci=0; + convertNodalConnectivityToDynamicGeoTypeMesh(c,ci); + MEDCouplingAutoRefCountObjectPtr cs(c),cis(ci); + retD->setNodalConnectivity(cs,cis); + } + return ret.retn(); +} + +DataArrayInt *MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception) +{ + checkConnectivityFullyDefined(); + if(_types.size()!=1) + throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh : current mesh does not contain exactly one geometric type !"); + INTERP_KERNEL::NormalizedCellType typ=*_types.begin(); + const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(typ); + if(cm.isDynamic()) + { + std::ostringstream oss; oss << "MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh : this contains a single geo type (" << cm.getRepr() << ") but "; + oss << "this type is dynamic ! Only static geometric type is possible for that type ! call convertNodalConnectivityToDynamicGeoTypeMesh instead !"; + throw INTERP_KERNEL::Exception(oss.str().c_str()); + } + int nbCells=getNumberOfCells(); + int typi=(int)typ; + int nbNodesPerCell=(int)cm.getNumberOfNodes(); + MEDCouplingAutoRefCountObjectPtr connOut=DataArrayInt::New(); connOut->alloc(nbCells*nbNodesPerCell,1); + int *outPtr=connOut->getPointer(); + const int *conn=_nodal_connec->begin(); + const int *connI=_nodal_connec_index->begin(); + nbNodesPerCell++; + for(int i=0;igetNumberOfTuples(); + if(lgth c(DataArrayInt::New()),ci(DataArrayInt::New()); + c->alloc(lgth-nbCells,1); ci->alloc(nbCells+1,1); + int *cp(c->getPointer()),*cip(ci->getPointer()); + const int *incp(_nodal_connec->begin()),*incip(_nodal_connec_index->begin()); + for(int i=0;i=1) + { + if((strt>=0 && strt=0 && stop<=lgth)) + cp=std::copy(incp+strt,incp+stop,cp); else - { - std::ostringstream oss; oss << "MEDCouplingUMesh::convertIntoSingleGeoTypeMesh : there something wrong in cell #" << i << " ! The type of cell is not those expected, or the length of nodal connectivity is not those expected (" << nbNodesPerCell-1 << ") !"; - throw INTERP_KERNEL::Exception(oss.str().c_str()); - } + throw INTERP_KERNEL::Exception(msg0); } - retC->setNodalConnectivity(connOut); + else + throw INTERP_KERNEL::Exception(msg0); + cip[1]=cip[0]+delta; } - else - throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertIntoSingleGeoTypeMesh : not implemented yet for non static geometric type !"); - return ret.retn(); + nodalConn=c.retn(); nodalConnIndex=ci.retn(); } /*! diff --git a/src/MEDCoupling/MEDCouplingUMesh.hxx b/src/MEDCoupling/MEDCouplingUMesh.hxx index f16d212d6..3fdf03809 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.hxx +++ b/src/MEDCoupling/MEDCouplingUMesh.hxx @@ -196,6 +196,8 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT DataArrayInt *rearrange2ConsecutiveCellTypes(); MEDCOUPLING_EXPORT std::vector splitByType() const; MEDCOUPLING_EXPORT MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT void convertNodalConnectivityToDynamicGeoTypeMesh(DataArrayInt *&nodalConn, DataArrayInt *&nodalConnIndex) const throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT static MEDCouplingUMesh *AggregateSortedByTypeMeshesOnSameCoords(const std::vector& ms, DataArrayInt *&szOfCellGrpOfSameType, DataArrayInt *&idInMsOfCellGrpOfSameType) throw(INTERP_KERNEL::Exception); diff --git a/src/MEDCoupling_Swig/MEDCouplingCommon.i b/src/MEDCoupling_Swig/MEDCouplingCommon.i index 60883c988..a625d708e 100644 --- a/src/MEDCoupling_Swig/MEDCouplingCommon.i +++ b/src/MEDCoupling_Swig/MEDCouplingCommon.i @@ -53,46 +53,103 @@ using namespace INTERP_KERNEL; %template(dvec) std::vector; %template(svec) std::vector; +//////////////////// %typemap(out) ParaMEDMEM::MEDCouplingMesh* { $result=convertMesh($1,$owner); } +%typemap(out) MEDCouplingMesh* +{ + $result=convertMesh($1,$owner); +} +//$$$$$$$$$$$$$$$$$$ + +//////////////////// %typemap(out) ParaMEDMEM::MEDCouplingPointSet* { $result=convertMesh($1,$owner); } +%typemap(out) MEDCouplingPointSet* +{ + $result=convertMesh($1,$owner); +} +//$$$$$$$$$$$$$$$$$$ + + +//////////////////// %typemap(out) ParaMEDMEM::MEDCoupling1GTUMesh* { $result=convertMesh($1,$owner); } +%typemap(out) MEDCoupling1GTUMesh* +{ + $result=convertMesh($1,$owner); +} +//$$$$$$$$$$$$$$$$$$ + +//////////////////// %typemap(out) ParaMEDMEM::MEDCouplingStructuredMesh* { $result=convertMesh($1,$owner); } +%typemap(out) MEDCouplingStructuredMesh* +{ + $result=convertMesh($1,$owner); +} +//$$$$$$$$$$$$$$$$$$ + +//////////////////// %typemap(out) ParaMEDMEM::MEDCouplingFieldDiscretization* { $result=convertFieldDiscretization($1,$owner); } +%typemap(out) MEDCouplingFieldDiscretization* +{ + $result=convertFieldDiscretization($1,$owner); +} +//$$$$$$$$$$$$$$$$$$ + +//////////////////// %typemap(out) ParaMEDMEM::MEDCouplingMultiFields* { $result=convertMultiFields($1,$owner); } +%typemap(out) MEDCouplingMultiFields* +{ + $result=convertMultiFields($1,$owner); +} +//$$$$$$$$$$$$$$$$$$ + +//////////////////// %typemap(out) ParaMEDMEM::DataArray* { $result=convertDataArray($1,$owner); } +%typemap(out) DataArray* +{ + $result=convertDataArray($1,$owner); +} +//$$$$$$$$$$$$$$$$$$ + +//////////////////// %typemap(out) ParaMEDMEM::DataArrayChar* { $result=convertDataArrayChar($1,$owner); } +%typemap(out) DataArrayChar* +{ + $result=convertDataArrayChar($1,$owner); +} +//$$$$$$$$$$$$$$$$$$ + #ifdef WITH_NUMPY %init %{ import_array(); %} #endif @@ -375,6 +432,7 @@ using namespace INTERP_KERNEL; %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells; %newobject ParaMEDMEM::MEDCouplingUMesh::findAndCorrectBadOriented3DCells; %newobject ParaMEDMEM::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh; +%newobject ParaMEDMEM::MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh; %newobject ParaMEDMEM::MEDCouplingUMesh::findCellIdsOnBoundary; %newobject ParaMEDMEM::MEDCouplingUMesh::computeSkin; %newobject ParaMEDMEM::MEDCouplingUMesh::buildSetInstanceFromThis; @@ -1708,6 +1766,7 @@ namespace ParaMEDMEM DataArrayInt *findAndCorrectBadOriented3DExtrudedCells() throw(INTERP_KERNEL::Exception); DataArrayInt *findAndCorrectBadOriented3DCells() throw(INTERP_KERNEL::Exception); ParaMEDMEM::MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const throw(INTERP_KERNEL::Exception); + DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception); static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception); static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception); static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception); @@ -2087,6 +2146,16 @@ namespace ParaMEDMEM return ret; } + PyObject *convertNodalConnectivityToDynamicGeoTypeMesh() const throw(INTERP_KERNEL::Exception) + { + DataArrayInt *ret0=0,*ret1=0; + self->convertNodalConnectivityToDynamicGeoTypeMesh(ret0,ret1); + PyObject *ret=PyTuple_New(2); + PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 )); + return ret; + } + static PyObject *AggregateSortedByTypeMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception) { std::vector meshes; @@ -2837,6 +2906,13 @@ namespace ParaMEDMEM convertFromPyObjVectorOfObj(li,SWIGTYPE_p_ParaMEDMEM__MEDCoupling1DGTUMesh,"MEDCoupling1DGTUMesh",tmp); return MEDCoupling1DGTUMesh::Merge1DGTUMeshesOnSameCoords(tmp); } + + static DataArrayInt *AggregateNodalConnAndShiftNodeIds(PyObject *li, const std::vector& offsetInNodeIdsPerElt) throw(INTERP_KERNEL::Exception) + { + std::vector tmp; + convertFromPyObjVectorOfObj(li,SWIGTYPE_p_ParaMEDMEM__DataArrayInt,"DataArrayInt",tmp); + return MEDCoupling1DGTUMesh::AggregateNodalConnAndShiftNodeIds(tmp,offsetInNodeIdsPerElt); + } } }; -- 2.39.2