From 703332aae2da1e286b294480d2ce0d7fa1e5f2ed Mon Sep 17 00:00:00 2001 From: Gerald NICOLAS Date: Tue, 17 Oct 2017 14:41:06 +0200 Subject: [PATCH] Impressions de DEBUG --- src/FrontTrack/FrontTrack.cxx | 14 +++++++++++--- src/FrontTrack/FrontTrack_NodeGroups.cxx | 3 +++ src/FrontTrack/FrontTrack_NodesOnGeom.cxx | 6 ++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/FrontTrack/FrontTrack.cxx b/src/FrontTrack/FrontTrack.cxx index 98974c1c..7c0706c3 100755 --- a/src/FrontTrack/FrontTrack.cxx +++ b/src/FrontTrack/FrontTrack.cxx @@ -55,7 +55,7 @@ void FrontTrack::track( const std::string& theInputMedFile, for ( size_t i = 0; i < theNodeFiles.size(); ++i ) { #ifdef _DEBUG_ - std::cout << "Fichier" << theNodeFiles[i] << std::endl; + std::cout << "Input node file:" << theNodeFiles[i] << std::endl; #endif if ( !FT_Utils::fileExists( theNodeFiles[i] )) throw std::invalid_argument( "Input node file does not exist: " + theNodeFiles[i] ); @@ -92,6 +92,9 @@ void FrontTrack::track( const std::string& theInputMedFile, if ( !xao.importXAO( theXaoFileName ) || !xao.getGeometry() ) throw std::invalid_argument( "Failed to read the XAO input file: " + theXaoFileName ); +#ifdef _DEBUG_ + std::cout << "Conversion en BREP" << std::endl; +#endif XAO::BrepGeometry* xaoGeom = dynamic_cast( xao.getGeometry() ); if ( !xaoGeom || xaoGeom->getTopoDS_Shape().IsNull() ) throw std::invalid_argument( "Failed to get a BREP shape from the XAO input file" ); @@ -104,17 +107,22 @@ void FrontTrack::track( const std::string& theInputMedFile, #endif FT_NodeGroups nodeGroups; nodeGroups.read( theNodeFiles, &xao, nodeCoords ); - +#ifdef _DEBUG_ + std::cout << "Nombre de groupes : " << nodeGroups.nbOfGroups() << std::endl; +#endif // project nodes to the boundary shapes and change their coordinates #ifdef _DEBUG_ - std::cout << "Projection des noeuds" << std::endl; + std::cout << "Projection des noeuds, theIsParallel=" << theIsParallel << std::endl; #endif OSD_Parallel::For( 0, nodeGroups.nbOfGroups(), nodeGroups, !theIsParallel ); // save the modified mesh +#ifdef _DEBUG_ + std::cout << "Ecriture du maillage" << std::endl; +#endif const int erase = 2; mfMesh->write( theOutputMedFile, /*mode=*/erase ); diff --git a/src/FrontTrack/FrontTrack_NodeGroups.cxx b/src/FrontTrack/FrontTrack_NodeGroups.cxx index 917a056a..9c8f6b36 100755 --- a/src/FrontTrack/FrontTrack_NodeGroups.cxx +++ b/src/FrontTrack/FrontTrack_NodeGroups.cxx @@ -34,6 +34,9 @@ namespace { TopTools_IndexedMapOfShape subShapes; TopExp::MapShapes( theMainShape, theSubType, subShapes ); +#ifdef _DEBUG_ + std::cout << ". Nombre de subShapes : " << subShapes.Size() << std::endl; +#endif theProjectors.resize( subShapes.Size() ); for ( int i = 1; i <= subShapes.Size(); ++i ) diff --git a/src/FrontTrack/FrontTrack_NodesOnGeom.cxx b/src/FrontTrack/FrontTrack_NodesOnGeom.cxx index d150c887..ed385fd9 100755 --- a/src/FrontTrack/FrontTrack_NodesOnGeom.cxx +++ b/src/FrontTrack/FrontTrack_NodesOnGeom.cxx @@ -236,6 +236,10 @@ void FT_NodesOnGeom::projectAndMove() size_t iP, iProjector; gp_Pnt newXyz; +#ifdef _DEBUG_ + std::cout << ".. _projectors.size() = " << _projectors.size() << std::endl; + std::cout << ".. _nodesOrder.size() = " << _nodesOrder.size() << std::endl; +#endif if ( _projectors.size() > 1 ) { // the nodes are to be projected onto several boundary shapes; @@ -288,6 +292,8 @@ void FT_NodesOnGeom::projectAndMove() gp_Pnt xyz = getPoint( nn._nodeToMove ); gp_Pnt xyz1 = getPoint( nn._neighborNodes[0] ); gp_Pnt xyz2 = getPoint( nn._neighborNodes[1] ); + +// maxDist2 : le quart du carré de la distance entre les deux voisins du noued à bouger double maxDist2 = xyz1.SquareDistance( xyz2 ) / 4.; if ( _projectors[ 0 ].project( xyz, maxDist2, newXyz, nn._params, nn._nearParams )) -- 2.39.2