Salome HOME
projects
/
modules
/
smesh.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cc7e17c
)
Fix regression of 3D_mesh_GHS3D_01/B1
author
eap
<eap@opencascade.com>
Fri, 28 Feb 2020 13:05:59 +0000
(16:05 +0300)
committer
eap
<eap@opencascade.com>
Fri, 28 Feb 2020 13:05:59 +0000
(16:05 +0300)
src/StdMeshers/StdMeshers_ViscousLayers.cxx
patch
|
blob
|
history
diff --git
a/src/StdMeshers/StdMeshers_ViscousLayers.cxx
b/src/StdMeshers/StdMeshers_ViscousLayers.cxx
index 270330be4ed87c7136859482f8130fbd0b2191ac..d82b30bcc699899820034b6e1370c17dca4049c5 100644
(file)
--- a/
src/StdMeshers/StdMeshers_ViscousLayers.cxx
+++ b/
src/StdMeshers/StdMeshers_ViscousLayers.cxx
@@
-1771,7
+1771,7
@@
namespace VISCOUS_3D
PyDump(SMESH_Mesh& m) {
int tag = 3 + m.GetId();
const char* fname = "/tmp/viscous.py";
PyDump(SMESH_Mesh& m) {
int tag = 3 + m.GetId();
const char* fname = "/tmp/viscous.py";
- cout << "exec
file('"<<fname<<"'
)"<<endl;
+ cout << "exec
(open('"<<fname<<"','rb').read()
)"<<endl;
py = _pyStream = new ofstream(fname);
*py << "import SMESH" << endl
<< "from salome.smesh import smeshBuilder" << endl
py = _pyStream = new ofstream(fname);
*py << "import SMESH" << endl
<< "from salome.smesh import smeshBuilder" << endl
@@
-6452,7
+6452,7
@@
gp_XYZ _Smoother1D::getNormalNormal( const gp_XYZ & normal,
void _Smoother1D::offPointsToPython() const
{
const char* fname = "/tmp/offPoints.py";
void _Smoother1D::offPointsToPython() const
{
const char* fname = "/tmp/offPoints.py";
- cout << "exec
file('"<<fname<<"'
)"<<endl;
+ cout << "exec
(open('"<<fname<<"','rb').read()
)"<<endl;
ofstream py(fname);
py << "import SMESH" << endl
<< "from salome.smesh import smeshBuilder" << endl
ofstream py(fname);
py << "import SMESH" << endl
<< "from salome.smesh import smeshBuilder" << endl
@@
-10462,6
+10462,8
@@
namespace VISCOUS_3D
PeriodicFaces( ShrinkFace* sf1, ShrinkFace* sf2 ): _shriFace{ sf1, sf2 } {}
bool IncludeShrunk( const TopoDS_Face& face, const TopTools_MapOfShape& shrunkFaces ) const;
bool MoveNodes( const TopoDS_Face& tgtFace );
PeriodicFaces( ShrinkFace* sf1, ShrinkFace* sf2 ): _shriFace{ sf1, sf2 } {}
bool IncludeShrunk( const TopoDS_Face& face, const TopTools_MapOfShape& shrunkFaces ) const;
bool MoveNodes( const TopoDS_Face& tgtFace );
+ void Clear() { _nnMap.clear(); }
+ bool IsEmpty() const { return _nnMap.empty(); }
};
//--------------------------------------------------------------------------------
};
//--------------------------------------------------------------------------------
@@
-10756,6
+10758,13
@@
namespace VISCOUS_3D
return & _periodicFaces[ i ];
return 0;
}
return & _periodicFaces[ i ];
return 0;
}
+ void ClearPeriodic( const TopoDS_Face& face )
+ {
+ for ( size_t i = 0; i < _periodicFaces.size(); ++i )
+ if ( _periodicFaces[ i ]._shriFace[0]->IsSame( face ) ||
+ _periodicFaces[ i ]._shriFace[1]->IsSame( face ))
+ _periodicFaces[ i ].Clear();
+ }
};
//================================================================================
};
//================================================================================
@@
-10765,6
+10774,7
@@
namespace VISCOUS_3D
bool PeriodicFaces::IncludeShrunk( const TopoDS_Face& face,
const TopTools_MapOfShape& shrunkFaces ) const
{
bool PeriodicFaces::IncludeShrunk( const TopoDS_Face& face,
const TopTools_MapOfShape& shrunkFaces ) const
{
+ if ( IsEmpty() ) return false;
return (( _shriFace[0]->IsSame( face ) && _shriFace[1]->IsShrunk( shrunkFaces )) ||
( _shriFace[1]->IsSame( face ) && _shriFace[0]->IsShrunk( shrunkFaces )));
}
return (( _shriFace[0]->IsSame( face ) && _shriFace[1]->IsShrunk( shrunkFaces )) ||
( _shriFace[1]->IsSame( face ) && _shriFace[0]->IsShrunk( shrunkFaces )));
}
@@
-10785,7
+10795,8
@@
namespace VISCOUS_3D
if ( iSrc != 0 )
{
trsfInverse = _trsf;
if ( iSrc != 0 )
{
trsfInverse = _trsf;
- trsfInverse.Invert();
+ if ( !trsfInverse.Invert())
+ return false;
trsf = &trsfInverse;
}
SMESHDS_Mesh* meshDS = dataSrc->GetHelper().GetMeshDS();
trsf = &trsfInverse;
}
SMESHDS_Mesh* meshDS = dataSrc->GetHelper().GetMeshDS();
@@
-10823,10
+10834,10
@@
namespace VISCOUS_3D
}
}
bool done = ( n2n == _nnMap.end() );
}
}
bool done = ( n2n == _nnMap.end() );
-
// cout << "MMMMMMMOOOOOOOOOOVVVVVVVVVVVEEEEEEEE
"
-
//
<< _shriFace[iSrc]->_subMesh->GetId() << " -> "
-
//
<< _shriFace[iTgt]->_subMesh->GetId() << " -- "
-
// << ( done ? "DONE" : "FAIL") << endl
;
+
debugMsg( "PeriodicFaces::MoveNodes
"
+
<< _shriFace[iSrc]->_subMesh->GetId() << " -> "
+
<< _shriFace[iTgt]->_subMesh->GetId() << " -- "
+
<< ( done ? "DONE" : "FAIL"))
;
return done;
}
return done;
}
@@
-11286,6
+11297,8
@@
bool _ViscousBuilder::shrink(_SolidData& theData)
getMeshDS()->RemoveFreeNode( n, smDS, /*fromGroups=*/false );
}
}
getMeshDS()->RemoveFreeNode( n, smDS, /*fromGroups=*/false );
}
}
+ _periodicity->ClearPeriodic( F );
+
// restore position and UV of target nodes
gp_Pnt p;
for ( size_t iS = 0; iS < subEOS.size(); ++iS )
// restore position and UV of target nodes
gp_Pnt p;
for ( size_t iS = 0; iS < subEOS.size(); ++iS )
@@
-11528,6
+11541,13
@@
bool _ViscousBuilder::prepareEdgeToShrink( _LayerEdge& edge,
if ( !n2 )
return error(SMESH_Comment("Wrongly meshed EDGE ") << getMeshDS()->ShapeToIndex( E ));
if ( !n2 )
return error(SMESH_Comment("Wrongly meshed EDGE ") << getMeshDS()->ShapeToIndex( E ));
+ if ( n2 == tgtNode ) // for 3D_mesh_GHS3D_01/B1
+ {
+ // shrunk by other SOLID
+ edge.Set( _LayerEdge::SHRUNK ); // ???
+ return true;
+ }
+
double uSrc = helper.GetNodeU( E, srcNode, n2 );
double uTgt = helper.GetNodeU( E, tgtNode, srcNode );
double u2 = helper.GetNodeU( E, n2, srcNode );
double uSrc = helper.GetNodeU( E, srcNode, n2 );
double uTgt = helper.GetNodeU( E, tgtNode, srcNode );
double u2 = helper.GetNodeU( E, n2, srcNode );