X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_ViscousLayers2D.cxx;h=8ad624c6efc6848636ab5e0412a04362698300a2;hp=f759c4ba08470ebbb0680321be638682213de6f1;hb=HEAD;hpb=560f8b2d0c2a7fdb4047f981cfac56ed3629bc1a diff --git a/src/StdMeshers/StdMeshers_ViscousLayers2D.cxx b/src/StdMeshers/StdMeshers_ViscousLayers2D.cxx index f759c4ba0..b89a42c2d 100644 --- a/src/StdMeshers/StdMeshers_ViscousLayers2D.cxx +++ b/src/StdMeshers/StdMeshers_ViscousLayers2D.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -38,6 +38,7 @@ #include "SMESH_Group.hxx" #include "SMESH_HypoFilter.hxx" #include "SMESH_Mesh.hxx" +#include "SMESH_MeshEditor.hxx" #include "SMESH_MesherHelper.hxx" #include "SMESH_ProxyMesh.hxx" #include "SMESH_Quadtree.hxx" @@ -82,6 +83,7 @@ #include #include #include +#include #include #include @@ -112,7 +114,7 @@ namespace VISCOUS_2D { _EdgeSubMesh(const SMDS_Mesh* mesh, int index=0): SubMesh(mesh,index) {} //virtual int NbElements() const { return _elements.size()+1; } - virtual int NbNodes() const { return Max( 0, _uvPtStructVec.size()-2 ); } + virtual smIdType NbNodes() const { return Max( 0, _uvPtStructVec.size()-2 ); } void SetUVPtStructVec(UVPtStructVec& vec) { _uvPtStructVec.swap( vec ); } UVPtStructVec& GetUVPtStructVec() { return _uvPtStructVec; } }; @@ -149,7 +151,7 @@ namespace VISCOUS_2D // Treat events void ProcessEvent(const int event, const int eventType, - SMESH_subMesh* subMesh, + SMESH_subMesh* /*subMesh*/, EventListenerData* data, const SMESH_Hypothesis* /*hyp*/) { @@ -238,9 +240,7 @@ namespace VISCOUS_2D bool SetNewLength( const double length ); -#ifdef _DEBUG_ - int _ID; -#endif + int _ID; // debug }; //-------------------------------------------------------------------------------- /*! @@ -508,8 +508,8 @@ StdMeshers_ViscousLayers2D::StdMeshers_ViscousLayers2D(int hypId, SMESH_Gen* gen _param_algo_dim = -2; // auxiliary hyp used by 2D algos } // -------------------------------------------------------------------------------- -bool StdMeshers_ViscousLayers2D::SetParametersByMesh(const SMESH_Mesh* theMesh, - const TopoDS_Shape& theShape) +bool StdMeshers_ViscousLayers2D::SetParametersByMesh(const SMESH_Mesh* /*theMesh*/, + const TopoDS_Shape& /*theShape*/) { // TODO ??? return false; @@ -672,9 +672,10 @@ bool _ViscousBuilder2D::error(const string& text ) _error->myAlgo = smError->myAlgo; smError = _error; } -#ifdef _DEBUG_ - cout << "_ViscousBuilder2D::error " << text << endl; -#endif + + if (SALOME::VerbosityActivated()) + cout << "_ViscousBuilder2D::error " << text << endl; + return false; } @@ -1337,9 +1338,9 @@ void _ViscousBuilder2D::setLayerEdgeData( _LayerEdge& lEdge, lEdge._ray.SetDirection( lEdge._normal2D ); lEdge._isBlocked = false; lEdge._length2D = 0; -#ifdef _DEBUG_ - lEdge._ID = _nbLE++; -#endif + + if (SALOME::VerbosityActivated()) + lEdge._ID = _nbLE++; } //================================================================================ @@ -2401,6 +2402,17 @@ bool _ViscousBuilder2D::refine() outerNodes.swap( innerNodes ); } + // Add faces to a group + SMDS_MeshGroup* group = StdMeshers_ViscousLayers::CreateGroup( hyp->GetGroupName(), + *_helper.GetMesh(), + SMDSAbs_Face ); + if ( group ) + { + TIDSortedElemSet::iterator fIt = L._newFaces.begin(); + for ( ; fIt != L._newFaces.end(); ++fIt ) + group->Add( *fIt ); + } + // faces between not shared _LayerEdge's (at concave VERTEX) for ( int isR = 0; isR < 2; ++isR ) { @@ -2412,15 +2424,22 @@ bool _ViscousBuilder2D::refine() if ( lNodes.empty() || rNodes.empty() || lNodes.size() != rNodes.size() ) continue; + const SMDS_MeshElement* face = 0; for ( size_t i = 1; i < lNodes.size(); ++i ) - _helper.AddFace( lNodes[ i+prev ], rNodes[ i+prev ], - rNodes[ i+cur ], lNodes[ i+cur ]); + { + face = _helper.AddFace( lNodes[ i+prev ], rNodes[ i+prev ], + rNodes[ i+cur ], lNodes[ i+cur ]); + if ( group ) + group->Add( face ); + } const UVPtStruct& ptOnVertex = points[ isR ? L._lastPntInd : L._firstPntInd ]; if ( isReverse ) - _helper.AddFace( ptOnVertex.node, lNodes[ 0 ], rNodes[ 0 ]); + face = _helper.AddFace( ptOnVertex.node, lNodes[ 0 ], rNodes[ 0 ]); else - _helper.AddFace( ptOnVertex.node, rNodes[ 0 ], lNodes[ 0 ]); + face = _helper.AddFace( ptOnVertex.node, rNodes[ 0 ], lNodes[ 0 ]); + if ( group ) + group->Add( face ); } // Fill the _ProxyMeshOfFace