From: eap Date: Tue, 5 Feb 2019 16:57:10 +0000 (+0300) Subject: 23627. Update documentation of added parameters. X-Git-Tag: V9_3_0a1^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f34db4c07f1c8f208ce35772ad2c1cbfb0f34969;p=plugins%2Fnetgenplugin.git 23627. Update documentation of added parameters. --- diff --git a/doc/salome/gui/NETGENPLUGIN/images/netgen2d3d.png b/doc/salome/gui/NETGENPLUGIN/images/netgen2d3d.png index 17f9d55..5cf924b 100644 Binary files a/doc/salome/gui/NETGENPLUGIN/images/netgen2d3d.png and b/doc/salome/gui/NETGENPLUGIN/images/netgen2d3d.png differ diff --git a/doc/salome/gui/NETGENPLUGIN/images/netgen2d3d_only.png b/doc/salome/gui/NETGENPLUGIN/images/netgen2d3d_only.png deleted file mode 100644 index f0abed3..0000000 Binary files a/doc/salome/gui/NETGENPLUGIN/images/netgen2d3d_only.png and /dev/null differ diff --git a/doc/salome/gui/NETGENPLUGIN/images/netgen2d_remesher.png b/doc/salome/gui/NETGENPLUGIN/images/netgen2d_remesher.png index 67eef4f..7836ad7 100644 Binary files a/doc/salome/gui/NETGENPLUGIN/images/netgen2d_remesher.png and b/doc/salome/gui/NETGENPLUGIN/images/netgen2d_remesher.png differ diff --git a/doc/salome/gui/NETGENPLUGIN/images/netgen_advanced.png b/doc/salome/gui/NETGENPLUGIN/images/netgen_advanced.png new file mode 100644 index 0000000..93219c5 Binary files /dev/null and b/doc/salome/gui/NETGENPLUGIN/images/netgen_advanced.png differ diff --git a/doc/salome/gui/NETGENPLUGIN/input/netgen_2d_3d_hypo.doc b/doc/salome/gui/NETGENPLUGIN/input/netgen_2d_3d_hypo.doc index 9e34081..ddd1e44 100644 --- a/doc/salome/gui/NETGENPLUGIN/input/netgen_2d_3d_hypo.doc +++ b/doc/salome/gui/NETGENPLUGIN/input/netgen_2d_3d_hypo.doc @@ -2,33 +2,43 @@ \page netgen_2d_3d_hypo_page NETGEN 2D and 3D hypotheses -NETGEN 2D Parameters and NETGEN 3D Parameters hypotheses work only with -NETGEN 1D-2D, NETGEN 2D, NETGEN 1D-2D-3D and -NETGEN 3D algorithms. NETGEN 1D-2D and NETGEN -1D-2D-3D algorithms do not require definition of lower-level -hypotheses and algorithms (2D and 1D for meshing 3D objects and 1D for -meshing 2D objects). +NETGEN 2D Parameters and NETGEN 3D Parameters +hypotheses work only with NETGEN algorithm in it's different forms: +- NETGEN 1D-2D +- NETGEN 2D +- NETGEN 1D-2D-3D +- NETGEN 3D. -\image html netgen2d3d.png -
Hypothesis dialog boxes of NETGEN 1D-2D and NETGEN - 1D-2D-3D algorithms are same
-
+NETGEN 1D-2D and NETGEN 1D-2D-3D algorithms do not + require definition of lower-level hypotheses and algorithms (2D and + 1D for meshing 3D objects and 1D for meshing 2D objects). -\image html netgen2d3d_only.png -
Dialog boxes of NETGEN 2D and NETGEN 3D - algorithms
-
-\image html netgen2d_remesher.png -
Hypothesis dialog box of NETGEN 2D remesher algorithms
+NETGEN 1D-2D-3D algorithm has maximal number of options. The +rest forms have less options as they construct elements of less number +of dimensions. All options are distributed among following tabs: +- \ref arguments_anchor "Arguments" - basic options. +- \ref local_sizes_anchor "Local Sizes" - local element size. +- \ref advanced_anchor "Advanced" - advanced options. +- \ref stl_anchor "STL" - specific Remesher options. + +\ref simple_anchor "NETGEN 2D/3D simple parameters" hypotheses allow +defining the size of elements for each dimension separately. +\anchor arguments_anchor +

Arguments tab

