-// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#ifdef _DEBUG_
// enable printing algo + shape id + hypo used while meshing
-//#define PRINT_WHO_COMPUTE_WHAT
+#define PRINT_WHO_COMPUTE_WHAT
#endif
-//#define PRINT_WHO_COMPUTE_WHAT
//=============================================================================
/*!
* \brief Allocate some memory at construction and release it at destruction.
ret = SMESH_Hypothesis::HYP_INCOMPATIBLE;
}
else if (!_father->IsUsedHypothesis( anHyp, this ))
- ret = SMESH_Hypothesis::HYP_INCOMPATIBLE;
+ {
+ if ( anHyp->GetDim() == this->GetAlgo()->GetDim() )
+ ret = SMESH_Hypothesis::HYP_INCOMPATIBLE;
+ }
if (SMESH_Hypothesis::IsStatusFatal( ret ))
{
TopoDS_Shape shape = _subShape;
algo->setSubMeshesToCompute(this);
// check submeshes needed
- // In parallel there would be no submesh to check
- if (_father->HasShapeToMesh() && !_father->IsParallel()) {
+ // When computing in parallel mode we do not have a additional layer of submesh
+ // The check should not be done in parallel as that check is not thread-safe
+ if (_father->HasShapeToMesh() && (!_father->IsParallel() || shape.ShapeType() != _father->GetParallelElement() )) {
bool subComputed = false, subFailed = false;
if (!algo->OnlyUnaryInput()) {
// --- commented for bos#22320 to compute all sub-shapes at once if possible;
#ifdef PRINT_WHO_COMPUTE_WHAT
for (subS.ReInit(); subS.More(); subS.Next())
{
- const std::list <const SMESHDS_Hypothesis *> & hyps
- {
- SMESH_MeshLocker myLocker(_father);
- hyps = _algo->GetUsedHypothesis( *_father, _subShape );
- }
+ SMESH_MeshLocker myLocker(_father);
+ const std::list <const SMESHDS_Hypothesis *> & hyps =
+ _algo->GetUsedHypothesis( *_father, _subShape );
SMESH_Comment hypStr;
if ( !hyps.empty() )
{
{
SMESH_subMesh* subMesh = smIt->next();
const TopoDS_Shape& S = subMesh->_subShape;
- if ( S.ShapeType() != this->_subShape.ShapeType() )
+
+ if ( S.ShapeType() != this->_subShape.ShapeType() ){
continue;
- if ( _allowedSubShapes && !_allowedSubShapes->IsEmpty() && !_allowedSubShapes->Contains( S ))
+ }
+ if ( _allowedSubShapes && !_allowedSubShapes->IsEmpty() && !_allowedSubShapes->Contains( S )){
continue;
+ }
if ( subMesh == this )
{
aBuilder.Add( aCompound, S );
else if ( subMesh->GetComputeState() == READY_TO_COMPUTE )
{
SMESH_Algo* anAlgo = subMesh->GetAlgo();
+
if (( anAlgo->IsSameName( *theAlgo )) && // same algo
( anAlgo->GetUsedHypothesis( *_father, S, skipAuxHyps ) == usedHyps ) && // same hyps
( anAlgo->GetAssignedShapes() == assiShapes ) && // on same sub-shapes