]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
update to correct a bug in the Med File 2.2 driver of the Med Memory
authornadir <nadir>
Fri, 2 Dec 2005 17:09:01 +0000 (17:09 +0000)
committernadir <nadir>
Fri, 2 Dec 2005 17:09:01 +0000 (17:09 +0000)
(Bug PAL10601).

src/MEDMEM/MEDMEM_MedMeshDriver22.cxx

index 2ba0c1b20720c8470b76d13417f7bc73e34d9ec6..c2db47f020c14ce6722dbe50e97f55a8fd58ab63 100644 (file)
@@ -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;