From 45ef0ad05431be9f1185a58f7b6b33d0ae723633 Mon Sep 17 00:00:00 2001 From: ageay Date: Tue, 2 Apr 2013 06:05:03 +0000 Subject: [PATCH] Protection of areOnlySimplexCells --- src/MEDCoupling/MEDCouplingUMesh.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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(); -- 2.39.2