mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-29 05:20:34 +05:00
0022362: EDF SMESH: Quadrangle (mapping) algorithm: enforced vertices
This commit is contained in:
parent
8b7bc04906
commit
57d9686940
@ -222,8 +222,8 @@ namespace
|
|||||||
* \brief Finds FaceQuadStruct having a side equal to a given one and rearranges
|
* \brief Finds FaceQuadStruct having a side equal to a given one and rearranges
|
||||||
* the found FaceQuadStruct::side to have the given side at a Q_BOTTOM place
|
* the found FaceQuadStruct::side to have the given side at a Q_BOTTOM place
|
||||||
*/
|
*/
|
||||||
FaceQuadStructPtr getQuadWithBottom( StdMeshers_FaceSide* side,
|
FaceQuadStructPtr getQuadWithBottom( StdMeshers_FaceSidePtr side,
|
||||||
FaceQuadStructPtr quad[ 6 ])
|
FaceQuadStructPtr quad[ 6 ])
|
||||||
{
|
{
|
||||||
FaceQuadStructPtr foundQuad;
|
FaceQuadStructPtr foundQuad;
|
||||||
for ( int i = 1; i < 6; ++i )
|
for ( int i = 1; i < 6; ++i )
|
||||||
@ -231,7 +231,7 @@ namespace
|
|||||||
if ( !quad[i] ) continue;
|
if ( !quad[i] ) continue;
|
||||||
for ( unsigned iS = 0; iS < quad[i]->side.size(); ++iS )
|
for ( unsigned iS = 0; iS < quad[i]->side.size(); ++iS )
|
||||||
{
|
{
|
||||||
const StdMeshers_FaceSide* side2 = quad[i]->side[iS];
|
const StdMeshers_FaceSidePtr side2 = quad[i]->side[iS];
|
||||||
if (( side->FirstVertex().IsSame( side2->FirstVertex() ) ||
|
if (( side->FirstVertex().IsSame( side2->FirstVertex() ) ||
|
||||||
side->FirstVertex().IsSame( side2->LastVertex() ))
|
side->FirstVertex().IsSame( side2->LastVertex() ))
|
||||||
&&
|
&&
|
||||||
@ -241,7 +241,7 @@ namespace
|
|||||||
{
|
{
|
||||||
if ( iS != Q_BOTTOM )
|
if ( iS != Q_BOTTOM )
|
||||||
{
|
{
|
||||||
vector< StdMeshers_FaceSide*> newSides;
|
vector< FaceQuadStruct::Side > newSides;
|
||||||
for ( unsigned j = iS; j < quad[i]->side.size(); ++j )
|
for ( unsigned j = iS; j < quad[i]->side.size(); ++j )
|
||||||
newSides.push_back( quad[i]->side[j] );
|
newSides.push_back( quad[i]->side[j] );
|
||||||
for ( unsigned j = 0; j < iS; ++j )
|
for ( unsigned j = 0; j < iS; ++j )
|
||||||
@ -391,7 +391,7 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh & aMesh,
|
|||||||
for ( int i = 0; i < 6; ++i )
|
for ( int i = 0; i < 6; ++i )
|
||||||
{
|
{
|
||||||
const TopoDS_Face& F = aCubeSide[i]._quad->face;
|
const TopoDS_Face& F = aCubeSide[i]._quad->face;
|
||||||
StdMeshers_FaceSide* baseQuadSide = aCubeSide[i]._quad->side[ Q_BOTTOM ];
|
StdMeshers_FaceSidePtr baseQuadSide = aCubeSide[i]._quad->side[ Q_BOTTOM ];
|
||||||
list<TopoDS_Edge> baseEdges( baseQuadSide->Edges().begin(), baseQuadSide->Edges().end() );
|
list<TopoDS_Edge> baseEdges( baseQuadSide->Edges().begin(), baseQuadSide->Edges().end() );
|
||||||
|
|
||||||
// assure correctness of node positions on baseE:
|
// assure correctness of node positions on baseE:
|
||||||
|
@ -107,7 +107,7 @@ namespace {
|
|||||||
algo->myProxyMesh->GetMesh() != helper->GetMesh() )
|
algo->myProxyMesh->GetMesh() != helper->GetMesh() )
|
||||||
algo->myProxyMesh.reset( new SMESH_ProxyMesh( *helper->GetMesh() ));
|
algo->myProxyMesh.reset( new SMESH_ProxyMesh( *helper->GetMesh() ));
|
||||||
|
|
||||||
algo->myQuadStruct.reset();
|
algo->myQuadList.clear();
|
||||||
|
|
||||||
if ( helper )
|
if ( helper )
|
||||||
algo->_quadraticMesh = helper->GetIsQuadratic();
|
algo->_quadraticMesh = helper->GetIsQuadratic();
|
||||||
@ -166,15 +166,15 @@ namespace {
|
|||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
bool setBottomEdge( const TopoDS_Edge& botE,
|
bool setBottomEdge( const TopoDS_Edge& botE,
|
||||||
faceQuadStruct::Ptr& quad,
|
FaceQuadStruct::Ptr& quad,
|
||||||
const TopoDS_Shape& face)
|
const TopoDS_Shape& face)
|
||||||
{
|
{
|
||||||
quad->side[ QUAD_TOP_SIDE ]->Reverse();
|
quad->side[ QUAD_TOP_SIDE ].grid->Reverse();
|
||||||
quad->side[ QUAD_LEFT_SIDE ]->Reverse();
|
quad->side[ QUAD_LEFT_SIDE ].grid->Reverse();
|
||||||
int edgeIndex = 0;
|
int edgeIndex = 0;
|
||||||
for ( size_t i = 0; i < quad->side.size(); ++i )
|
for ( size_t i = 0; i < quad->side.size(); ++i )
|
||||||
{
|
{
|
||||||
StdMeshers_FaceSide* quadSide = quad->side[i];
|
StdMeshers_FaceSidePtr quadSide = quad->side[i];
|
||||||
for ( int iE = 0; iE < quadSide->NbEdges(); ++iE )
|
for ( int iE = 0; iE < quadSide->NbEdges(); ++iE )
|
||||||
if ( botE.IsSame( quadSide->Edge( iE )))
|
if ( botE.IsSame( quadSide->Edge( iE )))
|
||||||
{
|
{
|
||||||
@ -681,7 +681,7 @@ bool StdMeshers_Prism_3D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& theSh
|
|||||||
continue; // already computed prism
|
continue; // already computed prism
|
||||||
}
|
}
|
||||||
// find a source FACE of the SOLID: it's a FACE sharing a bottom EDGE with wFace
|
// find a source FACE of the SOLID: it's a FACE sharing a bottom EDGE with wFace
|
||||||
const TopoDS_Edge& wEdge = (*wQuad)->side[ QUAD_TOP_SIDE ]->Edge(0);
|
const TopoDS_Edge& wEdge = (*wQuad)->side[ QUAD_TOP_SIDE ].grid->Edge(0);
|
||||||
PShapeIteratorPtr faceIt = myHelper->GetAncestors( wEdge, *myHelper->GetMesh(),
|
PShapeIteratorPtr faceIt = myHelper->GetAncestors( wEdge, *myHelper->GetMesh(),
|
||||||
TopAbs_FACE);
|
TopAbs_FACE);
|
||||||
while ( const TopoDS_Shape* f = faceIt->next() )
|
while ( const TopoDS_Shape* f = faceIt->next() )
|
||||||
@ -879,7 +879,7 @@ bool StdMeshers_Prism_3D::getWallFaces( Prism_3D::TPrismTopo & thePrism,
|
|||||||
int nbKnownFaces;
|
int nbKnownFaces;
|
||||||
do {
|
do {
|
||||||
nbKnownFaces = faceMap.Extent();
|
nbKnownFaces = faceMap.Extent();
|
||||||
StdMeshers_FaceSide *rightSide, *topSide; // sides of the quad
|
StdMeshers_FaceSidePtr rightSide, topSide; // sides of the quad
|
||||||
for ( size_t i = 0; i < thePrism.myWallQuads.size(); ++i )
|
for ( size_t i = 0; i < thePrism.myWallQuads.size(); ++i )
|
||||||
{
|
{
|
||||||
rightSide = thePrism.myWallQuads[i].back()->side[ QUAD_RIGHT_SIDE ];
|
rightSide = thePrism.myWallQuads[i].back()->side[ QUAD_RIGHT_SIDE ];
|
||||||
@ -911,8 +911,8 @@ bool StdMeshers_Prism_3D::getWallFaces( Prism_3D::TPrismTopo & thePrism,
|
|||||||
{
|
{
|
||||||
for ( size_t i = 0; i < thePrism.myWallQuads.size(); ++i )
|
for ( size_t i = 0; i < thePrism.myWallQuads.size(); ++i )
|
||||||
{
|
{
|
||||||
StdMeshers_FaceSide* topSide = thePrism.myWallQuads[i].back()->side[ QUAD_TOP_SIDE ];
|
StdMeshers_FaceSidePtr topSide = thePrism.myWallQuads[i].back()->side[ QUAD_TOP_SIDE ];
|
||||||
const TopoDS_Edge & topE = topSide->Edge( 0 );
|
const TopoDS_Edge & topE = topSide->Edge( 0 );
|
||||||
if ( topSide->NbEdges() > 1 )
|
if ( topSide->NbEdges() > 1 )
|
||||||
return toSM( error(COMPERR_BAD_SHAPE, TCom("Side face #") <<
|
return toSM( error(COMPERR_BAD_SHAPE, TCom("Side face #") <<
|
||||||
shapeID( thePrism.myWallQuads[i].back()->face )
|
shapeID( thePrism.myWallQuads[i].back()->face )
|
||||||
@ -958,8 +958,8 @@ bool StdMeshers_Prism_3D::getWallFaces( Prism_3D::TPrismTopo & thePrism,
|
|||||||
// Check that the top FACE shares all the top EDGEs
|
// Check that the top FACE shares all the top EDGEs
|
||||||
for ( size_t i = 0; i < thePrism.myWallQuads.size(); ++i )
|
for ( size_t i = 0; i < thePrism.myWallQuads.size(); ++i )
|
||||||
{
|
{
|
||||||
StdMeshers_FaceSide* topSide = thePrism.myWallQuads[i].back()->side[ QUAD_TOP_SIDE ];
|
StdMeshers_FaceSidePtr topSide = thePrism.myWallQuads[i].back()->side[ QUAD_TOP_SIDE ];
|
||||||
const TopoDS_Edge & topE = topSide->Edge( 0 );
|
const TopoDS_Edge & topE = topSide->Edge( 0 );
|
||||||
if ( !myHelper->IsSubShape( topE, thePrism.myTop ))
|
if ( !myHelper->IsSubShape( topE, thePrism.myTop ))
|
||||||
return toSM( error( TCom("Wrong source face (#") << shapeID( thePrism.myBottom )));
|
return toSM( error( TCom("Wrong source face (#") << shapeID( thePrism.myBottom )));
|
||||||
}
|
}
|
||||||
@ -1205,7 +1205,7 @@ bool StdMeshers_Prism_3D::computeWalls(const Prism_3D::TPrismTopo& thePrism)
|
|||||||
int wgt = 0; // "weight"
|
int wgt = 0; // "weight"
|
||||||
for ( ; quad != thePrism.myWallQuads[iW].end(); ++quad )
|
for ( ; quad != thePrism.myWallQuads[iW].end(); ++quad )
|
||||||
{
|
{
|
||||||
StdMeshers_FaceSide* lftSide = (*quad)->side[ QUAD_LEFT_SIDE ];
|
StdMeshers_FaceSidePtr lftSide = (*quad)->side[ QUAD_LEFT_SIDE ];
|
||||||
for ( int i = 0; i < lftSide->NbEdges(); ++i )
|
for ( int i = 0; i < lftSide->NbEdges(); ++i )
|
||||||
{
|
{
|
||||||
++wgt;
|
++wgt;
|
||||||
@ -1224,7 +1224,7 @@ bool StdMeshers_Prism_3D::computeWalls(const Prism_3D::TPrismTopo& thePrism)
|
|||||||
quad = thePrism.myWallQuads[iW].begin();
|
quad = thePrism.myWallQuads[iW].begin();
|
||||||
for ( ; quad != thePrism.myWallQuads[iW].end(); ++quad )
|
for ( ; quad != thePrism.myWallQuads[iW].end(); ++quad )
|
||||||
for ( int i = 0; i < NB_QUAD_SIDES; ++i )
|
for ( int i = 0; i < NB_QUAD_SIDES; ++i )
|
||||||
(*quad)->side[ i ]->SetIgnoreMediumNodes( true );
|
(*quad)->side[ i ].grid->SetIgnoreMediumNodes( true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1237,8 +1237,8 @@ bool StdMeshers_Prism_3D::computeWalls(const Prism_3D::TPrismTopo& thePrism)
|
|||||||
Prism_3D::TQuadList::const_iterator quad = quads.begin();
|
Prism_3D::TQuadList::const_iterator quad = quads.begin();
|
||||||
for ( ; quad != quads.end(); ++quad )
|
for ( ; quad != quads.end(); ++quad )
|
||||||
{
|
{
|
||||||
StdMeshers_FaceSide* rgtSide = (*quad)->side[ QUAD_RIGHT_SIDE ]; // tgt
|
StdMeshers_FaceSidePtr rgtSide = (*quad)->side[ QUAD_RIGHT_SIDE ]; // tgt
|
||||||
StdMeshers_FaceSide* lftSide = (*quad)->side[ QUAD_LEFT_SIDE ]; // src
|
StdMeshers_FaceSidePtr lftSide = (*quad)->side[ QUAD_LEFT_SIDE ]; // src
|
||||||
bool swapLeftRight = ( lftSide->NbSegments( /*update=*/true ) == 0 &&
|
bool swapLeftRight = ( lftSide->NbSegments( /*update=*/true ) == 0 &&
|
||||||
rgtSide->NbSegments( /*update=*/true ) > 0 );
|
rgtSide->NbSegments( /*update=*/true ) > 0 );
|
||||||
if ( swapLeftRight )
|
if ( swapLeftRight )
|
||||||
@ -1373,8 +1373,8 @@ bool StdMeshers_Prism_3D::computeWalls(const Prism_3D::TPrismTopo& thePrism)
|
|||||||
// to compute stuctured quad mesh on wall FACEs
|
// to compute stuctured quad mesh on wall FACEs
|
||||||
// ---------------------------------------------------
|
// ---------------------------------------------------
|
||||||
{
|
{
|
||||||
const TopoDS_Edge& botE = (*quad)->side[ QUAD_BOTTOM_SIDE ]->Edge(0);
|
const TopoDS_Edge& botE = (*quad)->side[ QUAD_BOTTOM_SIDE ].grid->Edge(0);
|
||||||
const TopoDS_Edge& topE = (*quad)->side[ QUAD_TOP_SIDE ]->Edge(0);
|
const TopoDS_Edge& topE = (*quad)->side[ QUAD_TOP_SIDE ].grid->Edge(0);
|
||||||
SMESH_subMesh* botSM = mesh->GetSubMesh( botE );
|
SMESH_subMesh* botSM = mesh->GetSubMesh( botE );
|
||||||
SMESH_subMesh* topSM = mesh->GetSubMesh( topE );
|
SMESH_subMesh* topSM = mesh->GetSubMesh( topE );
|
||||||
SMESH_subMesh* srcSM = botSM;
|
SMESH_subMesh* srcSM = botSM;
|
||||||
@ -2352,7 +2352,7 @@ bool StdMeshers_PrismAsBlock::Init(SMESH_MesherHelper* helper,
|
|||||||
Prism_3D::TQuadList::const_iterator quad = thePrism.myWallQuads[ iE ].begin();
|
Prism_3D::TQuadList::const_iterator quad = thePrism.myWallQuads[ iE ].begin();
|
||||||
for ( ; quad != thePrism.myWallQuads[ iE ].end(); ++quad )
|
for ( ; quad != thePrism.myWallQuads[ iE ].end(); ++quad )
|
||||||
{
|
{
|
||||||
const TopoDS_Edge& quadBot = (*quad)->side[ QUAD_BOTTOM_SIDE ]->Edge( 0 );
|
const TopoDS_Edge& quadBot = (*quad)->side[ QUAD_BOTTOM_SIDE ].grid->Edge( 0 );
|
||||||
if ( !myHelper->LoadNodeColumns( faceColumns, (*quad)->face, quadBot, meshDS ))
|
if ( !myHelper->LoadNodeColumns( faceColumns, (*quad)->face, quadBot, meshDS ))
|
||||||
return error(COMPERR_BAD_INPUT_MESH, TCom("Can't find regular quadrangle mesh ")
|
return error(COMPERR_BAD_INPUT_MESH, TCom("Can't find regular quadrangle mesh ")
|
||||||
<< "on a side face #" << MeshDS()->ShapeToIndex( (*quad)->face ));
|
<< "on a side face #" << MeshDS()->ShapeToIndex( (*quad)->face ));
|
||||||
@ -2373,7 +2373,7 @@ bool StdMeshers_PrismAsBlock::Init(SMESH_MesherHelper* helper,
|
|||||||
Prism_3D::TQuadList::const_iterator quad = thePrism.myWallQuads[ iE ].begin();
|
Prism_3D::TQuadList::const_iterator quad = thePrism.myWallQuads[ iE ].begin();
|
||||||
for ( ; quad != thePrism.myWallQuads[ iE ].end(); ++quad )
|
for ( ; quad != thePrism.myWallQuads[ iE ].end(); ++quad )
|
||||||
{
|
{
|
||||||
const TopoDS_Edge& quadBot = (*quad)->side[ QUAD_BOTTOM_SIDE ]->Edge( 0 );
|
const TopoDS_Edge& quadBot = (*quad)->side[ QUAD_BOTTOM_SIDE ].grid->Edge( 0 );
|
||||||
if ( !myHelper->LoadNodeColumns( faceColumns, (*quad)->face, quadBot, meshDS ))
|
if ( !myHelper->LoadNodeColumns( faceColumns, (*quad)->face, quadBot, meshDS ))
|
||||||
return error(COMPERR_BAD_INPUT_MESH, TCom("Can't find regular quadrangle mesh ")
|
return error(COMPERR_BAD_INPUT_MESH, TCom("Can't find regular quadrangle mesh ")
|
||||||
<< "on a side face #" << MeshDS()->ShapeToIndex( (*quad)->face ));
|
<< "on a side face #" << MeshDS()->ShapeToIndex( (*quad)->face ));
|
||||||
|
Loading…
Reference in New Issue
Block a user