From e0b96649a7177f616aa614951b9f6dc605bdc6ac Mon Sep 17 00:00:00 2001 From: jfa Date: Fri, 25 Jan 2013 13:48:38 +0000 Subject: [PATCH] Mantis issue 0020483: EDF 1117 SMESH,VISU: Mesh with descending connectivity is badly read by SMESH and VISU --- src/CONVERTOR/VISU_MedConvertor.cxx | 30 +++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/CONVERTOR/VISU_MedConvertor.cxx b/src/CONVERTOR/VISU_MedConvertor.cxx index 9f82a50e..2655e35f 100644 --- a/src/CONVERTOR/VISU_MedConvertor.cxx +++ b/src/CONVERTOR/VISU_MedConvertor.cxx @@ -1454,31 +1454,45 @@ VISU_MedConvertor aMesh->myName = aMeshName; aMesh->myMeshInfo = aMeshInfo; aMesh->myNamedPointCoords(new VISU::TMEDNamedPointCoords()); - + INITMSG(MYDEBUG,"aMeshName = '"<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 = "<myNbPoints<< "; anEntityInfo.size() = "<