From: eap Date: Thu, 22 Feb 2007 07:25:37 +0000 (+0000) Subject: PAL13615 (EDF PAL 315/31 GEOM SMESH : meshing of a "5 edges quadrangle") X-Git-Tag: V3_2_6a1~46 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b20d6d4b1e726a3724f3b7cf0779c263dbbb844e;p=modules%2Fsmesh.git PAL13615 (EDF PAL 315/31 GEOM SMESH : meshing of a "5 edges quadrangle") take into account medium nodes if not all edges have equadratic elements --- diff --git a/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx b/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx index 4540ef2a4..0f0a2411b 100644 --- a/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx +++ b/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx @@ -292,7 +292,7 @@ StdMeshers_CompositeSegment_1D::GetFaceSide(SMESH_Mesh& aMesh, eNext = nextC1Edge( eNext, aMesh, forward ); } } - return new StdMeshers_FaceSide( aFace, edges, &aMesh, true ); + return new StdMeshers_FaceSide( aFace, edges, &aMesh, true, false ); } //============================================================================= diff --git a/src/StdMeshers/StdMeshers_FaceSide.cxx b/src/StdMeshers/StdMeshers_FaceSide.cxx index b83bfb4b0..081d2a79f 100644 --- a/src/StdMeshers/StdMeshers_FaceSide.cxx +++ b/src/StdMeshers/StdMeshers_FaceSide.cxx @@ -61,10 +61,11 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace, const TopoDS_Edge& theEdge, SMESH_Mesh* theMesh, - const bool theIsForward) + const bool theIsForward, + const bool theIgnoreMediumNodes) { list edges(1,theEdge); - *this = StdMeshers_FaceSide( theFace, edges, theMesh, theIsForward ); + *this = StdMeshers_FaceSide( theFace, edges, theMesh, theIsForward, theIgnoreMediumNodes ); } //================================================================================ @@ -78,7 +79,8 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace, StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace, list& theEdges, SMESH_Mesh* theMesh, - const bool theIsForward) + const bool theIsForward, + const bool theIgnoreMediumNodes) { int nbEdges = theEdges.size(); myEdge.resize( nbEdges ); @@ -90,6 +92,7 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace, myNbPonits = myNbSegments = 0; myMesh = theMesh; myMissingVertexNodes = false; + myIgnoreMediumNodes = theIgnoreMediumNodes; if ( nbEdges == 0 ) return; SMESHDS_Mesh* meshDS = theMesh->GetMeshDS(); @@ -115,9 +118,11 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace, if ( SMESHDS_SubMesh* sm = meshDS->MeshElements( *edge )) { int nbN = sm->NbNodes(); - SMDS_ElemIteratorPtr elemIt = sm->GetElements(); - if ( elemIt->more() && elemIt->next()->IsQuadratic() ) - nbN -= sm->NbElements(); + if ( theIgnoreMediumNodes ) { + SMDS_ElemIteratorPtr elemIt = sm->GetElements(); + if ( elemIt->more() && elemIt->next()->IsQuadratic() ) + nbN -= sm->NbElements(); + } myNbPonits += nbN; myNbSegments += sm->NbElements(); } @@ -199,7 +204,7 @@ const vector& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst, double paramSize = myLast[i] - myFirst[i], r = myNormPar[i] - prevNormPar; while ( nItr->more() ) { const SMDS_MeshNode* node = nItr->next(); - if ( SMESH_MeshEditor::IsMedium( node, SMDSAbs_Edge )) + if ( myIgnoreMediumNodes && SMESH_MeshEditor::IsMedium( node, SMDSAbs_Edge )) continue; const SMDS_EdgePosition* epos = static_cast(node->GetPosition().get()); diff --git a/src/StdMeshers/StdMeshers_FaceSide.hxx b/src/StdMeshers/StdMeshers_FaceSide.hxx index 4320bccdc..c1fdd5958 100644 --- a/src/StdMeshers/StdMeshers_FaceSide.hxx +++ b/src/StdMeshers/StdMeshers_FaceSide.hxx @@ -78,14 +78,16 @@ public: StdMeshers_FaceSide(const TopoDS_Face& theFace, const TopoDS_Edge& theEdge, SMESH_Mesh* theMesh, - const bool theIsForward); + const bool theIsForward, + const bool theIgnoreMediumNodes); /*! * \brief Wrap several edges. Edges must be properly ordered and oriented. */ StdMeshers_FaceSide(const TopoDS_Face& theFace, list& theEdges, SMESH_Mesh* theMesh, - const bool theIsForward); + const bool theIsForward, + const bool theIgnoreMediumNodes); /*! * \brief Change orientation of side geometry */ @@ -180,13 +182,12 @@ protected: vector myPoints, myFalsePoints; vector myEdge; vector myC2d; - vector myFirst; - vector myLast; + vector myFirst, myLast; vector myNormPar; double myLength; int myNbPonits, myNbSegments; SMESH_Mesh* myMesh; - bool myMissingVertexNodes; + bool myMissingVertexNodes, myIgnoreMediumNodes; }; diff --git a/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx b/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx index 942f5fa74..db356207e 100644 --- a/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx +++ b/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx @@ -178,6 +178,7 @@ bool StdMeshers_MEFISTO_2D::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aSh MESSAGE("StdMeshers_MEFISTO_2D::Compute"); TopoDS_Face F = TopoDS::Face(aShape.Oriented(TopAbs_FORWARD)); + const bool ignoreMediumNodes = _quadraticMesh; // get all edges of a face TopoDS_Vertex V1; @@ -208,7 +209,8 @@ bool StdMeshers_MEFISTO_2D::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aSh return false; } } - StdMeshers_FaceSide* wire = new StdMeshers_FaceSide( F, wireEdges, &aMesh, true ); + StdMeshers_FaceSide* wire = new StdMeshers_FaceSide( F, wireEdges, &aMesh, + true, ignoreMediumNodes); wires[ iW ] = StdMeshers_FaceSidePtr( wire ); if (_hypLengthFromEdges && wire->NbSegments() ) _edgeLength += wire->Length() / wire->NbSegments(); diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx index 52a35e8f0..79e56a799 100644 --- a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx +++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx @@ -565,6 +565,7 @@ FaceQuadStruct* StdMeshers_Quadrangle_2D::CheckNbEdges(SMESH_Mesh & aMes Unexpect aCatch(SalomeException); const TopoDS_Face & F = TopoDS::Face(aShape); + const bool ignoreMediumNodes = _quadraticMesh; // verify 1 wire only, with 4 edges TopoDS_Vertex V; @@ -584,9 +585,10 @@ FaceQuadStruct* StdMeshers_Quadrangle_2D::CheckNbEdges(SMESH_Mesh & aMes list< TopoDS_Edge >::iterator edgeIt = edges.begin(); if ( nbEdgesInWire.front() == 4 ) { // exactly 4 edges for ( ; edgeIt != edges.end(); ++edgeIt, nbSides++ ) - quad->side[nbSides] = new StdMeshers_FaceSide(F,*edgeIt,&aMesh,nbSidesside[nbSides] = new StdMeshers_FaceSide(F, *edgeIt, &aMesh, + nbSides 4 ) { // more than 4 edges - try to unite + else if ( nbEdgesInWire.front() > 4 ) { // more than 4 edges - try to unite some list< TopoDS_Edge > sideEdges; while ( edgeIt != edges.end()) { sideEdges.clear(); @@ -598,7 +600,8 @@ FaceQuadStruct* StdMeshers_Quadrangle_2D::CheckNbEdges(SMESH_Mesh & aMes if ( sameSide ) sideEdges.push_back( *edgeIt++ ); } - quad->side[nbSides] = new StdMeshers_FaceSide(F,sideEdges,&aMesh,nbSidesside[nbSides] = new StdMeshers_FaceSide(F, sideEdges, &aMesh, + nbSides