From: ageay Date: Tue, 2 Apr 2013 06:05:03 +0000 (+0000) Subject: Protection of areOnlySimplexCells X-Git-Tag: V6_main_FINAL~224 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=45ef0ad05431be9f1185a58f7b6b33d0ae723633;p=tools%2Fmedcoupling.git Protection of areOnlySimplexCells --- diff --git a/src/MEDCoupling/MEDCouplingUMesh.cxx b/src/MEDCoupling/MEDCouplingUMesh.cxx index caadbd866..7e2c6b413 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh.cxx @@ -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();