PyDump(SMESH_Mesh& m) {
int tag = 3 + m.GetId();
const char* fname = "/tmp/viscous.py";
- cout << "execfile('"<<fname<<"')"<<endl;
+ cout << "exec(open('"<<fname<<"','rb').read() )"<<endl;
py = _pyStream = new ofstream(fname);
*py << "import SMESH" << endl
<< "from salome.smesh import smeshBuilder" << endl
void _Smoother1D::offPointsToPython() const
{
const char* fname = "/tmp/offPoints.py";
- cout << "execfile('"<<fname<<"')"<<endl;
+ cout << "exec(open('"<<fname<<"','rb').read() )"<<endl;
ofstream py(fname);
py << "import SMESH" << endl
<< "from salome.smesh import smeshBuilder" << endl
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(); }
};
//--------------------------------------------------------------------------------
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();
+ }
};
//================================================================================
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 )));
}
if ( iSrc != 0 )
{
trsfInverse = _trsf;
- trsfInverse.Invert();
+ if ( !trsfInverse.Invert())
+ return false;
trsf = &trsfInverse;
}
SMESHDS_Mesh* meshDS = dataSrc->GetHelper().GetMeshDS();
}
}
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;
}
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 )
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 );