From: eap Date: Tue, 3 May 2011 09:12:30 +0000 (+0000) Subject: 0021238: EDF 1817 SMESH: GHS3D on quadratic meshes X-Git-Tag: V6_3_0~27 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b9a882754e1b854ff648ca638ba45a2db89b361f;p=plugins%2Fhybridplugin.git 0021238: EDF 1817 SMESH: GHS3D on quadratic meshes partial fix after Gilles David modifs --- diff --git a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx index c726643..ccd012b 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx @@ -1586,7 +1586,7 @@ static bool writeGMFFile(const char* theMeshFileName, elem = (*elemIt); nodeIt = elem->nodesIterator(); int index=0; - while ( nodeIt->more() ) { + for ( int j = 0; j < 3; ++j ) { // find GHS3D ID const SMDS_MeshNode* node = castToNode( nodeIt->next() ); map< const SMDS_MeshNode*,int >::iterator it = aNodeToGhs3dIdMap.find(node); @@ -1603,7 +1603,7 @@ static bool writeGMFFile(const char* theMeshFileName, elem = (*elemIt); nodeIt = elem->nodesIterator(); int index=0; - while ( nodeIt->more() ) { + for ( int j = 0; j < 3; ++j ) { // find GHS3D ID const SMDS_MeshNode* node = castToNode( nodeIt->next() ); map< const SMDS_MeshNode*,int >::iterator it = anEnforcedNodeToGhs3dIdMap.find(node); @@ -1630,7 +1630,7 @@ static bool writeGMFFile(const char* theMeshFileName, elem = (*elemIt); nodeIt = elem->nodesIterator(); int index=0; - while ( nodeIt->more() ) { + for ( int j = 0; j < 4; ++j ) { // find GHS3D ID const SMDS_MeshNode* node = castToNode( nodeIt->next() ); map< const SMDS_MeshNode*,int >::iterator it = anEnforcedNodeToGhs3dIdMap.find(node); @@ -1863,12 +1863,12 @@ static bool writeGMFFile(const char* theMeshFileName, while (it->more()) { const SMDS_MeshElement *elem = it->next(); - if (elem->NbNodes() == 3) + if (elem->NbCornerNodes() == 3) { trianglesMap.Add(facesMap(i)); nbTriangles ++; } - else if (elem->NbNodes() == 4) + else if (elem->NbCornerNodes() == 4) { quadranglesMap.Add(facesMap(i)); nbQuadrangles ++; @@ -1889,7 +1889,7 @@ static bool writeGMFFile(const char* theMeshFileName, aFace = itOnSubMesh->next(); itOnSubFace = aFace->nodesIterator(); att.clear(); - while ( itOnSubFace->more() ) { + for ( int j = 0; j < 3; ++j ) { // find GHS3D ID aSmdsID = itOnSubFace->next()->GetID(); itOnMap = theSmdsToGhs3dIdMap.find( aSmdsID ); @@ -1908,7 +1908,7 @@ static bool writeGMFFile(const char* theMeshFileName, bool isOK = true; itOnSubFace = aFace->nodesIterator(); att.clear(); - while ( itOnSubFace->more() ) { + for ( int j = 0; j < 3; ++j ) { int aNodeID = itOnSubFace->next()->GetID(); itOnMap = theNodeId2NodeIndexMap.find(aNodeID); if (itOnMap != theNodeId2NodeIndexMap.end()) @@ -1923,13 +1923,13 @@ static bool writeGMFFile(const char* theMeshFileName, tt.push_back(att); } } - + if (tt.size()) { GmfSetKwd(idx, GmfTriangles, tt.size()); for (int i=0;iGetElements(); - while ( itOnSubMesh->more() ) + for ( int j = 0; j < 4; ++j ) { aFace = itOnSubMesh->next(); itOnSubFace = aFace->nodesIterator(); @@ -1962,7 +1962,7 @@ static bool writeGMFFile(const char* theMeshFileName, bool isOK = true; itOnSubFace = aFace->nodesIterator(); aqt.clear(); - while ( itOnSubFace->more() ) { + for ( int j = 0; j < 4; ++j ) { int aNodeID = itOnSubFace->next()->GetID(); itOnMap = theNodeId2NodeIndexMap.find(aNodeID); if (itOnMap != theNodeId2NodeIndexMap.end()) @@ -1994,7 +1994,7 @@ static bool writeGMFFile(const char* theMeshFileName, bool isOK = true; itOnSubFace = aFace->nodesIterator(); aet.clear(); - while ( itOnSubFace->more() ) { + for ( int j = 0; j < 2; ++j ) { int aNodeID = itOnSubFace->next()->GetID(); itOnMap = theNodeId2NodeIndexMap.find(aNodeID); if (itOnMap != theNodeId2NodeIndexMap.end())