From: vsr Date: Wed, 18 Dec 2013 15:10:27 +0000 (+0000) Subject: Merge from V7_3_BR branch 18/12/2013 X-Git-Tag: V7_4_0a1~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c32068e4d77bdea72351c2fcf720b8c4d978dcec;p=plugins%2Fnetgenplugin.git Merge from V7_3_BR branch 18/12/2013 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index c955823..46d4e83 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ CMAKE_POLICY(SET CMP0003 NEW) STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7) -SET(${PROJECT_NAME_UC}_MINOR_VERSION 2) +SET(${PROJECT_NAME_UC}_MINOR_VERSION 3) SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) SET(${PROJECT_NAME_UC}_VERSION ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) @@ -139,6 +139,12 @@ IF(EXISTS ${SMESH_ROOT_DIR}) MESSAGE(FATAL_ERROR "We absolutely need a Salome SMESH with GUI, please set SALOME_BUILD_GUI=ON in SMESH module") ENDIF(NOT SALOME_SMESH_BUILD_GUI) ENDIF(SALOME_BUILD_GUI) + IF(SALOME_BUILD_DOC) + IF(NOT SALOME_SMESH_BUILD_DOC) + MESSAGE(FATAL_ERROR "We absolutely need a Salome SMESH documentation to build NETGENPLUGIN documentation. " + "So, you should either set SALOME_BUILD_DOC=OFF in NETGENPLUGIN or set SALOME_BUILD_DOC=ON in SMESH module.") + ENDIF(NOT SALOME_SMESH_BUILD_DOC) + ENDIF(SALOME_BUILD_DOC) ELSE(EXISTS ${SMESH_ROOT_DIR}) MESSAGE(FATAL_ERROR "We absolutely need a Salome SMESH, please define SMESH_ROOT_DIR") ENDIF(EXISTS ${SMESH_ROOT_DIR}) diff --git a/doc/salome/gui/NETGENPLUGIN/CMakeLists.txt b/doc/salome/gui/NETGENPLUGIN/CMakeLists.txt index 0f018e5..144a250 100755 --- a/doc/salome/gui/NETGENPLUGIN/CMakeLists.txt +++ b/doc/salome/gui/NETGENPLUGIN/CMakeLists.txt @@ -47,4 +47,5 @@ INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/NETGENPLUGIN DESTINATION ${SALOME_ INSTALL(FILES images/head.png DESTINATION ${SALOME_INSTALL_DOC}/gui/NETGENPLUGIN) INSTALL(FILES images/head.png DESTINATION ${SALOME_INSTALL_DOC}/gui/NETGENPLUGIN/netgenpluginpy_doc) -SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES NETGENPLUGIN) +SET(make_clean_files NETGENPLUGIN netgenpluginpy_doc.tag) +SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}") diff --git a/src/GUI/NETGENPluginGUI_HypothesisCreator.cxx b/src/GUI/NETGENPluginGUI_HypothesisCreator.cxx index 7a0a094..abb45c4 100644 --- a/src/GUI/NETGENPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/NETGENPluginGUI_HypothesisCreator.cxx @@ -443,13 +443,14 @@ bool NETGENPluginGUI_HypothesisCreator::storeParamsToHypo( const NetgenHypothesi h->SetVarParameter( h_data.myMinSizeVar.toLatin1().constData(), "SetMinSize"); h->SetMinSize( h_data.myMinSize ); - if ( myIs2D ) + //if ( myIs2D ) { - NETGENPlugin::NETGENPlugin_Hypothesis_2D_var h_2d = - NETGENPlugin::NETGENPlugin_Hypothesis_2D::_narrow( h ); + // NETGENPlugin::NETGENPlugin_Hypothesis_2D_var h_2d = + // NETGENPlugin::NETGENPlugin_Hypothesis_2D::_narrow( h ); - if ( !h_2d->_is_nil() ) - h_2d->SetQuadAllowed( h_data.myAllowQuadrangles ); + // if ( !h_2d->_is_nil() ) + // h_2d->SetQuadAllowed( h_data.myAllowQuadrangles ); + h->SetQuadAllowed( h_data.myAllowQuadrangles ); } QMapIterator i(myLocalSizeMap); diff --git a/src/GUI/NETGENPlugin_msg_ja.ts b/src/GUI/NETGENPlugin_msg_ja.ts index 8f5276d..d423ab1 100644 --- a/src/GUI/NETGENPlugin_msg_ja.ts +++ b/src/GUI/NETGENPlugin_msg_ja.ts @@ -9,7 +9,7 @@ NETGEN_2D_TITLE - 仮説の構築 + 設定項目 NETGEN_3D_HYPOTHESIS @@ -17,15 +17,15 @@ NETGEN_3D_TITLE - 仮説の構築 + 設定項目 NETGEN_SimpleParameters_3D_HYPOTHESIS - Netgen 3 D 簡易パラメーター + Netgen 3D 簡易パラメーター NETGEN_SimpleParameters_3D_TITLE - 仮説の構築 + 設定項目 NETGEN_SimpleParameters_2D_HYPOTHESIS @@ -33,7 +33,7 @@ NETGEN_SimpleParameters_2D_TITLE - 仮説の構築 + 設定項目 NETGEN_ALLOW_QUADRANGLES @@ -121,7 +121,7 @@ NETGEN_LSZ_VERTEX - 点上 + 頂点 NETGEN_LSZ_EDGE diff --git a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx index 5992141..8587523 100644 --- a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx @@ -1667,10 +1667,12 @@ NETGENPlugin_Mesher::AddSegmentsToMesh(netgen::Mesh& ngMesh, // element size (regression on issue 0020452, note 0010898) int iPrev = SMESH_MesherHelper::WrapIndex( i-1, nbSegments ); int iNext = SMESH_MesherHelper::WrapIndex( i+1, nbSegments ); - int nbSeg = 1 + ( segLen[ iPrev ] > 1e-20 ) + ( segLen[ iNext ] > 1e-20 ); - double avgH = ( segLen[ iPrev ] + segLen[ i ] + segLen[ iNext ]) / nbSeg; - - RestrictLocalSize( ngMesh, 0.5*(np1+np2), avgH ); + double sunH = segLen[ iPrev ] + segLen[ i ] + segLen[ iNext ]; + int nbSeg = ( int( segLen[ iPrev ] > sunH / 100.) + + int( segLen[ i ] > sunH / 100.) + + int( segLen[ iNext ] > sunH / 100.)); + if ( nbSeg > 0 ) + RestrictLocalSize( ngMesh, 0.5*(np1+np2), sunH / nbSeg ); } if ( isInternalWire ) { diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx index 81a2280..4c4fea2 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx @@ -244,18 +244,35 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh, if ( nbSegments ) edgeLength /= nbSegments; } - if ( _hypMaxElementArea ) + else if ( _hypMaxElementArea ) { double maxArea = _hypMaxElementArea->GetMaxArea(); edgeLength = sqrt(2. * maxArea/sqrt(3.0)); } + else + { + // set edgeLength by a longest segment + double maxSeg2 = 0; + for ( int iW = 0; iW < nbWires; ++iW ) + { + const UVPtStructVec& points = wires[ iW ]->GetUVPtStruct(); + gp_Pnt pPrev = SMESH_TNodeXYZ( points[0].node ); + for ( size_t i = 1; i < points.size(); ++i ) + { + gp_Pnt p = SMESH_TNodeXYZ( points[i].node ); + maxSeg2 = Max( maxSeg2, p.SquareDistance( pPrev )); + pPrev = p; + } + } + edgeLength = sqrt( maxSeg2 ) * 1.05; + } if ( edgeLength < DBL_MIN ) edgeLength = occgeo.GetBoundingBox().Diam(); netgen::mparam.maxh = edgeLength; netgen::mparam.minh = aMesher.GetDefaultMinSize( aShape, netgen::mparam.maxh ); netgen::mparam.quad = _hypQuadranglePreference ? 1 : 0; - netgen::mparam.grading = 0.7; // very coarse mesh by default + netgen::mparam.grading = 0.4; // Moderate fineness by default } occgeo.face_maxh = netgen::mparam.maxh; @@ -383,6 +400,7 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh, netgen::mparam.maxh = Max( netgen::mparam.maxh, size ); } } + //cerr << "min " << netgen::mparam.minh << " max " << netgen::mparam.maxh << endl; netgen::mparam.minh *= 0.9; netgen::mparam.maxh *= 1.1;