+ +Arguments tab defines basic mesh parameters. + +\image html netgen2d3d.png +
Main tab of hypothesis dialog box NETGEN 1D-2D-3D algorithm
+
+ - Name - allows to define the name for the algorithm (NETGEN 2D (or 3D) Parameters by default). - Max Size - maximum linear dimensions for mesh cells. - Min Size - minimum linear dimensions for mesh cells. It is ignored if it is more than Max Size. -- Second Order - if this box is checked in, the algorithm will -create second order mesh. - Fineness - ranging from Very Coarse to Very Fine allows to set the level of meshing detalization using the three parameters below. You can select \a Custom to define them manually. @@ -56,23 +66,33 @@ number of segments on straight edges is defined by values of into account.) If this box is not checked in, then size of elements is defined by three parameters only: Max Size, Min Size and Growth rate. -- Allow Quadrangles - if this box is checked in, the mesher +- Quad-dominated - if this box is checked in, the mesher tries to generate quadrangle 2D mesh. Triangle elements are created where quadrangles are not possible. +- Second Order - if this box is checked in, the algorithm will +create second order mesh. - Optimize - if this box is checked in, the algorithm will modify initially created mesh in order to improve quality of elements. Optimization -process is rather time consuming comparing to creation of initial mesh. -- Fuse Coincident Nodes on Edges and Vertices - allows merging -mesh nodes on vertices and edges which are geometrically coincident -but are topologically different. -- Ridge angle - allows to define minimum angle in degrees between -normals of adjacent triangles at which the remesher (Netgen 2D working -w/o geometry) considers the edge between these triangles as a feature edge. +process is rather time consuming comparing to creation of initial +mesh. + +Remesher has two additional basic options: +- Keep existing edges - if activated, all edges present in the +initial mesh are kept and used to separate STL surfaces. +- Create groups of surfaces if activated, all new surface +elements are distributed among groups corresponding to STL surfaces +the Remesher detects. + + +\anchor local_sizes_anchor +

Local sizes tab

+ +Local sizes tab allows to define size of elements on and +around specified geometrical objects. \image html netgen3d_local_size.png -- Local sizes - allows to define size of elements on and -around specified geometrical objects. To define the local +- To define the local size it is necessary to select a geometrical objects in the object browser or in the viewer, and to click a button corresponding to the type of the geometrical objects: On Vertex, On @@ -103,12 +123,75 @@ section.
25, 0) and (25, 25, 200) size of elements should be 0.3. -\image html netgen2d3d_simple.png + +\anchor advanced_anchor +

Advanced tab

+ +Advanced tab allows advance controlling meshing algorithm. + +\image html netgen_advanced.png + +- Element size weight - weight of triangle size badness with respect to +triangle shape badness. Total triangle badness is evaluated as + shape_badness + size_weight * size_mismatch. +- Nb. surface optimization steps - number of loops when optimizing surface mesh. +- Nb. volume optimization steps - number of loops when optimizing volume mesh. +- Worst element measure - power of error, used to approximate max error optimization. +- Use Delaunay - if activated, use Delaunay approach to +construct volume elements, otherwise use Advancing front method. +- Check overlapping - check overlapping surfaces during surface meshing. +- Check chart boundary - to check chart boundary. +- Fuse Coincident Nodes on Edges and Vertices - allows merging +mesh nodes on vertices and edges which are geometrically coincident +but are topologically different. + + + +\anchor stl_anchor +

STL tab

+ + STL tab holds option of Remesher (NETGEN 2D working w/o geometry). + +\image html netgen2d_remesher.png +
Options specific to NETGEN 2D remesher algorithms
+ + +- Ridge angle - defines minimum angle in degrees between +normals of adjacent triangles at which the remesher considers the edge +between these triangles as a feature edge. Feature edges bound charts +of triangles that are re-meshed as separate surfaces. +- Edge corner angle - defines minimum angle in degrees +between adjacent edges of chart boundary, above which a point shared +by the edges is considered as an end point of chart boundary curve. +- Chart angle - angle between normals of adjacent triangles +under which a shared sharp edge is not considered as chart boundary, +provided that this edge is not classified as chart boundary due +to Ridge angle and Keep existing edges options. +- Outer chart angle - angle for overlapping parts of chart. +- Chart distance - defines a factor used to limit element +size by distance to neighbor chart. +- Line length - defines a factor used to limit size +of elements located near ends of chart boundary curves by length of a +chart boundary curve. +- Close edges - defines a factor used to limit size +of elements located near chart boundary curves by distance to other +chart boundary curves. +- Surface curvature - defines a factor used to limit size +of elements by surface curvature. +- Edge angle - defines a factor used to limit size +of elements by chart boundary curve curvature. +- Surface mesh curvature - defines a number of elements per +curvature radius. + +\anchor simple_anchor +

NETGEN 2D/3D simple parameters

