int nbTuples=profile->getNumberOfTuples();
int nbOfCells=getNumberOfCells();
code.resize(3); idsInPflPerType.resize(1);
- code[0]=(int)getCellModelEnum(); code[1]=nbOfCells;
+ code[0]=(int)getCellModelEnum(); code[1]=nbTuples;
idsInPflPerType.resize(1);
if(profile->isIdentity() && nbTuples==nbOfCells)
{
code[2]=-1;
idsInPflPerType[0]=const_cast<DataArrayInt *>(profile); idsInPflPerType[0]->incrRef();
- idsPerType.clear();
+ idsPerType.clear();
+ return ;
}
code[2]=0;
profile->checkAllIdsInRange(0,nbOfCells);
reason="mesh given in input is not castable in MEDCouplingSGTUMesh !";
return false;
}
- if(&_cm!=&otherC->_cm)
+ if(_cm!=otherC->_cm)
{
reason="mismatch in geometric type !";
return false;
const MEDCoupling1GTUMesh *otherC=dynamic_cast<const MEDCoupling1GTUMesh *>(other);
if(!otherC)
return false;
- if(&_cm!=&otherC->_cm)
+ if(_cm!=otherC->_cm)
return false;
return true;
}
return ret;
}
-/*!
- * Removes unused nodes (the node coordinates array is shorten) and returns an array
- * mapping between new and old node ids in "Old to New" mode. -1 values in the returned
- * array mean that the corresponding old node is no more used.
- * \return DataArrayInt * - a new instance of DataArrayInt of length \a
- * this->getNumberOfNodes() before call of this method. The caller is to
- * delete this array using decrRef() as it is no more needed.
- * \throw If the coordinates array is not set.
- * \throw If the nodal connectivity of cells is not defined.
- * \throw If the nodal connectivity includes an invalid id.
- *
- * \ref cpp_mcumesh_zipCoordsTraducer "Here is a C++ example".<br>
- * \ref py_mcumesh_zipCoordsTraducer "Here is a Python example".
- */
-DataArrayInt *MEDCoupling1SGTUMesh::zipCoordsTraducer() throw(INTERP_KERNEL::Exception)
-{
- int newNbOfNodes=-1;
- DataArrayInt *traducer=getNodeIdsInUse(newNbOfNodes);
- renumberNodes(traducer->getConstPointer(),newNbOfNodes);
- return traducer;
-}
-
/// @cond INTERNAL
struct MEDCouplingAccVisit
const int *conn=_conn->begin();
int nbNodesPerCell=getNumberOfNodesPerCell();
for(int i=0;i<nbOfCells;i++)
- for(int j=0;j<nbNodesPerCell;j++)
- if(conn[j]>=0 && conn[j]<nbOfNodes)
- traducer[conn[j]]=1;
+ for(int j=0;j<nbNodesPerCell;j++,conn++)
+ if(*conn>=0 && *conn<nbOfNodes)
+ traducer[*conn]=1;
else
{
std::ostringstream oss; oss << "MEDCoupling1SGTUMesh::getNodeIdsInUse : In cell #" << i << " presence of node id " << conn[j] << " not in [0," << nbOfNodes << ") !";
void MEDCoupling1SGTUMesh::renumberNodesInConn(const int *newNodeNumbersO2N)
{
getNumberOfCells();//only to check that all is well defined.
- _conn->renumberInPlace(newNodeNumbersO2N);
+ _conn->transformWithIndArr(newNodeNumbersO2N,newNodeNumbersO2N+getNumberOfNodes());
updateTime();
}
const DataArrayDouble *coords=(*it)->getCoords();
const INTERP_KERNEL::CellModel *cm=&((*it)->getCellModel());
int nbNodesPerCell=(*it)->getNumberOfNodesPerCell();
+ it++;
for(;it!=a.end();it++)
{
if(cm!=&((*it)->getCellModel()))
int nbOfCells=(*it)->getNumberOfCells();
const INTERP_KERNEL::CellModel *cm=&((*it)->getCellModel());
int nbNodesPerCell=(*it)->getNumberOfNodesPerCell();
+ it++;
for(;it!=a.end();it++)
{
if(cm!=&((*it)->getCellModel()))
offset+=(*it)->getNumberOfNodes();
}
//
- ret->_conn=c;
+ ret->setNodalConnectivity(c);
return ret.retn();
}
tmp1=DataArrayInt::New(); tmp1->alloc(0,1);
}
else
- {
- tmp1=_conn;
- tmp1->incrRef();
- }
+ tmp1=_conn;
ret->_conn=tmp1;
if(!_coords)
{
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New(); ret->alloc(6*nbOfCells,1);
const int *c(_conn->begin());
int *retPtr(ret->getPointer()),*newConnPtr(newConn->getPointer());
- for(int i=0;i<nbOfCells;i++,c+=8,newConnPtr+=20,retPtr+=6)
+ for(int i=0;i<nbOfCells;i++,c+=8,newConnPtr+=24,retPtr+=6)
{
for(int j=0;j<24;j++)
newConnPtr[j]=c[INTERP_KERNEL::SPLIT_NODES_6_WO[j]];
MEDCOUPLING_EXPORT MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const;
MEDCOUPLING_EXPORT DataArrayInt *mergeNodes(double precision, bool& areNodesMerged, int& newNbOfNodes);
MEDCOUPLING_EXPORT DataArrayInt *mergeNodes2(double precision, bool& areNodesMerged, int& newNbOfNodes);
- MEDCOUPLING_EXPORT DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfKeepCoords(const int *begin, const int *end) const;
MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfKeepCoords2(int start, int end, int step) const;
MEDCOUPLING_EXPORT void getReverseNodalConnectivity(DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const throw(INTERP_KERNEL::Exception);
private:
MEDCOUPLING_EXPORT MEDCoupling1SGTUMesh(const char *name, const INTERP_KERNEL::CellModel& cm);
MEDCOUPLING_EXPORT MEDCoupling1SGTUMesh(const MEDCoupling1SGTUMesh& other, bool recDeepCpy);
+ virtual ~MEDCoupling1SGTUMesh() { }
private:
void checkNonDynamicGeoType() const throw(INTERP_KERNEL::Exception);
static MEDCoupling1SGTUMesh *Merge1SGTUMeshesLL(std::vector<const MEDCoupling1SGTUMesh *>& a) throw(INTERP_KERNEL::Exception);
double *tmp=new double[nbTuples*nbOfCompo];
const double *iptr=getConstPointer();
for(int i=0;i<nbTuples;i++)
- std::copy(iptr+nbOfCompo*i,iptr+nbOfCompo*(i+1),tmp+nbOfCompo*old2New[i]);
+ {
+ int v=old2New[i];
+ if(v>=0 && v<nbTuples)
+ std::copy(iptr+nbOfCompo*i,iptr+nbOfCompo*(i+1),tmp+nbOfCompo*v);
+ else
+ {
+ std::ostringstream oss; oss << "DataArrayDouble::renumberInPlace : At place #" << i << " value is " << v << " ! Should be in [0," << nbTuples << ") !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ }
std::copy(tmp,tmp+nbTuples*nbOfCompo,getPointer());
delete [] tmp;
declareAsNew();
double *tmp=new double[nbTuples*nbOfCompo];
const double *iptr=getConstPointer();
for(int i=0;i<nbTuples;i++)
- std::copy(iptr+nbOfCompo*new2Old[i],iptr+nbOfCompo*(new2Old[i]+1),tmp+nbOfCompo*i);
+ {
+ int v=new2Old[i];
+ if(v>=0 && v<nbTuples)
+ std::copy(iptr+nbOfCompo*v,iptr+nbOfCompo*(v+1),tmp+nbOfCompo*i);
+ else
+ {
+ std::ostringstream oss; oss << "DataArrayDouble::renumberInPlaceR : At place #" << i << " value is " << v << " ! Should be in [0," << nbTuples << ") !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ }
std::copy(tmp,tmp+nbTuples*nbOfCompo,getPointer());
delete [] tmp;
declareAsNew();
}
else
{
- std::ostringstream oss; oss << "DataArrayInt::splitByValueRange : At rank #" << i << " the value is " << work[i] << " whereas the last value is " << *bg;
+ std::ostringstream oss; oss << "DataArrayInt::splitByValueRange : At rank #" << i << " the value is " << work[i] << " should be in [0," << *bg << ") !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
int *tmp=new int[nbTuples*nbOfCompo];
const int *iptr=getConstPointer();
for(int i=0;i<nbTuples;i++)
- std::copy(iptr+nbOfCompo*i,iptr+nbOfCompo*(i+1),tmp+nbOfCompo*old2New[i]);
+ {
+ int v=old2New[i];
+ if(v>=0 && v<nbTuples)
+ std::copy(iptr+nbOfCompo*i,iptr+nbOfCompo*(i+1),tmp+nbOfCompo*v);
+ else
+ {
+ std::ostringstream oss; oss << "DataArrayInt::renumberInPlace : At place #" << i << " value is " << v << " ! Should be in [0," << nbTuples << ") !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ }
std::copy(tmp,tmp+nbTuples*nbOfCompo,getPointer());
delete [] tmp;
declareAsNew();
int *tmp=new int[nbTuples*nbOfCompo];
const int *iptr=getConstPointer();
for(int i=0;i<nbTuples;i++)
- std::copy(iptr+nbOfCompo*new2Old[i],iptr+nbOfCompo*(new2Old[i]+1),tmp+nbOfCompo*i);
+ {
+ int v=new2Old[i];
+ if(v>=0 && v<nbTuples)
+ std::copy(iptr+nbOfCompo*v,iptr+nbOfCompo*(v+1),tmp+nbOfCompo*i);
+ else
+ {
+ std::ostringstream oss; oss << "DataArrayInt::renumberInPlaceR : At place #" << i << " value is " << v << " ! Should be in [0," << nbTuples << ") !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ }
std::copy(tmp,tmp+nbTuples*nbOfCompo,getPointer());
delete [] tmp;
declareAsNew();
if(!_coords)
throw INTERP_KERNEL::Exception("MEDCouplingPointSet::renumberNodes : no coords specified !");
MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> newCoords=_coords->renumberAndReduce(newNodeNumbers,newNbOfNodes);
- setCoords(newCoords);
renumberNodesInConn(newNodeNumbers);
+ setCoords(newCoords);//let it here not before renumberNodesInConn because old number of nodes is sometimes used...
}
/*!
{
return getCellIdsLyingOnNodes(partBg,partEnd,true);
}
+
+/*!
+ * Removes unused nodes (the node coordinates array is shorten) and returns an array
+ * mapping between new and old node ids in "Old to New" mode. -1 values in the returned
+ * array mean that the corresponding old node is no more used.
+ * \return DataArrayInt * - a new instance of DataArrayInt of length \a
+ * this->getNumberOfNodes() before call of this method. The caller is to
+ * delete this array using decrRef() as it is no more needed.
+ * \throw If the coordinates array is not set.
+ * \throw If the nodal connectivity of cells is not defined.
+ * \throw If the nodal connectivity includes an invalid id.
+ *
+ * \ref cpp_mcumesh_zipCoordsTraducer "Here is a C++ example".<br>
+ * \ref py_mcumesh_zipCoordsTraducer "Here is a Python example".
+ */
+DataArrayInt *MEDCouplingPointSet::zipCoordsTraducer() throw(INTERP_KERNEL::Exception)
+{
+ int newNbOfNodes=-1;
+ MEDCouplingAutoRefCountObjectPtr<DataArrayInt> traducer=getNodeIdsInUse(newNbOfNodes);
+ renumberNodes(traducer->getConstPointer(),newNbOfNodes);
+ return traducer.retn();
+}
const std::vector<std::string>& littleStrings);
virtual DataArrayInt *getCellsInBoundingBox(const double *bbox, double eps) const = 0;
virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) = 0;
- virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception) = 0;
+ virtual DataArrayInt *zipCoordsTraducer() throw(INTERP_KERNEL::Exception);
virtual DataArrayInt *zipConnectivityTraducer(int compType, int startCellId=0) throw(INTERP_KERNEL::Exception);
virtual void getReverseNodalConnectivity(DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const throw(INTERP_KERNEL::Exception) = 0;
//tools
_cnt++;
}
+int RefCountObject::getRCValue() const
+{
+ return _cnt;
+}
+
RefCountObject::~RefCountObject()
{
}
bool decrRef() const;
void incrRef() const;
virtual std::size_t getHeapMemorySize() const = 0;
+ int getRCValue() const;
protected:
virtual ~RefCountObject();
private:
*/
DataArrayInt *MEDCouplingUMesh::zipCoordsTraducer() throw(INTERP_KERNEL::Exception)
{
- int newNbOfNodes=-1;
- DataArrayInt *traducer=getNodeIdsInUse(newNbOfNodes);
- renumberNodes(traducer->getConstPointer(),newNbOfNodes);
- return traducer;
+ return MEDCouplingPointSet::zipCoordsTraducer();
}
/*!
INTERP_KERNEL::NormalizedCellType typ=*_types.begin();
int typi=(int)typ;
MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> ret=MEDCoupling1GTUMesh::New(getName(),typ);
- ret->setCoords(ret->getCoords());
+ ret->setCoords(getCoords());
MEDCoupling1SGTUMesh *retC=dynamic_cast<MEDCoupling1SGTUMesh *>((MEDCoupling1GTUMesh*)ret);
if(retC)
{
self.assertTrue(check.isEqual(ids));
code, idsInPflPerType, pfls=mesh1.splitProfilePerType(ids);
- self.assertEqual(3, len(code));
- self.assertEqual(NORM_HEXA8, code[0]);
- self.assertEqual(27, code[1]);
- self.assertEqual(0, code[2]);
+ self.assertEqual(1, len(code));
+ self.assertEqual(NORM_HEXA8, code[0][0]);
+ self.assertEqual(27, code[0][1]);
+ self.assertEqual(0, code[0][2]);
self.assertEqual(1, len(idsInPflPerType));
self.assertEqual(1, len(pfls));
self.assertTrue(idsInPflPerType[0].isEqual(DataArrayInt([0,1,2,3,4,5,6,7,8,9])));
d.setValues(val1,3,1);
d.setName("sup")
code,idsInPflPerType,pfls=m.splitProfilePerType(d);
- self.assertEqual(6,len(code));
+ self.assertEqual(2,len(code));
self.assertEqual(2,len(idsInPflPerType));
- expected1=[3,1,0, 4,2,1]
- for i in xrange(6):
- self.assertEqual(expected1[i],code[i]);
- pass
+ expected1=[[3,1,0], [4,2,1]]
+ self.assertEqual(expected1,code)
self.assertEqual(2,len(idsInPflPerType));
self.assertEqual(1,idsInPflPerType[0].getNumberOfTuples());
self.assertEqual(0,idsInPflPerType[0].getIJ(0,0));
d=DataArrayInt.New();
d.setValues(val2,4,1);
code,idsInPflPerType,pfls=m.splitProfilePerType(d);
- self.assertEqual(6,len(code));
+ self.assertEqual(2,len(code));
self.assertEqual(2,len(idsInPflPerType));
- expected2=[3,1,0, 4,3,-1]
- for i in xrange(6):
- self.assertEqual(expected2[i],code[i]);
- pass
+ expected2=[[3,1,0], [4,3,-1]]
+ self.assertEqual(expected2,code);
self.assertEqual(2,len(idsInPflPerType));
self.assertEqual(1,idsInPflPerType[0].getNumberOfTuples());
self.assertEqual(0,idsInPflPerType[0].getIJ(0,0));
d=DataArrayInt.New();
d.setValues(val3,3,1);
code,idsInPflPerType,pfls=m.splitProfilePerType(d);
- self.assertEqual(6,len(code));
+ self.assertEqual(2,len(code));
self.assertEqual(2,len(idsInPflPerType));
- expected3=[3,2,0, 4,1,1]
- for i in xrange(6):
- self.assertEqual(expected3[i],code[i]);
- pass
+ expected3=[[3,2,0], [4,1,1]]
+ self.assertEqual(expected3,code);
self.assertEqual(2,len(idsInPflPerType));
self.assertEqual(2,idsInPflPerType[0].getNumberOfTuples());
self.assertEqual(0,idsInPflPerType[0].getIJ(0,0));
d=DataArrayInt.New();
d.setValues(val4,2,1);
code,idsInPflPerType,pfls=m.splitProfilePerType(d);
- self.assertEqual(3,len(code));
+ self.assertEqual(1,len(code));
self.assertEqual(1,len(idsInPflPerType));
- expected4=[4,2,0]
- for i in xrange(3):
- self.assertEqual(expected4[i],code[i]);
- pass
+ expected4=[[4,2,0]]
+ self.assertEqual(expected4,code);
self.assertEqual(1,len(idsInPflPerType));
self.assertEqual(2,idsInPflPerType[0].getNumberOfTuples());
self.assertEqual(0,idsInPflPerType[0].getIJ(0,0));
%newobject ParaMEDMEM::MEDCouplingPointSet::mergeMyselfWithOnSameCoords;
%newobject ParaMEDMEM::MEDCouplingPointSet::fillCellIdsToKeepFromNodeIds;
%newobject ParaMEDMEM::MEDCouplingPointSet::getCellIdsLyingOnNodes;
+%newobject ParaMEDMEM::MEDCouplingPointSet::__getitem__;
%newobject ParaMEDMEM::MEDCouplingUMesh::New;
%newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity;
%newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex;
%newobject ParaMEDMEM::MEDCouplingUMesh::clone;
%newobject ParaMEDMEM::MEDCouplingUMesh::__iter__;
-%newobject ParaMEDMEM::MEDCouplingUMesh::__getitem__;
%newobject ParaMEDMEM::MEDCouplingUMesh::cellsByType;
%newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
%newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity2;
public:
bool decrRef() const;
void incrRef() const;
+ int getRCValue() const;
virtual std::size_t getHeapMemorySize() const;
};
}
PyObject *getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
{
std::vector<int> vals=self->getDistributionOfTypes();
+ if(vals.size()%3!=0)
+ throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::getDistributionOfTypes is not so that %3==0 !");
PyObject *ret=PyList_New((int)vals.size()/3);
for(int j=0;j<(int)vals.size()/3;j++)
{
std::vector<DataArrayInt *> idsPerType;
self->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
PyObject *ret=PyTuple_New(3);
- PyTuple_SetItem(ret,0,convertIntArrToPyList2(code));
+ //
+ if(code.size()%3!=0)
+ throw INTERP_KERNEL::Exception("Internal Error detected in wrap python ! code returned by MEDCouplingMesh::splitProfilePerType is not so that %3==0 !");
+ PyObject *ret0=PyList_New((int)code.size()/3);
+ for(int j=0;j<(int)code.size()/3;j++)
+ {
+ PyObject *ret00=PyList_New(3);
+ PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
+ PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
+ PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
+ PyList_SetItem(ret0,j,ret00);
+ }
+ PyTuple_SetItem(ret,0,ret0);
+ //
PyObject *ret1=PyList_New(idsInPflPerType.size());
for(std::size_t j=0;j<idsInPflPerType.size();j++)
PyList_SetItem(ret1,j,SWIG_NewPointerObj(SWIG_as_voidptr(idsInPflPerType[j]),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
return self->getCellIdsLyingOnNodes(da2->getConstPointer(),da2->getConstPointer()+da2->getNbOfElems(),fullyIn);
}
}
+
+ MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
+ {
+ int sw;
+ int singleVal;
+ std::vector<int> multiVal;
+ std::pair<int, std::pair<int,int> > slic;
+ ParaMEDMEM::DataArrayInt *daIntTyypp=0;
+ int nbc=self->getNumberOfCells();
+ convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
+ switch(sw)
+ {
+ case 1:
+ {
+ if(singleVal>=nbc)
+ {
+ std::ostringstream oss;
+ oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ if(singleVal>=0)
+ return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
+ else
+ {
+ if(nbc+singleVal>0)
+ {
+ int tmp=nbc+singleVal;
+ return self->buildPartOfMySelf(&tmp,&tmp+1,true);
+ }
+ else
+ {
+ std::ostringstream oss;
+ oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ }
+ }
+ case 2:
+ {
+ return static_cast<MEDCouplingPointSet *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
+ }
+ case 3:
+ {
+ return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
+ }
+ case 4:
+ {
+ if(!daIntTyypp)
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
+ daIntTyypp->checkAllocated();
+ return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
+ }
+ default:
+ throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
+ }
+ }
static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception)
{
{
return self->cellIterator();
}
-
- MEDCouplingPointSet *__getitem__(PyObject *listOrDataArrI) throw(INTERP_KERNEL::Exception)
- {
- int sw;
- int singleVal;
- std::vector<int> multiVal;
- std::pair<int, std::pair<int,int> > slic;
- ParaMEDMEM::DataArrayInt *daIntTyypp=0;
- int nbc=self->getNumberOfCells();
- convertObjToPossibleCpp2(listOrDataArrI,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
- switch(sw)
- {
- case 1:
- {
- if(singleVal>=nbc)
- {
- std::ostringstream oss;
- oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
- }
- if(singleVal>=0)
- return self->buildPartOfMySelf(&singleVal,&singleVal+1,true);
- else
- {
- if(nbc+singleVal>0)
- {
- int tmp=nbc+singleVal;
- return self->buildPartOfMySelf(&tmp,&tmp+1,true);
- }
- else
- {
- std::ostringstream oss;
- oss << "Requesting for cell id " << singleVal << " having only " << nbc << " cells !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
- }
- }
- }
- case 2:
- {
- return static_cast<MEDCouplingUMesh *>(self->buildPartOfMySelf(&multiVal[0],&multiVal[0]+multiVal.size(),true));
- }
- case 3:
- {
- return self->buildPartOfMySelf2(slic.first,slic.second.first,slic.second.second,true);
- }
- case 4:
- {
- if(!daIntTyypp)
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : null instance has been given in input !");
- daIntTyypp->checkAllocated();
- return self->buildPartOfMySelf(daIntTyypp->begin(),daIntTyypp->end(),true);
- }
- default:
- throw INTERP_KERNEL::Exception("MEDCouplingUMesh::__getitem__ : unrecognized type in input ! Possibilities are : int, list or tuple of int DataArrayInt instance !");
- }
- }
void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
{