0021231: EDF 1838 SMESH: Pattern mapping on a quadratic element

fix applying the 2D pattern to quafratic mesh faces
This commit is contained in:
eap 2011-04-26 13:15:40 +00:00
parent 84d055c1b3
commit 67ea75a7dd

View File

@ -2615,8 +2615,9 @@ bool SMESH_Pattern::Apply (const SMDS_MeshFace* theFace,
} }
// check nb of nodes // check nb of nodes
if (theFace->NbNodes() != myNbKeyPntInBoundary.front() ) { const int nbFaceNodes = theFace->NbCornerNodes();
MESSAGE( myKeyPointIDs.size() << " != " << theFace->NbNodes() ); if ( nbFaceNodes != myNbKeyPntInBoundary.front() ) {
MESSAGE( myKeyPointIDs.size() << " != " << nbFaceNodes );
return setErrorCode( ERR_APPL_BAD_NB_VERTICES ); return setErrorCode( ERR_APPL_BAD_NB_VERTICES );
} }
@ -2635,7 +2636,7 @@ bool SMESH_Pattern::Apply (const SMDS_MeshFace* theFace,
list< const SMDS_MeshNode* >::iterator n = nodes.end(); list< const SMDS_MeshNode* >::iterator n = nodes.end();
SMDS_ElemIteratorPtr noIt = theFace->nodesIterator(); SMDS_ElemIteratorPtr noIt = theFace->nodesIterator();
int iSub = 0; int iSub = 0;
while ( noIt->more() ) { while ( noIt->more() && iSub < nbFaceNodes ) {
const SMDS_MeshNode* node = smdsNode( noIt->next() ); const SMDS_MeshNode* node = smdsNode( noIt->next() );
nodes.push_back( node ); nodes.push_back( node );
if ( iSub++ == theNodeIndexOnKeyPoint1 ) if ( iSub++ == theNodeIndexOnKeyPoint1 )
@ -2651,7 +2652,7 @@ bool SMESH_Pattern::Apply (const SMDS_MeshFace* theFace,
nodes.splice( nodes.end(), nodes, nodes.begin(), n ); nodes.splice( nodes.end(), nodes, nodes.begin(), n );
} }
list< gp_XYZ > xyzList; list< gp_XYZ > xyzList;
myOrderedNodes.resize( theFace->NbNodes() ); myOrderedNodes.resize( nbFaceNodes );
for ( iSub = 0, n = nodes.begin(); n != nodes.end(); ++n ) { for ( iSub = 0, n = nodes.begin(); n != nodes.end(); ++n ) {
xyzList.push_back( gp_XYZ( (*n)->X(), (*n)->Y(), (*n)->Z() )); xyzList.push_back( gp_XYZ( (*n)->X(), (*n)->Y(), (*n)->Z() ));
myOrderedNodes[ iSub++] = *n; myOrderedNodes[ iSub++] = *n;
@ -3006,7 +3007,7 @@ bool SMESH_Pattern::Apply (SMESH_Mesh* theMesh,
} }
// put points on links to myIdsOnBoundary, // put points on links to myIdsOnBoundary,
// they will be used to sew new elements on adjacent refined elements // they will be used to sew new elements on adjacent refined elements
int nbNodes = (*face)->NbNodes(), eID = nbNodes + 1; int nbNodes = (*face)->NbCornerNodes(), eID = nbNodes + 1;
for ( int i = 0; i < nbNodes; i++ ) for ( int i = 0; i < nbNodes; i++ )
{ {
list< TPoint* > & linkPoints = getShapePoints( eID++ ); list< TPoint* > & linkPoints = getShapePoints( eID++ );