]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
22321: [CEA 933] Bug when reading a sauve file containing field on Gauss Pt
authoreap <eap@opencascade.com>
Thu, 19 Sep 2013 09:04:57 +0000 (09:04 +0000)
committereap <eap@opencascade.com>
Thu, 19 Sep 2013 09:04:57 +0000 (09:04 +0000)
Fix SauvWriter::makeProfileIDs() for a sole cell type and no profile

src/MEDLoader/SauvWriter.cxx

index 0ff5777aa3a41b4f95905b4eee99bcbdb5cf38c8..697847bb6ac05c182b0ec5e941e455053ee61676 100644 (file)
@@ -578,7 +578,16 @@ void SauvWriter::makeProfileIDs( SubMesh*                          sm,
       vector<const DataArrayInt *> idsPerType( 1, profile );
       MEDCouplingAutoRefCountObjectPtr<DataArrayInt>
         resIDs = uMesh->checkTypeConsistencyAndContig( code, idsPerType );
-      ids.assign( resIDs->begin(), resIDs->end() );
+      if (( const DataArrayInt *) resIDs )
+      {
+        ids.assign( resIDs->begin(), resIDs->end() );
+      }
+      else // mesh includes only one type
+      {
+        int nbE = code[1];
+        for ( ids.resize( nbE ); nbE; --nbE )
+          ids[ nbE-1 ] = nbE-1;
+      }
     }
 }