From: nadir Date: Fri, 2 Dec 2005 17:09:01 +0000 (+0000) Subject: update to correct a bug in the Med File 2.2 driver of the Med Memory X-Git-Tag: ForV3_1_0b1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2f9021103fb39aefab7d0673693655e2bdda8d0c;p=modules%2Fmed.git update to correct a bug in the Med File 2.2 driver of the Med Memory (Bug PAL10601). --- diff --git a/src/MEDMEM/MEDMEM_MedMeshDriver22.cxx b/src/MEDMEM/MEDMEM_MedMeshDriver22.cxx index 2ba0c1b20..c2db47f02 100644 --- a/src/MEDMEM/MEDMEM_MedMeshDriver22.cxx +++ b/src/MEDMEM/MEDMEM_MedMeshDriver22.cxx @@ -1307,8 +1307,18 @@ int MED_MESH_RDONLY_DRIVER22::getNodalConnectivity(CONNECTIVITY * Connectivity) Entity, med_2_2::MED_POLYGONE, med_2_2::MED_NOD); + + // Correction to permit the loading of mesh dimensionned at 2 even + // if it has only MED_POLYGON elements + + if (NumberOfPolygons > 0) + { + if (Connectivity->_entityDimension < 2) Connectivity->_entityDimension = 2; + } + if (NumberOfPolygons > 0) { + // By consequence this exception will never occur if (Connectivity->_entityDimension == 1) throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"In a 2D mesh, polygons need at least one 2D cell of a classic geometric type !")); med_int ConnectivitySize; @@ -1361,8 +1371,18 @@ int MED_MESH_RDONLY_DRIVER22::getNodalConnectivity(CONNECTIVITY * Connectivity) Entity, med_2_2::MED_POLYEDRE, med_2_2::MED_NOD); + + // Correction to permit the loading of mesh dimensionned at 3 even + // if it has only MED_POLYEDRE elements + + if (NumberOfPolyhedron > 0) + { + Connectivity->_entityDimension = 3; + } + if (NumberOfPolyhedron > 0) { + // By consequence this exception will never occur if (Connectivity->_entityDimension == 2 || Connectivity->_entityDimension == 1) throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"In a 3D mesh, polyhedron need at least one 3D cell of a classic geometric type !")); med_int FacesIndexSize, NumberOfNodes, NumberOfFaces;