mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-26 16:10:33 +05:00
bos #29143 [CEA] Compute takes too much time in polyhedron per solid use case
more optimization: don't try to find more local algos if uniDimAlgoShapes is empty
This commit is contained in:
parent
f85bc0ab6f
commit
a065ed143c
@ -248,7 +248,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
|
|||||||
// ================================================================
|
// ================================================================
|
||||||
// Apply algos that do NOT require discreteized boundaries
|
// Apply algos that do NOT require discreteized boundaries
|
||||||
// ("all-dimensional") and do NOT support sub-meshes, starting from
|
// ("all-dimensional") and do NOT support sub-meshes, starting from
|
||||||
// the most complex shapes and collect sub-meshes with algos that
|
// the most complex shapes and collect sub-meshes with algos that
|
||||||
// DO support sub-meshes
|
// DO support sub-meshes
|
||||||
// ================================================================
|
// ================================================================
|
||||||
|
|
||||||
@ -273,7 +273,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
|
|||||||
const TopoDS_Shape& aSubShape = smToCompute->GetSubShape();
|
const TopoDS_Shape& aSubShape = smToCompute->GetSubShape();
|
||||||
aShapeDim = GetShapeDim( aSubShape );
|
aShapeDim = GetShapeDim( aSubShape );
|
||||||
if ( aShapeDim < 1 ) break;
|
if ( aShapeDim < 1 ) break;
|
||||||
|
|
||||||
// check for preview dimension limitations
|
// check for preview dimension limitations
|
||||||
if ( aShapesId && aShapeDim > (int)aDim )
|
if ( aShapesId && aShapeDim > (int)aDim )
|
||||||
continue;
|
continue;
|
||||||
@ -390,47 +390,50 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
|
|||||||
|
|
||||||
const TopAbs_ShapeEnum shapeType = sm->GetSubShape().ShapeType();
|
const TopAbs_ShapeEnum shapeType = sm->GetSubShape().ShapeType();
|
||||||
|
|
||||||
// get a shape the algo is assigned to
|
if ( !uniDimAlgoShapes.IsEmpty() )
|
||||||
if ( !GetAlgo( sm, & algoShape ))
|
|
||||||
continue; // strange...
|
|
||||||
|
|
||||||
// look for more local algos
|
|
||||||
if ( SMESH_subMesh* algoSM = aMesh.GetSubMesh( algoShape ))
|
|
||||||
smIt = algoSM->getDependsOnIterator(!includeSelf, !complexShapeFirst);
|
|
||||||
else
|
|
||||||
smIt = sm->getDependsOnIterator(!includeSelf, !complexShapeFirst);
|
|
||||||
|
|
||||||
while ( smIt->more() )
|
|
||||||
{
|
{
|
||||||
SMESH_subMesh* smToCompute = smIt->next();
|
// get a shape the algo is assigned to
|
||||||
|
if ( !GetAlgo( sm, & algoShape ))
|
||||||
|
continue; // strange...
|
||||||
|
|
||||||
const TopoDS_Shape& aSubShape = smToCompute->GetSubShape();
|
// look for more local algos
|
||||||
const int aShapeDim = GetShapeDim( aSubShape );
|
if ( SMESH_subMesh* algoSM = aMesh.GetSubMesh( algoShape ))
|
||||||
if ( aShapeDim < 1 || aSubShape.ShapeType() <= shapeType )
|
smIt = algoSM->getDependsOnIterator(!includeSelf, !complexShapeFirst);
|
||||||
continue;
|
else
|
||||||
if ( !uniDimAlgoShapes.Contains( aSubShape ))
|
smIt = sm->getDependsOnIterator(!includeSelf, !complexShapeFirst);
|
||||||
continue; // [bos #29143] aMesh.GetHypothesis() is too long
|
|
||||||
|
|
||||||
// check for preview dimension limitations
|
while ( smIt->more() )
|
||||||
if ( aShapesId && GetShapeDim( aSubShape.ShapeType() ) > (int)aDim )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
|
|
||||||
filter
|
|
||||||
.And( SMESH_HypoFilter::IsApplicableTo( aSubShape ))
|
|
||||||
.And( SMESH_HypoFilter::IsMoreLocalThan( algoShape, aMesh ));
|
|
||||||
|
|
||||||
if ( SMESH_Algo* subAlgo = (SMESH_Algo*) aMesh.GetHypothesis( smToCompute, filter, true))
|
|
||||||
{
|
{
|
||||||
if ( ! subAlgo->NeedDiscreteBoundary() ) continue;
|
SMESH_subMesh* smToCompute = smIt->next();
|
||||||
TopTools_IndexedMapOfShape* localAllowed = allowedSubShapes;
|
|
||||||
if ( localAllowed && localAllowed->IsEmpty() )
|
|
||||||
localAllowed = 0; // prevent fillAllowed() with aSubShape
|
|
||||||
|
|
||||||
SMESH_Hypothesis::Hypothesis_Status status;
|
const TopoDS_Shape& aSubShape = smToCompute->GetSubShape();
|
||||||
if ( subAlgo->CheckHypothesis( aMesh, aSubShape, status ))
|
const int aShapeDim = GetShapeDim( aSubShape );
|
||||||
// mesh a lower smToCompute starting from vertices
|
if ( aShapeDim < 1 || aSubShape.ShapeType() <= shapeType )
|
||||||
Compute( aMesh, aSubShape, aFlags | SHAPE_ONLY_UPWARD, aDim, aShapesId, localAllowed );
|
continue;
|
||||||
|
if ( !uniDimAlgoShapes.Contains( aSubShape ))
|
||||||
|
continue; // [bos #29143] aMesh.GetHypothesis() is too long
|
||||||
|
|
||||||
|
// check for preview dimension limitations
|
||||||
|
if ( aShapesId && GetShapeDim( aSubShape.ShapeType() ) > (int)aDim )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
|
||||||
|
filter
|
||||||
|
.And( SMESH_HypoFilter::IsApplicableTo( aSubShape ))
|
||||||
|
.And( SMESH_HypoFilter::IsMoreLocalThan( algoShape, aMesh ));
|
||||||
|
|
||||||
|
if ( SMESH_Algo* subAlgo = (SMESH_Algo*) aMesh.GetHypothesis( smToCompute, filter, true))
|
||||||
|
{
|
||||||
|
if ( ! subAlgo->NeedDiscreteBoundary() ) continue;
|
||||||
|
TopTools_IndexedMapOfShape* localAllowed = allowedSubShapes;
|
||||||
|
if ( localAllowed && localAllowed->IsEmpty() )
|
||||||
|
localAllowed = 0; // prevent fillAllowed() with aSubShape
|
||||||
|
|
||||||
|
SMESH_Hypothesis::Hypothesis_Status status;
|
||||||
|
if ( subAlgo->CheckHypothesis( aMesh, aSubShape, status ))
|
||||||
|
// mesh a lower smToCompute starting from vertices
|
||||||
|
Compute( aMesh, aSubShape, aFlags | SHAPE_ONLY_UPWARD, aDim, aShapesId, localAllowed );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// --------------------------------
|
// --------------------------------
|
||||||
|
@ -237,6 +237,6 @@ private:
|
|||||||
int _MessInfo;
|
int _MessInfo;
|
||||||
};
|
};
|
||||||
|
|
||||||
}; // namespace SMESHHOMARDImpl
|
} // namespace SMESHHOMARDImpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user