From f6da709a6f7f475cf69dc174bfdb688b2de353db Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 10 May 2011 13:30:19 +0000 Subject: [PATCH] 0021238: EDF 1817 SMESH: GHS3D on quadratic meshes not to create nodes inside already meshed domains of imported mesh --- src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx | 28 ++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx index 6ec26e4..6e438fe 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx @@ -1046,7 +1046,7 @@ static bool readGMFFile(const char* theFile, else continue; - int id[nbElem*tabRef[token]]; // node ids + vector id (nbElem*tabRef[token]); // node ids if (token == GmfVertices) { std::cout << " vertices" << std::endl; @@ -1086,12 +1086,34 @@ static bool readGMFFile(const char* theFile, if (ver == GmfFloat) { GmfGetLin(InpMsh, token, &VerTab_f[nbElem][0], &VerTab_f[nbElem][1], &VerTab_f[nbElem][2], &dummy); if (iElem >= nbInitialNodes) - aGMFNode = theMeshDS->AddNode(VerTab_f[nbElem][0], VerTab_f[nbElem][1], VerTab_f[nbElem][2]); + { + if ( elemSearcher && + elemSearcher->FindElementsByPoint( gp_Pnt(VerTab_f[nbElem][0], + VerTab_f[nbElem][1], + VerTab_f[nbElem][2]), + SMDSAbs_Volume, foundVolumes )) + aGMFNode = 0; + else + aGMFNode = theMeshDS->AddNode(VerTab_f[nbElem][0], + VerTab_f[nbElem][1], + VerTab_f[nbElem][2]); + } } else { GmfGetLin(InpMsh, token, &VerTab_d[nbElem][0], &VerTab_d[nbElem][1], &VerTab_d[nbElem][2], &dummy); if (iElem >= nbInitialNodes) - aGMFNode = theMeshDS->AddNode(VerTab_d[nbElem][0], VerTab_d[nbElem][1], VerTab_d[nbElem][2]); + { + if ( elemSearcher && + elemSearcher->FindElementsByPoint( gp_Pnt(VerTab_d[nbElem][0], + VerTab_d[nbElem][1], + VerTab_d[nbElem][2]), + SMDSAbs_Volume, foundVolumes )) + aGMFNode = 0; + else + aGMFNode = theMeshDS->AddNode(VerTab_d[nbElem][0], + VerTab_d[nbElem][1], + VerTab_d[nbElem][2]); + } } if (iElem >= nbInitialNodes) { GMFNode[ aGMFID ] = aGMFNode; -- 2.39.2