From: eap Date: Wed, 20 May 2009 15:45:54 +0000 (+0000) Subject: 0020279: [CEA 334] control the "random" use when using mesh algorithms X-Git-Tag: V4_1_0_maintainance_FINAL~77 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ea67c67df5bd1fe9c086b860e749bbe085bee15a;p=modules%2Fsmesh.git 0020279: [CEA 334] control the "random" use when using mesh algorithms fix for SIGSEGV on quadratic mesh --- diff --git a/src/StdMeshers/StdMeshers_Penta_3D.cxx b/src/StdMeshers/StdMeshers_Penta_3D.cxx index 93bb7fd5c..3ff7db018 100644 --- a/src/StdMeshers/StdMeshers_Penta_3D.cxx +++ b/src/StdMeshers/StdMeshers_Penta_3D.cxx @@ -34,7 +34,7 @@ #include "SMDS_VolumeTool.hxx" #include "SMESHDS_SubMesh.hxx" #include "SMESH_Mesh.hxx" -#include "SMESH_MeshEditor.hxx" +#include "SMESH_MesherHelper.hxx" #include "SMESH_subMesh.hxx" #include "SMESH_subMeshEventListener.hxx" #include "SMESH_Comment.hxx" @@ -103,10 +103,6 @@ bool StdMeshers_Penta_3D::Compute(SMESH_Mesh& aMesh, return bOK; } - SMESH_MesherHelper helper(aMesh); - myTool = &helper; - myCreateQuadratic = myTool->IsQuadraticSubMesh(aShape); - // MakeBlock(); if (!myErrorStatus->IsOK()) { @@ -117,6 +113,12 @@ bool StdMeshers_Penta_3D::Compute(SMESH_Mesh& aMesh, if (!myErrorStatus->IsOK()) { return bOK; } + + // now unnecessary faces removed, we can load medium nodes + SMESH_MesherHelper helper(aMesh); + myTool = &helper; + myCreateQuadratic = myTool->IsQuadraticSubMesh(aShape); + // MakeNodes(); if (!myErrorStatus->IsOK()) { @@ -805,8 +807,6 @@ void StdMeshers_Penta_3D::MakeMeshOnFxy1() TopoDS::Face(myBlock.Shape(SMESH_Block::ID_Fxy0)); const TopoDS_Face& aFxy1= TopoDS::Face(myBlock.Shape(SMESH_Block::ID_Fxy1)); - SMESH_MesherHelper faceHelper( *GetMesh() ); - faceHelper.IsQuadraticSubMesh(aFxy1); // SMESH_Mesh* pMesh = GetMesh(); SMESHDS_Mesh * meshDS = pMesh->GetMeshDS(); @@ -861,10 +861,10 @@ void StdMeshers_Penta_3D::MakeMeshOnFxy1() SMDS_MeshFace * face = 0; switch ( aNbNodes ) { case 3: - face = faceHelper.AddFace(aNodes1[0], aNodes1[1], aNodes1[2]); + face = myTool->AddFace(aNodes1[0], aNodes1[1], aNodes1[2]); break; case 4: - face = faceHelper.AddFace(aNodes1[0], aNodes1[1], aNodes1[2], aNodes1[3]); + face = myTool->AddFace(aNodes1[0], aNodes1[1], aNodes1[2], aNodes1[3]); break; default: continue; @@ -1067,7 +1067,7 @@ void StdMeshers_Penta_3D::MakeBlock() aElementType = pElement->GetType(); if (aElementType==SMDSAbs_Face) { iNbNodes = pElement->NbNodes(); - if ( iNbNodes==3 || (myCreateQuadratic && iNbNodes==6) ) { + if ( iNbNodes==3 || (pElement->IsQuadratic() && iNbNodes==6) ) { aFTr = aF; ++iCnt; if (iCnt>1) {