From: eap Date: Fri, 22 Dec 2017 11:23:55 +0000 (+0300) Subject: 23418: [OCC] Mesh: Minimization of memory usage of SMESH X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=da8df69dce4ea15c1902f11e9eb4bdcbf011d8cf;p=plugins%2Fhybridplugin.git 23418: [OCC] Mesh: Minimization of memory usage of SMESH --- diff --git a/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.cxx b/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.cxx index f7ea3f6..2f1c1f4 100644 --- a/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.cxx +++ b/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.cxx @@ -611,7 +611,7 @@ static bool readGMFFile(MG_HYBRID_API* MGOutput, if (fullyCreatedElement) { aCreatedElem = theHelper->AddFace( node[0], node[1], node[2], noID, force3d ); // add iElem < aFaceGroupByHybridId.size() to avoid crash if imprinting with hexa core with MeshGems <= 2.4-5 - if ( !aFaceGroupByHybridId.empty() && iElem < aFaceGroupByHybridId.size() && !aFaceGroupByHybridId[iElem].empty() ) { + if ( iElem < (int)aFaceGroupByHybridId.size() && !aFaceGroupByHybridId[iElem].empty() ) { addElemInMeshGroup(theHelper->GetMesh(), aCreatedElem, aFaceGroupByHybridId[iElem], groupsToRemove); } // add element in shape for groups on geom to work diff --git a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.cxx b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.cxx index 3d99a62..c53fe06 100644 --- a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.cxx +++ b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.cxx @@ -906,14 +906,6 @@ bool HYBRIDPlugin_Hypothesis::SetEnforcedElements(TIDSortedElemSet theElemSet, S elemRet = _enfEdges.insert(make_pair(elem,groupName)); added = added && elemRet.second; } - else if (elem->GetType() > SMDSAbs_Edge) { - SMDS_ElemIteratorPtr it = elem->edgesIterator(); - for (;it->more();) { - const SMDS_MeshElement* anEdge = it->next(); - elemRet = _enfEdges.insert(make_pair(anEdge,groupName)); - added = added && elemRet.second; - } - } break; case SMESH::FACE: if (elem->GetType() == SMDSAbs_Face) @@ -923,16 +915,6 @@ bool HYBRIDPlugin_Hypothesis::SetEnforcedElements(TIDSortedElemSet theElemSet, S added = added && elemRet.second; } } - else if (elem->GetType() > SMDSAbs_Face) { // Group of faces - SMDS_ElemIteratorPtr it = elem->facesIterator(); - for (;it->more();) { - const SMDS_MeshElement* aFace = it->next(); - if (aFace->NbCornerNodes() == 3) { - elemRet = _enfTriangles.insert(make_pair(aFace,groupName)); - added = added && elemRet.second; - } - } - } break; default: break; diff --git a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.hxx b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.hxx index f732da8..2862586 100644 --- a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.hxx +++ b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.hxx @@ -111,7 +111,7 @@ public: struct TIDMeshIDCompare { bool operator () (const SMDS_MeshElement* e1, const SMDS_MeshElement* e2) const - { return e1->getMeshId() == e2->getMeshId() ? e1->GetID() < e2->GetID() : e1->getMeshId() < e2->getMeshId() ; } + { return e1->GetMesh() == e2->GetMesh() ? e1->GetID() < e2->GetID() : e1->GetMesh() < e2->GetMesh(); } }; typedef std::map TIDSortedElemGroupMap;