]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Mantis issue 0020483: EDF 1117 SMESH,VISU: Mesh with descending connectivity is badly...
authorjfa <jfa@opencascade.com>
Fri, 25 Jan 2013 13:48:38 +0000 (13:48 +0000)
committerjfa <jfa@opencascade.com>
Fri, 25 Jan 2013 13:48:38 +0000 (13:48 +0000)
src/CONVERTOR/VISU_MedConvertor.cxx

index 9f82a50ec9c0575df13e7be843956561424352c6..2655e35fce72588c473c4ce248787ff783e3d2da 100644 (file)
@@ -1454,31 +1454,45 @@ VISU_MedConvertor
       aMesh->myName = aMeshName;
       aMesh->myMeshInfo = aMeshInfo;
       aMesh->myNamedPointCoords(new VISU::TMEDNamedPointCoords());
-      
+
       INITMSG(MYDEBUG,"aMeshName = '"<<aMeshName<<
               "; aDim = "<<aDim<<"\n");
 
-      if(aType == MED::eNON_STRUCTURE){
+      if (aType == MED::eNON_STRUCTURE) {
 
-        if(MED::PNodeInfo aNodeInfo = myMed->GetPNodeInfo(aMeshInfo)){
-          MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
+        if (MED::PNodeInfo aNodeInfo = myMed->GetPNodeInfo(aMeshInfo)) {
+          MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo, MED::eNOD);
 
           aMesh->myNbPoints = aNodeInfo->GetNbElem();
           aMesh->myEntityInfo = anEntityInfo;
-        
-        
+
+          // Check connectivity (Mantis issue 0020483)
+          {
+            bool isDescConn = false;
+
+            MED::TEntityInfo aEntityInfoDesc = myMed->GetEntityInfo(aMeshInfo, MED::eDESC);
+            MED::TEntityInfo::iterator anEntityIterDesc = aEntityInfoDesc.begin();
+            for (; anEntityIterDesc != aEntityInfoDesc.end() && !isDescConn; anEntityIterDesc++) {
+              const MED::EEntiteMaillage& anEntity = anEntityIterDesc->first;
+              if (anEntity != MED::eNOEUD) isDescConn = true;
+            }
+
+            if (isDescConn)
+              MSG(1, "There are some elements in descending connectivity in med file. They were not read !!!");
+          }
+
 #ifndef _DEXCEPT_
           try{
 #endif
             INITMSG(MYDEBUG,"myNbPoints = "<<aMesh->myNbPoints<<
                     "; anEntityInfo.size() = "<<anEntityInfo.size()<<
                     "\n");
-            
+
             BuildMeshOnEntityMap(aMesh,
                                  anEntityInfo,
                                  aNodeInfo,
                                  myMed);
-            
+
 #ifndef _DEXCEPT_
           }catch(std::exception& exc){
             MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());