NETGEN 2D simple parameters and NETGEN 3D simple -parameters allow defining the size of elements for each +parameters
hypotheses allow defining the size of elements for each dimension. +\image html netgen2d3d_simple.png + \b 1D group allows defining the size of 1D elements in either of two ways: - Number of Segments allows specifying number of segments, that will split each edge, with equidistant distribution. diff --git a/src/GUI/NETGENPluginGUI_HypothesisCreator.cxx b/src/GUI/NETGENPluginGUI_HypothesisCreator.cxx index 0847703..6dce103 100644 --- a/src/GUI/NETGENPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/NETGENPluginGUI_HypothesisCreator.cxx @@ -478,15 +478,16 @@ QFrame* NETGENPluginGUI_HypothesisCreator::buildFrame() optLayout->setSpacing( 6 ); int row = 0; - optLayout->addWidget( new QLabel( tr( "NETGEN_ELEM_SIZE_WEIGHT" ), optBox ), row, 0 ); - myElemSizeWeight = new SMESHGUI_SpinBox( optBox ); - myElemSizeWeight->RangeStepAndValidator( 0., 1., 0.1, "parametric_precision" ); - optLayout->addWidget( myElemSizeWeight, row, 1 ); - row++; - + myElemSizeWeight = 0; myNbSurfOptSteps = 0; - if ( myIs2D || !myIsONLY ) + if ( myIs2D || !myIsONLY ) // 2D options { + optLayout->addWidget( new QLabel( tr( "NETGEN_ELEM_SIZE_WEIGHT" ), optBox ), row, 0 ); + myElemSizeWeight = new SMESHGUI_SpinBox( optBox ); + myElemSizeWeight->RangeStepAndValidator( 0., 1., 0.1, "parametric_precision" ); + optLayout->addWidget( myElemSizeWeight, row, 1 ); + row++; + optLayout->addWidget( new QLabel( tr( "NETGEN_NB_SURF_OPT_STEPS" ), optBox ), row, 0 ); myNbSurfOptSteps = new SalomeApp_IntSpinBox( optBox ); myNbSurfOptSteps->setMinimum( 0 ); @@ -515,24 +516,37 @@ QFrame* NETGENPluginGUI_HypothesisCreator::buildFrame() insLayout->setSpacing( 6 ); int row = 0; - insLayout->addWidget( new QLabel( tr( "NETGEN_WORST_ELEM_MEASURE" ), insGroup ), row, 0 ); - myWorstElemMeasure = new SalomeApp_IntSpinBox( insGroup ); - myWorstElemMeasure->setMinimum( 1 ); - myWorstElemMeasure->setMaximum( 10 ); - insLayout->addWidget( myWorstElemMeasure, row, 1, 1, 2 ); - row++; + myWorstElemMeasure = 0; + myUseDelauney = 0; + if ( !myIs2D ) + { + insLayout->addWidget( new QLabel( tr( "NETGEN_WORST_ELEM_MEASURE" ), insGroup ), row, 0 ); + myWorstElemMeasure = new SalomeApp_IntSpinBox( insGroup ); + myWorstElemMeasure->setMinimum( 1 ); + myWorstElemMeasure->setMaximum( 10 ); + insLayout->addWidget( myWorstElemMeasure, row, 1, 1, 2 ); + row++; - myUseDelauney = new QCheckBox( tr( "NETGEN_USE_DELAUNEY" ), insGroup ); - insLayout->addWidget( myUseDelauney, row, 0, 1, 2 ); - row++; + myUseDelauney = new QCheckBox( tr( "NETGEN_USE_DELAUNEY" ), insGroup ); + insLayout->addWidget( myUseDelauney, row, 0, 1, 2 ); + row++; + } - myCheckOverlapping = new QCheckBox( tr( "NETGEN_CHECK_OVERLAPPING" ), insGroup ); - insLayout->addWidget( myCheckOverlapping, row, 0, 1, 2 ); - row++; + myCheckOverlapping = 0; + if ( myIs2D || !myIsONLY ) // 2D options + { + myCheckOverlapping = new QCheckBox( tr( "NETGEN_CHECK_OVERLAPPING" ), insGroup ); + insLayout->addWidget( myCheckOverlapping, row, 0, 1, 2 ); + row++; + } - myCheckChartBoundary = new QCheckBox( tr( "NETGEN_CHECK_CHART_BOUNDARY" ), insGroup ); - insLayout->addWidget( myCheckChartBoundary, row, 0, 1, 2 ); - row++; + myCheckChartBoundary = 0; + if ( isRemesher ) + { + myCheckChartBoundary = new QCheckBox( tr( "NETGEN_CHECK_CHART_BOUNDARY" ), insGroup ); + insLayout->addWidget( myCheckChartBoundary, row, 0, 1, 2 ); + row++; + } myFuseEdges = 0; if ( !myIsONLY && !isRemesher ) @@ -590,9 +604,12 @@ void NETGENPluginGUI_HypothesisCreator::retrieveParams() const if (myFuseEdges) myFuseEdges->setChecked( data.myFuseEdges ); setTextOrVar( myWorstElemMeasure, data.myWorstElemMeasure, data.myWorstElemMeasureVar ); - myUseDelauney->setChecked( data.myUseDelauney ); - myCheckOverlapping->setChecked( data.myCheckOverlapping ); - myCheckChartBoundary->setChecked( data.myCheckChartBoundary ); + if ( myUseDelauney ) + myUseDelauney->setChecked( data.myUseDelauney ); + if ( myCheckOverlapping ) + myCheckOverlapping->setChecked( data.myCheckOverlapping ); + if ( myCheckChartBoundary ) + myCheckChartBoundary->setChecked( data.myCheckChartBoundary ); if ( myRidgeAngle ) { @@ -824,9 +841,9 @@ bool NETGENPluginGUI_HypothesisCreator::storeParamsToHypo( const NetgenHypothesi h->SetVarParameter ( h_data.myWorstElemMeasureVar.toLatin1().constData(), "SetWorstElemMeasure"); h->SetWorstElemMeasure( h_data.myWorstElemMeasure ); - h->SetUseDelauney( myUseDelauney ); - h->SetCheckOverlapping( myCheckOverlapping ); - h->SetCheckChartBoundary( myCheckChartBoundary ); + h->SetUseDelauney( h_data.myUseDelauney ); + h->SetCheckOverlapping( h_data.myCheckOverlapping ); + h->SetCheckChartBoundary( h_data.myCheckChartBoundary ); //if ( myIs2D ) { @@ -938,8 +955,11 @@ bool NETGENPluginGUI_HypothesisCreator::readParamsFromWidgets( NetgenHypothesisD if ( myFuseEdges ) h_data.myFuseEdges = myFuseEdges->isChecked(); - h_data.myElemSizeWeight = myElemSizeWeight->value(); - h_data.myElemSizeWeightVar = myElemSizeWeight->text(); + if ( myElemSizeWeight ) + { + h_data.myElemSizeWeight = myElemSizeWeight->value(); + h_data.myElemSizeWeightVar = myElemSizeWeight->text(); + } if ( myNbSurfOptSteps ) { h_data.myNbSurfOptSteps = myNbSurfOptSteps->value(); @@ -950,12 +970,19 @@ bool NETGENPluginGUI_HypothesisCreator::readParamsFromWidgets( NetgenHypothesisD h_data.myNbVolOptSteps = myNbVolOptSteps->value(); h_data.myNbVolOptStepsVar = myNbVolOptSteps->text(); } - h_data.myWorstElemMeasure = myWorstElemMeasure->value(); - h_data.myWorstElemMeasureVar = myWorstElemMeasure->text(); + if ( myWorstElemMeasure ) + { + h_data.myWorstElemMeasure = myWorstElemMeasure->value(); + h_data.myWorstElemMeasureVar = myWorstElemMeasure->text(); + } + if ( myUseDelauney ) + h_data.myUseDelauney = myUseDelauney->isChecked(); + + if ( myCheckOverlapping ) + h_data.myCheckOverlapping = myCheckOverlapping->isChecked(); - h_data.myUseDelauney = myUseDelauney->isChecked(); - h_data.myCheckOverlapping = myCheckOverlapping->isChecked(); - h_data.myCheckChartBoundary = myCheckChartBoundary->isChecked(); + if ( myCheckChartBoundary ) + h_data.myCheckChartBoundary = myCheckChartBoundary->isChecked(); if ( myRidgeAngle ) { diff --git a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx index d1b32d9..8d0e2ad 100644 --- a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx @@ -299,8 +299,8 @@ void NETGENPlugin_Mesher::SetParameters(const NETGENPlugin_Hypothesis* hyp) mparams.uselocalh = hyp->GetSurfaceCurvature(); netgen::merge_solids = hyp->GetFuseEdges(); _chordalError = hyp->GetChordalErrorEnabled() ? hyp->GetChordalError() : -1.; - mparams.optsteps2d = hyp->GetNbSurfOptSteps(); - mparams.optsteps3d = hyp->GetNbVolOptSteps(); + mparams.optsteps2d = _optimize ? hyp->GetNbSurfOptSteps() : 0; + mparams.optsteps3d = _optimize ? hyp->GetNbVolOptSteps() : 0; mparams.elsizeweight = hyp->GetElemSizeWeight(); mparams.opterrpow = hyp->GetWorstElemMeasure(); mparams.delaunay = hyp->GetUseDelauney();