X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FNETGENPlugin%2FNETGENPlugin_NETGEN_2D3D.cxx;h=320e3ca44c82635f3eb9a12ed757dadd9d30d4ad;hb=2d646f5c7d5ad52f0a47ea87c18d9ce74273599b;hp=b4b25e4e1cfcc22c389c41ac9c70fd1a9856705f;hpb=fd0f83d500bec2be3b3663a22331f2bf9cd24c67;p=plugins%2Fnetgenplugin.git diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx index b4b25e4..320e3ca 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2023 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -32,10 +32,12 @@ #include "NETGENPlugin_SimpleHypothesis_3D.hxx" #include "NETGENPlugin_Mesher.hxx" +#include +#include #include #include -#include -#include +#include + #include #include @@ -53,15 +55,16 @@ using namespace std; */ //============================================================================= -NETGENPlugin_NETGEN_2D3D::NETGENPlugin_NETGEN_2D3D(int hypId, int studyId, +NETGENPlugin_NETGEN_2D3D::NETGENPlugin_NETGEN_2D3D(int hypId, SMESH_Gen* gen) - : SMESH_3D_Algo(hypId, studyId, gen) + : SMESH_3D_Algo(hypId, gen) { - MESSAGE("NETGENPlugin_NETGEN_2D3D::NETGENPlugin_NETGEN_2D3D"); + //MESSAGE("NETGENPlugin_NETGEN_2D3D::NETGENPlugin_NETGEN_2D3D"); _name = "NETGEN_2D3D"; _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);// 1 bit /shape type _compatibleHypothesis.push_back("NETGEN_Parameters"); _compatibleHypothesis.push_back("NETGEN_SimpleParameters_3D"); + _compatibleHypothesis.push_back( StdMeshers_ViscousLayers::GetHypType() ); _requireDiscreteBoundary = false; _onlyUnaryInput = false; _hypothesis = NULL; @@ -70,52 +73,56 @@ NETGENPlugin_NETGEN_2D3D::NETGENPlugin_NETGEN_2D3D(int hypId, int studyId, //============================================================================= /*! - * + * */ //============================================================================= NETGENPlugin_NETGEN_2D3D::~NETGENPlugin_NETGEN_2D3D() { - MESSAGE("NETGENPlugin_NETGEN_2D3D::~NETGENPlugin_NETGEN_2D3D"); + //MESSAGE("NETGENPlugin_NETGEN_2D3D::~NETGENPlugin_NETGEN_2D3D"); } //============================================================================= /*! - * + * */ //============================================================================= -bool NETGENPlugin_NETGEN_2D3D::CheckHypothesis - (SMESH_Mesh& aMesh, - const TopoDS_Shape& aShape, - SMESH_Hypothesis::Hypothesis_Status& aStatus) +bool NETGENPlugin_NETGEN_2D3D::CheckHypothesis (SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape, + Hypothesis_Status& aStatus) { - MESSAGE("NETGENPlugin_NETGEN_2D3D::CheckHypothesis"); - - _hypothesis = NULL; - _mesher = NULL; + _hypothesis = NULL; + _viscousLayersHyp = NULL; + _mesher = NULL; - const list& hyps = GetUsedHypothesis(aMesh, aShape); - int nbHyp = hyps.size(); - if (!nbHyp) + const list& hyps = GetUsedHypothesis(aMesh, aShape, /*noAux=*/false); + if ( hyps.empty() ) { aStatus = SMESH_Hypothesis::HYP_OK; return true; // can work with no hypothesis } - const SMESHDS_Hypothesis* theHyp = hyps.front(); // use only the first hypothesis - - string hypName = theHyp->GetName(); - - if ( find( _compatibleHypothesis.begin(), _compatibleHypothesis.end(), - hypName ) != _compatibleHypothesis.end() ) - { - _hypothesis = theHyp; - aStatus = SMESH_Hypothesis::HYP_OK; - } - else + list::const_iterator h = hyps.begin(); + for ( ; h != hyps.end(); ++h ) { - aStatus = SMESH_Hypothesis::HYP_INCOMPATIBLE; + const SMESHDS_Hypothesis* aHyp = *h; + std::string hypName = aHyp->GetName(); + + if ( std::find( _compatibleHypothesis.begin(), _compatibleHypothesis.end(), + hypName ) != _compatibleHypothesis.end() ) + { + if ( hypName == StdMeshers_ViscousLayers::GetHypType() ) + _viscousLayersHyp = dynamic_cast( aHyp ); + else + _hypothesis = aHyp; + aStatus = SMESH_Hypothesis::HYP_OK; + } + else + { + aStatus = SMESH_Hypothesis::HYP_INCOMPATIBLE; + break; + } } return aStatus == SMESH_Hypothesis::HYP_OK; @@ -135,6 +142,7 @@ bool NETGENPlugin_NETGEN_2D3D::Compute(SMESH_Mesh& aMesh, NETGENPlugin_Mesher mesher(&aMesh, aShape, true); mesher.SetParameters(dynamic_cast(_hypothesis)); mesher.SetParameters(dynamic_cast(_hypothesis)); + mesher.SetParameters(_viscousLayersHyp); mesher.SetSelfPointer( &_mesher ); return mesher.Compute(); }