From: Nabil Ghodbane Date: Mon, 26 Jul 2021 14:50:36 +0000 (+0200) Subject: SALOME 9.3.0 - NETGENPLUGIN - do not forget to apply dos2unix... otherwise patch... X-Git-Tag: V9_8_0~117 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a63669a836ac2640729feba50ea03246ce3f746e;p=tools%2Fsat_salome.git SALOME 9.3.0 - NETGENPLUGIN - do not forget to apply dos2unix... otherwise patch on Windows will fail! --- diff --git a/products/patches/NETGENPlugin_Mesh.patch b/products/patches/NETGENPlugin_Mesh.patch index e69de29..ddc0651 100644 --- a/products/patches/NETGENPlugin_Mesh.patch +++ b/products/patches/NETGENPlugin_Mesh.patch @@ -0,0 +1,327 @@ +diff --git a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx +index f6398f4..7faff19 100644 +--- a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx ++++ b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx +@@ -83,6 +83,7 @@ + #include + #include + //#include ++ + namespace netgen { + #ifdef NETGEN_V5 + extern int OCCGenerateMesh (OCCGeometry&, Mesh*&, MeshingParameters&, int, int); +@@ -406,7 +407,7 @@ namespace + if ( node_id->second == newNgId) + { + #if defined(DUMP_SEGMENTS) || defined(DUMP_TRIANGLES) +- cout << "Ng " << newNgId << " - " << node; ++ std::cout << "Ng " << newNgId << " - " << node; + #endif + netgen::MeshPoint p( netgen::Point<3> (node->X(), node->Y(), node->Z()) ); + ngMesh.AddPoint( p ); +@@ -986,12 +987,12 @@ double NETGENPlugin_Mesher::GetDefaultMinSize(const TopoDS_Shape& geom, + if ( minh > 0.25 * bb.SquareExtent() ) // simple geometry, rough triangulation + { + minh = 1e-3 * sqrt( bb.SquareExtent()); +- //cout << "BND BOX minh = " <ShapeToIndex( face ) << endl +- << "\tface index: " << seg.si << endl +- << "\tp1: " << seg[0] << endl +- << "\tp2: " << seg[1] << endl +- << "\tp0 param: " << seg.epgeominfo[ 0 ].dist << endl +- << "\tp0 uv: " << seg.epgeominfo[ 0 ].u <<", "<< seg.epgeominfo[ 0 ].v << endl +- //<< "\tp0 edge: " << seg.epgeominfo[ 0 ].edgenr << endl +- << "\tp1 param: " << seg.epgeominfo[ 1 ].dist << endl +- << "\tp1 uv: " << seg.epgeominfo[ 1 ].u <<", "<< seg.epgeominfo[ 1 ].v << endl; +- //<< "\tp1 edge: " << seg.epgeominfo[ 1 ].edgenr << endl; ++ std::cout << "Segment: " << seg.edgenr << " on SMESH face " << helper.GetMeshDS()->ShapeToIndex( face ) << std::endl ++ << "\tface index: " << seg.si << std::endl ++ << "\tp1: " << seg[0] << std::endl ++ << "\tp2: " << seg[1] << std::endl ++ << "\tp0 param: " << seg.epgeominfo[ 0 ].dist << std::endl ++ << "\tp0 uv: " << seg.epgeominfo[ 0 ].u <<", "<< seg.epgeominfo[ 0 ].v << std::endl ++ //<< "\tp0 edge: " << seg.epgeominfo[ 0 ].edgenr << std::endl ++ << "\tp1 param: " << seg.epgeominfo[ 1 ].dist << std::endl ++ << "\tp1 uv: " << seg.epgeominfo[ 1 ].u <<", "<< seg.epgeominfo[ 1 ].v << std::endl; ++ //<< "\tp1 edge: " << seg.epgeominfo[ 1 ].edgenr << std::endl; + #endif + if ( isSeam ) + { +@@ -1195,10 +1196,10 @@ bool NETGENPlugin_Mesher::FillNgMesh(netgen::OCCGeometry& occgeom, + seg.edgenr = ngMesh.GetNSeg() + 1; // segment id + ngMesh.AddSegment( seg ); + #ifdef DUMP_SEGMENTS +- cout << "Segment: " << seg.edgenr << endl ++ std::cout << "Segment: " << seg.edgenr << std::endl + << "\t is SEAM (reverse) of the previous. " + << " Other " << (helper.GetPeriodicIndex() && 1 ? "U" : "V") +- << " = " << otherSeamParam << endl; ++ << " = " << otherSeamParam << std::endl; + #endif + } + else if ( fOri == TopAbs_INTERNAL ) +@@ -1208,7 +1209,7 @@ bool NETGENPlugin_Mesher::FillNgMesh(netgen::OCCGeometry& occgeom, + seg.edgenr = ngMesh.GetNSeg() + 1; // segment id + ngMesh.AddSegment( seg ); + #ifdef DUMP_SEGMENTS +- cout << "Segment: " << seg.edgenr << endl << "\t is REVERSE of the previous" << endl; ++ std::cout << "Segment: " << seg.edgenr << std::endl << "\t is REVERSE of the previous" << std::endl; + #endif + } + } +@@ -1359,8 +1360,8 @@ bool NETGENPlugin_Mesher::FillNgMesh(netgen::OCCGeometry& occgeom, + SMESH_TNodeXYZ xyz[3]; + + #ifdef DUMP_TRIANGLES +- cout << "SMESH face " << helper.GetMeshDS()->ShapeToIndex( geomFace ) +- << " internal="<ShapeToIndex( geomFace ) ++ << " internal="<GetElements(); +@@ -1411,7 +1412,7 @@ bool NETGENPlugin_Mesher::FillNgMesh(netgen::OCCGeometry& occgeom, + + ngMesh.AddSurfaceElement (tri); + #ifdef DUMP_TRIANGLES +- cout << tri << endl; ++ std::cout << tri << std::endl; + #endif + + if ( isInternalFace ) +@@ -1419,7 +1420,7 @@ bool NETGENPlugin_Mesher::FillNgMesh(netgen::OCCGeometry& occgeom, + swap( tri[1], tri[2] ); + ngMesh.AddSurfaceElement (tri); + #ifdef DUMP_TRIANGLES +- cout << tri << endl; ++ std::cout << tri << std::endl; + #endif + } + } +@@ -1824,7 +1825,7 @@ void NETGENPlugin_Mesher::AddIntVerticesInFaces(const netgen::OCCGeometry& o + double nodeDist3D = evalDist( vData.uv, vData.uvClose, surf ); + bool avgLenOK = ( avgSegLen2d < 0.75 * nodeDist2D ); + bool hintLenOK = ( segLenHint < 0.75 * nodeDist3D ); +- //cout << "uvV " << uvV.X() <<","< (P.X(), P.Y(), P.Z())); + ngMesh.AddPoint ( mp, 1, netgen::EDGEPOINT ); + segEnd2 = ngMesh.GetNP(); +- //cout << "Middle " << r << " uv " << uvP.X() << "," << uvP.Y() << "( " << ngMesh.Point(segEnd2).X()<<","<GetID() << endl +- << "\tp2: " << seg[1] << " n" << nodeVec[ seg[1]]->GetID() << endl +- << "\tp0 param: " << seg.epgeominfo[ 0 ].dist << endl +- << "\tp0 uv: " << seg.epgeominfo[ 0 ].u <<", "<< seg.epgeominfo[ 0 ].v << endl +- << "\tp0 edge: " << seg.epgeominfo[ 0 ].edgenr << endl +- << "\tp1 param: " << seg.epgeominfo[ 1 ].dist << endl +- << "\tp1 uv: " << seg.epgeominfo[ 1 ].u <<", "<< seg.epgeominfo[ 1 ].v << endl +- << "\tp1 edge: " << seg.epgeominfo[ 1 ].edgenr << endl; ++ std::cout << "Segment: " << seg.edgenr << std::endl ++ << "\tp1: " << seg[0] << " n" << nodeVec[ seg[0]]->GetID() << std::endl ++ << "\tp2: " << seg[1] << " n" << nodeVec[ seg[1]]->GetID() << std::endl ++ << "\tp0 param: " << seg.epgeominfo[ 0 ].dist << std::endl ++ << "\tp0 uv: " << seg.epgeominfo[ 0 ].u <<", "<< seg.epgeominfo[ 0 ].v << std::endl ++ << "\tp0 edge: " << seg.epgeominfo[ 0 ].edgenr << std::endl ++ << "\tp1 param: " << seg.epgeominfo[ 1 ].dist << std::endl ++ << "\tp1 uv: " << seg.epgeominfo[ 1 ].u <<", "<< seg.epgeominfo[ 1 ].v << std::endl ++ << "\tp1 edge: " << seg.epgeominfo[ 1 ].edgenr << std::endl; + } +- cout << "--END WIRE " << iW << endl; ++ std::cout << "--END WIRE " << iW << std::endl; + #else + SMESH_Comment __not_unused_variable( prevNbNGSeg ); + #endif +@@ -3669,8 +3670,8 @@ double NETGENPlugin_Mesher::GetProgress(const SMESH_Algo* holder, + double doneShapeRate = _curShapeIndex / double( _occgeom->fmap.Extent() ); + double doneTime = edgeMeshingTime + doneShapeRate * faceMeshingTime; + ((double&) _ticTime) = doneTime / _totalTime / _progressTic; +- // cout << "shape " << _curShapeIndex << " _ticTime " << _ticTime +- // << " " << doneTime / _totalTime / _progressTic << endl; ++ // std::cout << "shape " << _curShapeIndex << " _ticTime " << _ticTime ++ // << " " << doneTime / _totalTime / _progressTic << std::endl; + } + } + } +@@ -3688,8 +3689,8 @@ double NETGENPlugin_Mesher::GetProgress(const SMESH_Algo* holder, + double doneShapeRate = _curShapeIndex / double( _occgeom->somap.Extent() ); + double doneTime = edgeFaceMeshingTime + doneShapeRate * voluMeshingTime; + ((double&) _ticTime) = doneTime / _totalTime / _progressTic; +- // cout << "shape " << _curShapeIndex << " _ticTime " << _ticTime +- // << " " << doneTime / _totalTime / _progressTic << endl; ++ // std::cout << "shape " << _curShapeIndex << " _ticTime " << _ticTime ++ // << " " << doneTime / _totalTime / _progressTic << std::endl; + } + } + +@@ -3708,7 +3709,7 @@ double NETGENPlugin_Mesher::GetProgress(const SMESH_Algo* holder, + ((int&) *algoProgressTic )++; + ((double&) *algoProgress) = progress; + } +- //cout << progress << " " << *algoProgressTic << " " << netgen::multithread.task << " "<< _ticTime << endl; ++ //std::cout << progress << " " << *algoProgressTic << " " << netgen::multithread.task << " "<< _ticTime << std::endl; + + return Min( progress, 0.99 ); + } +@@ -3802,10 +3803,10 @@ void NETGENPlugin_Mesher::toPython( const netgen::Mesh* ngMesh ) + ofstream outfile( pyFile, ios::out ); + if ( !outfile ) return; + +- outfile << "import salome, SMESH" << endl +- << "from salome.smesh import smeshBuilder" << endl +- << "smesh = smeshBuilder.New()" << endl +- << "mesh = smesh.Mesh()" << endl << endl; ++ outfile << "import salome, SMESH" << std::endl ++ << "from salome.smesh import smeshBuilder" << std::endl ++ << "smesh = smeshBuilder.New()" << std::endl ++ << "mesh = smesh.Mesh()" << std::endl << std::endl; + + using namespace netgen; + PointIndex pi; +@@ -3815,12 +3816,12 @@ void NETGENPlugin_Mesher::toPython( const netgen::Mesh* ngMesh ) + outfile << "mesh.AddNode( "; + outfile << (*ngMesh)[pi](0) << ", "; + outfile << (*ngMesh)[pi](1) << ", "; +- outfile << (*ngMesh)[pi](2) << ") ## "<< pi << endl; ++ outfile << (*ngMesh)[pi](2) << ") ## "<< pi << std::endl; + } + + int nbDom = ngMesh->GetNDomains(); + for ( int i = 0; i < nbDom; ++i ) +- outfile<< "grp" << i+1 << " = mesh.CreateEmptyGroup( SMESH.FACE, 'domain"<< i+1 << "')"<< endl; ++ outfile<< "grp" << i+1 << " = mesh.CreateEmptyGroup( SMESH.FACE, 'domain"<< i+1 << "')"<< std::endl; + + SurfaceElementIndex sei; + for (sei = 0; sei < ngMesh->GetNSE(); sei++) +@@ -3830,14 +3831,14 @@ void NETGENPlugin_Mesher::toPython( const netgen::Mesh* ngMesh ) + for (int j = 0; j < sel.GetNP(); j++) + outfile << sel[j] << ( j+1 < sel.GetNP() ? ", " : " ])"); + if ( sel.IsDeleted() ) outfile << " ## IsDeleted "; +- outfile << endl; ++ outfile << std::endl; + + if ((*ngMesh)[sei].GetIndex()) + { + if ( int dom1 = ngMesh->GetFaceDescriptor((*ngMesh)[sei].GetIndex ()).DomainIn()) +- outfile << "grp"<< dom1 <<".Add([ " << (int)sei+1 << " ])" << endl; ++ outfile << "grp"<< dom1 <<".Add([ " << (int)sei+1 << " ])" << std::endl; + if ( int dom2 = ngMesh->GetFaceDescriptor((*ngMesh)[sei].GetIndex ()).DomainOut()) +- outfile << "grp"<< dom2 <<".Add([ " << (int)sei+1 << " ])" << endl; ++ outfile << "grp"<< dom2 <<".Add([ " << (int)sei+1 << " ])" << std::endl; + } + } + +@@ -3847,7 +3848,7 @@ void NETGENPlugin_Mesher::toPython( const netgen::Mesh* ngMesh ) + outfile << "mesh.AddVolume([ "; + for (int j = 0; j < el.GetNP(); j++) + outfile << el[j] << ( j+1 < el.GetNP() ? ", " : " ])"); +- outfile << endl; ++ outfile << std::endl; + } + + for (int i = 1; i <= ngMesh->GetNSeg(); i++) +@@ -3855,9 +3856,9 @@ void NETGENPlugin_Mesher::toPython( const netgen::Mesh* ngMesh ) + const Segment & seg = ngMesh->LineSegment (i); + outfile << "mesh.AddEdge([ " + << seg[0] << ", " +- << seg[1] << " ])" << endl; ++ << seg[1] << " ])" << std::endl; + } +- cout << "Write " << pyFile << endl; ++ std::cout << "Write " << pyFile << std::endl; + } + + //================================================================================ +@@ -4174,7 +4175,7 @@ void NETGENPlugin_Internals::getInternalEdges( TopTools_IndexedMapOfShape& fmap, + + ( ev.ShapeType() == TopAbs_EDGE ? emap : vmap ).Add( ev ); + fmap.Add( face ); +- //cout<<"INTERNAL EDGE or VERTEX "<first<<" on face "<second<first<<" on face "<second<first )); + } +@@ -4309,7 +4310,7 @@ NETGENPlugin_NetgenLibWrapper::NETGENPlugin_NetgenLibWrapper() + netgen::myerr = netgen::mycout; + _coutBuffer = std::cout.rdbuf(); + #ifdef _DEBUG_ +- cout << "NOTE: netgen output is redirected to file " << _outputFileName << endl; ++ std::cout << "NOTE: netgen output is redirected to file " << _outputFileName << std::endl; + #else + std::cout.rdbuf( netgen::mycout->rdbuf() ); + #endif