mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-15 00:30:33 +05:00
53057: NETGEN-1D2D3D issues "Ignored" warning for faces of a sub-mesh
This case also reveals the following bugs: 1) SMESH_MesherHelper::IsReversedSubMesh() incorrectly works on a coarsely meshed disk 2) Addition of NETGEN-1D2D3D removes already computed faces of a sub-mesh on a group of FACEs (SMESH_subMesh::cleanDependsOn()) 3) Volumes are shown, instead of faces, when displaying a sub-mesh on a SOLID with only a 2D algo assigned to the sub-mesh (SMESH_subMesh_i.cxx)
This commit is contained in:
parent
77ab849209
commit
d45cd9ae88
@ -2904,6 +2904,10 @@ bool SMESH_MesherHelper::IsReversedSubMesh (const TopoDS_Face& theFace)
|
|||||||
bool ok = true;
|
bool ok = true;
|
||||||
double u0 = GetNodeU( TopoDS::Edge( E ), nn[0], nn[1], &ok );
|
double u0 = GetNodeU( TopoDS::Edge( E ), nn[0], nn[1], &ok );
|
||||||
double u1 = GetNodeU( TopoDS::Edge( E ), nn[1], nn[0], &ok );
|
double u1 = GetNodeU( TopoDS::Edge( E ), nn[1], nn[0], &ok );
|
||||||
|
// check that the 2 nodes are connected with a segment (IPAL53055)
|
||||||
|
// if ( SMESHDS_SubMesh* sm = GetMeshDS()->MeshElements( E ))
|
||||||
|
// if ( sm->NbElements() > 0 && !GetMeshDS()->FindEdge( nn[0], nn[1] ))
|
||||||
|
// ok = false;
|
||||||
if ( ok )
|
if ( ok )
|
||||||
{
|
{
|
||||||
isReversed = ( u0 > u1 );
|
isReversed = ( u0 > u1 );
|
||||||
|
@ -1217,8 +1217,6 @@ void SMESH_subMesh::cleanDependsOn( SMESH_Algo* algoRequiringCleaning/*=0*/ )
|
|||||||
}
|
}
|
||||||
else if ( algoRequiringCleaning && algoRequiringCleaning->SupportSubmeshes() )
|
else if ( algoRequiringCleaning && algoRequiringCleaning->SupportSubmeshes() )
|
||||||
{
|
{
|
||||||
SMESHDS_Mesh* meshDS = _father->GetMeshDS();
|
|
||||||
|
|
||||||
// find sub-meshes to keep elements on
|
// find sub-meshes to keep elements on
|
||||||
set< SMESH_subMesh* > smToKeep;
|
set< SMESH_subMesh* > smToKeep;
|
||||||
TopAbs_ShapeEnum prevShapeType = TopAbs_SHAPE;
|
TopAbs_ShapeEnum prevShapeType = TopAbs_SHAPE;
|
||||||
@ -1242,13 +1240,14 @@ void SMESH_subMesh::cleanDependsOn( SMESH_Algo* algoRequiringCleaning/*=0*/ )
|
|||||||
}
|
}
|
||||||
if ( !keepSubMeshes )
|
if ( !keepSubMeshes )
|
||||||
{
|
{
|
||||||
// look for an algo assigned to sm
|
// look for a local algo used to mesh sm
|
||||||
bool algoFound = false;
|
TopoDS_Shape algoShape = SMESH_MesherHelper::GetShapeOfHypothesis
|
||||||
const list<const SMESHDS_Hypothesis*>& hyps = meshDS->GetHypothesis( sm->_subShape );
|
( algoRequiringCleaning, _subShape, _father );
|
||||||
list<const SMESHDS_Hypothesis*>::const_iterator h = hyps.begin();
|
SMESH_HypoFilter moreLocalAlgo;
|
||||||
for ( ; ( !algoFound && h != hyps.end() ); ++h )
|
moreLocalAlgo.Init( SMESH_HypoFilter::IsMoreLocalThan( algoShape, *_father ));
|
||||||
algoFound = ((*h)->GetType() != SMESHDS_Hypothesis::PARAM_ALGO );
|
moreLocalAlgo.And ( SMESH_HypoFilter::IsAlgo() );
|
||||||
keepSubMeshes = algoFound;
|
bool localAlgoFound = _father->GetHypothesis( sm->_subShape, moreLocalAlgo, true );
|
||||||
|
keepSubMeshes = localAlgoFound;
|
||||||
}
|
}
|
||||||
// remember all sub-meshes of sm
|
// remember all sub-meshes of sm
|
||||||
if ( keepSubMeshes )
|
if ( keepSubMeshes )
|
||||||
|
@ -107,9 +107,10 @@ bool getSubMeshes(::SMESH_subMesh* theSubMesh,
|
|||||||
TopAbs_ShapeEnum aShapeType = aShape.ShapeType();
|
TopAbs_ShapeEnum aShapeType = aShape.ShapeType();
|
||||||
|
|
||||||
// IPAL18558: Wrong information of the created sub-mesh is shown. (Sub-mesh on a FACE
|
// IPAL18558: Wrong information of the created sub-mesh is shown. (Sub-mesh on a FACE
|
||||||
// with only 1D algo assigned
|
// with only 1D algo assigned)
|
||||||
// Find dimension of sub-meshes to return as highest dimension of the assigned algorithm
|
// Find dimension of sub-meshes to return as highest dimension of the assigned algorithm
|
||||||
if ( theSubMesh->IsEmpty() && !theSubMesh->GetAlgo() )
|
if (( theSubMesh->IsEmpty() || ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() )) &&
|
||||||
|
( !theSubMesh->GetAlgo() ))
|
||||||
{
|
{
|
||||||
// on father sub-meshes, check presence of an algo which will mesh this sub-mesh
|
// on father sub-meshes, check presence of an algo which will mesh this sub-mesh
|
||||||
// even if no algo is assigned to this sub-mesh
|
// even if no algo is assigned to this sub-mesh
|
||||||
@ -121,20 +122,22 @@ bool getSubMeshes(::SMESH_subMesh* theSubMesh,
|
|||||||
|
|
||||||
if ( !topAlgoPresent )
|
if ( !topAlgoPresent )
|
||||||
{
|
{
|
||||||
// look for a sub-mesh with an algo
|
// find max dimension of an assigned algo
|
||||||
SMESH_subMeshIteratorPtr smIt =
|
|
||||||
theSubMesh->getDependsOnIterator(/*includeSelf=*/false, /*complexShapeFirst=*/true);
|
|
||||||
TopAbs_ShapeEnum algoShape = TopAbs_SHAPE;
|
TopAbs_ShapeEnum algoShape = TopAbs_SHAPE;
|
||||||
while ( smIt->more() && algoShape == TopAbs_SHAPE )
|
const std::list <const SMESHDS_Hypothesis * >& hyps = aMesh->GetHypothesisList( aShape );
|
||||||
{
|
std::list <const SMESHDS_Hypothesis * >::const_iterator hypIt = hyps.begin();
|
||||||
sm = smIt->next();
|
for ( ; hypIt != hyps.end(); ++hypIt )
|
||||||
if ( sm->GetAlgo() )
|
if ( const SMESH_Algo* algo = dynamic_cast< const SMESH_Algo* >( *hypIt ))
|
||||||
algoShape = sm->GetSubShape().ShapeType();
|
switch ( algo->GetDim() ) {
|
||||||
}
|
case 1: algoShape = TopAbs_EDGE; break;
|
||||||
|
case 2: algoShape = TopAbs_FACE; break;
|
||||||
|
case 3: algoShape = TopAbs_SOLID; break;
|
||||||
|
case 0: algoShape = TopAbs_VERTEX; break;
|
||||||
|
}
|
||||||
if ( algoShape != TopAbs_SHAPE )
|
if ( algoShape != TopAbs_SHAPE )
|
||||||
{
|
{
|
||||||
// return all sub-meshes on this shape type
|
// return all sub-meshes on this dimension
|
||||||
smIt = theSubMesh->getDependsOnIterator(/*includeSelf=*/false, /*complexShapeFirst=*/true);
|
SMESH_subMeshIteratorPtr smIt = theSubMesh->getDependsOnIterator(/*includeSelf=*/false);
|
||||||
while ( smIt->more() )
|
while ( smIt->more() )
|
||||||
{
|
{
|
||||||
sm = smIt->next();
|
sm = smIt->next();
|
||||||
@ -209,6 +212,8 @@ CORBA::Long SMESH_subMesh_i::GetNumberOfElements()
|
|||||||
|
|
||||||
::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId];
|
::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId];
|
||||||
SMESHDS_SubMesh* aSubMeshDS = aSubMesh->GetSubMeshDS();
|
SMESHDS_SubMesh* aSubMeshDS = aSubMesh->GetSubMeshDS();
|
||||||
|
if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() )
|
||||||
|
aSubMeshDS = 0;
|
||||||
|
|
||||||
int nbElems = aSubMeshDS ? aSubMeshDS->NbElements() : 0;
|
int nbElems = aSubMeshDS ? aSubMeshDS->NbElements() : 0;
|
||||||
|
|
||||||
@ -244,6 +249,8 @@ CORBA::Long SMESH_subMesh_i::GetNumberOfNodes(CORBA::Boolean all)
|
|||||||
}
|
}
|
||||||
::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId];
|
::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId];
|
||||||
SMESHDS_SubMesh* aSubMeshDS = aSubMesh->GetSubMeshDS();
|
SMESHDS_SubMesh* aSubMeshDS = aSubMesh->GetSubMeshDS();
|
||||||
|
if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() )
|
||||||
|
aSubMeshDS = 0;
|
||||||
|
|
||||||
if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() )
|
if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() )
|
||||||
{
|
{
|
||||||
@ -292,6 +299,8 @@ SMESH::long_array* SMESH_subMesh_i::GetElementsId()
|
|||||||
|
|
||||||
::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId];
|
::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId];
|
||||||
SMESHDS_SubMesh* aSubMeshDS = aSubMesh->GetSubMeshDS();
|
SMESHDS_SubMesh* aSubMeshDS = aSubMesh->GetSubMeshDS();
|
||||||
|
if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() )
|
||||||
|
aSubMeshDS = 0;
|
||||||
|
|
||||||
int nbElems = aSubMeshDS ? aSubMeshDS->NbElements() : 0;
|
int nbElems = aSubMeshDS ? aSubMeshDS->NbElements() : 0;
|
||||||
TListOfSubMeshes smList;
|
TListOfSubMeshes smList;
|
||||||
@ -342,6 +351,8 @@ SMESH::long_array* SMESH_subMesh_i::GetElementsByType( SMESH::ElementType theEle
|
|||||||
|
|
||||||
::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId];
|
::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId];
|
||||||
SMESHDS_SubMesh* aSubMeshDS = aSubMesh->GetSubMeshDS();
|
SMESHDS_SubMesh* aSubMeshDS = aSubMesh->GetSubMeshDS();
|
||||||
|
if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() )
|
||||||
|
aSubMeshDS = 0;
|
||||||
|
|
||||||
// PAL5440, return all nodes belonging to elements of submesh
|
// PAL5440, return all nodes belonging to elements of submesh
|
||||||
set<int> nodeIds;
|
set<int> nodeIds;
|
||||||
|
Loading…
Reference in New Issue
Block a user