/*!
* Returns nb of cells having the geometric type \a type. No throw if no cells in \a this has the geometric type \a type.
*/
-int MEDCoupling1GTUMesh::getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const
+std::size_t MEDCoupling1GTUMesh::getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const
{
return type==getCellModelEnum()?getNumberOfCells():0;
}
* \return INTERP_KERNEL::NormalizedCellType - enumeration item describing the cell type.
* \throw If \a cellId is invalid. Valid range is [0, \a this->getNumberOfCells() ).
*/
-INTERP_KERNEL::NormalizedCellType MEDCoupling1GTUMesh::getTypeOfCell(int cellId) const
+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)