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
This commit is contained in:
eap 2007-02-22 07:25:37 +00:00
parent 3de06f4736
commit b20d6d4b1e
5 changed files with 28 additions and 17 deletions

View File

@ -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 );
}
//=============================================================================

View File

@ -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<TopoDS_Edge> 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<TopoDS_Edge>& 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<UVPtStruct>& 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<const SMDS_EdgePosition*>(node->GetPosition().get());

View File

@ -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<TopoDS_Edge>& 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<uvPtStruct> myPoints, myFalsePoints;
vector<TopoDS_Edge> myEdge;
vector<Handle(Geom2d_Curve)> myC2d;
vector<double> myFirst;
vector<double> myLast;
vector<double> myFirst, myLast;
vector<double> myNormPar;
double myLength;
int myNbPonits, myNbSegments;
SMESH_Mesh* myMesh;
bool myMissingVertexNodes;
bool myMissingVertexNodes, myIgnoreMediumNodes;
};

View File

@ -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();

View File

@ -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,nbSides<TOP_SIDE);
quad->side[nbSides] = new StdMeshers_FaceSide(F, *edgeIt, &aMesh,
nbSides<TOP_SIDE, ignoreMediumNodes);
}
else if ( nbEdgesInWire.front() > 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,nbSides<TOP_SIDE);
quad->side[nbSides] = new StdMeshers_FaceSide(F, sideEdges, &aMesh,
nbSides<TOP_SIDE, ignoreMediumNodes);
++nbSides;
}
}