DataArrayInt64 *revNodal = DataArrayInt64::New();
DataArrayInt64 *revNodalIdx = DataArrayInt64::New();
mesh->getReverseNodalConnectivity(revNodal, revNodalIdx);
- for (mcIdType nodeId = 0; nodeId < nbNodes; nodeId++)
+ for (size_t nodeId = 0; nodeId < (size_t)nbNodes; nodeId++)
{
- int nbCells = revNodalIdx->getIJ(nodeId + 1, 0) - revNodalIdx->getIJ(nodeId, 0);
+ int nbCells = revNodalIdx->getIJ(nodeId + 1, 0) -
+ revNodalIdx->getIJ(nodeId, 0);
std::vector<mcIdType> cellIds(nbCells, 0);
int start = revNodalIdx->getIJ(nodeId, 0);
for (size_t i = 0; i < cellIds.size(); ++i)
ShapeRecognMesh::ShapeRecognMesh(const std::string &fileName)
{
mesh = ReadUMeshFromFile(fileName);
- // TODO: check if the elements of the mesh are triangle ?
+ if (mesh->getMeshDimension() != 2)
+ throw INTERP_KERNEL::Exception("Expect a mesh with a dimension equal to 2");
+ if (mesh->getNumberOfCellsWithType(INTERP_KERNEL::NORM_TRI3) != mesh->getNumberOfCells())
+ throw INTERP_KERNEL::Exception("Expect a mesh containing exclusively triangular cells");
}
ShapeRecognMesh::~ShapeRecognMesh()