mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-27 09:50:34 +05:00
0020918: EDF 1447 SMESH: Mesh common borders
avoid leaving nodes in two sub-meshes at the same time
This commit is contained in:
parent
dcd45204f2
commit
57dc31db42
@ -339,7 +339,7 @@ bool StdMeshers_Import_1D2D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape &
|
|||||||
int nbFaces = link2Nb->second;
|
int nbFaces = link2Nb->second;
|
||||||
if ( nbFaces == 1 )
|
if ( nbFaces == 1 )
|
||||||
{
|
{
|
||||||
// check if the link lie on face boundary
|
// check if a not shared link lie on face boundary
|
||||||
bool nodesOnBoundary = true;
|
bool nodesOnBoundary = true;
|
||||||
list< TopoDS_Shape > bndShapes;
|
list< TopoDS_Shape > bndShapes;
|
||||||
for ( int is1stN = 0; is1stN < 2 && nodesOnBoundary; ++is1stN )
|
for ( int is1stN = 0; is1stN < 2 && nodesOnBoundary; ++is1stN )
|
||||||
@ -354,6 +354,7 @@ bool StdMeshers_Import_1D2D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape &
|
|||||||
if ( Abs(u-f) < 2 * faceTol || Abs(u-l) < 2 * faceTol )
|
if ( Abs(u-f) < 2 * faceTol || Abs(u-l) < 2 * faceTol )
|
||||||
// duplicated node on vertex
|
// duplicated node on vertex
|
||||||
return error("Source elements overlap one another");
|
return error("Source elements overlap one another");
|
||||||
|
tgtSM->RemoveNode( n, /*isNodeDeleted=*/false );
|
||||||
tgtMesh->SetNodeOnEdge( (SMDS_MeshNode*)n, edges[iE], u );
|
tgtMesh->SetNodeOnEdge( (SMDS_MeshNode*)n, edges[iE], u );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -369,10 +370,10 @@ bool StdMeshers_Import_1D2D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape &
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( !nodesOnBoundary )
|
if ( !nodesOnBoundary )
|
||||||
break; // free internal link
|
break; // error: free internal link
|
||||||
if ( bndShapes.front().ShapeType() == TopAbs_EDGE &&
|
if ( bndShapes.front().ShapeType() == TopAbs_EDGE &&
|
||||||
bndShapes.front() != bndShapes.back() )
|
bndShapes.front() != bndShapes.back() )
|
||||||
break; // link nodes on different geom edges
|
break; // error: link nodes on different geom edges
|
||||||
|
|
||||||
// find geom edge the link is on
|
// find geom edge the link is on
|
||||||
if ( bndShapes.back().ShapeType() != TopAbs_EDGE )
|
if ( bndShapes.back().ShapeType() != TopAbs_EDGE )
|
||||||
@ -387,7 +388,7 @@ bool StdMeshers_Import_1D2D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape &
|
|||||||
geomEdge.Nullify();
|
geomEdge.Nullify();
|
||||||
}
|
}
|
||||||
if ( geomEdge.IsNull() )
|
if ( geomEdge.IsNull() )
|
||||||
break; // vertices belong to different edges -> free internal link
|
break; // vertices belong to different edges -> error: free internal link
|
||||||
bndShapes.push_back( geomEdge );
|
bndShapes.push_back( geomEdge );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -405,15 +406,13 @@ bool StdMeshers_Import_1D2D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape &
|
|||||||
|
|
||||||
TopoDS_Edge geomEdge = TopoDS::Edge(bndShapes.back());
|
TopoDS_Edge geomEdge = TopoDS::Edge(bndShapes.back());
|
||||||
helper.CheckNodeU( geomEdge, link._medium, u, 10*faceTol, /*force=*/true );
|
helper.CheckNodeU( geomEdge, link._medium, u, 10*faceTol, /*force=*/true );
|
||||||
|
tgtSM->RemoveNode( link._medium, /*isNodeDeleted=*/false );
|
||||||
tgtMesh->SetNodeOnEdge( (SMDS_MeshNode*)link._medium, geomEdge, u );
|
tgtMesh->SetNodeOnEdge( (SMDS_MeshNode*)link._medium, geomEdge, u );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edge = tgtMesh->AddEdge( newNodes[0], newNodes[1]);
|
edge = tgtMesh->AddEdge( newNodes[0], newNodes[1]);
|
||||||
}
|
}
|
||||||
// remove nodes from submesh of theShape
|
|
||||||
for ( unsigned i = 0; i < newNodes.size(); ++i )
|
|
||||||
tgtSM->RemoveNode( newNodes[i], /*isNodeDeleted=*/false );
|
|
||||||
if ( !edge )
|
if ( !edge )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -458,25 +457,6 @@ bool StdMeshers_Import_1D2D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape &
|
|||||||
for ( unsigned iE = 0; iE < edges.size(); ++iE )
|
for ( unsigned iE = 0; iE < edges.size(); ++iE )
|
||||||
theMesh.GetSubMesh( edges[iE] )->ComputeStateEngine(SMESH_subMesh::CHECK_COMPUTE_STATE);
|
theMesh.GetSubMesh( edges[iE] )->ComputeStateEngine(SMESH_subMesh::CHECK_COMPUTE_STATE);
|
||||||
|
|
||||||
SMESH_subMesh* sm = theMesh.GetSubMesh(theShape);
|
|
||||||
SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(true,false);
|
|
||||||
cout << endl << string(80,'=') << endl
|
|
||||||
<< "Compute( face " << tgtMesh->ShapeToIndex(theShape) << endl;
|
|
||||||
while ( smIt->more() )
|
|
||||||
{
|
|
||||||
sm = smIt->next();
|
|
||||||
TopAbs::Print(sm->GetSubShape().ShapeType(), cout);
|
|
||||||
cout << " " << sm->GetId() << endl << " Elems:";
|
|
||||||
SMDS_ElemIteratorPtr eIt = sm->GetSubMeshDS()->GetElements();
|
|
||||||
while ( eIt->more() )
|
|
||||||
cout << " " << eIt->next()->GetID();
|
|
||||||
cout << endl << " Nodes:";
|
|
||||||
SMDS_NodeIteratorPtr nIt = sm->GetSubMeshDS()->GetNodes();
|
|
||||||
while ( nIt->more() )
|
|
||||||
cout << " " << nIt->next()->GetID();
|
|
||||||
cout << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ============
|
// ============
|
||||||
// Copy meshes
|
// Copy meshes
|
||||||
// ============
|
// ============
|
||||||
|
Loading…
Reference in New Issue
Block a user