]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Protection of areOnlySimplexCells
authorageay <ageay>
Tue, 2 Apr 2013 06:05:03 +0000 (06:05 +0000)
committerageay <ageay>
Tue, 2 Apr 2013 06:05:03 +0000 (06:05 +0000)
src/MEDCoupling/MEDCouplingUMesh.cxx

index caadbd866a3234d720f5aa0cb9831c74ee0fe7ae..7e2c6b413be89f08e3cc939b6f739daa61021d95 100644 (file)
@@ -4893,8 +4893,9 @@ DataArrayInt *MEDCouplingUMesh::simplexize(int policy) throw(INTERP_KERNEL::Exce
 bool MEDCouplingUMesh::areOnlySimplexCells() const throw(INTERP_KERNEL::Exception)
 {
   checkFullyDefined();
-  if(getMeshDimension()<1)
-    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::areOnlySimplexCells : only available with meshes having a meshdim >= 1 !");
+  int mdim=getMeshDimension();
+  if(mdim<1 || mdim>3)
+    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::areOnlySimplexCells : only available with meshes having a meshdim 1, 2 or 3 !");
   int nbCells=getNumberOfCells();
   const int *conn=_nodal_connec->getConstPointer();
   const int *connI=_nodal_connec_index->getConstPointer();