Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
23413: [CEA 2025] bug SMESH orientation
[modules/smesh.git]
/
src
/
DriverMED
/
DriverMED_R_SMESHDS_Mesh.cxx
diff --git
a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx
b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx
index ba851616c2851908b1dc7c075d991668fad55a39..16c555eaf4723c41a7dfb138aea43e0d6f266f54 100644
(file)
--- a/
src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx
+++ b/
src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-201
5
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-201
6
CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-42,7
+42,7
@@
//#include <stdlib.h>
#ifdef _DEBUG_
//#include <stdlib.h>
#ifdef _DEBUG_
-static int MYDEBUG =
1
;
+static int MYDEBUG =
0
;
//#define _DEXCEPT_
#else
static int MYDEBUG = 0;
//#define _DEXCEPT_
#else
static int MYDEBUG = 0;
@@
-155,7
+155,8
@@
Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
aFamily->SetGroupAttributVal(anAttrVal);
}
if(MYDEBUG) MESSAGE(aGroupName);
aFamily->SetGroupAttributVal(anAttrVal);
}
if(MYDEBUG) MESSAGE(aGroupName);
- aFamily->AddGroupName(aGroupName);
+ if ( strncmp( aGroupName.c_str(), NIG_GROUP_PREFIX, strlen(NIG_GROUP_PREFIX) ) != 0 )
+ aFamily->AddGroupName(aGroupName);
}
aFamily->SetId( aFamId );
myFamilies[aFamId] = aFamily;
}
aFamily->SetId( aFamId );
myFamilies[aFamId] = aFamily;
@@
-172,7
+173,7
@@
Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
//------------------------------------------------------
PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo);
if (!aNodeInfo) {
//------------------------------------------------------
PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo);
if (!aNodeInfo) {
- aResult =
DRS_FAIL
;
+ aResult =
addMessage("No nodes", /*isFatal=*/true )
;
continue;
}
aMeshInfo->myDim=aMeshInfo->mySpaceDim;// ignore meshdim in MEDFile because it can be false
continue;
}
aMeshInfo->myDim=aMeshInfo->mySpaceDim;// ignore meshdim in MEDFile because it can be false
@@
-365,9
+366,9
@@
Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
}
#ifndef _DEXCEPT_
} catch(const std::exception& exc) {
}
#ifndef _DEXCEPT_
} catch(const std::exception& exc) {
- aResult =
DRS_FAIL
;
+ aResult =
addMessage( exc.what(), /*isFatal=*/true )
;
} catch (...) {
} catch (...) {
- aResult =
DRS_FAIL
;
+ aResult =
addMessage( "Unknown exception", /*isFatal=*/true )
;
}
#endif
if ( !anElement ) {
}
#endif
if ( !anElement ) {
@@
-500,7
+501,8
@@
Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
default:;
}
vector<TInt> aNodeIds(aNbNodes);
default:;
}
vector<TInt> aNodeIds(aNbNodes);
- for(int iElem = 0; iElem < aNbElems; iElem++){
+ for ( int iElem = 0; iElem < aNbElems; iElem++ )
+ {
bool anIsValidConnect = false;
TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem);
#ifndef _DEXCEPT_
bool anIsValidConnect = false;
TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem);
#ifndef _DEXCEPT_
@@
-521,10
+523,10
@@
Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
#ifndef _DEXCEPT_
}catch(const std::exception& exc){
INFOS("Following exception was caught:\n\t"<<exc.what());
#ifndef _DEXCEPT_
}catch(const std::exception& exc){
INFOS("Following exception was caught:\n\t"<<exc.what());
- aResult =
DRS_FAIL
;
+ aResult =
addMessage( exc.what(), /*isFatal=*/true )
;
}catch(...){
INFOS("Unknown exception was caught !!!");
}catch(...){
INFOS("Unknown exception was caught !!!");
- aResult =
DRS_FAIL
;
+ aResult =
addMessage( "Unknown exception", /*isFatal=*/true )
;
}
#endif
if(!anIsValidConnect)
}
#endif
if(!anIsValidConnect)
@@
-950,17
+952,19
@@
Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
}
break;
}
break;
+ default:;
+
} // switch(aGeom)
#ifndef _DEXCEPT_
} // switch(aGeom)
#ifndef _DEXCEPT_
- }
catch(const std::exception& exc)
{
+ }
catch(const std::exception& exc)
{
INFOS("The following exception was caught:\n\t"<<exc.what());
INFOS("The following exception was caught:\n\t"<<exc.what());
- aResult =
DRS_FAIL
;
- }
catch(...)
{
+ aResult =
addMessage( exc.what(), /*isFatal=*/true )
;
+ }
catch(...)
{
INFOS("Unknown exception was caught !!!");
INFOS("Unknown exception was caught !!!");
- aResult =
DRS_FAIL
;
+ aResult =
addMessage( "Unknown exception", /*isFatal=*/true )
;
}
}
-#endif
+#endif
if (!anElement) {
aResult = DRS_WARN_SKIP_ELEM;
}
if (!anElement) {
aResult = DRS_WARN_SKIP_ELEM;
}
@@
-973,27
+977,29
@@
Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
}
if ( DriverMED::checkFamilyID ( aFamily, aFamNum, myFamilies )) {
// Save reference to this element from its family
}
if ( DriverMED::checkFamilyID ( aFamily, aFamNum, myFamilies )) {
// Save reference to this element from its family
-
myFamilies[aFamNum]
->AddElement(anElement);
-
myFamilies[aFamNum]
->SetType(anElement->GetType());
+
aFamily
->AddElement(anElement);
+
aFamily
->SetType(anElement->GetType());
}
}
}
}
- }
- }}
- }
- }
+ } // loop on aNbElems
+ }} // switch(aGeom)
+ } // loop on aGeom2Size
+ } // loop on aEntityInfo
+
if (aDescendingEntitiesMap.Extent()) isDescConn = true; // Mantis issue 0020483
if (aDescendingEntitiesMap.Extent()) isDescConn = true; // Mantis issue 0020483
+
} // for(int iMesh = 0; iMesh < aNbMeshes; iMesh++)
#ifndef _DEXCEPT_
}
catch(const std::exception& exc)
{
INFOS("The following exception was caught:\n\t"<<exc.what());
} // for(int iMesh = 0; iMesh < aNbMeshes; iMesh++)
#ifndef _DEXCEPT_
}
catch(const std::exception& exc)
{
INFOS("The following exception was caught:\n\t"<<exc.what());
- aResult =
DRS_FAIL
;
+ aResult =
addMessage( exc.what(), /*isFatal=*/true )
;
}
catch(...)
{
INFOS("Unknown exception was caught !!!");
}
catch(...)
{
INFOS("Unknown exception was caught !!!");
- aResult =
DRS_FAIL
;
+ aResult =
addMessage( "Unknown exception", /*isFatal=*/true )
;
}
#endif
if (myMesh)
}
#endif
if (myMesh)
@@
-1076,8
+1082,8
@@
void DriverMED_R_SMESHDS_Mesh::GetGroup(SMESHDS_Group* theGroup)
DriverMED_FamilyPtr aFamily = (*aFamsIter).second;
if (aFamily->GetTypes().count( theGroup->GetType() ) && aFamily->MemberOf(aGroupName))
{
DriverMED_FamilyPtr aFamily = (*aFamsIter).second;
if (aFamily->GetTypes().count( theGroup->GetType() ) && aFamily->MemberOf(aGroupName))
{
- const
set<const SMDS_MeshElement *>&
anElements = aFamily->GetElements();
-
set<const SMDS_MeshElement *>
::const_iterator anElemsIter = anElements.begin();
+ const
ElementsSet&
anElements = aFamily->GetElements();
+
ElementsSet
::const_iterator anElemsIter = anElements.begin();
for (; anElemsIter != anElements.end(); anElemsIter++)
{
const SMDS_MeshElement * element = *anElemsIter;
for (; anElemsIter != anElements.end(); anElemsIter++)
{
const SMDS_MeshElement * element = *anElemsIter;
@@
-1105,8
+1111,8
@@
void DriverMED_R_SMESHDS_Mesh::GetSubMesh (SMESHDS_SubMesh* theSubMesh,
DriverMED_FamilyPtr aFamily = (*aFamsIter).second;
if (aFamily->MemberOf(aName))
{
DriverMED_FamilyPtr aFamily = (*aFamsIter).second;
if (aFamily->MemberOf(aName))
{
- const
set<const SMDS_MeshElement *>&
anElements = aFamily->GetElements();
-
set<const SMDS_MeshElement *>
::const_iterator anElemsIter = anElements.begin();
+ const
ElementsSet&
anElements = aFamily->GetElements();
+
ElementsSet
::const_iterator anElemsIter = anElements.begin();
if (aFamily->GetType() == SMDSAbs_Node)
{
for (; anElemsIter != anElements.end(); anElemsIter++)
if (aFamily->GetType() == SMDSAbs_Node)
{
for (; anElemsIter != anElements.end(); anElemsIter++)
@@
-1141,14
+1147,13
@@
void DriverMED_R_SMESHDS_Mesh::CreateAllSubMeshes ()
if (aName.substr(0, 7) == string("SubMesh"))
{
int Id = atoi(string(aName).substr(7).c_str());
if (aName.substr(0, 7) == string("SubMesh"))
{
int Id = atoi(string(aName).substr(7).c_str());
-
set<const SMDS_MeshElement *>
anElements = aFamily->GetElements();
-
set<const SMDS_MeshElement *>::
iterator anElemsIter = anElements.begin();
+
const ElementsSet&
anElements = aFamily->GetElements();
+
ElementsSet::const_
iterator anElemsIter = anElements.begin();
if (aFamily->GetType() == SMDSAbs_Node)
{
for (; anElemsIter != anElements.end(); anElemsIter++)
{
if (aFamily->GetType() == SMDSAbs_Node)
{
for (; anElemsIter != anElements.end(); anElemsIter++)
{
- SMDS_MeshNode* node = const_cast<SMDS_MeshNode*>
- ( static_cast<const SMDS_MeshNode*>( *anElemsIter ));
+ const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( *anElemsIter );
// find out a shape type
TopoDS_Shape aShape = myMesh->IndexToShape( Id );
int aShapeType = ( aShape.IsNull() ? -1 : aShape.ShapeType() );
// find out a shape type
TopoDS_Shape aShape = myMesh->IndexToShape( Id );
int aShapeType = ( aShape.IsNull() ? -1 : aShape.ShapeType() );