0021238: EDF 1817 SMESH: GHS3D on quadratic meshes

enhance IsQuadraticSubMesh() for the mesh w/o shape
This commit is contained in:
eap 2011-04-22 16:08:20 +00:00
parent 8aec90a5df
commit 3fb9c77ac1

View File

@ -123,8 +123,22 @@ bool SMESH_MesherHelper::IsQuadraticSubMesh(const TopoDS_Shape& aSh)
int nbOldLinks = myTLinkNodeMap.size();
if ( !myMesh->HasShapeToMesh() )
{
if (( myCreateQuadratic = myMesh->NbFaces( ORDER_QUADRATIC )))
{
SMDS_FaceIteratorPtr fIt = meshDS->facesIterator();
while ( fIt->more() )
AddTLinks( static_cast< const SMDS_MeshFace* >( fIt->next() ));
}
}
else
{
TopExp_Explorer exp( aSh, subType );
TopTools_MapOfShape checkedSubShapes;
for (; exp.More() && myCreateQuadratic; exp.Next()) {
if ( !checkedSubShapes.Add( exp.Current() ))
continue; // needed if aSh is compound of solids
if ( SMESHDS_SubMesh * subMesh = meshDS->MeshElements( exp.Current() )) {
if ( SMDS_ElemIteratorPtr it = subMesh->GetElements() ) {
while(it->more()) {
@ -157,6 +171,7 @@ bool SMESH_MesherHelper::IsQuadraticSubMesh(const TopoDS_Shape& aSh)
}
}
}
}
if ( nbOldLinks == myTLinkNodeMap.size() )
myCreateQuadratic = false;
@ -334,18 +349,20 @@ void SMESH_MesherHelper::AddTLinks(const SMDS_MeshEdge* edge)
*/
//================================================================================
void SMESH_MesherHelper::AddTLinks(const SMDS_MeshFace* face)
void SMESH_MesherHelper::AddTLinks(const SMDS_MeshFace* f)
{
if ( face->IsQuadratic() )
{
const int nbLinks = face->NbCornerNodes();
for ( int i = 0; i < nbLinks; ++i )
{
const SMDS_MeshNode* n1 = face->GetNode( i );
const SMDS_MeshNode* n2 = face->GetNode(( i + 1 ) % nbLinks );
const SMDS_MeshNode* n12 = face->GetNode( i + nbLinks );
AddTLinkNode( n1, n2, n12 );
}
if ( !f->IsPoly() )
switch ( f->NbNodes() ) {
case 6:
AddTLinkNode(f->GetNode(0),f->GetNode(1),f->GetNode(3));
AddTLinkNode(f->GetNode(1),f->GetNode(2),f->GetNode(4));
AddTLinkNode(f->GetNode(2),f->GetNode(0),f->GetNode(5)); break;
case 8:
AddTLinkNode(f->GetNode(0),f->GetNode(1),f->GetNode(4));
AddTLinkNode(f->GetNode(1),f->GetNode(2),f->GetNode(5));
AddTLinkNode(f->GetNode(2),f->GetNode(3),f->GetNode(6));
AddTLinkNode(f->GetNode(3),f->GetNode(0),f->GetNode(7));
default:;
}
}