For the case of SALOME_TESTS/Grids/smesh/3D_mesh_NETGEN_05/F6

1) Make "Fuse Nodes on Edges ..." be true by default
  2) Set an error only to a SOLID on which bad elements lie.
This commit is contained in:
eap 2014-03-14 19:41:30 +04:00
parent a01e94cf57
commit 37cd0123d4
2 changed files with 41 additions and 1 deletions

View File

@ -316,7 +316,7 @@ void NETGENPlugin_Hypothesis::SetFuseEdges(bool theVal)
//============================================================================= //=============================================================================
bool NETGENPlugin_Hypothesis::GetDefaultFuseEdges() bool NETGENPlugin_Hypothesis::GetDefaultFuseEdges()
{ {
return false; return true; // false; -- for SALOME_TESTS/Grids/smesh/3D_mesh_NETGEN_05/F6
} }
//============================================================================= //=============================================================================

View File

@ -2095,6 +2095,39 @@ namespace
return str; return str;
} }
//================================================================================
/*!
* \brief Looks for triangles lying on a SOLID
*/
//================================================================================
bool hasBadElemOnSolid( const list<const SMDS_MeshElement*>& elems,
SMESH_subMesh* solidSM )
{
TopTools_IndexedMapOfShape solidSubs;
TopExp::MapShapes( solidSM->GetSubShape(), solidSubs );
SMESHDS_Mesh* mesh = solidSM->GetFather()->GetMeshDS();
list<const SMDS_MeshElement*>::const_iterator e = elems.begin();
for ( ; e != elems.end(); ++e )
{
const SMDS_MeshElement* elem = *e;
if ( elem->GetType() != SMDSAbs_Face )
continue;
int nbNodesOnSolid = 0;
SMDS_NodeIteratorPtr nIt = elem->nodeIterator();
while ( nIt->more() )
{
const SMDS_MeshNode* n = nIt->next();
const TopoDS_Shape& s = mesh->IndexToShape( n->getshapeId() );
nbNodesOnSolid += ( !s.IsNull() && solidSubs.Contains( s ));
if ( nbNodesOnSolid > 2 )
return true;
}
}
return false;
}
const double edgeMeshingTime = 0.001; const double edgeMeshingTime = 0.001;
const double faceMeshingTime = 0.019; const double faceMeshingTime = 0.019;
const double edgeFaceMeshingTime = edgeMeshingTime + faceMeshingTime; const double edgeFaceMeshingTime = edgeMeshingTime + faceMeshingTime;
@ -2698,8 +2731,15 @@ bool NETGENPlugin_Mesher::Compute()
{ {
smError.reset( new SMESH_ComputeError( *error )); smError.reset( new SMESH_ComputeError( *error ));
if ( nbVol && SMESH_Algo::GetMeshError( sm ) == SMESH_Algo::MEr_OK ) if ( nbVol && SMESH_Algo::GetMeshError( sm ) == SMESH_Algo::MEr_OK )
{
smError->myName = COMPERR_WARNING; smError->myName = COMPERR_WARNING;
} }
else if ( !smError->myBadElements.empty() ) // bad surface mesh
{
if ( !hasBadElemOnSolid( smError->myBadElements, sm ))
smError.reset();
}
}
pb3D = pb3D || ( smError && smError->IsKO() ); pb3D = pb3D || ( smError && smError->IsKO() );
} }
if ( !pb2D && !pb3D ) if ( !pb2D && !pb3D )