*/
INTERP_KERNEL::NormalizedCellType MEDCoupling1GTUMesh::getTypeOfCell(std::size_t cellId) const
{
- if(cellId>=0 && cellId<getNumberOfCells())
+ if(cellId<getNumberOfCells())
return getCellModelEnum();
std::ostringstream oss; oss << "MEDCoupling1GTUMesh::getTypeOfCell : Requesting type of cell #" << cellId << " but it should be in [0," << getNumberOfCells() << ") !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
return ret.retn();
}
-void MEDCoupling1SGTUMesh::getNodeIdsOfCell(int cellId, std::vector<int>& conn) const
+void MEDCoupling1SGTUMesh::getNodeIdsOfCell(std::size_t cellId, std::vector<int>& conn) const
{
int sz=getNumberOfNodesPerCell();
conn.resize(sz);
- if(cellId>=0 && cellId<getNumberOfCells())
+ if(cellId<getNumberOfCells())
std::copy(_conn->begin()+cellId*sz,_conn->begin()+(cellId+1)*sz,conn.begin());
else
{
return ret.retn();
}
-void MEDCoupling1DGTUMesh::getNodeIdsOfCell(int cellId, std::vector<int>& conn) const
+void MEDCoupling1DGTUMesh::getNodeIdsOfCell(std::size_t cellId, std::vector<int>& conn) const
{
- int nbOfCells(getNumberOfCells());//performs checks
- if(cellId>=0 && cellId<nbOfCells)
+ std::size_t nbOfCells(getNumberOfCells());//performs checks
+ if(cellId<nbOfCells)
{
int strt=_conn_indx->getIJ(cellId,0),stp=_conn_indx->getIJ(cellId+1,0);
int nbOfNodes=stp-strt;
*/
void MEDCoupling1DGTUMesh::insertNextCell(const int *nodalConnOfCellBg, const int *nodalConnOfCellEnd)
{
- int sz=(int)std::distance(nodalConnOfCellBg,nodalConnOfCellEnd);
+ std::size_t sz(std::distance(nodalConnOfCellBg,nodalConnOfCellEnd));
DataArrayInt *c(_conn),*c2(_conn_indx);
if(c && c2)
{
int pos=c2->back();
- if(pos==c->getNumberOfTuples())
+ if(pos==(int)c->getNumberOfTuples())
{
c->pushBackValsSilent(nodalConnOfCellBg,nodalConnOfCellEnd);
c2->pushBackSilent(pos+sz);
bool MEDCoupling1DGTUMesh::isPacked() const
{
checkConsistencyLight();
- return _conn_indx->front()==0 && _conn_indx->back()==_conn->getNumberOfTuples();
+ return _conn_indx->front()==0 && _conn_indx->back()==(int)_conn->getNumberOfTuples();
}
MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::Merge1DGTUMeshes(const MEDCoupling1DGTUMesh *mesh1, const MEDCoupling1DGTUMesh *mesh2)
MEDCOUPLING_EXPORT DataArrayInt *computeNbOfNodesPerCell() const;
MEDCOUPLING_EXPORT DataArrayInt *computeNbOfFacesPerCell() const;
MEDCOUPLING_EXPORT DataArrayInt *computeEffectiveNbOfNodesPerCell() const;
- MEDCOUPLING_EXPORT void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const;
+ MEDCOUPLING_EXPORT void getNodeIdsOfCell(std::size_t cellId, std::vector<int>& conn) const;
MEDCOUPLING_EXPORT std::string simpleRepr() const;
MEDCOUPLING_EXPORT std::string advancedRepr() const;
MEDCOUPLING_EXPORT DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const;
MEDCOUPLING_EXPORT DataArrayInt *computeNbOfNodesPerCell() const;
MEDCOUPLING_EXPORT DataArrayInt *computeNbOfFacesPerCell() const;
MEDCOUPLING_EXPORT DataArrayInt *computeEffectiveNbOfNodesPerCell() const;
- MEDCOUPLING_EXPORT void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const;
+ MEDCOUPLING_EXPORT void getNodeIdsOfCell(std::size_t cellId, std::vector<int>& conn) const;
MEDCOUPLING_EXPORT std::string simpleRepr() const;
MEDCOUPLING_EXPORT std::string advancedRepr() const;
MEDCOUPLING_EXPORT DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author : Anthony Geay (CEA/DEN)
+// Author : Anthony Geay (EDF R&D)
#include "MEDCouplingFieldDiscretization.hxx"
#include "MEDCouplingCMesh.hxx"
if(!arr)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretization::integral : input array is NULL !");
MCAuto<MEDCouplingFieldDouble> vol=getMeasureField(mesh,isWAbs);
- int nbOfCompo=arr->getNumberOfComponents();
- int nbOfElems=getNumberOfTuples(mesh);
+ std::size_t nbOfCompo(arr->getNumberOfComponents()),nbOfElems(getNumberOfTuples(mesh));
if(nbOfElems!=arr->getNumberOfTuples())
{
std::ostringstream oss; oss << "MEDCouplingFieldDiscretization::integral : field is not correct ! number of tuples in array is " << arr->getNumberOfTuples();
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
std::fill(res,res+nbOfCompo,0.);
- const double *arrPtr=arr->getConstPointer();
- const double *volPtr=vol->getArray()->getConstPointer();
+ const double *arrPtr(arr->begin()),*volPtr(vol->getArray()->begin());
INTERP_KERNEL::AutoPtr<double> tmp=new double[nbOfCompo];
- for (int i=0;i<nbOfElems;i++)
+ for(std::size_t i=0;i<nbOfElems;i++)
{
std::transform(arrPtr+i*nbOfCompo,arrPtr+(i+1)*nbOfCompo,(double *)tmp,std::bind2nd(std::multiplies<double>(),volPtr[i]));
std::transform((double *)tmp,(double *)tmp+nbOfCompo,res,res,std::plus<double>());
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
const DataArrayInt *ids(idsPerType[pos]);
- if(!ids || !ids->isAllocated() || ids->getNumberOfComponents()!=1 || ids->getNumberOfTuples()!=nbOfEltInChunk || ids->getMinValueInArray()<0)
+ if(!ids || !ids->isAllocated() || ids->getNumberOfComponents()!=1 || (int)ids->getNumberOfTuples()!=nbOfEltInChunk || ids->getMinValueInArray()<0)
{
std::ostringstream oss; oss << "MEDCouplingFieldDiscretizationP0::getNumberOfTuplesExpectedRegardingCode : input pfl chunck at pos " << pos << " should have " << i << " tuples and one component and with ids all >=0 !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
const DataArrayInt *ids(idsPerType[pos]);
- if(!ids || !ids->isAllocated() || ids->getNumberOfComponents()!=1 || ids->getNumberOfTuples()!=nbOfEltInChunk || ids->getMinValueInArray()<0)
+ if(!ids || !ids->isAllocated() || ids->getNumberOfComponents()!=1 || (int)ids->getNumberOfTuples()!=nbOfEltInChunk || ids->getMinValueInArray()<0)
{
std::ostringstream oss; oss << "MEDCouplingFieldDiscretizationOnNodes::getNumberOfTuplesExpectedRegardingCode : input pfl chunck at pos " << pos << " should have " << i << " tuples and one component and with ids all >=0 !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
{
if(!mesh || !da)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationNodes::checkCoherencyBetween : NULL input mesh or DataArray !");
- if(mesh->getNumberOfNodes()!=da->getNumberOfTuples())
+ if(mesh->getNumberOfNodes()!=(int)da->getNumberOfTuples())
{
std::ostringstream message;
message << "Field on nodes invalid because there are " << mesh->getNumberOfNodes();
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationPerCell has no discretization per cell !");
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationPerCell::checkCoherencyBetween : NULL input mesh or DataArray !");
- int nbOfTuples=_discr_per_cell->getNumberOfTuples();
+ std::size_t nbOfTuples(_discr_per_cell->getNumberOfTuples());
if(nbOfTuples!=mesh->getNumberOfCells())
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationPerCell has a discretization per cell but it's not matching the underlying mesh !");
}
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::getNumberOfTuplesExpectedRegardingCode : invalid input code !");
int nbOfSplit=(int)idsPerType.size();
int nbOfTypes=(int)code.size()/3;
- int ret=0;
+ std::size_t ret(0);
for(int i=0;i<nbOfTypes;i++)
{
int nbOfEltInChunk=code[3*i+1];
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
const DataArrayInt *ids(idsPerType[pos]);
- if(!ids || !ids->isAllocated() || ids->getNumberOfComponents()!=1 || ids->getNumberOfTuples()!=nbOfEltInChunk || ids->getMinValueInArray()<0)
+ if(!ids || !ids->isAllocated() || ids->getNumberOfComponents()!=1 || (int)ids->getNumberOfTuples()!=nbOfEltInChunk || ids->getMinValueInArray()<0)
{
std::ostringstream oss; oss << "MEDCouplingFieldDiscretizationGauss::getNumberOfTuplesExpectedRegardingCode : input pfl chunck at pos " << pos << " should have " << i << " tuples and one component and with ids all >=0 !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
{
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::getOffsetArr : NULL input mesh !");
- int nbOfTuples=mesh->getNumberOfCells();
+ std::size_t nbOfTuples(mesh->getNumberOfCells());
MCAuto<DataArrayInt> ret=DataArrayInt::New();
ret->alloc(nbOfTuples+1,1);
- int *retPtr=ret->getPointer();
- const int *start=_discr_per_cell->getConstPointer();
+ int *retPtr(ret->getPointer());
+ const int *start(_discr_per_cell->begin());
if(_discr_per_cell->getNumberOfTuples()!=nbOfTuples)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::getOffsetArr : mismatch between the mesh and the discretization ids array length !");
int maxPossible=(int)_loc.size();
retPtr[0]=0;
- for(int i=0;i<nbOfTuples;i++,start++)
+ for(std::size_t i=0;i<nbOfTuples;i++,start++)
{
if(*start>=0 && *start<maxPossible)
retPtr[i+1]=retPtr[i]+_loc[*start].getNumberOfGaussPt();
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
- int nbOfTuples(getNumberOfTuples(mesh));
+ std::size_t nbOfTuples(getNumberOfTuples(mesh));
if(nbOfTuples!=da->getNumberOfTuples())
{
std::ostringstream oss; oss << "Invalid number of tuples in the array : expecting " << nbOfTuples << " having " << da->getNumberOfTuples() << " !";
_discr_per_cell->checkAllocated();
if(_discr_per_cell->getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::getMeasureField : no discr per cell array defined but with nb of components different from 1 !");
- if(_discr_per_cell->getNumberOfTuples()!=(int)vol->getNumberOfTuples())
+ if(_discr_per_cell->getNumberOfTuples()!=vol->getNumberOfTuples())
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::getMeasureField : no discr per cell array defined but mismatch between nb of cells of mesh and size of spatial disr array !");
MCAuto<DataArrayInt> offset=getOffsetArr(mesh);
MCAuto<DataArrayDouble> arr=DataArrayDouble::New(); arr->alloc(getNumberOfTuples(mesh),1);
if(!mesh)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::computeTupleIdsToSelectFromCellIds : null mesh !");
MCAuto<DataArrayInt> nbOfNodesPerCell=buildNbOfGaussPointPerCellField();//check of _discr_per_cell not NULL pointer
- int nbOfCells=mesh->getNumberOfCells();
+ std::size_t nbOfCells(mesh->getNumberOfCells());
if(_discr_per_cell->getNumberOfTuples()!=nbOfCells)
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::computeTupleIdsToSelectFromCellIds : mismatch of nb of tuples of cell ids array and number of cells !");
nbOfNodesPerCell->computeOffsetsFull();
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
const DataArrayInt *ids(idsPerType[pos]);
- if(!ids || !ids->isAllocated() || ids->getNumberOfComponents()!=1 || ids->getNumberOfTuples()!=nbOfEltInChunk || ids->getMinValueInArray()<0)
+ if(!ids || !ids->isAllocated() || ids->getNumberOfComponents()!=1 || (int)ids->getNumberOfTuples()!=nbOfEltInChunk || ids->getMinValueInArray()<0)
{
std::ostringstream oss; oss << "MEDCouplingFieldDiscretizationGaussNE::getNumberOfTuplesExpectedRegardingCode : input pfl chunck at pos " << pos << " should have " << i << " tuples and one component and with ids all >=0 !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
void MEDCouplingFieldDiscretizationGaussNE::checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArray *da) const
{
- int nbOfTuples=getNumberOfTuples(mesh);
+ std::size_t nbOfTuples(getNumberOfTuples(mesh));
if(nbOfTuples!=da->getNumberOfTuples())
{
std::ostringstream oss; oss << "Invalid number of tuples in the array : expecting " << nbOfTuples << " !";
{
if(!arr || !arr->isAllocated())
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationKriging::getValueOnMulti : input array is null or not allocated !");
- int nbOfRows(getNumberOfMeshPlaces(mesh));
+ std::size_t nbOfRows(getNumberOfMeshPlaces(mesh));
if(arr->getNumberOfTuples()!=nbOfRows)
{
std::ostringstream oss; oss << "MEDCouplingFieldDiscretizationKriging::getValueOnMulti : input array does not have correct number of tuples ! Excepted " << nbOfRows << " having " << arr->getNumberOfTuples() << " !";
*/
DataArrayDouble *MEDCouplingFieldDiscretizationKriging::performDrift(const DataArrayDouble *matr, const DataArrayDouble *arr, int& delta) const
{
- int spaceDimension=arr->getNumberOfComponents();
+ std::size_t spaceDimension(arr->getNumberOfComponents());
delta=spaceDimension+1;
- int szOfMatrix=arr->getNumberOfTuples();
+ std::size_t szOfMatrix(arr->getNumberOfTuples());
if(szOfMatrix*szOfMatrix!=matr->getNumberOfTuples())
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationKriging::performDrift : invalid size");
MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
const double *srcWork=matr->getConstPointer();
const double *srcWork2=arr->getConstPointer();
double *destWork=ret->getPointer();
- for(int i=0;i<szOfMatrix;i++)
+ for(std::size_t i=0;i<szOfMatrix;i++)
{
destWork=std::copy(srcWork,srcWork+szOfMatrix,destWork);
srcWork+=szOfMatrix;
std::fill(destWork,destWork+spaceDimension+1,0.); destWork+=spaceDimension+1;
MCAuto<DataArrayDouble> arrNoI=arr->toNoInterlace();
srcWork2=arrNoI->getConstPointer();
- for(int i=0;i<spaceDimension;i++)
+ for(std::size_t i=0;i<spaceDimension;i++)
{
destWork=std::copy(srcWork2,srcWork2+szOfMatrix,destWork);
srcWork2+=szOfMatrix;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author : Anthony Geay (CEA/DEN)
+// Author : Anthony Geay (EDF R&D)
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingFieldTemplate.hxx"
if(_type.isNull())
throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform zipConnectivity !");
MCAuto<MEDCouplingUMesh> meshC2((MEDCouplingUMesh *)meshC->deepCopy());
- int oldNbOfCells=meshC2->getNumberOfCells();
+ std::size_t oldNbOfCells(meshC2->getNumberOfCells());
MCAuto<DataArrayInt> arr=meshC2->zipConnectivityTraducer(compType);
if(meshC2->getNumberOfCells()!=oldNbOfCells)
{
return ret*_mesh1D->getNumberOfCells();
}
-void MEDCouplingMappedExtrudedMesh::getNodeIdsOfCell(int cellId, std::vector<int>& conn) const
+void MEDCouplingMappedExtrudedMesh::getNodeIdsOfCell(std::size_t cellId, std::vector<int>& conn) const
{
int nbOfCells2D(_mesh2D->getNumberOfCells());
int nbOfNodes2D(_mesh2D->getNumberOfNodes());
MEDCOUPLING_EXPORT DataArrayInt *computeNbOfFacesPerCell() const;
MEDCOUPLING_EXPORT DataArrayInt *computeEffectiveNbOfNodesPerCell() const;
MEDCOUPLING_EXPORT std::size_t getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
- MEDCOUPLING_EXPORT void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const;
+ MEDCOUPLING_EXPORT void getNodeIdsOfCell(std::size_t cellId, std::vector<int>& conn) const;
MEDCOUPLING_EXPORT void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const;
MEDCOUPLING_EXPORT std::string simpleRepr() const;
MEDCOUPLING_EXPORT std::string advancedRepr() const;
void DataArray::checkNbOfTuples(int nbOfTuples, const std::string& msg) const
{
- if(getNumberOfTuples()!=nbOfTuples)
+ if((int)getNumberOfTuples()!=nbOfTuples)
{
std::ostringstream oss; oss << msg << " : mismatch number of tuples : expected " << nbOfTuples << " having " << getNumberOfTuples() << " !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
case 3:
{
BBTree<3,int> bbt(otherBBoxFrmt->begin(),0,0,otherBBoxFrmt->getNumberOfTuples(),eps);
- for(int i=0;i<nbOfTuples;i++,retPtr++,thisBBPtr+=nbOfComp)
+ for(std::size_t i=0;i<nbOfTuples;i++,retPtr++,thisBBPtr+=nbOfComp)
*retPtr=bbt.getNbOfIntersectingElems(thisBBPtr);
break;
}
case 2:
{
BBTree<2,int> bbt(otherBBoxFrmt->begin(),0,0,otherBBoxFrmt->getNumberOfTuples(),eps);
- for(int i=0;i<nbOfTuples;i++,retPtr++,thisBBPtr+=nbOfComp)
+ for(std::size_t i=0;i<nbOfTuples;i++,retPtr++,thisBBPtr+=nbOfComp)
*retPtr=bbt.getNbOfIntersectingElems(thisBBPtr);
break;
}
case 1:
{
BBTree<1,int> bbt(otherBBoxFrmt->begin(),0,0,otherBBoxFrmt->getNumberOfTuples(),eps);
- for(int i=0;i<nbOfTuples;i++,retPtr++,thisBBPtr+=nbOfComp)
+ for(std::size_t i=0;i<nbOfTuples;i++,retPtr++,thisBBPtr+=nbOfComp)
*retPtr=bbt.getNbOfIntersectingElems(thisBBPtr);
break;
}
throw INTERP_KERNEL::Exception("DataArrayDouble::fromCartToCylGiven : input coords are NULL !");
MCAuto<DataArrayDouble> ret(DataArrayDouble::New());
checkAllocated(); coords->checkAllocated();
- int nbOfComp(getNumberOfComponents()),nbTuples(getNumberOfTuples());
+ std::size_t nbOfComp(getNumberOfComponents()),nbTuples(getNumberOfTuples());
if(nbOfComp!=3)
throw INTERP_KERNEL::Exception("DataArrayDouble::fromCartToCylGiven : must be an array with exactly 3 components !");
if(coords->getNumberOfComponents()!=3)
std::size_t nbOfComp(a1->getNumberOfComponents());
if(nbOfComp!=a2->getNumberOfComponents())
throw INTERP_KERNEL::Exception("Nb of components mismatch for array Dot !");
- int nbOfTuple=a1->getNumberOfTuples();
+ std::size_t nbOfTuple(a1->getNumberOfTuples());
if(nbOfTuple!=a2->getNumberOfTuples())
throw INTERP_KERNEL::Exception("Nb of tuples mismatch for array Dot !");
DataArrayDouble *ret=DataArrayDouble::New();
ret->alloc(nbOfTuple,1);
double *retPtr=ret->getPointer();
- const double *a1Ptr=a1->getConstPointer();
- const double *a2Ptr=a2->getConstPointer();
- for(int i=0;i<nbOfTuple;i++)
+ const double *a1Ptr=a1->begin(),*a2Ptr(a2->begin());
+ for(std::size_t i=0;i<nbOfTuple;i++)
{
double sum=0.;
for(std::size_t j=0;j<nbOfComp;j++)
throw INTERP_KERNEL::Exception("Nb of components mismatch for array crossProduct !");
if(nbOfComp!=3)
throw INTERP_KERNEL::Exception("Nb of components must be equal to 3 for array crossProduct !");
- int nbOfTuple=a1->getNumberOfTuples();
+ std::size_t nbOfTuple(a1->getNumberOfTuples());
if(nbOfTuple!=a2->getNumberOfTuples())
throw INTERP_KERNEL::Exception("Nb of tuples mismatch for array crossProduct !");
DataArrayDouble *ret=DataArrayDouble::New();
ret->alloc(nbOfTuple,3);
double *retPtr=ret->getPointer();
- const double *a1Ptr=a1->getConstPointer();
- const double *a2Ptr=a2->getConstPointer();
- for(int i=0;i<nbOfTuple;i++)
+ const double *a1Ptr(a1->begin()),*a2Ptr(a2->begin());
+ for(std::size_t i=0;i<nbOfTuple;i++)
{
retPtr[3*i]=a1Ptr[3*i+1]*a2Ptr[3*i+2]-a1Ptr[3*i+2]*a2Ptr[3*i+1];
retPtr[3*i+1]=a1Ptr[3*i+2]*a2Ptr[3*i]-a1Ptr[3*i]*a2Ptr[3*i+2];
std::size_t nbOfComp(a1->getNumberOfComponents());
if(nbOfComp!=a2->getNumberOfComponents())
throw INTERP_KERNEL::Exception("Nb of components mismatch for array Max !");
- int nbOfTuple=a1->getNumberOfTuples();
+ std::size_t nbOfTuple(a1->getNumberOfTuples());
if(nbOfTuple!=a2->getNumberOfTuples())
throw INTERP_KERNEL::Exception("Nb of tuples mismatch for array Max !");
- DataArrayDouble *ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret(DataArrayDouble::New());
ret->alloc(nbOfTuple,nbOfComp);
- double *retPtr=ret->getPointer();
- const double *a1Ptr=a1->getConstPointer();
- const double *a2Ptr=a2->getConstPointer();
- int nbElem=nbOfTuple*nbOfComp;
- for(int i=0;i<nbElem;i++)
+ double *retPtr(ret->getPointer());
+ const double *a1Ptr(a1->begin()),*a2Ptr(a2->begin());
+ std::size_t nbElem(nbOfTuple*nbOfComp);
+ for(std::size_t i=0;i<nbElem;i++)
retPtr[i]=std::max(a1Ptr[i],a2Ptr[i]);
ret->copyStringInfoFrom(*a1);
- return ret;
+ return ret.retn();
}
/*!
std::size_t nbOfComp(a1->getNumberOfComponents());
if(nbOfComp!=a2->getNumberOfComponents())
throw INTERP_KERNEL::Exception("Nb of components mismatch for array min !");
- int nbOfTuple=a1->getNumberOfTuples();
+ std::size_t nbOfTuple(a1->getNumberOfTuples());
if(nbOfTuple!=a2->getNumberOfTuples())
throw INTERP_KERNEL::Exception("Nb of tuples mismatch for array min !");
- DataArrayDouble *ret=DataArrayDouble::New();
+ MCAuto<DataArrayDouble> ret(DataArrayDouble::New());
ret->alloc(nbOfTuple,nbOfComp);
- double *retPtr=ret->getPointer();
- const double *a1Ptr=a1->getConstPointer();
- const double *a2Ptr=a2->getConstPointer();
- int nbElem=nbOfTuple*nbOfComp;
- for(int i=0;i<nbElem;i++)
+ double *retPtr(ret->getPointer());
+ const double *a1Ptr(a1->begin()),*a2Ptr(a2->begin());
+ std::size_t nbElem(nbOfTuple*nbOfComp);
+ for(std::size_t i=0;i<nbElem;i++)
retPtr[i]=std::min(a1Ptr[i],a2Ptr[i]);
ret->copyStringInfoFrom(*a1);
- return ret;
+ return ret.retn();
}
/*!
checkAllocated();
if(getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("DataArrayInt::hasOnlyUniqueValues: must be applied on DataArrayInt with only one component, you can call 'rearrange' method before !");
- int nbOfTuples(getNumberOfTuples());
+ std::size_t nbOfTuples(getNumberOfTuples());
std::set<int> s(begin(),end()); // in C++11, should use unordered_set (O(1) complexity)
if (s.size() != nbOfTuples)
return false;
{
std::size_t nbOfCompoExp(std::distance(tupleBg,tupleEnd));
checkAllocated();
- if(getNumberOfComponents()!=(int)nbOfCompoExp)
+ if(getNumberOfComponents()!=nbOfCompoExp)
{
std::ostringstream oss; oss << "DataArrayInt::findIdsEqualTuple : mismatch of number of components. Input tuple has " << nbOfCompoExp << " whereas this array has " << getNumberOfComponents() << " components !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
{
if(!a1 || !a2)
throw INTERP_KERNEL::Exception("DataArrayInt::Aggregate : input DataArrayInt instance is NULL !");
- int nbOfComp=a1->getNumberOfComponents();
+ std::size_t nbOfComp(a1->getNumberOfComponents());
if(nbOfComp!=a2->getNumberOfComponents())
throw INTERP_KERNEL::Exception("Nb of components mismatch for array Aggregation !");
- int nbOfTuple1=a1->getNumberOfTuples();
- int nbOfTuple2=a2->getNumberOfTuples();
- DataArrayInt *ret=DataArrayInt::New();
+ std::size_t nbOfTuple1(a1->getNumberOfTuples()),nbOfTuple2(a2->getNumberOfTuples());
+ MCAuto<DataArrayInt> ret(DataArrayInt::New());
ret->alloc(nbOfTuple1+nbOfTuple2-offsetA2,nbOfComp);
- int *pt=std::copy(a1->getConstPointer(),a1->getConstPointer()+nbOfTuple1*nbOfComp,ret->getPointer());
+ int *pt=std::copy(a1->begin(),a1->end(),ret->getPointer());
std::copy(a2->getConstPointer()+offsetA2*nbOfComp,a2->getConstPointer()+nbOfTuple2*nbOfComp,pt);
ret->copyStringInfoFrom(*a1);
- return ret;
+ return ret.retn();
}
/*!
if(a.empty())
throw INTERP_KERNEL::Exception("DataArrayInt::Aggregate : input list must be NON EMPTY !");
std::vector<const DataArrayInt *>::const_iterator it=a.begin();
- int nbOfComp=(*it)->getNumberOfComponents();
- int nbt=(*it++)->getNumberOfTuples();
+ std::size_t nbOfComp((*it)->getNumberOfComponents()),nbt((*it++)->getNumberOfTuples());
for(int i=1;it!=a.end();it++,i++)
{
if((*it)->getNumberOfComponents()!=nbOfComp)
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author : Anthony Geay (CEA/DEN)
+// Author : Anthony Geay (EDF R&D)
#ifndef __PARAMEDMEM_MEDCOUPLINGMEMARRAY_TXX__
#define __PARAMEDMEM_MEDCOUPLINGMEMARRAY_TXX__
{
int a,b,c;
spd->getSlice(a,b,c);
- if(a==0 && b==getNumberOfTuples() && c==1)
+ if(a==0 && b==(int)getNumberOfTuples() && c==1)
{
DataArrayTemplate<T> *directRet(const_cast<DataArrayTemplate<T> *>(this));
directRet->incrRef();
for(it=a.begin();it!=a.end();it++)
(*it)->checkAllocated();
it=a.begin();
- int nbOfTuples((*it)->getNumberOfTuples());
+ std::size_t nbOfTuples((*it)->getNumberOfTuples());
std::vector<int> nbc(a.size());
std::vector<const T *> pts(a.size());
nbc[0]=(*it)->getNumberOfComponents();
typename Traits<T>::ArrayType *ret(Traits<T>::ArrayType::New());
ret->alloc(nbOfTuples,totalNbOfComp);
T *retPtr(ret->getPointer());
- for(int i=0;i<nbOfTuples;i++)
- for(int j=0;j<(int)a.size();j++)
+ for(std::size_t i=0;i<nbOfTuples;i++)
+ for(std::size_t j=0;j<a.size();j++)
{
retPtr=std::copy(pts[j],pts[j]+nbc[j],retPtr);
pts[j]+=nbc[j];
{
this->checkAllocated();
other->checkAllocated();
- int nbOfTuples(this->getNumberOfTuples());
+ std::size_t nbOfTuples(this->getNumberOfTuples());
if(nbOfTuples!=other->getNumberOfTuples())
throw INTERP_KERNEL::Exception("DataArrayDouble::meldWith : mismatch of number of tuples !");
int nbOfComp1(this->getNumberOfComponents()),nbOfComp2(other->getNumberOfComponents());
T *newArr=(T *)malloc((nbOfTuples*(nbOfComp1+nbOfComp2))*sizeof(T));
T *w=newArr;
const T *inp1(this->begin()),*inp2(other->begin());
- for(int i=0;i<nbOfTuples;i++,inp1+=nbOfComp1,inp2+=nbOfComp2)
+ for(std::size_t i=0;i<nbOfTuples;i++,inp1+=nbOfComp1,inp2+=nbOfComp2)
{
w=std::copy(inp1,inp1+nbOfComp1,w);
w=std::copy(inp2,inp2+nbOfComp2,w);
this->checkAllocated();
if(this->getNumberOfComponents()!=1 || other.getNumberOfComponents()!=1)
throw INTERP_KERNEL::Exception("DataArrayInt::buildPermutationArr : 'this' and 'other' have to have exactly ONE component !");
- int nbTuple(this->getNumberOfTuples());
+ std::size_t nbTuple(this->getNumberOfTuples());
other.checkAllocated();
if(nbTuple!=other.getNumberOfTuples())
throw INTERP_KERNEL::Exception("DataArrayInt::buildPermutationArr : 'this' and 'other' must have the same number of tuple !");
ret->alloc(nbTuple,1);
ret->fillWithValue(-1);
const T *pt(this->begin());
- std::map<int,int> mm;
- for(int i=0;i<nbTuple;i++)
- mm[pt[i]]=i;
+ std::map<int,mcIdType> mm;
+ for(std::size_t i=0;i<nbTuple;i++)
+ mm[pt[i]]=(mcIdType)i;
pt=other.begin();
mcIdType *retToFill(ret->getPointer());
- for(int i=0;i<nbTuple;i++)
+ for(std::size_t i=0;i<nbTuple;i++)
{
std::map<int,int>::const_iterator it=mm.find(pt[i]);
if(it==mm.end())
ret->alloc(nbTuples,1);
T *retPt(ret->getPointer());
std::map<int,mcIdType> m;
- for(mcIdType i=0;i<thisNbTuples;i++,thisPt++)
- m[*thisPt]=i;
+ for(std::size_t i=0;i<thisNbTuples;i++,thisPt++)
+ m[*thisPt]=(mcIdType)i;
if(m.size()!=thisNbTuples)
throw INTERP_KERNEL::Exception("DataArrayInt::indicesOfSubPart : some elements appears more than once !");
- for(mcIdType i=0;i<nbTuples;i++,retPt++,pt++)
+ for(std::size_t i=0;i<nbTuples;i++,retPt++,pt++)
{
std::map<int,mcIdType>::const_iterator it(m.find(*pt));
if(it!=m.end())
MEDCOUPLING_EXPORT virtual std::size_t getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const = 0;
MEDCOUPLING_EXPORT virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(std::size_t cellId) const = 0;
MEDCOUPLING_EXPORT virtual std::set<INTERP_KERNEL::NormalizedCellType> getAllGeoTypes() const = 0;
- MEDCOUPLING_EXPORT virtual void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const = 0;
+ MEDCOUPLING_EXPORT virtual void getNodeIdsOfCell(std::size_t cellId, std::vector<int>& conn) const = 0;
MEDCOUPLING_EXPORT virtual DataArrayInt *getCellIdsFullyIncludedInNodeIds(const int *partBg, const int *partEnd) const;
MEDCOUPLING_EXPORT virtual void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const = 0;
MEDCOUPLING_EXPORT virtual std::string simpleRepr() const = 0;
return computeNbOfNodesPerCell();
}
-void MEDCouplingStructuredMesh::getNodeIdsOfCell(int cellId, std::vector<int>& conn) const
+void MEDCouplingStructuredMesh::getNodeIdsOfCell(std::size_t cellId, std::vector<int>& conn) const
{
int meshDim=getMeshDimension();
int tmpCell[3],tmpNode[3];
MEDCOUPLING_EXPORT std::vector<int> getLocationFromNodeId(int nodeId) const;
MEDCOUPLING_EXPORT static void GetPosFromId(int eltId, int meshDim, const int *split, int *res);
MEDCOUPLING_EXPORT static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim);
- MEDCOUPLING_EXPORT void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const;
+ MEDCOUPLING_EXPORT void getNodeIdsOfCell(std::size_t cellId, std::vector<int>& conn) const;
MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDCOUPLING_EXPORT void copyTinyStringsFrom(const MEDCouplingMesh *other);
MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const;
oss << ", whereas other mesh dimension is set equal to " << otherOnSameCoordsThanThis.getMeshDimension() << " !";
throw INTERP_KERNEL::Exception(oss.str());
}
- int nbOfCellsToModify=(int)std::distance(cellIdsBg,cellIdsEnd);
+ std::size_t nbOfCellsToModify(std::distance(cellIdsBg,cellIdsEnd));
if(nbOfCellsToModify!=otherOnSameCoordsThanThis.getNumberOfCells())
{
std::ostringstream oss; oss << "MEDCouplingUMesh::setPartOfMySelf : cells ids length (" << nbOfCellsToModify << ") do not match the number of cells of other mesh (" << otherOnSameCoordsThanThis.getNumberOfCells() << ") !";
throw INTERP_KERNEL::Exception(oss.str());
}
- int nbOfCells=getNumberOfCells();
- bool easyAssign=true;
- const int *connI=_nodal_connec_index->getConstPointer();
- const int *connIOther=otherOnSameCoordsThanThis._nodal_connec_index->getConstPointer();
+ std::size_t nbOfCells(getNumberOfCells());
+ bool easyAssign(true);
+ const int *connI(_nodal_connec_index->begin());
+ const int *connIOther=otherOnSameCoordsThanThis._nodal_connec_index->begin();
for(const int *it=cellIdsBg;it!=cellIdsEnd && easyAssign;it++,connIOther++)
{
- if(*it>=0 && *it<nbOfCells)
+ if(*it>=0 && *it<(int)nbOfCells)
{
easyAssign=(connIOther[1]-connIOther[0])==(connI[*it+1]-connI[*it]);
}
throw INTERP_KERNEL::Exception(oss.str());
}
int nbOfCellsToModify=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::setPartOfMySelfSlice : ");
- if(nbOfCellsToModify!=otherOnSameCoordsThanThis.getNumberOfCells())
+ if(nbOfCellsToModify!=(int)otherOnSameCoordsThanThis.getNumberOfCells())
{
std::ostringstream oss; oss << "MEDCouplingUMesh::setPartOfMySelfSlice : cells ids length (" << nbOfCellsToModify << ") do not match the number of cells of other mesh (" << otherOnSameCoordsThanThis.getNumberOfCells() << ") !";
throw INTERP_KERNEL::Exception(oss.str());
// Connex zone without the crack (to compute the next seed really)
int dnu;
DAInt connexCheck = MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(&seed, &seed+1, neighInit00,neighIInit00, -1, dnu);
- int cnt = 0;
+ std::size_t cnt(0);
for (int * ptr = connexCheck->getPointer(); cnt < connexCheck->getNumberOfTuples(); ptr++, cnt++)
hitCells->setIJ(*ptr,0,1);
// Connex zone WITH the crack (to identify cells lying on either part of the crack)
INTERP_KERNEL::NormalizedCellType MEDCouplingUMesh::getTypeOfCell(std::size_t cellId) const
{
const int *ptI(_nodal_connec_index->begin()),*pt(_nodal_connec->begin());
- if(cellId>=0 && cellId<_nodal_connec_index->getNbOfElems()-1)
+ if(cellId<_nodal_connec_index->getNbOfElems()-1)
return (INTERP_KERNEL::NormalizedCellType) pt[ptI[cellId]];
else
{
* cleared before the appending.
* \throw If \a cellId is invalid. Valid range is [0, \a this->getNumberOfCells() ).
*/
-void MEDCouplingUMesh::getNodeIdsOfCell(int cellId, std::vector<int>& conn) const
+void MEDCouplingUMesh::getNodeIdsOfCell(std::size_t cellId, std::vector<int>& conn) const
{
- const int *ptI=_nodal_connec_index->getConstPointer();
- const int *pt=_nodal_connec->getConstPointer();
+ const int *ptI(_nodal_connec_index->begin()),*pt(_nodal_connec->begin());
for(const int *w=pt+ptI[cellId]+1;w!=pt+ptI[cellId+1];w++)
if(*w>=0)
conn.push_back(*w);
std::vector<std::vector<int> > res;
buildSubCellsFromCut(cut3DSurf,desc2->begin(),descIndx2->begin(),mDesc1->getCoords()->begin(),eps,res);
std::size_t sz(res.size());
- if((int)res.size()==mDesc1->getNumberOfCells() && sameNbNodes)
+ if(res.size()==mDesc1->getNumberOfCells() && sameNbNodes)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::clipSingle3DCellByPlane : cell is not clipped !");
for(std::size_t i=0;i<sz;i++)
{
MCAuto<MEDCouplingFieldDouble> f=buildDirectionVectorField();
const double *fPtr=f->getArray()->getConstPointer();
double tmp[3];
- for(int i=0;i<getNumberOfCells();i++)
+ for(std::size_t i=0;i<getNumberOfCells();i++)
{
const double *tmp1=fPtr+3*i;
tmp[0]=tmp1[1]*v[2]-tmp1[2]*v[1];
previousArrI=*arrIPtr;
*arrIPtr=(int)arrOut.size();
}
- if(arr->getNumberOfTuples()==(int)arrOut.size())
+ if(arr->getNumberOfTuples()==arrOut.size())
return false;
arr->alloc((int)arrOut.size(),1);
std::copy(arrOut.begin(),arrOut.end(),arr->getPointer());
MEDCOUPLING_EXPORT INTERP_KERNEL::NormalizedCellType getTypeOfCell(std::size_t cellId) const;
MEDCOUPLING_EXPORT DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
MEDCOUPLING_EXPORT std::size_t getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
- MEDCOUPLING_EXPORT void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const;
+ MEDCOUPLING_EXPORT void getNodeIdsOfCell(std::size_t cellId, std::vector<int>& conn) const;
MEDCOUPLING_EXPORT std::string simpleRepr() const;
MEDCOUPLING_EXPORT std::string advancedRepr() const;
MEDCOUPLING_EXPORT std::string cppRepr() const;
newConnIPtr[1]=newConnIPtr[0]+3;
}
}
- if(addCoo.empty() && ((int)newConn.size())==_nodal_connec->getNumberOfTuples())//nothing happens during tessellation : no update needed
+ if(addCoo.empty() && newConn.size()==_nodal_connec->getNumberOfTuples())//nothing happens during tessellation : no update needed
return ;
_types=types;
DataArrayInt::SetArrayIn(newConnI,_nodal_connec_index);
VectorOfCellInfo(const std::vector<int>& edges, const std::vector< MCAuto<INTERP_KERNEL::Edge> >& edgesPtr);
std::size_t size() const { return _pool.size(); }
int getPositionOf(double eps, const MEDCouplingUMesh *mesh) const;
- void setMeshAt(int pos, const MCAuto<MEDCouplingUMesh>& mesh, int istart, int iend, const MCAuto<MEDCouplingUMesh>& mesh1DInCase, const std::vector< std::vector<int> >& edges, const std::vector< std::vector< MCAuto<INTERP_KERNEL::Edge> > >& edgePtrs);
+ void setMeshAt(std::size_t pos, const MCAuto<MEDCouplingUMesh>& mesh, int istart, int iend, const MCAuto<MEDCouplingUMesh>& mesh1DInCase, const std::vector< std::vector<int> >& edges, const std::vector< std::vector< MCAuto<INTERP_KERNEL::Edge> > >& edgePtrs);
const std::vector<int>& getConnOf(int pos) const { return get(pos)._edges; }
const std::vector< MCAuto<INTERP_KERNEL::Edge> >& getEdgePtrOf(int pos) const { return get(pos)._edges_ptr; }
MCAuto<MEDCouplingUMesh> getZeMesh() const { return _ze_mesh; }
return zeMesh->getCellContainingPoint(barys->begin(),eps);
}
-void VectorOfCellInfo::setMeshAt(int pos, const MCAuto<MEDCouplingUMesh>& mesh, int istart, int iend, const MCAuto<MEDCouplingUMesh>& mesh1DInCase, const std::vector< std::vector<int> >& edges, const std::vector< std::vector< MCAuto<INTERP_KERNEL::Edge> > >& edgePtrs)
+void VectorOfCellInfo::setMeshAt(std::size_t pos, const MCAuto<MEDCouplingUMesh>& mesh, int istart, int iend, const MCAuto<MEDCouplingUMesh>& mesh1DInCase, const std::vector< std::vector<int> >& edges, const std::vector< std::vector< MCAuto<INTERP_KERNEL::Edge> > >& edgePtrs)
{
get(pos);//to check pos
bool isFast(pos==0 && _pool.size()==1);
_edge_info.push_back(EdgeInfo(istart,iend,pos,edgePtrs[0].back()));
//
std::vector<CellInfo> pool(_pool.size()-1+sz);
- for(int i=0;i<pos;i++)
+ for(std::size_t i=0;i<pos;i++)
pool[i]=_pool[i];
for(std::size_t j=0;j<sz;j++)
pool[pos+j]=CellInfo(edges[j],edgePtrs[j]);
MCAuto<MEDCouplingUMesh> splitOfOneCell(BuildMesh2DCutFrom(eps,*it,m1Desc,partOfMesh1CuttingCur2DCell,dd1->begin()+dd2->getIJ(*it,0),dd1->begin()+dd2->getIJ((*it)+1,0),intersectEdge1,ret2->getNumberOfTuples(),partOfRet3));
ret3->setPartOfValues3(partOfRet3,idsNonColPerCell2->begin(),idsNonColPerCell2->end(),0,2,1,true);
outMesh2DSplit.push_back(splitOfOneCell);
- for(int i=0;i<splitOfOneCell->getNumberOfCells();i++)
+ for(std::size_t i=0;i<splitOfOneCell->getNumberOfCells();i++)
ret2->pushBackSilent(*it);
}
//
const double * normalsP = normals->getConstPointer();
// Sort faces by decreasing surface:
- vector<pair<double,int>> S;
- for(int i=0;i < surfs->getNumberOfTuples();i++){
+ vector< pair<double,int> > S;
+ for(std::size_t i=0;i < surfs->getNumberOfTuples();i++)
+ {
pair<double,int> p = make_pair(surfs->begin()[i], i);
S.push_back(p);
- }
+ }
sort(S.rbegin(),S.rend()); // reverse sort
vector<bool> hit(nDescCell);
fill(hit.begin(), hit.end(), false);
MCAuto<MEDCouplingUMesh> mPartCand(mDesc->buildPartOfMySelf(&cands2[0], &cands2[0]+cands2.size(), false)); // false=zipCoords is called
double * cooPartRef(mPartRef->_coords->getPointer());
double * cooPartCand(mPartCand->_coords->getPointer());
- for (int ii = 0; ii < mPartRef->_coords->getNumberOfTuples(); ii++)
+ for (std::size_t ii = 0; ii < mPartRef->_coords->getNumberOfTuples(); ii++)
rotation.transform_vector(cooPartRef+SPACEDIM*ii);
- for (int ii = 0; ii < mPartCand->_coords->getNumberOfTuples(); ii++)
+ for (std::size_t ii = 0; ii < mPartCand->_coords->getNumberOfTuples(); ii++)
rotation.transform_vector(cooPartCand+SPACEDIM*ii);
// Localize faces in 2D thanks to barycenters
// Sort edges by decreasing length:
vector<pair<double,int>> S;
- for(int i=0;i < lens->getNumberOfTuples();i++){
+ for(std::size_t i=0;i < lens->getNumberOfTuples();i++)
+ {
pair<double,int> p = make_pair(lens->getIJ(i, 0), i);
S.push_back(p);
- }
+ }
sort(S.rbegin(),S.rend()); // reverse sort
vector<bool> hit(nDesc2Cell);
MCAuto<DataArrayInt> nodeMapInv = nodeMap->invertArrayO2N2N2O(nbElemsNotM1);
double * cooPartRef(mPartRef->_coords->getPointer());
double * cooPartCand(mPartCand->_coords->getPointer());
- for (int ii = 0; ii < mPartRef->_coords->getNumberOfTuples(); ii++)
+ for (std::size_t ii = 0; ii < mPartRef->_coords->getNumberOfTuples(); ii++)
rotation.transform_vector(cooPartRef+SPACEDIM*ii);
- for (int ii = 0; ii < mPartCand->_coords->getNumberOfTuples(); ii++)
+ for (std::size_t ii = 0; ii < mPartCand->_coords->getNumberOfTuples(); ii++)
rotation.transform_vector(cooPartCand+SPACEDIM*ii);
MCAuto<DataArrayInt> idx(DataArrayInt::New()); idx->alloc(1); idx->fillWithValue(0);
MCAuto<DataArrayInt> vals(DataArrayInt::New()); vals->alloc(0);
newConn->set3(superIdx, idx, vals);
- for(int ii = 0; ii < getNumberOfCells(); ii++)
+ for(std::size_t ii = 0; ii < getNumberOfCells(); ii++)
for (int jj=descIP[ii]; jj < descIP[ii+1]; jj++)
{
int sz, faceIdx = abs(descP[jj])-1;