X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FNETGENPlugin%2FNETGENPlugin_NETGEN_2D3D.cxx;h=99f5994b8b6b285cd3bb65202042b23b8cb2a25b;hb=1b359b696a744f5cefdd5185651b466a78e5812f;hp=4797cc7314bf62057db83769bd561b2ece5fdd4f;hpb=65987d083d9ef9c3deccf4b87d24fee7f71fc889;p=plugins%2Fnetgenplugin.git diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx index 4797cc7..99f5994 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx @@ -32,10 +32,12 @@ #include "NETGENPlugin_SimpleHypothesis_3D.hxx" #include "NETGENPlugin_Mesher.hxx" +#include +#include #include #include -#include -#include +#include + #include #include @@ -57,11 +59,12 @@ NETGENPlugin_NETGEN_2D3D::NETGENPlugin_NETGEN_2D3D(int hypId, SMESH_Gen* 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, //============================================================================= /*! - * + * */ //============================================================================= 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(); }