mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-25 08:50:35 +05:00
bos #29143 [CEA] Compute takes too much time in polyhedron per solid use case
This commit is contained in:
parent
7b665239fa
commit
4a9dc0d210
@ -39,11 +39,12 @@
|
||||
#include "SMESH_MesherHelper.hxx"
|
||||
#include "SMESH_subMesh.hxx"
|
||||
|
||||
#include "utilities.h"
|
||||
#include "Utils_ExceptHandlers.hxx"
|
||||
#include <utilities.h>
|
||||
#include <Utils_ExceptHandlers.hxx>
|
||||
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
|
||||
#include "memoire.h"
|
||||
|
||||
@ -331,6 +332,32 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
|
||||
else
|
||||
smWithAlgoSupportingSubmeshes[0].push_front( shDim2smIt->second );
|
||||
|
||||
// gather sub-shapes with local uni-dimensional algos (bos #29143)
|
||||
// ----------------------------------------------------------------
|
||||
TopTools_MapOfShape uniDimAlgoShapes;
|
||||
ShapeToHypothesis::Iterator s2hyps( aMesh.GetMeshDS()->GetHypotheses() );
|
||||
for ( ; s2hyps.More(); s2hyps.Next() )
|
||||
{
|
||||
const TopoDS_Shape& s = s2hyps.Key();
|
||||
if ( s.IsSame( aMesh.GetShapeToMesh() ))
|
||||
continue;
|
||||
for ( auto & hyp : s2hyps.Value() )
|
||||
{
|
||||
if ( const SMESH_Algo* algo = dynamic_cast< const SMESH_Algo*>( hyp ))
|
||||
if ( algo->NeedDiscreteBoundary() )
|
||||
{
|
||||
TopAbs_ShapeEnum sType;
|
||||
switch ( algo->GetDim() ) {
|
||||
case 3: sType = TopAbs_SOLID; break;
|
||||
case 2: sType = TopAbs_FACE; break;
|
||||
default: sType = TopAbs_EDGE; break;
|
||||
}
|
||||
for ( TopExp_Explorer ex( s2hyps.Key(), sType ); ex.More(); ex.Next() )
|
||||
uniDimAlgoShapes.Add( ex.Current() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ======================================================
|
||||
// Apply all-dimensional algorithms supporing sub-meshes
|
||||
// ======================================================
|
||||
@ -374,9 +401,11 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
|
||||
SMESH_subMesh* smToCompute = smIt->next();
|
||||
|
||||
const TopoDS_Shape& aSubShape = smToCompute->GetSubShape();
|
||||
const int aShapeDim = GetShapeDim( aSubShape );
|
||||
const int aShapeDim = GetShapeDim( aSubShape );
|
||||
if ( aShapeDim < 1 || aSubShape.ShapeType() <= shapeType )
|
||||
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 )
|
||||
@ -1222,6 +1251,26 @@ int SMESH_Gen::GetShapeDim(const TopAbs_ShapeEnum & aShapeType)
|
||||
return dim[ aShapeType ];
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Return shape dimension by exploding compounds
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
int SMESH_Gen::GetFlatShapeDim(const TopoDS_Shape &aShape)
|
||||
{
|
||||
int aShapeDim;
|
||||
if ( aShape.ShapeType() == TopAbs_COMPOUND ||
|
||||
aShape.ShapeType() == TopAbs_COMPSOLID )
|
||||
{
|
||||
TopoDS_Iterator it( aShape );
|
||||
aShapeDim = GetFlatShapeDim( it.Value() );
|
||||
}
|
||||
else
|
||||
aShapeDim = GetShapeDim( aShape );
|
||||
return aShapeDim;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* Generate a new id unique within this Gen
|
||||
|
@ -154,6 +154,7 @@ public:
|
||||
static int GetShapeDim(const TopAbs_ShapeEnum & aShapeType);
|
||||
static int GetShapeDim(const TopoDS_Shape & aShape)
|
||||
{ return GetShapeDim( aShape.ShapeType() ); }
|
||||
static int GetFlatShapeDim(const TopoDS_Shape &aShape);
|
||||
|
||||
SMESH_Algo* GetAlgo(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape, TopoDS_Shape* assignedTo=0);
|
||||
SMESH_Algo* GetAlgo(SMESH_subMesh * aSubMesh, TopoDS_Shape* assignedTo=0);
|
||||
|
Loading…
Reference in New Issue
Block a user