mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-02-28 22:25:36 +05:00
23047: [CEA 1472] Incorrect mesh with Netgen 1D-2D-3D but not reported in error
Fix SMESH_MesherHelper::IsReversedSubMesh() 23046: EDF SMESH Regression: Field "Compare" in filters is not updated anymore Make "Compare" empty for all "Belong to ..." criteria IPAL52693: Viscous layers construction fails with SIGSEGV Fix SIGSEGV but bad VL is constructed anyway
This commit is contained in:
parent
42ae6ba11a
commit
8a16cec663
@ -70,7 +70,7 @@ using namespace std;
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
gp_XYZ XYZ(const SMDS_MeshNode* n) { return gp_XYZ(n->X(), n->Y(), n->Z()); }
|
inline SMESH_TNodeXYZ XYZ(const SMDS_MeshNode* n) { return SMESH_TNodeXYZ(n); }
|
||||||
|
|
||||||
enum { U_periodic = 1, V_periodic = 2 };
|
enum { U_periodic = 1, V_periodic = 2 };
|
||||||
}
|
}
|
||||||
@ -2743,38 +2743,80 @@ bool SMESH_MesherHelper::IsReversedSubMesh (const TopoDS_Face& theFace)
|
|||||||
if ( !aSubMeshDSFace )
|
if ( !aSubMeshDSFace )
|
||||||
return isReversed;
|
return isReversed;
|
||||||
|
|
||||||
|
// find an element on a bounday of theFace
|
||||||
|
SMDS_ElemIteratorPtr iteratorElem = aSubMeshDSFace->GetElements();
|
||||||
|
const SMDS_MeshNode* nn[2];
|
||||||
|
while ( iteratorElem->more() ) // loop on elements on theFace
|
||||||
|
{
|
||||||
|
const SMDS_MeshElement* elem = iteratorElem->next();
|
||||||
|
if ( ! elem ) continue;
|
||||||
|
|
||||||
|
// look for 2 nodes on EDGE
|
||||||
|
int nbNodes = elem->NbCornerNodes();
|
||||||
|
nn[0] = elem->GetNode( nbNodes-1 );
|
||||||
|
for ( int iN = 0; iN < nbNodes; ++iN )
|
||||||
|
{
|
||||||
|
nn[1] = elem->GetNode( iN );
|
||||||
|
if ( nn[0]->GetPosition()->GetDim() < 2 &&
|
||||||
|
nn[1]->GetPosition()->GetDim() < 2 )
|
||||||
|
{
|
||||||
|
TopoDS_Shape s0 = GetSubShapeByNode( nn[0], GetMeshDS() );
|
||||||
|
TopoDS_Shape s1 = GetSubShapeByNode( nn[1], GetMeshDS() );
|
||||||
|
TopoDS_Shape E = GetCommonAncestor( s0, s1, *myMesh, TopAbs_EDGE );
|
||||||
|
if ( !E.IsNull() && !s0.IsSame( s1 ))
|
||||||
|
{
|
||||||
|
// is E seam edge?
|
||||||
|
int nb = 0;
|
||||||
|
for ( TopExp_Explorer exp( theFace, TopAbs_EDGE ); exp.More(); exp.Next() )
|
||||||
|
if ( E.IsSame( exp.Current() )) {
|
||||||
|
++nb;
|
||||||
|
E = exp.Current(); // to know orientation
|
||||||
|
}
|
||||||
|
if ( nb == 1 )
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
double u0 = GetNodeU( TopoDS::Edge( E ), nn[0], nn[1], &ok );
|
||||||
|
double u1 = GetNodeU( TopoDS::Edge( E ), nn[1], nn[0], &ok );
|
||||||
|
if ( ok )
|
||||||
|
{
|
||||||
|
isReversed = ( u0 > u1 );
|
||||||
|
if ( E.Orientation() == TopAbs_REVERSED )
|
||||||
|
isReversed = !isReversed;
|
||||||
|
return isReversed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nn[0] = nn[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// find an element with a good normal
|
// find an element with a good normal
|
||||||
gp_Vec Ne;
|
gp_Vec Ne;
|
||||||
bool normalOK = false;
|
bool normalOK = false;
|
||||||
gp_XY uv;
|
gp_XY uv;
|
||||||
SMDS_ElemIteratorPtr iteratorElem = aSubMeshDSFace->GetElements();
|
iteratorElem = aSubMeshDSFace->GetElements();
|
||||||
while ( !normalOK && iteratorElem->more() ) // loop on elements on theFace
|
while ( !normalOK && iteratorElem->more() ) // loop on elements on theFace
|
||||||
{
|
{
|
||||||
const SMDS_MeshElement* elem = iteratorElem->next();
|
const SMDS_MeshElement* elem = iteratorElem->next();
|
||||||
if ( elem && elem->NbCornerNodes() > 2 )
|
if ( ! SMESH_MeshAlgos::FaceNormal( elem, const_cast<gp_XYZ&>( Ne.XYZ() ), /*normalized=*/0 ))
|
||||||
{
|
continue;
|
||||||
SMESH_TNodeXYZ nPnt[3];
|
normalOK = true;
|
||||||
|
|
||||||
|
// get UV of a node inside theFACE
|
||||||
SMDS_ElemIteratorPtr nodesIt = elem->nodesIterator();
|
SMDS_ElemIteratorPtr nodesIt = elem->nodesIterator();
|
||||||
int iNodeOnFace = 0, iPosDim = SMDS_TOP_VERTEX;
|
const SMDS_MeshNode* nInFace = 0;
|
||||||
for ( int iN = 0; nodesIt->more() && iN < 3; ++iN) // loop on nodes
|
int iPosDim = SMDS_TOP_VERTEX;
|
||||||
|
while ( nodesIt->more() ) // loop on nodes
|
||||||
{
|
{
|
||||||
nPnt[ iN ] = nodesIt->next();
|
const SMDS_MeshNode* n = static_cast<const SMDS_MeshNode*>( nodesIt->next() );
|
||||||
if ( nPnt[ iN ]._node->GetPosition()->GetTypeOfPosition() > iPosDim )
|
if ( n->GetPosition()->GetTypeOfPosition() >= iPosDim )
|
||||||
{
|
{
|
||||||
iNodeOnFace = iN;
|
nInFace = n;
|
||||||
iPosDim = nPnt[ iN ]._node->GetPosition()->GetTypeOfPosition();
|
iPosDim = n->GetPosition()->GetTypeOfPosition();
|
||||||
}
|
|
||||||
}
|
|
||||||
// compute normal
|
|
||||||
gp_Vec v01( nPnt[0], nPnt[1] ), v02( nPnt[0], nPnt[2] );
|
|
||||||
if ( v01.SquareMagnitude() > RealSmall() &&
|
|
||||||
v02.SquareMagnitude() > RealSmall() )
|
|
||||||
{
|
|
||||||
Ne = v01 ^ v02;
|
|
||||||
if (( normalOK = ( Ne.SquareMagnitude() > RealSmall() )))
|
|
||||||
uv = GetNodeUV( theFace, nPnt[iNodeOnFace]._node, 0, &normalOK );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
uv = GetNodeUV( theFace, nInFace, 0, &normalOK );
|
||||||
}
|
}
|
||||||
if ( !normalOK )
|
if ( !normalOK )
|
||||||
return isReversed;
|
return isReversed;
|
||||||
@ -2785,11 +2827,8 @@ bool SMESH_MesherHelper::IsReversedSubMesh (const TopoDS_Face& theFace)
|
|||||||
// if ( surf.IsNull() || surf->Continuity() < GeomAbs_C1 )
|
// if ( surf.IsNull() || surf->Continuity() < GeomAbs_C1 )
|
||||||
// some surfaces not detected as GeomAbs_C1 are nevertheless correct for meshing
|
// some surfaces not detected as GeomAbs_C1 are nevertheless correct for meshing
|
||||||
if ( surf.IsNull() || surf->Continuity() < GeomAbs_C0 )
|
if ( surf.IsNull() || surf->Continuity() < GeomAbs_C0 )
|
||||||
{
|
|
||||||
if (!surf.IsNull())
|
|
||||||
MESSAGE("surf->Continuity() < GeomAbs_C1 " << (surf->Continuity() < GeomAbs_C1));
|
|
||||||
return isReversed;
|
return isReversed;
|
||||||
}
|
|
||||||
gp_Vec d1u, d1v; gp_Pnt p;
|
gp_Vec d1u, d1v; gp_Pnt p;
|
||||||
surf->D1( uv.X(), uv.Y(), p, d1u, d1v );
|
surf->D1( uv.X(), uv.Y(), p, d1u, d1v );
|
||||||
gp_Vec Nf = (d1u ^ d1v).Transformed( loc );
|
gp_Vec Nf = (d1u ^ d1v).Transformed( loc );
|
||||||
@ -3217,6 +3256,11 @@ TopoDS_Shape SMESH_MesherHelper::GetCommonAncestor(const TopoDS_Shape& shape1,
|
|||||||
TopoDS_Shape commonAnc;
|
TopoDS_Shape commonAnc;
|
||||||
if ( !shape1.IsNull() && !shape2.IsNull() )
|
if ( !shape1.IsNull() && !shape2.IsNull() )
|
||||||
{
|
{
|
||||||
|
if ( shape1.ShapeType() == ancestorType && IsSubShape( shape2, shape1 ))
|
||||||
|
return shape1;
|
||||||
|
if ( shape2.ShapeType() == ancestorType && IsSubShape( shape1, shape2 ))
|
||||||
|
return shape2;
|
||||||
|
|
||||||
PShapeIteratorPtr ancIt = GetAncestors( shape1, mesh, ancestorType );
|
PShapeIteratorPtr ancIt = GetAncestors( shape1, mesh, ancestorType );
|
||||||
while ( const TopoDS_Shape* anc = ancIt->next() )
|
while ( const TopoDS_Shape* anc = ancIt->next() )
|
||||||
if ( IsSubShape( shape2, *anc ))
|
if ( IsSubShape( shape2, *anc ))
|
||||||
|
@ -1824,9 +1824,9 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con
|
|||||||
case SMESH::FT_BelongToPlane:
|
case SMESH::FT_BelongToPlane:
|
||||||
case SMESH::FT_BelongToCylinder:
|
case SMESH::FT_BelongToCylinder:
|
||||||
case SMESH::FT_BelongToGenSurface:
|
case SMESH::FT_BelongToGenSurface:
|
||||||
case SMESH::FT_LyingOnGeom: nbCompareSigns = 1; isThresholdEditable = true; break;
|
case SMESH::FT_LyingOnGeom: nbCompareSigns = 0; isThresholdEditable = true; break;
|
||||||
|
|
||||||
case SMESH::FT_RangeOfIds: nbCompareSigns = 1; isThresholdEditable = true; break;
|
case SMESH::FT_RangeOfIds: nbCompareSigns = 0; isThresholdEditable = true; break;
|
||||||
|
|
||||||
case SMESH::FT_BadOrientedVolume:
|
case SMESH::FT_BadOrientedVolume:
|
||||||
case SMESH::FT_BareBorderVolume:
|
case SMESH::FT_BareBorderVolume:
|
||||||
|
@ -3791,7 +3791,9 @@ bool _ViscousBuilder::smoothAndCheck(_SolidData& data,
|
|||||||
for ( int iS = 0; iS < data._edgesOnShape.size(); ++iS )
|
for ( int iS = 0; iS < data._edgesOnShape.size(); ++iS )
|
||||||
{
|
{
|
||||||
_EdgesOnShape& eos = data._edgesOnShape[ iS ];
|
_EdgesOnShape& eos = data._edgesOnShape[ iS ];
|
||||||
if ( !eos._toSmooth || eos.ShapeType() != shapeType )
|
if ( !eos._toSmooth ||
|
||||||
|
eos.ShapeType() != shapeType ||
|
||||||
|
eos._edges.empty() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// already smoothed?
|
// already smoothed?
|
||||||
|
Loading…
Reference in New Issue
Block a user