return MEDCouplingMesh::isEqualIfNotWhy(other,prec,reason);
}
-INTERP_KERNEL::NormalizedCellType MEDCouplingStructuredMesh::getTypeOfCell(int cellId) const
+INTERP_KERNEL::NormalizedCellType MEDCouplingStructuredMesh::getTypeOfCell(std::size_t cellId) const
{
return GetGeoTypeGivenMeshDimension(getMeshDimension());
}
return ret2;
}
-int MEDCouplingStructuredMesh::getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const
+std::size_t MEDCouplingStructuredMesh::getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const
{
- int ret=getNumberOfCells();
+ std::size_t ret(getNumberOfCells());
if(type==getTypeOfCell(0))
return ret;
- const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(getTypeOfCell(0));
+ const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel(getTypeOfCell(0)));
std::ostringstream oss; oss << "MEDCouplingStructuredMesh::getNumberOfCellsWithType : no specified type ! Type available is " << cm.getRepr() << " !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
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];
* - After \a code contains [NORM_...,nbCells,0], \a idsInPflPerType [[0,1]] and \a idsPerType is [[1,2]] <br>
*/
-void MEDCouplingStructuredMesh::splitProfilePerType(const DataArrayInt *profile, std::vector<int>& code, std::vector<DataArrayInt *>& idsInPflPerType, std::vector<DataArrayInt *>& idsPerType) const
+void MEDCouplingStructuredMesh::splitProfilePerType(const DataArrayInt *profile, std::vector<int>& code, std::vector<DataArrayInt *>& idsInPflPerType, std::vector<DataArrayInt *>& idsPerType, bool smartPflKiller) const
{
if(!profile || !profile->isAllocated())
throw INTERP_KERNEL::Exception("MEDCouplingStructuredMesh::splitProfilePerType : input profile is NULL or not allocated !");
code.resize(3); idsInPflPerType.resize(1);
code[0]=(int)getTypeOfCell(0); code[1]=nbOfCells;
idsInPflPerType.resize(1);
- if(profile->isIota(nbOfCells))
+ if(smartPflKiller && profile->isIota(nbOfCells))
{
code[2]=-1;
idsInPflPerType[0]=profile->deepCopy();
}
-int MEDCouplingStructuredMesh::getNumberOfCells() const
+std::size_t MEDCouplingStructuredMesh::getNumberOfCells() const
{
std::vector<int> ngs(getNodeGridStructure());
- int ret(1);
+ std::size_t ret(1);
bool isCatched(false);
std::size_t ii(0);
for(std::vector<int>::const_iterator it=ngs.begin();it!=ngs.end();it++,ii++)
/*!
* This method builds the explicit entity array from the structure in \a st and the range in \a partCompactFormat.
- * If the range contains invalid values regarding sructure an exception will be thrown.
+ * If the range contains invalid values regarding structure an exception will be thrown.
*
* \return DataArrayInt * - a new object.
* \sa MEDCouplingStructuredMesh::IsPartStructured, MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt, SwitchOnIdsFrom, ExtractFieldOfBoolFrom, ExtractFieldOfDoubleFrom, MultiplyPartOf
* \param [in] st - the structure of grid ( \b without considering ghost cells).
* \param [in] part - the part in the structure ( \b without considering ghost cells) contained in grid whose structure is defined by \a st.
* \param [in] factor - the factor, the tuples in \a da will be multiply by.
- * \param [in,out] da - The DataArray in wich only tuples specified by \a part will be modified.
+ * \param [in,out] da - The DataArray in which only tuples specified by \a part will be modified.
*
* \sa BuildExplicitIdsFrom
*/
* \param [in] part - the part in the structure ( \b without considering ghost cells) contained in grid whose structure is defined by \a st.
* \param [in] ghostSize - \a ghostSize must be >= 0.
* \param [in] factor - the factor, the tuples in \a da will be multiply by.
- * \param [in,out] da - The DataArray in wich only tuples specified by \a part will be modified.
+ * \param [in,out] da - The DataArray in which only tuples specified by \a part will be modified.
*
* \sa MultiplyPartOf, PutInGhostFormat
*/