Merge from V7_3_BR branch 18/12/2013

This commit is contained in:
vsr 2013-12-18 15:10:27 +00:00
parent 61fa2bb95b
commit c32068e4d7
6 changed files with 47 additions and 19 deletions

View File

@ -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})

View File

@ -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}")

View File

@ -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<QString,QString> i(myLocalSizeMap);

View File

@ -9,7 +9,7 @@
</message>
<message>
<source>NETGEN_2D_TITLE</source>
<translation></translation>
<translation></translation>
</message>
<message>
<source>NETGEN_3D_HYPOTHESIS</source>
@ -17,15 +17,15 @@
</message>
<message>
<source>NETGEN_3D_TITLE</source>
<translation></translation>
<translation></translation>
</message>
<message>
<source>NETGEN_SimpleParameters_3D_HYPOTHESIS</source>
<translation>Netgen 3 D </translation>
<translation>Netgen 3D </translation>
</message>
<message>
<source>NETGEN_SimpleParameters_3D_TITLE</source>
<translation></translation>
<translation></translation>
</message>
<message>
<source>NETGEN_SimpleParameters_2D_HYPOTHESIS</source>
@ -33,7 +33,7 @@
</message>
<message>
<source>NETGEN_SimpleParameters_2D_TITLE</source>
<translation></translation>
<translation></translation>
</message>
<message>
<source>NETGEN_ALLOW_QUADRANGLES</source>
@ -121,7 +121,7 @@
</message>
<message>
<source>NETGEN_LSZ_VERTEX</source>
<translation></translation>
<translation></translation>
</message>
<message>
<source>NETGEN_LSZ_EDGE</source>

View File

@ -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 )
{

View File

@ -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;