Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
022398: EDF 2783 SMESH: No end with viscous layer computation
[modules/smesh.git]
/
src
/
SMESH
/
SMESH_Gen.cxx
diff --git
a/src/SMESH/SMESH_Gen.cxx
b/src/SMESH/SMESH_Gen.cxx
index cc7d3870711be6b44a959829543eddc6b8913412..793566ed987c44d9a27decbfa39e4cd4e229eede 100644
(file)
--- a/
src/SMESH/SMESH_Gen.cxx
+++ b/
src/SMESH/SMESH_Gen.cxx
@@
-43,10
+43,11
@@
#include "Utils_ExceptHandlers.hxx"
#include <TopoDS_Iterator.hxx>
#include "Utils_ExceptHandlers.hxx"
#include <TopoDS_Iterator.hxx>
+#include <TopoDS.hxx>
#include "memoire.h"
#include "memoire.h"
-#ifdef W
NT
+#ifdef W
IN32
#include <windows.h>
#endif
#include <windows.h>
#endif
@@
-65,7
+66,7
@@
SMESH_Gen::SMESH_Gen()
{
MESSAGE("SMESH_Gen::SMESH_Gen");
_localId = 0;
{
MESSAGE("SMESH_Gen::SMESH_Gen");
_localId = 0;
- _hypId = 0;
+ _hypId
= 0;
_segmentation = _nbSegments = 10;
SMDS_Mesh::_meshList.clear();
MESSAGE(SMDS_Mesh::_meshList.size());
_segmentation = _nbSegments = 10;
SMDS_Mesh::_meshList.clear();
MESSAGE(SMDS_Mesh::_meshList.size());
@@
-120,16
+121,17
@@
SMESH_Mesh* SMESH_Gen::CreateMesh(int theStudyId, bool theIsEmbeddedMode)
}
//=============================================================================
}
//=============================================================================
-/*
!
+/*
* Compute a mesh
*/
//=============================================================================
bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
const TopoDS_Shape & aShape,
* Compute a mesh
*/
//=============================================================================
bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
const TopoDS_Shape & aShape,
- const bool anUpward,
- const ::MeshDimension aDim,
- TSetOfInt* aShapesId)
+ const bool aShapeOnly /*=false*/,
+ const bool anUpward /*=false*/,
+ const ::MeshDimension aDim /*=::MeshDim_3D*/,
+ TSetOfInt* aShapesId /*=0*/)
{
MESSAGE("SMESH_Gen::Compute");
MEMOSTAT;
{
MESSAGE("SMESH_Gen::Compute");
MEMOSTAT;
@@
-143,11
+145,12
@@
bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
const int globalAlgoDim = 100;
SMESH_subMeshIteratorPtr smIt;
const int globalAlgoDim = 100;
SMESH_subMeshIteratorPtr smIt;
- SMESH_subMesh::compute_event computeEvent;
- if ( !anUpward && aShape.IsSame( aMesh.GetShapeToMesh() ))
- computeEvent = SMESH_subMesh::COMPUTE;
- else
- computeEvent = SMESH_subMesh::COMPUTE_SUBMESH;
+
+ // Fix of Issue 22150. Due to !BLSURF->OnlyUnaryInput(), BLSURF computes edges
+ // that must be computed by Projection 1D-2D when Projection asks to compute
+ // one face only.
+ SMESH_subMesh::compute_event computeEvent =
+ aShapeOnly ? SMESH_subMesh::COMPUTE_SUBMESH : SMESH_subMesh::COMPUTE;
if ( anUpward ) // is called from the below code in this method
{
if ( anUpward ) // is called from the below code in this method
{
@@
-161,12
+164,13
@@
bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
SMESH_subMesh* smToCompute = smIt->next();
// do not mesh vertices of a pseudo shape
SMESH_subMesh* smToCompute = smIt->next();
// do not mesh vertices of a pseudo shape
- const TopAbs_ShapeEnum aShType = smToCompute->GetSubShape().ShapeType();
- if ( !aMesh.HasShapeToMesh() && aShType == TopAbs_VERTEX )
+ const TopoDS_Shape& shape = smToCompute->GetSubShape();
+ const TopAbs_ShapeEnum shapeType = shape.ShapeType();
+ if ( !aMesh.HasShapeToMesh() && shapeType == TopAbs_VERTEX )
continue;
// check for preview dimension limitations
continue;
// check for preview dimension limitations
- if ( aShapesId && GetShapeDim(
aSh
Type ) > (int)aDim )
+ if ( aShapesId && GetShapeDim(
shape
Type ) > (int)aDim )
{
// clear compute state not to show previous compute errors
// if preview invoked less dimension less than previous
{
// clear compute state not to show previous compute errors
// if preview invoked less dimension less than previous
@@
-183,8
+187,9
@@
bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
_sm_current = NULL;
}
_sm_current = NULL;
}
- // we check all the submeshes here and detect if any of them failed to compute
- if (smToCompute->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE)
+ // we check all the sub-meshes here and detect if any of them failed to compute
+ if (smToCompute->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE &&
+ ( shapeType != TopAbs_EDGE || !SMESH_Algo::isDegenerated( TopoDS::Edge( shape ))))
ret = false;
else if ( aShapesId )
aShapesId->insert( smToCompute->GetId() );
ret = false;
else if ( aShapesId )
aShapesId->insert( smToCompute->GetId() );
@@
-204,7
+209,9
@@
bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
list< SMESH_subMesh* > smWithAlgoSupportingSubmeshes[4]; // for each dim
// map to sort sm with same dim algos according to dim of
list< SMESH_subMesh* > smWithAlgoSupportingSubmeshes[4]; // for each dim
// map to sort sm with same dim algos according to dim of
- // the shape the algo assigned to (issue 0021217)
+ // the shape the algo assigned to (issue 0021217).
+ // Other issues influenced the algo applying order:
+ // 21406, 21556, 21893, 20206
multimap< int, SMESH_subMesh* > shDim2sm;
multimap< int, SMESH_subMesh* >::reverse_iterator shDim2smIt;
TopoDS_Shape algoShape;
multimap< int, SMESH_subMesh* > shDim2sm;
multimap< int, SMESH_subMesh* >::reverse_iterator shDim2smIt;
TopoDS_Shape algoShape;
@@
-273,7
+280,7
@@
bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
// reload sub-meshes from shDim2sm into smWithAlgoSupportingSubmeshes
for ( shDim2smIt = shDim2sm.rbegin(); shDim2smIt != shDim2sm.rend(); ++shDim2smIt )
if ( shDim2smIt->first == globalAlgoDim )
// reload sub-meshes from shDim2sm into smWithAlgoSupportingSubmeshes
for ( shDim2smIt = shDim2sm.rbegin(); shDim2smIt != shDim2sm.rend(); ++shDim2smIt )
if ( shDim2smIt->first == globalAlgoDim )
- smWithAlgoSupportingSubmeshes[
0
].push_back( shDim2smIt->second );
+ smWithAlgoSupportingSubmeshes[
3
].push_back( shDim2smIt->second );
else
smWithAlgoSupportingSubmeshes[0].push_front( shDim2smIt->second );
else
smWithAlgoSupportingSubmeshes[0].push_front( shDim2smIt->second );
@@
-329,7
+336,7
@@
bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
SMESH_Hypothesis::Hypothesis_Status status;
if ( subAlgo->CheckHypothesis( aMesh, aSubShape, status ))
// mesh a lower smToCompute starting from vertices
SMESH_Hypothesis::Hypothesis_Status status;
if ( subAlgo->CheckHypothesis( aMesh, aSubShape, status ))
// mesh a lower smToCompute starting from vertices
- Compute( aMesh, aSubShape, /*anUpward=*/true, aDim, aShapesId );
+ Compute( aMesh, aSubShape,
aShapeOnly,
/*anUpward=*/true, aDim, aShapesId );
}
}
}
}
}
}
@@
-342,9
+349,9
@@
bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
sm = *subIt;
if ( sm->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
{
sm = *subIt;
if ( sm->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
{
- const TopAbs_ShapeEnum
aSh
Type = sm->GetSubShape().ShapeType();
+ const TopAbs_ShapeEnum
shape
Type = sm->GetSubShape().ShapeType();
// check for preview dimension limitations
// check for preview dimension limitations
- if ( aShapesId && GetShapeDim(
aSh
Type ) > (int)aDim )
+ if ( aShapesId && GetShapeDim(
shape
Type ) > (int)aDim )
continue;
if (_compute_canceled)
continue;
if (_compute_canceled)
@@
-361,7
+368,7
@@
bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
// -----------------------------------------------
// mesh the rest sub-shapes starting from vertices
// -----------------------------------------------
// -----------------------------------------------
// mesh the rest sub-shapes starting from vertices
// -----------------------------------------------
- ret = Compute( aMesh, aShape, /*anUpward=*/true, aDim, aShapesId );
+ ret = Compute( aMesh, aShape,
aShapeOnly,
/*anUpward=*/true, aDim, aShapesId );
}
MESSAGE( "VSR - SMESH_Gen::Compute() finished, OK = " << ret);
}
MESSAGE( "VSR - SMESH_Gen::Compute() finished, OK = " << ret);
@@
-445,12
+452,12
@@
bool SMESH_Gen::Evaluate(SMESH_Mesh & aMesh,
SMESH_subMesh* smToCompute = smIt->next();
// do not mesh vertices of a pseudo shape
SMESH_subMesh* smToCompute = smIt->next();
// do not mesh vertices of a pseudo shape
- const TopAbs_ShapeEnum
aSh
Type = smToCompute->GetSubShape().ShapeType();
- //if ( !aMesh.HasShapeToMesh() &&
aSh
Type == TopAbs_VERTEX )
+ const TopAbs_ShapeEnum
shape
Type = smToCompute->GetSubShape().ShapeType();
+ //if ( !aMesh.HasShapeToMesh() &&
shape
Type == TopAbs_VERTEX )
// continue;
if ( !aMesh.HasShapeToMesh() ) {
// continue;
if ( !aMesh.HasShapeToMesh() ) {
- if(
aShType == TopAbs_VERTEX || aSh
Type == TopAbs_WIRE ||
-
aSh
Type == TopAbs_SHELL )
+ if(
shapeType == TopAbs_VERTEX || shape
Type == TopAbs_WIRE ||
+
shape
Type == TopAbs_SHELL )
continue;
}
continue;
}
@@
-517,8
+524,6
@@
bool SMESH_Gen::Evaluate(SMESH_Mesh & aMesh,
const int aShapeDim = GetShapeDim( aSubShape );
if ( aShapeDim < 1 ) continue;
const int aShapeDim = GetShapeDim( aSubShape );
if ( aShapeDim < 1 ) continue;
- //const TopAbs_ShapeEnum aShType = smToCompute->GetSubShape().ShapeType();
-
SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
filter
.And( SMESH_HypoFilter::IsApplicableTo( aSubShape ))
SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
filter
.And( SMESH_HypoFilter::IsApplicableTo( aSubShape ))
@@
-625,7
+630,9
@@
static bool checkConformIgnoredAlgos(SMESH_Mesh& aMesh,
theErrors.back().Set( SMESH_Hypothesis::HYP_NOTCONFORM, algo, false );
}
theErrors.back().Set( SMESH_Hypothesis::HYP_NOTCONFORM, algo, false );
}
- // sub-algos will be hidden by a local <algo>
+ // sub-algos will be hidden by a local <algo> if <algo> does not support sub-meshes
+ if ( algo->SupportSubmeshes() )
+ algo = 0;
SMESH_subMeshIteratorPtr revItSub =
aSubMesh->getDependsOnIterator( /*includeSelf=*/false, /*complexShapeFirst=*/true);
bool checkConform2 = false;
SMESH_subMeshIteratorPtr revItSub =
aSubMesh->getDependsOnIterator( /*includeSelf=*/false, /*complexShapeFirst=*/true);
bool checkConform2 = false;
@@
-905,7
+912,6
@@
bool SMESH_Gen::GetAlgoState(SMESH_Mesh& theMesh,
if ( !hasAlgo ) {
ret = false;
if ( !hasAlgo ) {
ret = false;
- INFOS( "None algorithm attached" );
theErrors.push_back( TAlgoStateError() );
theErrors.back().Set( SMESH_Hypothesis::HYP_MISSING, 1, true );
}
theErrors.push_back( TAlgoStateError() );
theErrors.back().Set( SMESH_Hypothesis::HYP_MISSING, 1, true );
}
@@
-973,7
+979,7
@@
std::vector< std::string > SMESH_Gen::GetPluginXMLPaths()
sep = rootDir[pos];
break;
}
sep = rootDir[pos];
break;
}
-#ifdef W
NT
+#ifdef W
IN32
if (sep.empty() ) sep = "\\";
#else
if (sep.empty() ) sep = "/";
if (sep.empty() ) sep = "\\";
#else
if (sep.empty() ) sep = "/";
@@
-988,7
+994,7
@@
std::vector< std::string > SMESH_Gen::GetPluginXMLPaths()
xmlPath += tolower( pluginSubDir[pos] );
xmlPath += sep + plugin + ".xml";
bool fileOK;
xmlPath += tolower( pluginSubDir[pos] );
xmlPath += sep + plugin + ".xml";
bool fileOK;
-#ifdef W
NT
+#ifdef W
IN32
fileOK = (GetFileAttributes(xmlPath.c_str()) != INVALID_FILE_ATTRIBUTES);
#else
fileOK = (access(xmlPath.c_str(), F_OK) == 0);
fileOK = (GetFileAttributes(xmlPath.c_str()) != INVALID_FILE_ATTRIBUTES);
#else
fileOK = (access(xmlPath.c_str(), F_OK) == 0);