merge V7_7_BR

This commit is contained in:
Paul RASCLE 2016-02-01 15:23:06 +01:00
commit 193c49c877
303 changed files with 16075 additions and 6685 deletions

View File

@ -28,8 +28,8 @@ CMAKE_POLICY(SET CMP0003 NEW)
STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7) SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7)
SET(${PROJECT_NAME_UC}_MINOR_VERSION 6) SET(${PROJECT_NAME_UC}_MINOR_VERSION 7)
SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) SET(${PROJECT_NAME_UC}_PATCH_VERSION 1)
SET(${PROJECT_NAME_UC}_VERSION SET(${PROJECT_NAME_UC}_VERSION
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
SET(${PROJECT_NAME_UC}_VERSION_DEV 0) SET(${PROJECT_NAME_UC}_VERSION_DEV 0)
@ -121,7 +121,9 @@ IF(SALOME_BUILD_GUI)
IF(EXISTS ${GUI_ROOT_DIR}) IF(EXISTS ${GUI_ROOT_DIR})
LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files") LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
FIND_PACKAGE(SalomeGUI) FIND_PACKAGE(SalomeGUI)
FULL_GUI(TRUE) #check whether GUI builded in full mode and with CORBA SALOME_GUI_WITH_CORBA() #check whether GUI builded with CORBA
SALOME_GUI_MODE(SALOME_USE_VTKVIEWER SALOME_USE_SALOMEOBJECT
OPTIONAL SALOME_USE_PLOT2DVIEWER SALOME_USE_PYCONSOLE)
## ##
## Prerequisites From GUI: ## Prerequisites From GUI:
## ##

View File

@ -165,6 +165,7 @@ SET(GOOD_TESTS
transforming_meshes_ex13.py transforming_meshes_ex13.py
use_existing_faces.py use_existing_faces.py
viewing_meshes_ex02.py viewing_meshes_ex02.py
split_biquad.py
) )
SET(EXAMPLES_TESTS ${BAD_TESTS} ${GOOD_TESTS} testme.py) SET(EXAMPLES_TESTS ${BAD_TESTS} ${GOOD_TESTS} testme.py)

View File

@ -0,0 +1,37 @@
# Split bi-quadratic to linear
import salome
salome.salome_init()
from salome.geom import geomBuilder
geompy = geomBuilder.New(salome.myStudy)
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy)
# make a shape consisting of two quadranges
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
OY1 = geompy.MakeTranslation( OY, 1, 0, 0 )
OY2 = geompy.MakeTranslation( OY, 2, 0, 0 )
q1 = geompy.MakeQuad2Edges( OY, OY1 )
q2 = geompy.MakeQuad2Edges( OY1, OY2 )
shape = geompy.Partition( [q1,q2], theName='shape' )
ff = geompy.SubShapeAll( shape, geompy.ShapeType["FACE"], theName="quad" )
# mesh one quadrange with quadrangless and the other with triangles
mesh = smesh.Mesh( shape )
mesh.Segment().NumberOfSegments(1)
mesh.Quadrangle()
mesh.Triangle( ff[1] )
mesh.Compute()
# make group of quadrangles and extrude them into a hexahedron
quadGroup = mesh.Group( ff[0], "quads")
mesh.ExtrusionSweepObject2D( quadGroup, [0,0,1], 1 )
# make the mesh bi-quadratic
mesh.ConvertToQuadratic( theToBiQuad=True )
# split all elements into linear ones
mesh.SplitBiQuadraticIntoLinear()

View File

@ -1,16 +1,11 @@
# Translation # Translation
import SMESH_mechanic import SMESH_mechanic
import SMESH
smesh = SMESH_mechanic.smesh
mesh = SMESH_mechanic.mesh mesh = SMESH_mechanic.mesh
# define translation vector # define translation vector
point = SMESH.PointStruct(-150., -150., 0.) vector = [-150., -150., 0.]
vector =SMESH.DirStruct(point)
# translate a mesh # make a translated copy of all elements of the mesh
doCopy = 1 mesh.TranslateObject(mesh, vector, Copy=True)
mesh.Translate([], vector, doCopy)

View File

@ -1,10 +1,14 @@
# Merging Nodes # Merging Nodes
import SMESH_mechanic import SMESH_mechanic, SMESH
mesh = SMESH_mechanic.mesh mesh = SMESH_mechanic.mesh
# merge nodes # merge nodes
Tolerance = 25.0 Tolerance = 4.0
# prevent nodes located on geom edges from removal during merge:
# create a group including all nodes on edges
allSegs = mesh.MakeGroup( "all segments", SMESH.EDGE, SMESH.FT_ElemGeomType,'=', SMESH.Geom_EDGE )
GroupsOfNodes = mesh.FindCoincidentNodes(Tolerance) GroupsOfNodes = mesh.FindCoincidentNodes(Tolerance)
mesh.MergeNodes(GroupsOfNodes) mesh.MergeNodes(GroupsOfNodes, NodesToKeep=allSegs)

View File

@ -11,35 +11,40 @@ import SMESH, SALOMEDS
from salome.smesh import smeshBuilder from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy) smesh = smeshBuilder.New(salome.myStudy)
# create two faces of the box # make two not sewed quadranges
box1 = geompy.MakeBox(0., 0., 0., 20., 20., 15.) OY0 = geompy.MakeVectorDXDYDZ(0, 1, 0)
facesList1 = geompy.SubShapeAll(box1, geompy.ShapeType["FACE"]) OY1 = geompy.MakeTranslation( OY0, 1, 0, 0, theName="OY1" )
face1 = facesList1[2] OY2 = geompy.MakeTranslation( OY0, 1.01, 0, 0, theName="OY2" )
OY3 = geompy.MakeTranslation( OY0, 2, 0, 0 )
q1 = geompy.MakeQuad2Edges( OY0, OY1 )
q2 = geompy.MakeQuad2Edges( OY2, OY3 )
box2 = geompy.MakeBox(0., 5., 0., 20., 20., 15.) shape = geompy.MakeCompound( [q1,q2], theName='shape' )
facesList2 = geompy.SubShapeAll(box2, geompy.ShapeType["FACE"])
face2 = facesList2[1]
edgesList = geompy.SubShapeAll(face2, geompy.ShapeType["EDGE"])
edge1 = edgesList[2]
aComp = geompy.MakeCompound([face1, face2])
geompy.addToStudy(aComp, "Two faces")
# create a mesh on two faces
mesh = smesh.Mesh(aComp, "Two faces : quadrangle mesh")
algo1D = mesh.Segment()
algo1D.NumberOfSegments(4)
algo2D = mesh.Quadrangle()
algo_local = mesh.Segment(edge1)
algo_local.Arithmetic1D(1, 4)
algo_local.Propagation()
# make a non-uniform quadrangle mesh on two faces
mesh = smesh.Mesh(shape, "Two faces : quadrangle mesh")
mesh.Segment().Arithmetic1D( 0.1, 0.4 )
mesh.Segment(q1).NumberOfSegments( 5 )
mesh.Quadrangle()
mesh.Compute() mesh.Compute()
# sew free borders # sew free borders
# FirstNodeID1, SecondNodeID1, LastNodeID1,
# FirstNodeID2, SecondNodeID2, LastNodeID2, CreatePolygons, CreatePolyedrs segs1 = mesh.GetSubMeshElementsId( OY1 ) # mesh segments generated on borders
mesh.SewFreeBorders(6, 21, 5, 1, 12, 3, 0, 0) segs2 = mesh.GetSubMeshElementsId( OY2 )
FirstNodeID1 = mesh.GetElemNode( segs1[0], 0 )
SecondNodeID1 = mesh.GetElemNode( segs1[0], 1 )
LastNodeID1 = mesh.GetElemNode( segs1[-1], 1 )
FirstNodeID2 = mesh.GetElemNode( segs2[0], 0 )
SecondNodeID2 = mesh.GetElemNode( segs2[0], 1 )
LastNodeID2 = mesh.GetElemNode( segs2[-1], 1 )
CreatePolygons = True
CreatePolyedrs = False
res = mesh.SewFreeBorders(FirstNodeID1, SecondNodeID1, LastNodeID1,
FirstNodeID2, SecondNodeID2, LastNodeID2,
CreatePolygons, CreatePolyedrs )
print res
print "nb polygons:", mesh.NbPolygons()

View File

@ -20,7 +20,7 @@ aComp = geompy.MakeCompound([box1, box2])
geompy.addToStudy(aComp, "Two boxes") geompy.addToStudy(aComp, "Two boxes")
# create a mesh on two boxes # create a mesh on two boxes
mesh = smesh.Mesh(aComp, "Two faces : quadrangle mesh") mesh = smesh.Mesh(aComp, "Sew Side Elements")
algo1D = mesh.Segment() algo1D = mesh.Segment()
algo1D.NumberOfSegments(2) algo1D.NumberOfSegments(2)
@ -33,6 +33,31 @@ algo_local.Propagation()
mesh.Compute() mesh.Compute()
# sew side elements # sew side elements
# IDsOfSide1Elements, IDsOfSide2Elements,
# NodeID1OfSide1ToMerge, NodeID1OfSide2ToMerge, NodeID2OfSide1ToMerge, NodeID2OfSide2ToMerge # find elements to sew
mesh.SewSideElements([69, 70, 71, 72], [91, 92, 89, 90], 8, 38, 23, 58) face1 = geompy.GetFaceNearPoint( aComp, geompy.MakeVertex( 5, 10, 5 ))
IDsOfSide1Elements = mesh.GetSubMeshElementsId( face1 )
print "side faces 1:",IDsOfSide1Elements
face1Translated = geompy.MakeTranslation( face1, 0,5,0 )
faceFilter = smesh.GetFilter( SMESH.FACE, SMESH.FT_BelongToGeom,'=', face1Translated )
IDsOfSide2Elements = mesh.GetIdsFromFilter( faceFilter )
print "side faces 2:",IDsOfSide2Elements
# find corresponding nodes on sides
edge1 = geompy.GetEdgeNearPoint( aComp, geompy.MakeVertex( 0, 10, 5 ))
segs1 = mesh.GetSubMeshElementsId( edge1 ) # mesh segments generated on edge1
NodeID1OfSide1ToMerge = mesh.GetElemNode( segs1[0], 0 )
NodeID2OfSide1ToMerge = mesh.GetElemNode( segs1[0], 1 )
print "nodes of side1:", [NodeID1OfSide1ToMerge,NodeID2OfSide1ToMerge]
edge2 = geompy.GetEdgeNearPoint( aComp, geompy.MakeVertex( 0, 15, 5 ))
segs2 = mesh.GetSubMeshElementsId( edge2 ) # mesh segments generated on edge2
NodeID1OfSide2ToMerge = mesh.GetElemNode( segs2[0], 0 )
NodeID2OfSide2ToMerge = mesh.GetElemNode( segs2[0], 1 )
print "nodes of side2:", [NodeID1OfSide2ToMerge,NodeID2OfSide2ToMerge]
res = mesh.SewSideElements(IDsOfSide1Elements, IDsOfSide2Elements,
NodeID1OfSide1ToMerge, NodeID1OfSide2ToMerge,
NodeID2OfSide1ToMerge, NodeID2OfSide2ToMerge)
print res

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

BIN
doc/salome/gui/SMESH/images/free_borders1.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
doc/salome/gui/SMESH/images/image152.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 25 KiB

BIN
doc/salome/gui/SMESH/images/image88.jpg Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

BIN
doc/salome/gui/SMESH/images/mergeelems.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 13 KiB

BIN
doc/salome/gui/SMESH/images/mergenodes.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 28 KiB

BIN
doc/salome/gui/SMESH/images/merging_nodes1.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
doc/salome/gui/SMESH/images/merging_nodes2.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
doc/salome/gui/SMESH/images/sewing1.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 24 KiB

BIN
doc/salome/gui/SMESH/images/sewing2.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 28 KiB

BIN
doc/salome/gui/SMESH/images/sewing3.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 31 KiB

BIN
doc/salome/gui/SMESH/images/sewing4.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 945 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

View File

@ -5,31 +5,31 @@
Basic 1D hypothesis specifies: Basic 1D hypothesis specifies:
<ul> <ul>
<li>how \ref a1d_algos_anchor "Wire Discretization" should divide the edge;</li> <li>how \ref a1d_algos_anchor "Wire Discretization" should divide the edge;</li>
<li>how \ref a1d_algos_anchor "Composite Side Discretization" should divide the group of C1-continues edges.</li> <li>how \ref a1d_algos_anchor "Composite Side Discretization" should divide the group of C1-continuous edges.</li>
</ul> </ul>
By type of nodes distribution the 1D hypotheses can be categorized as follows: 1D hypotheses can be categorized by type of nodes distribution as follows:
<ul> <ul>
<li>Uniform distribution <li>Uniform distribution:
<ul> <ul>
<li>\ref average_length_anchor "Local Length"</li> <li>\ref average_length_anchor "Local Length"</li>
<li>\ref max_length_anchor "Max Size"</li> <li>\ref max_length_anchor "Max Size"</li>
<li>\ref number_of_segments_anchor "Number of segments" with Equidistant distribution</li> <li>\ref number_of_segments_anchor "Number of segments" with Equidistant distribution</li>
<li>\ref automatic_length_anchor "Automatic Length"</li> <li>\ref automatic_length_anchor "Automatic Length"</li>
</ul></li> </ul></li>
<li>Constantly increasing or decreasing length of segments <li>Constantly increasing or decreasing length of segments:
<ul> <ul>
<li>\ref arithmetic_1d_anchor "Arithmetic 1D"</li> <li>\ref arithmetic_1d_anchor "Arithmetic 1D"</li>
<li>\ref geometric_1d_anchor "Geometric Progression"</li> <li>\ref geometric_1d_anchor "Geometric Progression"</li>
<li>\ref start_and_end_length_anchor "Start and end length"</li> <li>\ref start_and_end_length_anchor "Start and end length"</li>
<li>\ref number_of_segments_anchor "Number of segments" with Scale distribution</li> <li>\ref number_of_segments_anchor "Number of segments" with Scale distribution</li>
</ul></li> </ul></li>
<li>Distribution depending on curvature <li>Distribution depending on curvature:
<ul> <ul>
<li>\ref adaptive_1d_anchor "Adaptive"</li> <li>\ref adaptive_1d_anchor "Adaptive"</li>
<li>\ref deflection_1d_anchor "Deflection 1D"</li> <li>\ref deflection_1d_anchor "Deflection 1D"</li>
</ul></li> </ul></li>
<li>Arbitrary distribution <li>Arbitrary distribution:
<ul> <ul>
<li>\ref fixed_points_1d_anchor "Fixed points 1D"</li> <li>\ref fixed_points_1d_anchor "Fixed points 1D"</li>
<li>\ref number_of_segments_anchor "Number of segments" with <li>\ref number_of_segments_anchor "Number of segments" with
@ -144,12 +144,17 @@ composing your geometrical object. Definition of this hypothesis
consists of setting the \b length of segments, which will approximate these consists of setting the \b length of segments, which will approximate these
edges, and the \b precision of rounding. edges, and the \b precision of rounding.
The \b precision parameter is used to round a number of segments, The \b precision parameter is used to round a <em>number of segments</em>,
calculated by dividing the edge length by the specified \b length of calculated by dividing the <em>edge length</em> by the specified \b length of
segment, to the higher integer if the remainder exceeds the precision segment, to the higher integer if the \a remainder exceeds the \b precision
and to the lower integer otherwise. Use value 0.5 to provide rounding and to the lower integer otherwise. <br>
to the nearest integer, 1.0 for the lower integer, 0.0 for the higher Use value 0.5 to provide rounding to the nearest integer, 1.0 for the lower integer, 0.0 for the higher integer. Default value is 1e-07.
integer. Default value is 1e-07.
For example: if <em>edge length</em> is 10.0 and the segment \b length
is 3.0 then their division gives 10./3. = 3.33(3) and the \a remainder is 0.33(3).
If \b precision is less than 0.33(3) then the edge is divided into 3 segments.
If \b precision is more than 0.33(3) then the edge is divided into 4 segments.
\image html image41.gif \image html image41.gif
@ -245,6 +250,7 @@ negative</b>.
\ref tui_deflection_1d "Defining Number of Segments" hypothesis \ref tui_deflection_1d "Defining Number of Segments" hypothesis
operation. operation.
\note The plot functionality is available only if GUI module is builded with Plot 2D Viewer (set option SALOME_USE_PLOT2DVIEWER to ON when building GUI module).
<br> <br>
\anchor start_and_end_length_anchor \anchor start_and_end_length_anchor
@ -316,7 +322,7 @@ possible to select the edges to be reversed either directly picking them in
the 3D viewer or selecting the edges or groups of edges in the the 3D viewer or selecting the edges or groups of edges in the
Object Browser. Object Browser.
\ref reversed_edges_helper_anchor "Helper" group assists you in \ref reversed_edges_helper_anchor "Helper" group assists in
defining <b>Reversed Edges</b> parameter. defining <b>Reversed Edges</b> parameter.
@ -330,23 +336,23 @@ defining <b>Reversed Edges</b> parameter.
\image html rev_edges_helper_dlg.png \image html rev_edges_helper_dlg.png
\b Helper group assists you in defining <b>Reversed Edges</b> \b Helper group assists in defining <b>Reversed Edges</b>
parameter of the hypotheses depending on edge direction. parameter of the hypotheses depending on edge direction.
<b>Show whole geometry</b> check-box lets you see the whole <b>Show whole geometry</b> check-box allows seeing the whole
geometrical model in the 3D Viewer. This can help you to understand geometrical model in the 3D Viewer, which can help to understand the
location within the model of a set of edges shown in the Viewer. location of a set of edges within the model.
<b>Propagation chains</b> group helps you to define <b>Propagation chains</b> group allows defining <b>Reversed Edges</b>
<b>Reversed Edges</b> so that opposite edges of quadrilateral faces for splitting opposite edges of quadrilateral faces
will be split in the logically same direction. When this group is in a logically uniform direction. When this group is
activated, the list is filled with propagation chains found within the activated, the list is filled with propagation chains found within the
model. When you select a chain in the list, edges of the chain are model. When a chain is selected in the list its edges are
shown in the Viewer with arrows so that you can chose a common shown in the Viewer with arrows, which enables choosing a common
direction for all chain edges. \b Reverse button inverses the common direction for all chain edges. \b Reverse button inverts the common
direction of chain edges. If \b Add button is active, this means that some direction of chain edges. If \b Add button is active, some
edges of a chain have different direction and you can click \b Add edges of a chain have a different direction, so you can click \b Add
button to add such edges to <b>Reversed Edges</b> list. button to add them to <b>Reversed Edges</b> list.
\image html propagation_chain.png "The whole geometry and a propagation chain" \image html propagation_chain.png "The whole geometry and a propagation chain"

View File

@ -26,9 +26,9 @@ which will compose the mesh of these faces.
\anchor length_from_edges_anchor \anchor length_from_edges_anchor
<h2>Length from Edges</h2> <h2>Length from Edges</h2>
<b>Length from edges</b> hypothesis defines maximum linear size of <b>Length from edges</b> hypothesis defines the maximum linear size of
mesh faces as an average length of mesh edges approximating a boundary mesh faces as an average length of mesh edges approximating
of a face being meshed. the meshed face boundary.
<b>See Also</b> a sample TUI Script of a <b>See Also</b> a sample TUI Script of a
\ref tui_length_from_edges "Length from Edges" hypothesis operation. \ref tui_length_from_edges "Length from Edges" hypothesis operation.
@ -38,7 +38,7 @@ of a face being meshed.
\image html hypo_quad_params_dialog.png "Quadrangle parameters: Transition" \image html hypo_quad_params_dialog.png "Quadrangle parameters: Transition"
<b>Quadrangle parameters</b> is a hypothesis for Quadrangle (Mapping) algorithm. <b>Quadrangle parameters</b> is a hypothesis for \ref quad_ijk_algo_page.
<b>Transition</b> tab is used to define the algorithm of transition <b>Transition</b> tab is used to define the algorithm of transition
between opposite sides of the face with a different number of between opposite sides of the face with a different number of
@ -113,7 +113,7 @@ of the enforced nodes.
projected to the meshed face and located close enough to the projected to the meshed face and located close enough to the
meshed face will be used to create the enforced nodes.</li> meshed face will be used to create the enforced nodes.</li>
</ul> </ul>
\note <b>Enforced nodes</b> can't be created at \b Reduced transition type. \note <b>Enforced nodes</b> cannot be created at \b Reduced transition type.
Let us see how the algorithm works: Let us see how the algorithm works:
<ul> <ul>

View File

@ -26,7 +26,7 @@ about selection filters and their usage in GUI.
- In Python scripts, filters can be used to choose only some mesh - In Python scripts, filters can be used to choose only some mesh
entities (nodes or elements) for the operations, which require the entities (nodes or elements) for the operations, which require the
list of entities as input parameter (create/modify group, remove list of entities as input parameter (create/modify group, remove
nodes/elements, etc) and for the operations, which accept objects as nodes/elements, etc) and for the operations, which accept objects
as input parameter. The page \ref tui_filters_page provides as input parameter. The page \ref tui_filters_page provides
examples of the filters usage in Python scripts. examples of the filters usage in Python scripts.
*/ */

View File

@ -14,17 +14,16 @@ The choice of a hypothesis depends on the selected algorithm.
Hypotheses are created during creation and edition of Hypotheses are created during creation and edition of
\ref constructing_meshes_page "meshes" and \ref constructing_meshes_page "meshes" and
\ref constructing_submeshes_page "sub-mesh". \ref constructing_submeshes_page "sub-meshes".
Once created a hypotheses can be reused during creation and Once created a hypotheses can be reused during creation and edition of
edition of other meshes and sub-meshes. All created hypotheses and other meshes and sub-meshes. All created hypotheses and algorithms are
algorithms are present in the Object Browser in \a Hypotheses and present in the Object Browser in \a Hypotheses and \a Algorithms
\a Algorithms folders correspondingly. From the context menu of the folders correspondingly. It is possible to open a dialog to modify the
hypothesis you can invoke a dialog for modification of its parameters, parameters of a hypothesis from its context menu. This menu also
and \b Unassign command that will unassign the hypothesis from all provides \b Unassign command that will unassign the hypothesis from
the meshes and sub-meshes using it. all meshes and sub-meshes using it. Modification of any parameter of a
Modification of any hypothesis parameter and unassignment of a hypothesis and its unassignment leads to automatic removal of elements
hypothesis leads to automatic removal of elements generated with use generated using it.
of this hypothesis.
In \b MESH there are the following Basic Hypotheses: In \b MESH there are the following Basic Hypotheses:
<ul> <ul>

View File

@ -19,31 +19,31 @@ Mesh module provides several ways to create the mesh:
Construction of \subpage constructing_submeshes_page "sub-meshes" Construction of \subpage constructing_submeshes_page "sub-meshes"
allows to discretize some sub-shapes of the main shape, for example a face, allows to discretize some sub-shapes of the main shape, for example a face,
using different meshing parameters than other sub-shapes.<br> using the meshing parameters that differ from those for other sub-shapes.<br>
Meshing parameters of meshes and sub-meshes can be Meshing parameters of meshes and sub-meshes can be
\subpage editing_meshes_page "edited". (Upon edition only mesh entities \subpage editing_meshes_page "edited". (Upon edition only mesh entities
generated using changed meshing parameters are removed and will be generated using changed meshing parameters are removed and will be
re-computed).<br> re-computed).<br>
\note Algorithms and hypotheses used at mesh level are referred as \note Algorithms and hypotheses used at mesh level are referred to as
\a global ones and those used at sub-mesh level are referred as \a \a global ones and those used at sub-mesh level are referred to as \a
local ones. local ones.
</li> </li>
<li>Bottom-up way, using \ref modifying_meshes_page "mesh modification" <li>Bottom-up way, using \ref modifying_meshes_page "mesh modification"
operations, especially \ref extrusion_page "extrusion" and \ref operations, especially \ref extrusion_page "extrusion" and \ref
revolution_page "revolution". To create an empty mesh not based on revolution_page "revolution". To create an empty mesh not based on a
geometry, use the same dialog as to \ref constructing_meshes_page geometry, use the same dialog as to \ref constructing_meshes_page
"construct the mesh on geometry" but do not specify any geometry "construct the mesh on geometry" but do not specify a geometry
nor meshing algorithm. or a meshing algorithm.
</li> </li>
<li>The mesh can be \ref importing_exporting_meshes_page "imported" from <li>The mesh can be \subpage importing_exporting_meshes_page "imported" from
(and exported to) the file in MED, UNV, STL, CGNS, DAT, GMF and (and exported to) the file in MED, UNV, STL, CGNS, DAT, GMF and
SAUVE formats. SAUVE formats.
</li> </li>
<li>The 3D mesh can be generated from the 2D mesh, \ref <li>The 3D mesh can be generated from the 2D mesh, \ref
importing_exporting_meshes_page "imported" or manually created. To importing_exporting_meshes_page "imported" or manually created. To
setup the meshing parameters of a mesh not based on geometry, just setup the meshing parameters of a mesh not based on a geometry, just
invoke \ref editing_meshes_page "Edit mesh / sub-mesh" command on invoke \ref editing_meshes_page "Edit mesh / sub-mesh" command on
your 3D mesh. your 2D mesh.
</li> </li>
<li>Several meshes can be \subpage building_compounds_page "combined" <li>Several meshes can be \subpage building_compounds_page "combined"
into a new mesh. into a new mesh.
@ -66,29 +66,29 @@ Attractive meshing capabilities include:
sub-meshes. sub-meshes.
The \b structure of a SALOME mesh is described by nodes and elements based on The \b structure of a SALOME mesh is described by nodes and elements based on
these nodes. Geometry of the element is defined by the sequence of these nodes. The geometry of an element is defined by the sequence of
nodes constituting it and nodes constituting it and
the <a href="http://www.code-aster.org/outils/med/html/connectivites.html"> the <a href="http://www.code-aster.org/outils/med/html/connectivites.html">
connectivity convention </a> (adopted from MED library). Definition of connectivity convention </a> (adopted from MED library). Definition of
the element basing on elements of lower dimension is NOT supported. the element basing on the elements of a lower dimension is NOT supported.
\anchor mesh_entities \anchor mesh_entities
The mesh can include the following entities: The mesh can include the following entities:
<ul> <ul>
<li>\b Node &mdash; an entity of a mesh defining a position in 3D <li>\b Node &mdash; a mesh entity defining a position in 3D
space with coordinates (x, y, z).</li> space with coordinates (x, y, z).</li>
<li>\b Edge (or segment) &mdash; 1D element of a mesh linking two nodes.</li> <li>\b Edge (or segment) &mdash; 1D mesh element linking two nodes.</li>
<li>\b Face &mdash; 2D element of a mesh representing a part of <li>\b Face &mdash; 2D mesh element representing a part of
surface bound by links between face nodes. A face can be a surface bound by links between face nodes. A face can be a
triangle, quadrangle or polygon.</li> triangle, quadrangle or polygon.</li>
<li>\b Volume &mdash; 3D element of a mesh representing a part of 3D <li>\b Volume &mdash; 3D mesh element representing a part of 3D
space bound by volume facets. Nodes of a volume describing each space bound by volume facets. Nodes of a volume describing each
facet are defined by facet are defined by
the <a href="http://www.code-aster.org/outils/med/html/connectivites.html"> the <a href="http://www.code-aster.org/outils/med/html/connectivites.html">
MED connectivity convention.</a> A volume can be a tetrahedron, hexahedron, MED connectivity convention.</a> A volume can be a tetrahedron, hexahedron,
pentahedron, pyramid, hexagonal prism or polyhedron.</li> pentahedron, pyramid, hexagonal prism or polyhedron.</li>
<li>\b 0D element &mdash; element of a mesh defined by one node.</li> <li>\b 0D element &mdash; mesh element defined by one node.</li>
<li>\b Ball element &mdash; discrete element of a mesh defined by a <li>\b Ball element &mdash; discrete mesh element defined by a
node and a diameter.</li> node and a diameter.</li>
</ul> </ul>
@ -97,10 +97,14 @@ generated on (if any). The node generated on the geometrical edge or
surface in addition stores its position in parametric space of the surface in addition stores its position in parametric space of the
associated geometrical entity. associated geometrical entity.
SALOME supports elements of second order, without central node Mesh entities are identified by integer IDs starting from 1.
(quadratic triangle, quadrangle, tetrahedron, hexahedron, pentahedron Nodes and elements are countered separately, i.e. there can be a node
and pyramid) and with central nodes (bi-quadratic triangle and and element with the same ID.
quadrangle and tri-quadratic hexahedron).<br>
SALOME supports elements of second order, without a central node
(quadratic triangle, quadrangle, polygon, tetrahedron, hexahedron,
pentahedron and pyramid) and with central nodes (bi-quadratic triangle
and quadrangle and tri-quadratic hexahedron).<br>
Quadratic mesh can be obtained in two ways: Quadratic mesh can be obtained in two ways:
- Using a global \ref quadratic_mesh_anchor "Quadratic Mesh" - Using a global \ref quadratic_mesh_anchor "Quadratic Mesh"
hypothesis. (Elements with the central node are not generated in this way). hypothesis. (Elements with the central node are not generated in this way).

View File

@ -24,7 +24,6 @@ Node quality controls:
Edge quality controls: Edge quality controls:
<ul> <ul>
<li>\subpage free_edges_page "Free edges"</li>
<li>\subpage free_borders_page "Free borders"</li> <li>\subpage free_borders_page "Free borders"</li>
<li>\subpage length_page "Length"</li> <li>\subpage length_page "Length"</li>
<li>\subpage borders_at_multi_connection_page "Borders at multi-connection"</li> <li>\subpage borders_at_multi_connection_page "Borders at multi-connection"</li>
@ -33,6 +32,7 @@ Edge quality controls:
Face quality controls: Face quality controls:
<ul> <ul>
<li>\subpage free_edges_page "Free edges"</li>
<li>\subpage free_faces_page "Free faces"</li> <li>\subpage free_faces_page "Free faces"</li>
<li>\subpage bare_border_faces_page "Bare border faces"</li> <li>\subpage bare_border_faces_page "Bare border faces"</li>
<li>\subpage over_constrained_faces_page "Over-constrained faces"</li> <li>\subpage over_constrained_faces_page "Over-constrained faces"</li>

View File

@ -32,7 +32,7 @@ nodal connectivity of elements in the documentation on MED library or
<li>From the \b Modification menu choose the \b Add item, the <li>From the \b Modification menu choose the \b Add item, the
following associated sub-menu will appear:</li> following associated sub-menu will appear:</li>
\image html image146.png \image html image152.png
From this sub-menu select the type of element which you would like to add to your mesh. From this sub-menu select the type of element which you would like to add to your mesh.
@ -47,10 +47,13 @@ existing groups of the corresponding type becomes available. By
default, no group is selected. In this case, when the user presses default, no group is selected. In this case, when the user presses
<b>Apply</b> or <b>Apply & Close</b> button, the warning message box <b>Apply</b> or <b>Apply & Close</b> button, the warning message box
informs the user about the necessity to input new group name. The informs the user about the necessity to input new group name. The
combo box lists both \ref standalone_group "standalone groups" combo box lists groups of all the
and \ref group_on_geom "groups on geometry". If the user chooses a \ref grouping_elements_page "three types": both
group on geometry, he is warned and proposed to \ref standalone_group "standalone groups",
\ref convert_to_standalone "convert this group to standalone". \ref group_on_filter "groups on filter", and
\ref group_on_geom "groups on geometry". If the user chooses a
group on geometry or on filter, he is warned and proposed to
convert this group to standalone.
If the user rejects conversion operation, it is cancelled and If the user rejects conversion operation, it is cancelled and
a new node/element is not created! a new node/element is not created!
@ -105,11 +108,17 @@ In this dialog
0D elements on in the VTK viewer or typing their IDs in the dialog.</li> 0D elements on in the VTK viewer or typing their IDs in the dialog.</li>
</ul></li> </ul></li>
<li><b> Set Filter </b> button allows selecting elements or nodes <li><b> Set Filter </b> button allows selecting elements or nodes
by filtering mesh elements or nodes with different criteria by filtering mesh elements or nodes with different criteria
(see \ref filtering_elements "Filter usage").</li> (see \ref filtering_elements "Filter usage").</li>
<li> Switching on <b>Add to group</b> check-box allows specifying the <li> Switching on <b>Add to group</b> check-box allows specifying the
name of the group to which all created or found 0D elements will be added. You can either select an existing group from name of the group to which all created or found (existing) 0D elements will
a drop-down list, or enter the name of the group to be created.</li> be added. You can either select an existing group from a drop-down
list, or enter the name of the group to be created. If a selected
existing \ref grouping_elements_page "group" is not Standalone
(Group On Geometry or Group On Filter) it will be converted to
Standalone.
\warning If <b>Add to group</b> is activated it has to be filled in.
</li>
</ul> </ul>
@ -121,7 +130,7 @@ by filtering mesh elements or nodes with different criteria
In this dialog box specify the nodes, which will form your ball elements, In this dialog box specify the nodes, which will form your ball elements,
either by selecting them in the 3D viewer or by manually entering their IDs, either by selecting them in the 3D viewer or by manually entering their IDs,
specify the ball diameter and click the \b Apply or <b>Apply and specify the ball diameter and click the \b Apply or <b>Apply and
Close</b> button. Close</b> button.
\image html add_ball.png \image html add_ball.png

View File

@ -36,7 +36,7 @@ one of the following:
\image html image152.png \image html image152.png
\note All dialogs for quadratic element adding to the mesh \note All dialogs for adding quadratic element to the mesh
provide the possibility to automatically add an element provide the possibility to automatically add an element
to the specified group or to create the group anew using to the specified group or to create the group anew using
<b>Add to group</b> box, that allows choosing an existing group for <b>Add to group</b> box, that allows choosing an existing group for
@ -47,23 +47,29 @@ existing groups of the corresponding type becomes available. By
default, no group is selected. In this case, when the user presses default, no group is selected. In this case, when the user presses
<b>Apply</b> or <b>Apply & Close</b> button, the warning message box <b>Apply</b> or <b>Apply & Close</b> button, the warning message box
informs the user about the necessity to input a new group name. The informs the user about the necessity to input a new group name. The
combo box lists both \ref standalone_group "standalone groups" combo box lists groups of all the
and \ref group_on_geom "groups on geometry". If the user chooses a \ref grouping_elements_page "three types": both
group on geometry, he is warned and proposed to \ref standalone_group "standalone groups",
\ref convert_to_standalone "convert this group to standalone". \ref group_on_filter "groups on filter", and
\ref group_on_geom "groups on geometry". If the user chooses a
group on geometry or on filter, he is warned and proposed to
convert this group to standalone.
If the user rejects conversion operation, it is cancelled and If the user rejects conversion operation, it is cancelled and
a new quadratic element is not created. a new quadratic element is not created.
To create any <b>Quadratic Element</b> specify the nodes which will form your To create any <b>Quadratic Element</b> specify the nodes which will
element by selecting them in the 3D viewer with pressed Shift form your element by selecting them in the 3D viewer with pressed
button. Their numbers will appear in the dialog box as <b>Corner Nodes</b> Shift button and click \a Selection button to the right of
(alternatively you can just input numbers in this field without <b>Corner Nodes</b> label. Their numbers will appear in the dialog box
selection). The edges formed by the corner nodes will appear in the as <b>Corner Nodes</b> (alternatively you can just input numbers in
table. To define the middle nodes for each edge, double-click on the this field without selection; note that to use this way the mesh
respective field and input the number of the node (or pick the node in should be selected before invoking this operation). The edges formed
the viewer). For bi-quadratic and tri-quadratic elements, your also by the corner nodes will appear in the table. To define the middle
need to specify central nodes. nodes for each edge, double-click on the respective field and input
the number of the node (or pick the node in the viewer). For
bi-quadratic and tri-quadratic elements, your also need to specify
central nodes.
As soon as all needed nodes are specified, a preview of a new As soon as all needed nodes are specified, a preview of a new
quadratic element will be displayed in the 3D viewer. Then quadratic element will be displayed in the 3D viewer. Then
you will be able to click \b Apply or <b>Apply and Close</b> button to you will be able to click \b Apply or <b>Apply and Close</b> button to

View File

@ -31,12 +31,13 @@ The following additional hypothesis are available:
<h2>Propagation of 1D Hypothesis on opposite edges</h2> <h2>Propagation of 1D Hypothesis on opposite edges</h2>
<b>Propagation of 1D Hypothesis on opposite edges</b> allows to mesh <b>Propagation of 1D Hypothesis on opposite edges</b> allows to mesh
opposite sides of a quadrangle face, and of other adjacent quadrangles, opposite sides of a quadrangle face and other adjacent quadrangles,
using the same hypothesis assigned to one edge only.<br> using the same hypothesis assigned to only one edge.<br>
Thus you define a sub-mesh on an edge where you define 1D meshing Thus you define a sub-mesh on the edge where you define 1D meshing
parameters and a \b Propagation hypothesis. These local meshing parameters and the \b Propagation hypothesis. These local meshing
parameters will be propagated via opposite sides of quadrangles to the parameters will be propagated via opposite sides of quadrangles to the
whole geometry, or till an edge with other local meshing parameters. whole geometry, and this propagation stops at an edge with other local
meshing parameters.
This hypothesis can be taken into account by This hypothesis can be taken into account by
\ref a1d_algos_anchor "Wire Discretization" and \ref a1d_algos_anchor "Wire Discretization" and
@ -84,17 +85,17 @@ computations.
<li><b>Stretch factor</b> - defines the growth factor of element height <li><b>Stretch factor</b> - defines the growth factor of element height
from the mesh boundary inwards.</li> from the mesh boundary inwards.</li>
<li><b>Extrusion method</b> (available in 3D only) - defines how <li><b>Extrusion method</b> (available in 3D only) - defines how
position of nodes are found during prism construction and how positions of nodes are found during prism construction and how
creation of distorted and intersecting prisms is prevented. the creation of distorted and intersecting prisms is prevented.
<ul><li><b>Surface offset + smooth</b> method extrudes nodes along normal <ul><li><b>Surface offset + smooth</b> method extrudes nodes along the normal
to underlying geometrical surface. Smoothing of internal surface of to the underlying geometrical surface. Smoothing of the internal surface of
element layers is possible to avoid creation of invalid prisms.</li> element layers is possible to avoid creation of invalid prisms.</li>
<li><b>Face offset</b> method extrudes nodes along average normal of <li><b>Face offset</b> method extrudes nodes along the average normal of
surrounding mesh faces till intersection with a neighbor mesh face surrounding mesh faces to the intersection with a neighbor mesh face
translated along its own normal by the layers thickness. Thickness translated along its own normal by the thickness of layers. The thickness
of layers can be limited to avoid creation of invalid prisms.</li> of layers can be limited to avoid creation of invalid prisms.</li>
<li><b>Node offset</b> method extrudes nodes along average normal of <li><b>Node offset</b> method extrudes nodes along the average normal of
surrounding mesh faces by the layers thickness. Thickness of surrounding mesh faces by the thickness of layers. The thickness of
layers can be limited to avoid creation of invalid prisms.</li> layers can be limited to avoid creation of invalid prisms.</li>
\image html viscous_layers_extrusion_method.png "Prisms created by the tree extrusion methods at the same other parameters" \image html viscous_layers_extrusion_method.png "Prisms created by the tree extrusion methods at the same other parameters"
</ul></li> </ul></li>
@ -107,9 +108,9 @@ computations.
Faces (or edges) can be selected either in the Object Browser or in Faces (or edges) can be selected either in the Object Browser or in
the VTK Viewer. the VTK Viewer.
\note A mesh shown in the 3D Viewer can prevent selection of faces \note A mesh shown in the 3D Viewer can prevent selection of faces
and edges, just hide the mesh to avoid this. Sometimes a face to and edges, just hide the mesh to avoid this. If a face, which should be
select is hidden by other faces, in this case consider creating a selected, is hidden by other faces, consider creating a
group of faces you want to select in the Geometry module.<br> group of faces to be selected in the Geometry module.<br>
To avoid a long wait when a To avoid a long wait when a
geometry with many faces (or edges) is displayed, the number of faces geometry with many faces (or edges) is displayed, the number of faces
(edges) shown at a time is limited by the value of "Sub-shapes (edges) shown at a time is limited by the value of "Sub-shapes
@ -150,12 +151,12 @@ computations.
Quadratic Mesh hypothesis allows to build a quadratic mesh (in which Quadratic Mesh hypothesis allows to build a quadratic mesh (in which
links between element nodes are not straight but curved lines due to links between element nodes are not straight but curved lines due to
presence of an additional midside node). presence of an additional mid-side node).
This 1D hypothesis can be taken into account by This 1D hypothesis can be taken into account by
\ref a1d_algos_anchor "Wire Discretization" and \ref a1d_algos_anchor "Wire Discretization" and
\ref a1d_algos_anchor "Composite Side Discretization" algorithms. To \ref a1d_algos_anchor "Composite Side Discretization" algorithms. To
make a quadratic mesh assign this hypothesis at create a quadratic mesh assign this hypothesis at
\ref constructing_meshes_page "mesh construction". \ref constructing_meshes_page "mesh construction".
See \ref adding_quadratic_elements_page See \ref adding_quadratic_elements_page
@ -168,9 +169,13 @@ for more information about quadratic meshes.
This additional hypothesis can be used together with 2D triangulation algorithms. This additional hypothesis can be used together with 2D triangulation algorithms.
It allows 2D triangulation algorithms to build quadrangular meshes. It allows 2D triangulation algorithms to build quadrangular meshes.
When used with "Quadrangle (Mapping)" meshing algorithm, that is obsolete Usage of this hypothesis with "Quadrangle (Mapping)" meshing algorithm
since introducing \ref hypo_quad_params_anchor "Quadrangle parameters" is obsolete since introducing
hypothesis, this hypothesis has one restriction on its work: the total quantity of \ref hypo_quad_params_anchor "Quadrangle parameters" hypothesis.
segments on all four sides of the face must be even (divisible by 2). Usage of this hypothesis with "Quadrangle (Mapping)" meshing algorithm
corresponds to specifying "Quadrangle Preference" transition type of
\ref hypo_quad_params_anchor "Quadrangle parameters" hypothesis.
\note "Quadrangle Preference" transition type can be used only if the
total quantity of segments on all sides of the face is even (divisible
by 2), else "Standard" transition type is used.
*/ */

View File

@ -7,26 +7,26 @@ used for meshing entities (1D, 2D, 3D sub-shapes) composing
geometrical objects. geometrical objects.
An algorithm represents either an implementation of a certain meshing An algorithm represents either an implementation of a certain meshing
technique or a interface to a whole meshing program generating elements technique or an interface to the whole meshing program generating elements
of several dimensions. of several dimensions.
<ul> <ul>
<li>For meshing of 1D entities (<b>edges</b>):</li> <li>For meshing of 1D entities (<b>edges</b>):</li>
\anchor a1d_algos_anchor \anchor a1d_algos_anchor
<ul> <ul>
<li><em>Wire Discretization</em> meshing algorithm - splits an edge into a <li><b>Wire Discretization</b> meshing algorithm - splits an edge into a
number of mesh segments following an 1D hypothesis. number of mesh segments following an 1D hypothesis.
</li> </li>
<li><em>Composite Side Discretization</em> algorithm - allows to apply an 1D <li><b>Composite Side Discretization</b> algorithm - allows to apply a 1D
hypothesis to a whole side of a geometrical face even if it is hypothesis to a whole side of a geometrical face even if it is
composed of several edges provided that they form C1 curve and form composed of several edges provided that they form C1 curve in all
one side in all faces of the main shape.</li> faces of the main shape.</li>
</ul> </ul>
<li>For meshing of 2D entities (<b>faces</b>):</li> <li>For meshing of 2D entities (<b>faces</b>):</li>
<ul> <ul>
<li><em>Triangle (Mefisto)</em> meshing algorithm - splits faces <li><b>Triangle (Mefisto)</b> meshing algorithm - splits faces
into triangular elements.</li> into triangular elements.</li>
<li>\subpage quad_ijk_algo_page "Quadrangle (Mapping)" meshing <li>\subpage quad_ijk_algo_page "Quadrangle (Mapping)" meshing
algorithm - splits faces into quadrangular elements.</li> algorithm - splits faces into quadrangular elements.</li>
@ -39,8 +39,15 @@ number of mesh segments following an 1D hypothesis.
<li>For meshing of 3D entities (<b>solid objects</b>):</li> <li>For meshing of 3D entities (<b>solid objects</b>):</li>
<ul> <ul>
<li><em>Hexahedron (i,j,k)</em>meshing algorithm - 6-sided solids are <li><b>Hexahedron (i,j,k)</b> meshing algorithm - solids are
split into hexahedral (cuboid) elements.</li> split into hexahedral elements thus forming a structured 3D
mesh. The algorithm requires that 2D mesh generated on a solid could
be considered as a mesh of a box, i.e. there should be eight nodes
shared by three quadrangles and the rest nodes should be shared by
four quadrangles.
\image html hexa_ijk_mesh.png "Structured mesh generated by Hexahedron (i,j,k) on a solid bound by 16 faces"
</li>
<li>\subpage cartesian_algo_page "Body Fitting" meshing <li>\subpage cartesian_algo_page "Body Fitting" meshing
algorithm - solids are split into hexahedral elements forming algorithm - solids are split into hexahedral elements forming
a Cartesian grid; polyhedra and other types of elements are generated a Cartesian grid; polyhedra and other types of elements are generated
@ -52,22 +59,25 @@ number of mesh segments following an 1D hypothesis.
\image html image126.gif "Example of a hexahedral 3D mesh" \image html image126.gif "Example of a hexahedral 3D mesh"
</ul> </ul>
Some 3D meshing algorithms, such as Hexahedron(i,j,k) and some Some 3D meshing algorithms, such as Hexahedron(i,j,k) also can
commercial ones, also can generate 3D meshes from 2D meshes, working generate 3D meshes from 2D meshes, working without geometrical
without geometrical objects. objects.
There is also a number of more specific algorithms: There is also a number of more specific algorithms:
<ul> <ul>
<li>\subpage prism_3d_algo_page "for meshing prismatic 3D shapes"</li> <li>\subpage prism_3d_algo_page "for meshing prismatic 3D shapes with hexahedra and prisms"</li>
<li>\subpage quad_from_ma_algo_page "for meshing faces with sinuous borders"</li> <li>\subpage quad_from_ma_algo_page "for quadrangle meshing of faces with sinuous borders"</li>
<li> <b>Polygon per Face</b> meshing algorithm - generates one mesh
face (either a triangle, a quadrangle or a polygon) per a geometrical
face using all nodes from the face boundary.</li>
<li>\subpage projection_algos_page "for meshing by projection of another mesh"</li> <li>\subpage projection_algos_page "for meshing by projection of another mesh"</li>
<li>\subpage import_algos_page "for meshing by importing elements from another mesh"</li> <li>\subpage import_algos_page "for meshing by importing elements from another mesh"</li>
<li>\subpage radial_prism_algo_page "for meshing geometrical objects with cavities"</li> <li>\subpage radial_prism_algo_page "for meshing 3D geometrical objects with cavities with hexahedra and prisms"</li>
<li>\subpage radial_quadrangle_1D2D_algo_page "for meshing special 2d faces (circles and part of circles)"</li> <li>\subpage radial_quadrangle_1D2D_algo_page "for quadrangle meshing of disks and parts of disks"</li>
<li>\subpage use_existing_page "Use Edges to be Created Manually" and <li>\subpage use_existing_page "Use Edges to be Created Manually" and
\ref use_existing_page "Use Faces to be Created Manually" algorithms can be \ref use_existing_page "Use Faces to be Created Manually" algorithms can be
used to create a 1D or a 2D mesh in a python script.</li> used to create a 1D or a 2D mesh in a python script.</li>
<li>\subpage segments_around_vertex_algo_page "for defining the local size of elements around a certain node"</li> <li>\subpage segments_around_vertex_algo_page "for defining the length of mesh segments around certain vertices"</li>
</ul> </ul>
\ref constructing_meshes_page "Constructing meshes" page describes in \ref constructing_meshes_page "Constructing meshes" page describes in

View File

@ -2,8 +2,8 @@
\page borders_at_multi_connection_page Borders at multi-connection \page borders_at_multi_connection_page Borders at multi-connection
\n This mesh quality control highlights segments according to number \n This mesh quality control highlights segments according to the number
of elements, faces and volumes, the segment belongs to. of elements, faces and volumes, to which the segment belongs.
\image html image151.gif \image html image151.gif

View File

@ -3,7 +3,7 @@
\page borders_at_multi_connection_2d_page Borders at multi-connection 2D \page borders_at_multi_connection_2d_page Borders at multi-connection 2D
\n This mesh quality control highlights borders of faces (links \n This mesh quality control highlights borders of faces (links
between nodes) according to number of faces the link belongs to. between nodes) according to the number of faces, to which the link belongs.
\image html image127.gif \image html image127.gif

View File

@ -4,10 +4,10 @@
\n Compound Mesh is a combination of several meshes. All elements and \n Compound Mesh is a combination of several meshes. All elements and
groups present in input meshes are present in the compound groups present in input meshes are present in the compound
mesh. Neither geometry nor hypotheses of initial meshes are used by mesh. However, it does not use geometry or hypotheses of the initial meshes.
the compound mesh. No link between input meshes and a compound mesh is The links between the input meshes and the compound mesh are not
supported, so that modification of an input mesh does not lead to supported, consequently the modification of an input mesh does not lead to
update of the compound mesh. the update of the compound mesh.
<em>To Build a compound mesh:</em> <em>To Build a compound mesh:</em>
@ -27,15 +27,16 @@ The following dialog box will appear:
<ul> <ul>
<li>\b Name - allows selecting the name of the resulting \b Compound mesh.</li> <li>\b Name - allows selecting the name of the resulting \b Compound mesh.</li>
<li><b>Meshes, sub-meshes, groups</b> - allows selecting the meshes, <li><b>Meshes, sub-meshes, groups</b> - allows selecting the meshes,
sub-meshes and groups which will be concatenated. They can be sub-meshes and groups to be concatenated. They can be
chosen in the Object Browser while holding \b Ctrl button.</li> chosen in the Object Browser while holding \b Ctrl button.</li>
<li><b>Processing identical groups</b> - allows selecting the method <li><b>Processing identical groups</b> - allows selecting the method
of processing the namesake groups existing in the input meshes. of processing the namesake groups existing in the input meshes.
They can be either <ul> They can be either <ul>
<li>\b United - all elements of Group1 of Mesh_1 and Group1 of Mesh_2 <li>\b United - all elements of \em Group1 of \em Mesh_1 and \em
become the elements of Group1 of the Compound_Mesh, or</li> Group1 of \em Mesh_2 become the elements of \em Group1 of the
<li>\b Renamed - Group1 of Mesh_1 becomes Group1_1 and Group1 of Mesh_2 \em Compound_Mesh, or</li>
becomes Group1_2.</li> <li>\b Renamed - \em Group1 of \em Mesh_1 becomes \em Group1_1
and \em Group1 of \em Mesh_2 becomes \em Group1_2.</li>
</ul> </ul>
See \ref grouping_elements_page "Creating Groups" for more information See \ref grouping_elements_page "Creating Groups" for more information
about groups.</li> about groups.</li>

View File

@ -41,11 +41,9 @@ To apply this algorithm when you define your mesh, select <b>Body
This dialog allows to define This dialog allows to define
<ul> <ul>
<li>\b Name of the algorithm. </li> <li>\b Name of the algorithm. </li>
<li> Minimal size of a cell truncated by the geometry boundary. If the <li> Minimal size of a cell truncated by the geometry boundary. If the
size of a truncated grid cell is \b Threshold times less than a size of a truncated grid cell is \b Threshold times less than a
initial cell size, then a mesh element is not created. </li> initial cell size, then a mesh element is not created. </li>
<li> <b> Implement Edges </b> check-box activates incorporation of <li> <b> Implement Edges </b> check-box activates incorporation of
geometrical edges in the mesh. geometrical edges in the mesh.
@ -64,9 +62,10 @@ This dialog allows to define
System.</li> System.</li>
<li> You can define the \b Spacing of a grid as an algebraic formula <li> You can define the \b Spacing of a grid as an algebraic formula
<em>f(t)</em> where \a t is a position along a grid axis <em>f(t)</em> where \a t is a position along a grid axis
normalized at [0.0,1.0]. The whole range of geometry can be normalized at [0.0,1.0]. <em>f(t)</em> must be non-negative
divided into sub-ranges with their own spacing formulas to apply; at 0. <= \a t <= 1. The whole extent of geometry can be
\a t varies between 0.0 and 1.0 within each sub-range. \b Insert button divided into ranges with their own spacing formulas to apply;
\a t varies between 0.0 and 1.0 within each \b Range. \b Insert button
divides a selected range into two. \b Delete button adds the divides a selected range into two. \b Delete button adds the
selected sub-range to the previous one. Double click on a range in selected sub-range to the previous one. Double click on a range in
the list enables edition of its right boundary. Double click on a the list enables edition of its right boundary. Double click on a

View File

@ -28,12 +28,12 @@
element will be added to the list. To remove a selected element or element will be added to the list. To remove a selected element or
elements from the list click the \b Remove button. The \b Sort button elements from the list click the \b Remove button. The \b Sort button
allows to sort the list of elements IDs. The <b>Set filter</b> button allows to sort the list of elements IDs. The <b>Set filter</b> button
allows to apply a definite \ref filtering_elements "filter" to allows to apply a definite \ref filtering_elements "filter" to the
selection of elements.</li> selection of elements.</li>
<li><b>Apply to all</b> radio button allows to modify the orientation <li><b>Apply to all</b> radio button allows to modify the orientation
of all elements of the selected mesh.</li> of all elements of the selected mesh.</li>
<li><b>Select from</b> set of fields allows to choose a sub-mesh or an <li><b>Select from</b> set of fields allows to choose a sub-mesh or an
existing group whose elements then can be added to the list.</li> existing group whose elements can be added to the list.</li>
</ul> </ul>
</li> </li>

View File

@ -2,55 +2,54 @@
\page constructing_meshes_page Constructing meshes \page constructing_meshes_page Constructing meshes
To create a mesh on geometry, at first you create a mesh object by choosing To create a mesh on geometry, it is necessary to create a mesh object by choosing
- a geometrical shape produced in the Geometry module (<em>main shape</em>); - a geometrical shape produced in the Geometry module (<em>main shape</em>);
- <em>meshing parameters</em>, including - <em>meshing parameters</em>, including
- \ref basic_meshing_algos_page "meshing algorithms" and - \ref basic_meshing_algos_page "meshing algorithms" and
- \ref about_hypo_page "hypotheses" specifying constraints to be - \ref about_hypo_page "hypotheses" specifying constraints to be
taken into account by chosen meshing algorithms. taken into account by the chosen meshing algorithms.
Then you already can launch mesh generation by invoking \ref Then you can launch mesh generation by invoking \ref compute_anchor "Compute" command.
compute_anchor "Compute" command.
\note Sometimes \a hypotheses term is used to refer to both algorithms \note Sometimes \a hypotheses term is used to refer to both algorithms
and hypotheses. and hypotheses.
Generation of the mesh on the geometry is performed in the bottom-up Mesh generation on the geometry is performed in the bottom-up
flow: nodes on vertices are created first, then edges are divided into flow: nodes on vertices are created first, then edges are divided into
segments using nodes on vertices; the segments of the edges is then segments using nodes on vertices; the node of segments are then
used while meshing faces; then the mesh of the faces is used while meshing used to mesh faces; then the nodes of faces are used to mesh
solids. This automatically assures the conformity of the mesh. solids. This automatically assures the conformity of the mesh.
You are to choose a meshing algorithm for every dimension of It is required to choose a meshing algorithm for every dimension of
sub-shapes up to the highest dimension you desire to generate. Note sub-shapes up to the highest dimension to be generated. Note
that some algorithms generate elements of several dimensions while that some algorithms generate elements of several dimensions, and
others, of only one. But it's not necessary to define meshing others of only one. It is not necessary to define meshing
parameters for all dimensions at once; you can start from 1D parameters for all dimensions at once; you can start from 1D
meshing parameters only, compute the 1D mesh, then define 2D meshing meshing parameters only, compute the 1D mesh, then define 2D meshing
parameters and compute the 2D mesh (note that 1D mesh won't be parameters and compute the 2D mesh (note that 1D mesh will not be
re-computed). re-computed).
An algorithm of a certain dimension chosen at mesh creation is applied An algorithm of a certain dimension chosen at mesh creation is applied
to discretize every sub-shape of this dimension. But you can to discretize every sub-shape of this dimension. It is possible to
specify a different algorithm or hypothesis to be applied to one or specify a different algorithm or hypothesis to be applied to one or
a group of sub-shapes by creating a \ref constructing_submeshes_page a group of sub-shapes by creating a \ref constructing_submeshes_page
"sub-mesh". You can specify no algorithms at all at mesh object "sub-mesh". You can specify no algorithms at all at mesh object
creation and specify the meshing parameters on sub-meshes only; then creation and specify the meshing parameters on sub-meshes only; then
only sub-shapes for which you defined an algorithm and a needed only the sub-shapes, for which an algorithm and a hypothesis (if any)
hypothesis (if any) will be discretized. have been defined will be discretized.
\n Construction of a mesh on some geometry includes at least two (mesh \n Construction of a mesh on a geometry includes at least two
creation and computing) of the following steps: (\ref create_mesh_anchor "mesh creation" and
\ref compute_anchor "computing") of the following steps:
<ul> <ul>
<li> \ref create_mesh_anchor "Creation of a mesh object" where you <li> \ref create_mesh_anchor "Creation of a mesh object", where you
can specify meshing parameters to apply to all sub-shapes of the can specify meshing parameters to apply to all sub-shapes of the
main shape.</li> main shape.</li>
<li> \ref constructing_submeshes_page "Creation of sub-meshes" <li> \ref constructing_submeshes_page "Creation of sub-meshes",
(optional) where you can specify meshing parameters to apply to (optional) where you can specify meshing parameters to apply to the
selected sub-shapes.</li> selected sub-shapes.</li>
<li> \ref evaluate_anchor "Evaluating mesh size" (optional) can be <li> \ref evaluate_anchor "Evaluating mesh size" (optional) can be
used to know approximate number of elements before actual generation used to know an approximate number of elements before their actual generation.</li>
of them.</li>
<li> \ref preview_anchor "Previewing the mesh" (optional) can be <li> \ref preview_anchor "Previewing the mesh" (optional) can be
used to generate mesh of only lower dimension(s) in order to used to generate mesh of only lower dimension(s) in order to
visually estimate it before full mesh generation, which can be much visually estimate it before full mesh generation, which can be much
@ -61,8 +60,8 @@ creation and computing) of the following steps:
<li> \ref compute_anchor "Computing the mesh" uses defined meshing <li> \ref compute_anchor "Computing the mesh" uses defined meshing
parameters to generate mesh elements.</li> parameters to generate mesh elements.</li>
<li> \ref edit_anchor "Editing the mesh" (optional) can be used to <li> \ref edit_anchor "Editing the mesh" (optional) can be used to
\ref modifying_meshes_page "modify" mesh of lower dimension before \ref modifying_meshes_page "modify" the mesh of a lower dimension before
\ref compute_anchor "computing" elements of upper dimension.</li> \ref compute_anchor "computing" elements of an upper dimension.</li>
</ul> </ul>
\anchor create_mesh_anchor \anchor create_mesh_anchor
@ -103,10 +102,10 @@ creation and computing) of the following steps:
3D sub-shapes (solids) and generate 3D mesh elements 3D sub-shapes (solids) and generate 3D mesh elements
(tetrahedra, hexahedra etc.) (tetrahedra, hexahedra etc.)
As soon as you have selected an algorithm, you can create (or As soon as you have selected an algorithm, you can create a
select already created) a hypothesis. A set of accessible hypothesis (or select an already created one). A set of accessible
hypotheses includes only hypotheses the selected algorithm can take hypotheses includes only the hypotheses that can be used by the
into account. selected algorithm.
\note \note
- Some page(s) can be disabled if the geometrical - Some page(s) can be disabled if the geometrical
@ -115,10 +114,10 @@ creation and computing) of the following steps:
\b 3D page is disabled. \b 3D page is disabled.
- Some algorithms affect the geometry of several dimensions, - Some algorithms affect the geometry of several dimensions,
i.e. 1D+2D or 1D+2D+3D. If such an algorithm is selected, the i.e. 1D+2D or 1D+2D+3D. If such an algorithm is selected, the
dialog box pages related to the corresponding lower dimensions are dialog pages related to the corresponding lower dimensions are
disabled. disabled.
- \b 0D page does not refer to the 0D elements, but to 0D - \b 0D page refers to 0D geometry (vertices) rather than
geometry (vertices). Mesh module does not provide algorithms that to 0D elements. Mesh module does not provide algorithms that
produce 0D elements. Currently \b 0D page provides only one produce 0D elements. Currently \b 0D page provides only one
algorithm "Segments around vertex" that allows specifying the required algorithm "Segments around vertex" that allows specifying the required
size of mesh edges about the selected vertex (or vertices). size of mesh edges about the selected vertex (or vertices).
@ -126,9 +125,9 @@ creation and computing) of the following steps:
For example, you need to mesh a 3D object. For example, you need to mesh a 3D object.
First, you can change a default name of your mesh in the \b Name First, you can change a default name of your mesh in the \b Name
box. Then check that a selected geometrical object, whose name is box. Then check that the selected geometrical object indicated in
shown in \b Geometry field, is that you wish to mesh; if not, click \b Geometry field, is what you wish to mesh; if not, select
the right object in the Object Browser. Click "Select" button the correct object in the Object Browser. Click "Select" button
near \b Geometry field if the name of the object has not yet near \b Geometry field if the name of the object has not yet
appeared in \b Geometry field. appeared in \b Geometry field.
<center> <center>
@ -189,13 +188,9 @@ creation and computing) of the following steps:
which is a 2D object, you do not need to define a 3D Algorithm and which is a 2D object, you do not need to define a 3D Algorithm and
Hypotheses. Hypotheses.
In the <b>Object Browser</b> the structure of the new mesh will be In the <b>Object Browser</b> the structure of the new mesh is
displayed as follows: displayed as follows:
<center>
\image html image88.jpg \image html image88.jpg
</center>
It contains: It contains:
<ul> <ul>
<li>a mesh name (<em>Mesh_mechanic</em>); <li>a mesh name (<em>Mesh_mechanic</em>);
@ -205,6 +200,13 @@ creation and computing) of the following steps:
to the hypotheses chosen at the construction of the mesh;</li> to the hypotheses chosen at the construction of the mesh;</li>
<li><b>Applied algorithms</b> folder containing the references <li><b>Applied algorithms</b> folder containing the references
to the algorithms chosen at the construction of the mesh.</li> to the algorithms chosen at the construction of the mesh.</li>
<li><b>SubMeshes on Face</b> folder containing the sub-meshes
defined on geometrical faces. There also can be folders for
sub-meshes on vertices, edges, wires, shells, solids and
compounds.</li>
<li><b>Groups of Faces</b> folder containing the groups of mesh
faces. There also can be folders for groups of nodes, edges,
volumes 0D elements and balls.</li>
</ul> </ul>
There is an alternative way to assign Algorithms and Hypotheses by There is an alternative way to assign Algorithms and Hypotheses by
@ -214,21 +216,32 @@ creation and computing) of the following steps:
CustomMeshers.xml file located in the home directory. CustomMeshers.xml CustomMeshers.xml file located in the home directory. CustomMeshers.xml
file must describe sets of hypotheses in the file must describe sets of hypotheses in the
same way as ${SMESH_ROOT_DIR}/share/salome/resources/smesh/StdMeshers.xml same way as ${SMESH_ROOT_DIR}/share/salome/resources/smesh/StdMeshers.xml
file does (sets of hypotheses are enclosed between <hypotheses-set-group> file does (sets of hypotheses are enclosed between \<hypotheses-set-group\>
tags). tags). For example:
~~~~~~{.xml}
<center> <?xml version='1.0' encoding='us-ascii'?>
<!DOCTYPE meshers PUBLIC "" "desktop.dtd">
<meshers>
<hypotheses-set-group>
<hypotheses-set name="My favorite hypotheses"
hypos="AutomaticLength"
algos="CompositeSegment_1D, Quadrangle_2D, GHS3D_3D"/>
</hypotheses-set-group>
</meshers>
~~~~~~
If the file contents are incorrect, there can be an error at
activation of Mesh module: <em>"fatal parsing error: error
triggered by consumer in line ..."</em>
<br>
<center>
\image html hypo_sets.png \image html hypo_sets.png
List of sets of hypotheses. Tag <em>[custom]</em> is List of sets of hypotheses. Tag <em>[custom]</em> is
automatically added to the sets defined by the user. automatically added to the sets defined by the user.
</center> </center>
\note \note
- \a "Automatic" in the names of predefined sets of - \a "Automatic" in the names of predefined sets of hypotheses
hypotheses came from previous versions of SALOME where does not actually mean that they are suitable for meshing any
\ref automatic_length_anchor "Automatic Length" hypothesis geometry.
was included in these sets, and not that these sets are suitable for
meshing any geometry.
- The list of sets of hypotheses can be shorter than in the - The list of sets of hypotheses can be shorter than in the
above image depending on the geometry dimension. above image depending on the geometry dimension.
</li> </li>
@ -253,7 +266,9 @@ information box:
<h2>Previewing the mesh</h2> <h2>Previewing the mesh</h2>
Before \ref compute_anchor "the mesh computation", it is also possible Before \ref compute_anchor "the mesh computation", it is also possible
to see the mesh preview. to see the mesh preview. This operation allows to incrementally
compute the mesh, dimension by dimension, and to discard an
unsatisfactory mesh.
For this, select the mesh in the Object Browser. From the \b Mesh menu For this, select the mesh in the Object Browser. From the \b Mesh menu
select \b Preview or click "Preview" button in the toolbar or activate select \b Preview or click "Preview" button in the toolbar or activate
@ -371,8 +386,8 @@ will see the following information.
It is equally possible to skip \ref evaluate_anchor "the Evaluation" It is equally possible to skip \ref evaluate_anchor "the Evaluation"
and \ref preview_anchor "the Preview" and to \b Compute the mesh after and \ref preview_anchor "the Preview" and to \b Compute the mesh after
the hypotheses are assigned. For this, select your mesh in the hypotheses are assigned. For this, select your mesh in
the <b>Object Browser</b>. From the \b Mesh menu select \b Compute or the <b>Object Browser</b>. From the \b Mesh menu or the context menu
click "Compute" button of the toolbar. select \b Compute or click \a "Compute" button of the toolbar.
<center> <center>
\image html image28.png \image html image28.png
@ -381,24 +396,25 @@ click "Compute" button of the toolbar.
After the mesh computation finishes, the Mesh Computation information After the mesh computation finishes, the Mesh Computation information
box appears. If you close this box and click "Compute" button again, box appears. If you close this box and click "Compute" button again,
without previously changing meshing parameters, the mesh is without previously changing meshing parameters, the mesh will NOT be
NOT re-computed and the Mesh Computation information box with re-computed and the Mesh Computation information box will be shown
the same contents is shown. (To fully re-compute the mesh, invoke \ref with the same contents. (To fully re-compute the mesh, invoke
clear_mesh_anchor "Clear Mesh Data" command before). \ref clear_mesh_anchor "Clear Mesh Data" command before).
In case of a success, the box shows information on number of entities If the mesh computation has been a success, the box shows information
of different types in the mesh. on the number of entities of different types in the mesh.
\image html meshcomputationsucceed.png \image html meshcomputationsucceed.png
\anchor meshing_failed_anchor \anchor meshing_failed_anchor
If the mesh computation failed, the information about the cause of the If the mesh computation has failed, the information about the cause of the
failure is provided in \b Errors table. failure is provided in \b Errors table.
\image html meshcomputationfail.png \image html meshcomputationfail.png
After you select an error, <b>Show Sub-shape</b> button allows After you select an error in \b Errors table, <b>Show Sub-shape</b> button allows
visualizing in magenta the geometrical entity that causes the error. visualizing in magenta the geometrical entity meshing of which failed
(Name of this entity or its ID and type is shown in \a Sub-shape column).
<center> <center>
\image html failed_computation.png \image html failed_computation.png
@ -439,12 +455,12 @@ By default, the information box is always shown after mesh computation operation
\anchor edit_anchor \anchor edit_anchor
<h2>Editing the mesh</h2> <h2>Editing the mesh</h2>
It is possible to \ref modifying_meshes_page "edit the mesh" of It is possible to \ref modifying_meshes_page "edit the mesh" of a
lower dimension before generation of mesh of higher dimension. lower dimension before generation of the mesh of a higher dimension.
For example you can generate 2D mesh, modify it using e.g. For example you can generate a 2D mesh, modify it using e.g.
\ref pattern_mapping_page, and then generate 3D mesh basing on the \ref pattern_mapping_page, and then generate a 3D mesh basing on the
modified 2D mesh. The workflow is following: modified 2D mesh. The workflow is as follows:
- Define 1D and 2D meshing algorithms. - Define 1D and 2D meshing algorithms.
- Compute the mesh. 2D mesh is generated. - Compute the mesh. 2D mesh is generated.
- Apply \ref pattern_mapping_page. - Apply \ref pattern_mapping_page.
@ -453,9 +469,9 @@ and hypotheses.
- Compute the mesh. 3D mesh is generated. - Compute the mesh. 3D mesh is generated.
\note Nodes and elements added \ref adding_nodes_and_elements_page \note Nodes and elements added \ref adding_nodes_and_elements_page
"manually" can't be used in this workflow because the manually created "manually" cannot be used in this workflow because the manually created
entities are not attached to any geometry and thus (usually) can't be entities are not attached to any geometry and thus (usually) cannot be
found by a mesher paving some geometry. found by the mesher paving a geometry.
<b>See Also</b> a sample TUI Script demonstrates the possibility of <b>See Also</b> a sample TUI Script demonstrates the possibility of
\ref tui_editing_while_meshing "Intermediate edition while meshing" \ref tui_editing_while_meshing "Intermediate edition while meshing"

View File

@ -11,8 +11,8 @@ and/or hypotheses than those used to generate the mesh on other
sub-shapes. sub-shapes.
Creation of a sub-mesh allows to control individually meshing of a Creation of a sub-mesh allows to control individually meshing of a
certain sub-shape, thus allowing to get mesh locally coarser or finer, to get certain sub-shape, thus to get a locally coarser or finer mesh, to get
elements of different types in the same mesh etc. elements of different types in the same mesh, etc.
A sub-shape to create a sub-mesh on should be retrieved from the main shape A sub-shape to create a sub-mesh on should be retrieved from the main shape
in one of the following ways: <ul> in one of the following ways: <ul>
@ -33,7 +33,7 @@ compound of solids, starts from searching an algorithm, 1D as for the
edge. The following sub-shapes are sequentially checked for presence edge. The following sub-shapes are sequentially checked for presence
of a sub-mesh where 1D algorithm is assigned: of a sub-mesh where 1D algorithm is assigned:
<ul> <ul>
<li> the \b edge it-self</li> <li> the \b edge itself</li>
<li> <b>groups of edges</b> containing the edge, if any</li> <li> <b>groups of edges</b> containing the edge, if any</li>
<li> \b wires sharing the edge</li> <li> \b wires sharing the edge</li>
<li> \b faces sharing the edge</li> <li> \b faces sharing the edge</li>
@ -43,29 +43,28 @@ of a sub-mesh where 1D algorithm is assigned:
<li> <b>groups of solids</b> sharing the edge, if any</li> <li> <b>groups of solids</b> sharing the edge, if any</li>
<li> the <b>main shape</b></li> <li> the <b>main shape</b></li>
</ul> </ul>
(This sequence of sub-shapes defines priority of sub-meshes. Thus more (This sequence of sub-shapes defines the priority of sub-meshes. Thus more
local, i.e. assigned to sub-shape of lower dimension, algorithms and local, i.e. assigned to sub-shape of lower dimension, algorithms and
hypotheses have higher priority during the search of hypotheses to hypotheses have higher priority during the search of hypotheses to
apply.) apply.)
As soon as an 1D algorithm is found the search stops and the same As soon as a 1D algorithm is found, the search stops and the same
sequence of sub-shapes is checked to find a main and additional 1D sequence of sub-shapes is checked to find the main and additional 1D
hypotheses the found 1D algorithm can take into account. hypotheses, which can be taken into account by the found 1D algorithm.
The multi-dimensional algorithms have higher priority than The multi-dimensional algorithms have a higher priority than
uni-dimensional algorithms if they are assigned to sub-meshes of the uni-dimensional ones if they are assigned to sub-meshes of the
same priority. same priority.
If meshing parameters are defined on sub-meshes of the same priority, If meshing parameters are defined on sub-meshes of the same priority,
for example different 1D hypotheses are assigned to two faces sharing for example, different 1D hypotheses are assigned to two faces sharing
an edge, the hypothesis assigned to a sub-shape with a lower ID will an edge, the hypothesis assigned to a sub-shape with a lower ID will
be used for meshing. You can \ref submesh_order_anchor "change" mutual be used for meshing. You can \ref submesh_order_anchor "change" mutual
priority of such concurrent sub-meshes. priority of such concurrent sub-meshes.
\n Construction of a sub-mesh consists of: \n Construction of a sub-mesh consists of:
<ul> <ul>
<li>Selecting a mesh which will encapsulate your sub-mesh</li> <li>Selecting a mesh which will encapsulate the sub-mesh</li>
<li>Selecting a sub-shape for meshing</li> <li>Selecting a sub-shape for meshing</li>
<li>Applying one or several <li>Applying one or several
\ref about_hypo_page "hypotheses" and \ref about_hypo_page "hypotheses" and
@ -94,7 +93,7 @@ Geometry (e.g. a face if the parent mesh has been built on box) of the
sub-mesh. You can define meshing algorithms and hypotheses in the same way as sub-mesh. You can define meshing algorithms and hypotheses in the same way as
in \ref constructing_meshes_page "Create mesh" dialog. in \ref constructing_meshes_page "Create mesh" dialog.
Later you can change applied hypotheses or their parameters in Later you can change the applied hypotheses or their parameters in
\ref editing_meshes_page "Edit mesh/sub-mesh" dialog. Mesh entities \ref editing_meshes_page "Edit mesh/sub-mesh" dialog. Mesh entities
generated using changed hypotheses are automatically removed. generated using changed hypotheses are automatically removed.

View File

@ -51,7 +51,7 @@ The following dialog box will appear:
<center>Quadratic mesh</center> <center>Quadratic mesh</center>
</li> </li>
<li>Click the \b Apply or \b OK button.</li> <li>Click the \b Apply or <b>Apply and Close</b> button.</li>
</ol> </ol>
<br><b>See Also</b> a sample TUI Script of a \ref tui_quadratic "Convert to/from quadratic" operation. <br><b>See Also</b> a sample TUI Script of a \ref tui_quadratic "Convert to/from quadratic" operation.

View File

@ -14,9 +14,9 @@ menu in the Object browser <b>Create Groups from Geometry</b> item.
\image html create_groups_from_geometry.png \image html create_groups_from_geometry.png
In this dialog \b Elements group contains a list of shapes to create In this dialog \b Elements group contains a list of shapes, on which
groups of elements on them; \b Nodes group contains a list of shapes groups of elements will be created; \b Nodes group contains a list of shapes,
to create groups of node on them. on which groups of nodes will be created.
*/ */

View File

@ -23,7 +23,9 @@ elements which will form your group:</li>
</ul> </ul>
<li><b>Name</b> field allows to enter the name of your new group.</li> <li><b>Name</b> field allows to enter the name of your new group.</li>
<li><b>Color</b> - allows to assign to the group a certain color. The <li><b>Color</b> - allows to assign to the group a certain color. The
chosen color is used to display the elements of the group.</li> chosen color is used to display the elements of the group.<br>
Activation of <em>Auto Color</em> item in mesh context menu
switches on a random choice of a color for a new group.</li>
</ul> </ul>
Mesh module distinguishes between the three Group types: Mesh module distinguishes between the three Group types:
<b>Standalone Group</b>, <b>Group on Geometry</b> and <b>Group on Filter</b>. <b>Standalone Group</b>, <b>Group on Geometry</b> and <b>Group on Filter</b>.
@ -98,11 +100,11 @@ of a certain type generated on the selected geometrical object. Group
contents are dynamically updated if the mesh is modified. The group on contents are dynamically updated if the mesh is modified. The group on
geometry can be created only if the mesh is based on geometry. geometry can be created only if the mesh is based on geometry.
To define a group, click a \a Selection button and chose To define a group, click the \a Selection button and choose
- <em>Direct geometry selection</em> to select a shape in the Object - <em>Direct geometry selection</em> to select a shape in the Object
Browser or in the Viewer; Browser or in the Viewer;
- <em>Find geometry by mesh element selection</em> to activate a - <em>Find geometry by mesh element selection</em> to activate a
dialog which retrieves a shape by a selected element generated on dialog which retrieves a shape by the selected element generated on
this shape. this shape.
Note that this choice is available only if the mesh elements are Note that this choice is available only if the mesh elements are
@ -130,8 +132,8 @@ of a certain type satisfying the defined filter. Group contents are
dynamically updated if the mesh is modified. dynamically updated if the mesh is modified.
To define a group, click the <b>Set filter</b> button and define To define a group, click the <b>Set filter</b> button and define
criteria of the filter in the opened dialog. After confirmation of the criteria of the filter in the opened dialog. After the
operation a new group of mesh elements will be created. See more about operation is confirmed, a new group of mesh elements will be created. See more about
filters on the filters on the
\ref selection_filter_library_page "Selection filter library" page. \ref selection_filter_library_page "Selection filter library" page.

View File

@ -18,7 +18,8 @@ The following dialog box shall appear:
\image html diagonalinversion.png \image html diagonalinversion.png
</li> </li>
<li>Enter IDs of nodes forming the required edge in the \b Edge field (the node IDs must be separated by a dash) or select <li>Enter IDs of nodes forming the required edge in the \b Edge field
(the node IDs must be separated by dashes) or select
this edge in the 3D viewer.</li> this edge in the 3D viewer.</li>
<li>Click the \b Apply or <b>Apply and Close</b> button.</li> <li>Click the \b Apply or <b>Apply and Close</b> button.</li>
</ol> </ol>

View File

@ -8,7 +8,7 @@ mesh of plus one dimension are additionally created. All created
elements can be automatically grouped. Extrusion can be used to create elements can be automatically grouped. Extrusion can be used to create
a \ref extrusion_struct "structured mesh from scratch". a \ref extrusion_struct "structured mesh from scratch".
\image html extrusion_box.png "If you extrude several quadrangles, you get exactly same mesh as if you meshed a geometrical box (except that the initial quadrangles can be incorrectly oriented): quadrangles and segments on boundary of generated mesh are created" \image html extrusion_box.png "If you extrude several quadrangles, you get exactly the same mesh as if you meshed a geometrical box (except for that the initial quadrangles can be incorrectly oriented): quadrangles and segments are created on the boundary of the generated mesh"
<p>Any node, segment or 2D element can be extruded. Each type of <p>Any node, segment or 2D element can be extruded. Each type of
elements is extruded into a corresponding type of result elements: elements is extruded into a corresponding type of result elements:
@ -22,6 +22,14 @@ elements is extruded into a corresponding type of result elements:
<tr><td>Hexagonal polygon </td><td> Hexagonal prism </td></tr> <tr><td>Hexagonal polygon </td><td> Hexagonal prism </td></tr>
</table> </table>
When 2D elements are extruded, in addition to 3D elements segments are
created on ribs of the result 3D mesh. Free edges of input 2D elements
generate logically horizontal rib segments. Logically vertical rib
segments are generated from nodes belonging to a sole input 2D element
(a figure below illustrates this rule).
\image html extru_rib_segs.png "Two triangles extruded: no vertical rib segments generated from nodes #2 and #3 as they are shared by both triangles"
<em>To use extrusion:</em> <em>To use extrusion:</em>
<ol> <ol>
<li>From the \b Modification menu choose the \b Extrusion item or click <li>From the \b Modification menu choose the \b Extrusion item or click
@ -32,24 +40,24 @@ elements is extruded into a corresponding type of result elements:
<em>"Extrusion" button</em> <em>"Extrusion" button</em>
</center> </center>
The following dialog, looking different depending on selected options, The following dialog will appear:
will appear:
\image html extrusionalongaline1.png \image html extrusionalongaline1.png
\image html extrusionalongaline2.png
\image html extrusionalongaline3.png
</li> </li>
<li>In this dialog: <li>In this dialog:
<ul> <ul>
<li>Use \a Selection button to specify what you are going to
select at a given moment, \b Nodes, \b Edges or \b Faces.
\image html image120.png
<center><em>"Selection" button</em></center>
</li>
<li>Specify \b Nodes, \b Edges and \b Faces, which will be extruded, by one <li>Specify \b Nodes, \b Edges and \b Faces, which will be extruded, by one
of following means: of following means:
<ul> <ul>
<li><b>Select the whole mesh, sub-mesh or group</b> activating this <li><b>Select the whole mesh, sub-mesh or group</b> activating the
checkbox.</li> corresponding check-box.</li>
<li>Choose mesh elements with the mouse in the 3D Viewer. It is <li>Choose mesh elements with the mouse in the 3D Viewer. It is
possible to select a whole area with a mouse frame.</li> possible to select a whole area with a mouse frame.</li>
<li>Input the element IDs directly in <b>Node IDs</b>, <b>Edge <li>Input the element IDs directly in <b>Node IDs</b>, <b>Edge
@ -63,6 +71,10 @@ will appear:
<li>If the <b>Extrusion to Distance</b> radio button is selected <li>If the <b>Extrusion to Distance</b> radio button is selected
- specify the translation vector by which the elements will be extruded. - specify the translation vector by which the elements will be extruded.
</li> </li>
<p><br></p>
\image html extrusionalongaline2.png
<li>If the <b>Extrusion Along Vector</b> radio button is selected <li>If the <b>Extrusion Along Vector</b> radio button is selected
<ul> <ul>
<li>specify the coordinates of the \b Vector along which the elements <li>specify the coordinates of the \b Vector along which the elements
@ -72,19 +84,23 @@ will appear:
be negative).</li> be negative).</li>
</ul> </ul>
</li> </li>
<p><br></p>
\image html extrusionalongaline3.png
<li>If the <b>Extrusion By Normal</b> radio button is selected, <li>If the <b>Extrusion By Normal</b> radio button is selected,
every node of selected faces is extruded along the \a average every node of the selected faces is extruded along the \a average
of the \a normal vectors to the faces sharing the node. (Nodes and of the \a normal vectors to the faces sharing the node. (Nodes and
edges can't be extruded in this mode.) edges cannot be extruded in this mode.)
<ul> <ul>
<li>Specify the \b Distance of extrusion (it can be negative),</li> <li>Specify the \b Distance of extrusion (it can be negative),</li>
<li>Use <b>Along average normal</b> check-box to specify along <li>Use <b>Along average normal</b> check-box to specify along
what vector the distance is measured. which vector the distance is measured.
<ul> <ul>
<li>If it is \a activated the distance is measured along the <li>If it is \a activated the distance is measured along the
average normal mentioned above. </li> average normal mentioned above. </li>
<li>If it is \a deactivated every node is extruded along the <li>If it is \a deactivated every node is extruded along the
average normal till its intersection with the virtual plane got average normal till its intersection with a virtual plane obtained
by translation of the face sharing the node along its own normal by translation of the face sharing the node along its own normal
by the \b Distance.</li> by the \b Distance.</li>
</ul> </ul>
@ -95,8 +111,8 @@ will appear:
\image html extrusionbynormal_alongavgnorm.png "'Along average normal' activated (to the left) and deactivated (to the right)" \image html extrusionbynormal_alongavgnorm.png "'Along average normal' activated (to the left) and deactivated (to the right)"
<p></li> <p></li>
<li>Using <b>Use only input elements</b> check-box specify what <li><b>Use only input elements</b> check-box specifies what
elements to use to compute the average normal.<ul> elements will be used to compute the average normal.<ul>
<li> If it is \a activated only selected faces, among faces <li> If it is \a activated only selected faces, among faces
sharing the node, are used to compute the average normal at sharing the node, are used to compute the average normal at
the node. </li> the node. </li>

View File

@ -2,12 +2,14 @@
\page free_borders_page Free borders \page free_borders_page Free borders
\n This mesh quality control highlights borders of faces consisting of \n This mesh quality control highlights 1D elements (segments)
1D elements (segments) belonging to one face only. belonging to one element (face or volume) only.
\image html free_borders1.png \image html free_borders1.png
In this picture the free borders are displayed in white. In this picture the free borders are displayed in red. (Faces are
explicitly shown via <em>Display Entity</em> menu as all elements but
segments are hidden upon this control activation).
<br><b>See Also</b> a sample TUI Script of a <br><b>See Also</b> a sample TUI Script of a
\ref tui_free_borders "Free Borders quality control" operation. \ref tui_free_borders "Free Borders quality control" operation.

View File

@ -3,7 +3,7 @@
\page free_edges_page Free edges \page free_edges_page Free edges
\n This mesh quality control highlights borders of faces \n This mesh quality control highlights borders of faces
consisting of node links belonging to one face only. (links between nodes, not mesh segments) belonging to one face only.
\image html free_edges.png \image html free_edges.png
<center>In this picture some elements of mesh have been deleted and <center>In this picture some elements of mesh have been deleted and

View File

@ -19,12 +19,12 @@ In this dialog box specify <ul>
<li>\b All - include if all nodes are common;</li> <li>\b All - include if all nodes are common;</li>
<li>\b Main - include if all corner nodes are common (meaningful for <li>\b Main - include if all corner nodes are common (meaningful for
a quadratic mesh) </li> a quadratic mesh) </li>
<li><b>At least one</b> - include if one or more node is common</li> <li><b>At least one</b> - include if one or more nodes are common</li>
<li>\b Majority - include if half of nodes or more is common</li></ul> <li>\b Majority - include if half or more nodes are common</li></ul>
</li> </li>
<li> select reference groups,</li> <li> select reference groups,</li>
<li> <b>Include underlying entities only</b> option if activated <li> If <b>Include underlying entities only</b> option is activated
allows inclusion of an entity provided that it is based on nodes of an entity can be included if it is based on nodes of
one element of a reference group.</li> one element of a reference group.</li>
</ul> </ul>

View File

@ -12,35 +12,36 @@ visualization only and is not exported.
There are three types of groups different by their internal There are three types of groups different by their internal
organization:<ol> organization:<ol>
<li><b>Standalone group</b> is a static set of mesh entities. Its <li><b>Standalone group</b> is a static set of mesh entities. Its
contents can be explicitely controlled by the user. Upon removal of contents can be explicitly controlled by the user. Upon removal of
the entities included into the group, the group becomes empty and the entities included into the group, the group becomes empty and
the user is to pay efforts to restore its contents. Hence it is its content can be restored only manually. Hence it is
resonable to create standalone groups when the mesh generation is reasonable to create standalone groups when the mesh generation is
finished and mesh quality is verified. finished and mesh quality is verified.
\warning Creation and edition of large standalone groups in \warning Creation and edition of large standalone groups in
\ref creating_groups_page "Create group" dialog using manual edition \ref creating_groups_page "Create group" dialog using manual edition
is problematic due to poor performance of the dialog.</li> is problematic due to poor performance of the dialog.</li>
<li><b>Group on geomerty</b> is associated to one or a group of
<li><b>Group on geometry</b> is associated to a sub-shape or a group of
sub-shapes of the main shape and includes mesh entities generated on sub-shapes of the main shape and includes mesh entities generated on
this geometrical entities. The association to geometry is these geometrical entities. The association to a geometry is
established at group construction and can't be changed. The group established at group construction and cannot be changed. The group
contents is always up-to-date without user's efforts, hence the contents are always updated automatically, hence the
group can be created even before mesh elements generation.</li> group can be created even before mesh elements generation.</li>
<li><b>Group on filter</b> encapsulates a filter which is used to <li><b>Group on filter</b> encapsulates a filter, which is used to
select mesh entities composing the group from the whole select mesh entities composing the group from the whole
mesh. Criteria of the filter can be changed at any time. The mesh. Criteria of the filter can be changed at any time. The
group contents is always up-to-date without user's efforts, hence group contents are always updated automatically, hence
the group can be created even before mesh elements generation.</li> the group can be created even before mesh elements generation.</li>
</ol> </ol>
The group on geometry and group on filter can be converted to The group on geometry and group on filter can be converted to
the standalone group. a standalone group.
\image html groups_in_OB.png "Groups of different types look differently in the Object Browser" \image html groups_in_OB.png "Groups of different types look differently in the Object Browser"
The following ways of group creation are possible: The following ways of group creation are possible:
- \subpage creating_groups_page "Create group" dialog allows creation of - \subpage creating_groups_page "Create group" dialog allows creation of
a group of any of all the three types: a group of any type:
\ref standalone_group "Standalone group", \ref standalone_group "Standalone group",
\ref group_on_geom "Group on geometry" and \ref group_on_geom "Group on geometry" and
\ref group_on_filter "Group on filter" using dedicated tabs. \ref group_on_filter "Group on filter" using dedicated tabs.
@ -49,7 +50,7 @@ The following ways of group creation are possible:
- Standalone groups of all nodes and elements of the chosen sub-mesh - Standalone groups of all nodes and elements of the chosen sub-mesh
(type of elements depends on dimension of sub-mesh geometry) can (type of elements depends on dimension of sub-mesh geometry) can
be created using <b>Mesh -> Construct Group</b> menu item (available be created using <b>Mesh -> Construct Group</b> menu item (available
in context menu as well). from the context menu as well).
- Standalone groups of any element type can be created basing on nodes - Standalone groups of any element type can be created basing on nodes
of other groups - using \subpage group_of_underlying_elements_page of other groups - using \subpage group_of_underlying_elements_page
"Group based on nodes of other groups" dialog. "Group based on nodes of other groups" dialog.
@ -69,10 +70,9 @@ The created groups can be later:
- \ref importing_exporting_meshes_page "Exported" into a file as a - \ref importing_exporting_meshes_page "Exported" into a file as a
whole mesh. whole mesh.
In the Object Browser, if groups container item includes more In the Object Browser, if an item contains more than one child group,
than one group, it is possible to sort the groups by name in it is possible to sort the groups by name in ascending order
ascending order. For this, select the groups container in the Object using <b>Sort children</b> context menu item.
Browser and choose <b>Sort children</b> context menu item.
\image html smesh_sort_groups.png "Sorting groups" \image html smesh_sort_groups.png "Sorting groups"

View File

@ -4,8 +4,8 @@
\n In MESH there is a functionality allowing import/export \n In MESH there is a functionality allowing import/export
of meshes from/to \b MED, \b UNV (I-DEAS 10), \b DAT (simple ascii format), \b STL, of meshes from/to \b MED, \b UNV (I-DEAS 10), \b DAT (simple ascii format), \b STL,
\b GMF (internal format of DISTENE products, namely BLSurf, GHS3D and \b GMF (internal format of DISTENE products, namely MG-CADSurf, MG-Tetra and
Hexotic algorithms) and \b CGNS format files. You can also export a MG-Hexa algorithms) and \b CGNS format files. You can also export a
group as a whole mesh. group as a whole mesh.

View File

@ -16,25 +16,31 @@
either \ref importing_exporting_meshes_page "imported" or manually either \ref importing_exporting_meshes_page "imported" or manually
created); created);
</li> </li>
<li>\ref importing_exporting_meshes_page "import and export of meshes in various formats";</li> <li>\ref importing_exporting_meshes_page "importing and exporting meshes"
in various formats;</li>
<li>\subpage modifying_meshes_page "modifying meshes" with a vast <li>\subpage modifying_meshes_page "modifying meshes" with a vast
array of dedicated operations;</li> array of dedicated operations;</li>
<li>\subpage grouping_elements_page "creating groups of mesh elements";</li> <li>\subpage grouping_elements_page "creating groups" of mesh
elements;</li>
<li>filtering mesh entities (nodes or elements) using <li>filtering mesh entities (nodes or elements) using
\subpage filters_page "Filters" functionality for \ref \subpage filters_page "Filters" functionality for \ref
grouping_elements_page "creating groups" and applying \ref grouping_elements_page "creating groups" and applying \ref
modifying_meshes_page "mesh modifications";</li> modifying_meshes_page "mesh modifications";</li>
<li>\subpage viewing_meshes_overview_page "viewing meshes" in <li>\subpage viewing_meshes_overview_page "viewing meshes" in
the VTK viewer;</li> the VTK viewer and \ref mesh_infos_page "getting info" on mesh
and its sub-objects;</li>
<li>applying to meshes \subpage quality_page "Quality Controls", <li>applying to meshes \subpage quality_page "Quality Controls",
allowing to highlight important elements; allowing to highlight important elements;</li>
<li>various \subpage measurements_page "measurements" of the mesh objects. <li>taking various \subpage measurements_page "measurements" of the
mesh objects.</li>
</ul> </ul>
When setting parameters of operations, it is possible to use the variables predefined in It is possible to use the variables predefined in
\subpage using_notebook_mesh_page "Salome notebook". \subpage using_notebook_mesh_page "Salome notebook" to set parameters
of operations.
Mesh module preferences are described in the \subpage mesh_preferences_page section of SALOME Mesh Help. Mesh module preferences are described in the \subpage mesh_preferences_page
section of SALOME Mesh Help.
Almost all mesh module functionalities are accessible via Almost all mesh module functionalities are accessible via
\subpage smeshpy_interface_page "Mesh module Python interface". \subpage smeshpy_interface_page "Mesh module Python interface".

View File

@ -2,68 +2,62 @@
\page merging_elements_page Merging Elements \page merging_elements_page Merging Elements
\n This functionality allows to merge coincident elements of a mesh \n This functionality allows to merge coincident elements of a
object selectable in the dialog box. Two elements are considered coincident if they are based on the same set of nodes. mesh. Two elements are considered coincident if they are based on the
same set of nodes.
\image html mergeelems_ico.png "Merge elements menu button" \image html mergeelems_ico.png "Merge elements menu button"
<ol> To merge elements choose in the main menu \b Modification -> \b Transformation
<li>Choose in the main menu \b Modification -> \b Transformation -> <b>Merge elements</b> item. The following dialog box shall
-> <b>Merge elements</b> item. The following dialog box shall appear:
appear:</li>
\image html mergeelems_auto.png \image html mergeelems_auto.png
<br>
In this dialog:
<ul> <ul>
<li>\b Name is the name of the mesh object whose elements will be <li>\b Name is the name of the mesh object whose elements will be
merged.</li> merged.</li>
<li>\b Automatic or \b Manual Mode allows choosing how the elements <li>\b Automatic or \b Manual Mode allows choosing how the elements
are processed. are processed. In the \b Automatic Mode all elements created on
</ul> the same nodes will be merged. In \b Manual mode you can adjust
groups of coincident elements detected by the program.
<li><b>Automatic mode:</b> If the \b Manual Mode is selected, additional controls are
<ul>
<li>In the \b Automatic Mode the elements created on the same nodes
will be merged.</li>
</ul>
</li>
<li>If the \b Manual Mode is selected, additional controls are
available: available:
\image html mergeelems.png \image html mergeelems.png
<br> <br>
<ul> <ul>
<li>\b Detect button generates the list of coincident elements found <li>\b Detect button generates the list of coincident elements found
in the selected object.</li> in the selected object.</li>
<li><b>Coincident elements</b> is a list of groups of elements for <li><b>Coincident elements</b> is a list of groups of elements for
merging. As result of the operation all elements of each group will merging. After the operation all elements of each group will
be replaced by the firts element of the group. be united into one element. The first element of a group is kept and
<ul> the others are removed.
<li>\b Remove button deletes the selected group from the list.</li> <li>\b Remove button deletes the selected group from the list.</li>
<li>\b Add button adds to the list a group of elements selected in the <li>\b Add button adds to the list a group of elements selected in the
viewer with pressed "Shift" key.</li> viewer with pressed "Shift" key.</li>
<li><b>Select all</b> checkbox selects all groups.</li> <li><b>Select all</b> check-box selects all groups.</li>
<li><b>Show double elements IDs</b> checkbox shows/hides identifiers of <li><b>Show double elements IDs</b> check-box shows/hides identifiers of
elements of selected groups in the 3D viewer.</li> elements of the selected groups in the 3D viewer.</li>
</ul></li> <li><b>Edit selected group of coincident elements</b> list allows
<li><b>Edit selected group</b> list allows editing the selected group: editing the selected group:
<br><br> <br><br>
\image html add.png \image html add.png
<center>adds to the group the elements selected in the viewer.</center> <center>adds to the group the elements selected in the viewer.</center>
<br> <br>
\image html remove.png \image html remove.png
<center>removes from the group the selected elements.</center> <center>removes the selected elements from the group.</center>
<br> <br>
\image html sort.png \image html sort.png
<center>moves the selected element to the first position in the <center>moves the selected element to the first position in the
group. This means that all other elements of the group will be group in order to keep it in the mesh.</center>
replaced by this one.</center> <br>
<br> </li>
</li> </ul>
<li>To confirm your choice click \b Apply or <b>Apply and Close</b> button.</li> <li>To confirm your choice click \b Apply or <b>Apply and Close</b> button.</li>
</ul> </ul>
</ol>
In this picture you see a triangle which coincides with one of the In this picture you see a triangle which coincides with one of the
elements of the mesh. After we apply <b>Merge Elements</b> functionality, the elements of the mesh. After we apply <b>Merge Elements</b> functionality, the

View File

@ -18,35 +18,59 @@ then converted to the single node.
<ul> <ul>
<li>\b Name is the name of the mesh whose nodes will be merged.</li> <li>\b Name is the name of the mesh whose nodes will be merged.</li>
<li>\b Automatic or \b Manual mode allows choosing how the nodes are <li>\b Automatic or \b Manual mode allows choosing how the nodes are
processed. processed. In \b Manual mode you can adjust groups of coincident nodes
detected by the program and/or select any nodes to be merged.</li>
<li>\b Tolerance is a maximum distance between nodes sufficient for <li>\b Tolerance is a maximum distance between nodes sufficient for
merging.</li> merging.</li>
<li><b>Exclude Groups</b> group box allows to ignore the nodes which <li>Activation of <b>No merge of corner and medium nodes of quadratic
belong to the specified mesh groups. cells</b> check-box prevents merging medium nodes of quadratic
elements with corner nodes. This check-box is enabled provided
that the selected mesh includes quadratic elements.</li>
<li><b>Exclude groups from detection</b> group allows to ignore the
nodes which belong to the specified mesh groups. This control is
active provided that the mesh includes groups.</li>
<li><b>Nodes to keep during the merge</b> group allows to specify
nodes to keep in the mesh. (By default a node being the first in a
group of coincident nodes is kept.) It is possible to either select
nodes in the Viewer or select groups of any element type whose nodes
will be kept.
<ul>
<li>\a Selection button activates selection of nodes to keep.</li>
<li><b>Nodes</b> button activates selection of nodes in the
Viewer.</li>
<li><b>Groups and sub-meshes</b> button activates selection of
groups and sub-meshes.</li>
<li>\b Add button adds selected nodes or groups to the list.</li>
<li> Nodes or groups selected in the list can be removed using \b
Remove button.</li>
</ul>
</li>
</ul> </ul>
<li><b>Automatic mode:</b> <li><b>Automatic mode:</b>
<br> <br>
<ul> <ul>
<li>In the \b Automatic Mode all Nodes within the indicated tolerance <li>In the \b Automatic Mode all nodes within the indicated tolerance
will be merged. The nodes which belong to the groups specified in the will be merged. The nodes which belong to the groups specified in
<b>Exclude Groups</b> will be not taken into account.</li> <b>Exclude groups from detection</b> will NOT be taken into account.</li>
</ul> </ul>
</li><br> </li><br>
<li> The \b Manual mode gives you full control of what the operation will do. <li> The \b Manual mode gives you full control of what the operation will do.
In this mode additional controls are available: In this mode additional controls are available:
<ul> <ul>
<li>\b Detect button generates the list of coincident nodes for the given <li>\b Detect button generates the list of coincident nodes for the given
\b Tolerance.</li> \b Tolerance.</li>
<li><b>Coincident nodes</b> is a list of groups of nodes for <li><b>Coincident nodes</b> is a list of groups of nodes for
merging. As result of the operation all nodes of each group will be merging. Upon \b Apply all nodes of each group will
replaces by the firts node of the group. be united into one node. The first node of a group is kept and
the others are removed. By default the first node has a lowest ID
within the group.
<ul> <ul>
<li>\b Remove button deletes the selected group from the list.</li> <li>\b Remove button deletes the selected group from the list.</li>
<li>\b Add button adds to the list a group of nodes selected in the <li>\b Add button adds to the list a group of nodes selected in the
viewer with pressed "Shift" key.</li> viewer.</li>
<li><b>Select all</b> checkbox selects all groups.</li> <li><b>Select all</b> check-box selects all groups.</li>
<li><b>Show double nodes IDs</b> checkbox shows/hides identifiers of <li><b>Show double nodes IDs</b> check-box shows/hides identifiers of
nodes of selected groups in the 3D viewer.</li> nodes of selected groups in the 3D viewer.</li>
</ul> </ul>
@ -54,8 +78,8 @@ nodes of selected groups in the 3D viewer.</li>
\image html mergenodes.png \image html mergenodes.png
<br> <br>
</li> </li>
<li><b>Edit selected group</b> list allows editing the selected <li><b>Edit selected group of coincident nodes</b> list allows
group: editing the selected group:
<br><br> <br><br>
\image html add.png \image html add.png
<center>adds to the group the nodes selected in the viewer.</center> <center>adds to the group the nodes selected in the viewer.</center>
@ -65,17 +89,21 @@ nodes of selected groups in the 3D viewer.</li>
<br> <br>
\image html sort.png \image html sort.png
<center>moves the selected node to the first position in the <center>moves the selected node to the first position in the
group. This means that all other nodes of the group will be group in order to keep it in the mesh.</center><br>
replaced by this one.</center><br> </li>
</li>
</ul> </ul>
</li> </li>
<li>To confirm your choice click \b Apply or <b>Apply and Close</b> button.</li> <li>To confirm your choice click \b Apply or <b>Apply and Close</b> button.</li>
</ol> </ol>
\image html merging_nodes1.png "The initial obgect" \image html merging_nodes1.png
<center> The initial object. Nodes 25, 26 and 5 are added to <b>Nodes
\image html merging_nodes2.png "The object has been merged with a very big tolerance" to keep during the merge</b> group.
</center>
<br>
\image html merging_nodes2.png
<center> The object has been merged
</center>
<br><b>See Also</b> a sample TUI Script of a <br><b>See Also</b> a sample TUI Script of a
\ref tui_merging_nodes "Merge Nodes" operation. \ref tui_merging_nodes "Merge Nodes" operation.

View File

@ -14,14 +14,16 @@ in the toolbar.
<em>"Mesh Information" button</em></center> <em>"Mesh Information" button</em></center>
The <b>Mesh Information</b> dialog box provides three tab pages: The <b>Mesh Information</b> dialog box provides three tab pages:
- <b>\ref advanced_mesh_infos_anchor "Base Info"</b> - to show base - <b>\ref advanced_mesh_infos_anchor "Base Info"</b> - to show
information about the selected mesh object. base and quantitative information about the selected mesh object.
- <b>\ref mesh_element_info_anchor "Element Info"</b> - to show - <b>\ref mesh_element_info_anchor "Element Info"</b> - to show
detailed information about the selected mesh node or element. detailed information about the selected mesh nodes or elements.
- <b>\ref mesh_addition_info_anchor "Additional Info"</b> - to show additional information available - <b>\ref mesh_addition_info_anchor "Additional Info"</b> - to show
for the selected mesh, sub-mesh or group object. additional information available for the selected mesh, sub-mesh or
group object.
- <b>\ref mesh_quality_info_anchor "Quality Info"</b> - to show - <b>\ref mesh_quality_info_anchor "Quality Info"</b> - to show
overall quality information about the selected mesh, sub-mesh or group object. overall quality information about the selected mesh, sub-mesh or group
object.
\anchor advanced_mesh_infos_anchor \anchor advanced_mesh_infos_anchor
<h2>Base Information</h2> <h2>Base Information</h2>
@ -43,7 +45,8 @@ information about the selected mesh node(s) or element(s), namely:
- For a node: - For a node:
- Node ID; - Node ID;
- Coordinates (X, Y, Z); - Coordinates (X, Y, Z);
- Connectivity information (connected elements); - Connectivity information (connected elements); double click in
this line makes the dialog show information of these elements;
- Position on a shape (for meshes built on a geometry); - Position on a shape (for meshes built on a geometry);
- Groups information (names of groups the node belongs to). - Groups information (names of groups the node belongs to).
@ -55,7 +58,8 @@ information about the selected mesh node(s) or element(s), namely:
- Element ID; - Element ID;
- Type (triangle, quadrangle, etc.); - Type (triangle, quadrangle, etc.);
- Gravity center (X, Y, Z coordinates); - Gravity center (X, Y, Z coordinates);
- Connectivity information (connected nodes); - Connectivity information (connected nodes); double click in
a line of a node makes the dialog show information of this node;
- Quality controls (area, aspect ration, volume, etc.); - Quality controls (area, aspect ration, volume, etc.);
- Position on a shape (for meshes built on a geometry); - Position on a shape (for meshes built on a geometry);
- Groups information (names of groups the element belongs to). - Groups information (names of groups the element belongs to).
@ -63,7 +67,7 @@ information about the selected mesh node(s) or element(s), namely:
<center>\image html eleminfo2.png <center>\image html eleminfo2.png
<em>"Element Info" page, element information</em></center> <em>"Element Info" page, element information</em></center>
The use can either input the ID of a node or element he wants to The user can either input the ID of a node or element he wants to
analyze directly in the dialog box or select the node(s) or element(s) in analyze directly in the dialog box or select the node(s) or element(s) in
the 3D viewer. the 3D viewer.
@ -152,6 +156,8 @@ button. Also, values are automatically computed if the number of
nodes / elements does not exceed the "Automatic controls compute limit" set nodes / elements does not exceed the "Automatic controls compute limit" set
via the "Mesh information" preferences (zero value means that there is no limit). via the "Mesh information" preferences (zero value means that there is no limit).
\note The plot functionality is available only if GUI module is builded with Plot 2D Viewer (set option SALOME_USE_PLOT2DVIEWER to ON when building GUI module).
The button \b "Dump" allows printing the information displayed in the The button \b "Dump" allows printing the information displayed in the
dialog box to a .txt file. dialog box to a .txt file.

View File

@ -44,17 +44,17 @@ or in later sessions with this module according to the preferences.
presentation mode as default. presentation mode as default.
- <b>Representation of the 2D quadratic elements</b> - <b>Representation of the 2D quadratic elements</b>
- <b>Default mode of the 2D quadratic elements</b> combobox - allows - <b>Default mode of the 2D quadratic elements</b> combo-box - allows
to select lines or arcs for representation of quadratic elements as default. to select lines or arcs for representation of quadratic elements as default.
- <b>Maximum Angle</b> - maximum deviation angle used by the - <b>Maximum Angle</b> - maximum deviation angle used by the
application to build arcs. application to build arcs.
- <b>Mesh export</b> - <b>Mesh export</b>
- If you toggle <b>Automatically create groups for MED export</b> checkbox, - If you toggle <b>Automatically create groups for MED export</b> check-box,
this operation will be carried out automatically. this operation will be carried out automatically.
- <b>Mesh computation</b> - <b>Mesh computation</b>
- <b>Show a computation result notification</b> combobox allows to - <b>Show a computation result notification</b> combo-box allows to
select the notification mode about a mesh computation result. select the notification mode about a mesh computation result.
There are 3 possible modes: There are 3 possible modes:
- <b>Never</b> - do not show the result dialog at all; - <b>Never</b> - do not show the result dialog at all;
@ -132,16 +132,16 @@ or in later sessions with this module according to the preferences.
\image html pref22.png \image html pref22.png
- <b>Nodes</b> allows to define default parameters for nodes, which will be applied - <b>Nodes</b> allows to define default parameters for nodes, which will be applied
for a new created mesh only. Customization of already created meshes can be done using for a newly created mesh only. Existing meshes can be customized using
\ref colors_size_page "Properties dialog box" that is called by click on popup menu of mesh. \ref colors_size_page "Properties dialog box" available from the context menu of a mesh.
- <b>Color</b> - allows to select the color of nodes. Click on the - <b>Color</b> - allows to select the color of nodes. Click on the
colored line to access to the <b>Select Color</b> dialog box. colored line to access to the <b>Select Color</b> dialog box.
- <b>Type of marker</b> - allows to define the shape of nodes. - <b>Type of marker</b> - allows to define the shape of nodes.
- <b>Scale of marker</b> - allows to define the size of nodes. - <b>Scale of marker</b> - allows to define the size of nodes.
- <b>Elements</b> allows to define default parameters for different elements, which will be applied - <b>Elements</b> allows to define default parameters for different elements, which will be applied
for a new created mesh only. Customization of already created meshes can be done using for a newly created mesh only. Existing meshes can be customized using
\ref colors_size_page "Properties dialog box" that is called by click on popup menu of mesh. \ref colors_size_page "Properties dialog box" available from the context menu of a mesh.
- <b>Surface color</b> - allows to select the surface color of 2D elements - <b>Surface color</b> - allows to select the surface color of 2D elements
(seen in Shading mode). Click on the colored line to access to the (seen in Shading mode). Click on the colored line to access to the
<b>Select Color</b> dialog box. <b>Select Color</b> dialog box.
@ -175,21 +175,21 @@ or in later sessions with this module according to the preferences.
- <b>Groups</b> - <b>Groups</b>
- <b>Names color</b> - specifies color of group names to be used in - <b>Names color</b> - specifies color of group names to be used in
3D viewer. 3D viewer.
- <b>Default color</b> - specifies default group color, which is used - <b>Default color</b> - specifies the default group color, which is used
when creating new mesh group (see \ref creating_groups_page "Create Group dialog box"). to create a new mesh group (see \ref creating_groups_page "Create Group dialog box").
- <b>Numbering</b> allows to define properties of numbering functionality: - <b>Numbering</b> allows to define properties of numbering functionality:
- <b>Nodes</b> - specifies text properties of nodes numbering - <b>Nodes</b> - specifies text properties of nodes numbering
(font family, size, attributes, color). (font family, size, attributes, color).
- <b>Elements</b> - same for elements. - <b>Elements</b> - same for elements.
- <b>Orientation of Faces</b> - allows to define the behavior of - <b>Orientation of Faces</b> - allows to define default properties of orientation vectors.
<b>Orientation of faces</b> functionality, which will be applied These preferences will be applied to the newly created meshes only; properties of existing meshes
for a new created mesh only. Customization of already created meshes can be done using can be customized using \ref colors_size_page "Properties dialog box"
\ref colors_size_page "Properties dialog box" that is called by click on popup menu of mesh. available from the context menu of a mesh.
- \b Color - allows to define the color of orientation vertors; - \b Color - allows to define the color of orientation vectors;
- \b Scale - allows to define the size of orientation vectors; - \b Scale - allows to define the size of orientation vectors;
- <b>3D Vector</b> checkbox allows to choose between 2D planar - <b>3D Vector</b> check-box allows to choose between 2D planar
and 3D vectors. and 3D vectors.
<br><h2>Selection Preferences</h2> <br><h2>Selection Preferences</h2>
@ -220,9 +220,9 @@ or in later sessions with this module according to the preferences.
\image html pref24.png \image html pref24.png
\note The following settings are default and will be applied for \note The following settings are default and will be applied for
a new created mesh only. Customization of already created meshes a newly created mesh only. Existing meshes
can be done using local \ref scalar_bar_dlg "Scalar Bar Properties dialog box" can be customized using local \ref scalar_bar_dlg "Scalar Bar Properties dialog box"
that is called by click on popup menu of mesh. available from the context menu of a mesh.
- <b>Font</b> - in this menu you can set type, face and color for - <b>Font</b> - in this menu you can set type, face and color for
the font of <b>Title</b> and <b>Labels</b>. the font of <b>Title</b> and <b>Labels</b>.

View File

@ -43,6 +43,8 @@ transformation operations, giving the possibility to:
triangles.</li> triangles.</li>
<li>\subpage split_to_tetra_page "Split" volumic elements into <li>\subpage split_to_tetra_page "Split" volumic elements into
tetrahedra or prisms.</li> tetrahedra or prisms.</li>
<li>\subpage split_biquad_to_linear_page "Split bi-quadratic" elements
into linear ones without creation of additional nodes.</li>
<li>\subpage smoothing_page "Smooth" elements, reducung distortions in <li>\subpage smoothing_page "Smooth" elements, reducung distortions in
them by adjusting the locations of nodes.</li> them by adjusting the locations of nodes.</li>
<li>Create an \subpage extrusion_page "extrusion" along a vector or by <li>Create an \subpage extrusion_page "extrusion" along a vector or by
@ -58,8 +60,8 @@ transformation operations, giving the possibility to:
<li>\subpage cut_mesh_by_plane_page "Cut a tetrahedron mesh by a plane".</li> <li>\subpage cut_mesh_by_plane_page "Cut a tetrahedron mesh by a plane".</li>
</ul> </ul>
It is possible to \ref edit_anchor "modify the mesh" of lower \note It is possible to \ref edit_anchor "modify the mesh" of a lower
dimension before generation of mesh of higher dimension. dimension before generation of the mesh of a higher dimension.
<p><br></p> <p><br></p>

View File

@ -149,7 +149,7 @@ Alternatively, it is possible to select <b>Refine selected mesh elements</b>
check-box and apply the pattern to check-box and apply the pattern to
<ul> <ul>
<li> One or several <b>Mesh volumes</b> instead of a geometric 3D object</li> <li> One or several <b>Mesh volumes</b> instead of a geometric 3D object</li>
<li> and select two /b Nodes instead of vertices.</li> <li> and select two \b Nodes instead of vertices.</li>
</ul> </ul>
Additionally it is possible to: Additionally it is possible to:
<ul> <ul>

View File

@ -5,15 +5,20 @@
Medial Axis Projection algorithm can be used for meshing faces with Medial Axis Projection algorithm can be used for meshing faces with
sinuous borders and having channel-like shape, for which is it sinuous borders and having channel-like shape, for which is it
difficult to define 1D hypotheses so that generated quadrangles to be difficult to define 1D hypotheses so that generated quadrangles to be
of good shape. of good shape. The algorithm can be also applied to faces with ring
topology, which can be viewed as a closed 'channel'. In the latter
case radial discretization of a ring can be specified by
using <em>Number of Layers</em> or <em>Distribution of Layers</em>
hypothesis.
\image html quad_from_ma_mesh.png "A mesh of a river model" \image html quad_from_ma_mesh.png "A mesh of a river model to the left and of a ring-face to the right"
The algorithm assures good shape of quadrangles by constructing Medial The algorithm assures good shape of quadrangles by constructing Medial
Axis between sinuous borders of the face and using it to Axis between sinuous borders of the face and using it to
discretize the borders. discretize the borders. (Shape of quadrangles can be not perfect at
locations where opposite sides of a 'channel' are far from being parallel.)
\image html quad_from_ma_medial_axis.png "Media Axis between two blue sinuous borders" \image html quad_from_ma_medial_axis.png "Medial Axis between two blue sinuous borders"
The Medial Axis is used in two ways: The Medial Axis is used in two ways:
<ol> <ol>
@ -22,9 +27,9 @@ The Medial Axis is used in two ways:
Axis.</li> Axis.</li>
<li> If there is no sub-meshes on the sinuous borders, then a part of <li> If there is no sub-meshes on the sinuous borders, then a part of
the Medial Axis that can be mapped to both borders is discretized the Medial Axis that can be mapped to both borders is discretized
using a hypothesis assigned to the face or its ancestor shapes, using a 1D hypothesis assigned to the face or its ancestor shapes,
and the division points are mapped from the Medial Axis to the both and the division points are mapped from the Medial Axis to the both
borders.</li> borders to find positions of nodes.</li>
</ol> </ol>
*/ */

View File

@ -3,20 +3,20 @@
\page quad_ijk_algo_page Quadrangle (Mapping) meshing algorithm \page quad_ijk_algo_page Quadrangle (Mapping) meshing algorithm
<b>Quadrangle (Mapping)</b> meshing algorithm is intended for creating <b>Quadrangle (Mapping)</b> meshing algorithm is intended for creating
all-quadrangle and quad-dominant meshes on faces with no holes and all-quadrangle and quad-dominant meshes on faces without holes and
bound by at least three edges. bound by at least three edges.
The algorithm can create mesh on any face but mesh quality and The algorithm can create mesh on any face but its quality and
validity depends on two factors: validity depend on two factors:
- face shape (number of edges and concavity of boundary); - face shape (number of edges and boundary concavity);
- discretization of edges. - discretization of edges.
\image html quad_mesh_invalid.png "Invalid mesh on quadrilateral concave faces" \image html quad_mesh_invalid.png "Invalid mesh on quadrilateral concave faces"
The algorithm uses <em>Transfinite Interpolation</em> technic in The algorithm uses <em>Transfinite Interpolation</em> technique in the
parametric space of a face to locate nodes inside the face. parametric space of a face to locate nodes inside the face.
The algorithm treats any face as a quadrangle. If a face is bound by The algorithm treats any face as quadrangle. If a face is bound by
more than four edges, four most sharp vertices are considered as more than four edges, four most sharp vertices are considered as
corners of the quadrangle and all edges between these vertices are corners of the quadrangle and all edges between these vertices are
treated as quadrangle sides. In the case of three edges, the vertex treated as quadrangle sides. In the case of three edges, the vertex
@ -26,24 +26,24 @@ quadrangle.
\image html quad_meshes.png "Algorithm generates a structured mesh on complex faces provided that edges are properly discretized" \image html quad_meshes.png "Algorithm generates a structured mesh on complex faces provided that edges are properly discretized"
To get an all-quadrangle mesh you have to carefully define 1D To get an all-quadrangle mesh you have to carefully define 1D
hypotheses on edges of a face. To get a \b structured mesh you have to assure hypotheses on edges of a face. To get a \b structured mesh you have to provide
equal number of segments on opposite sides of the quadrangle. If this equal number of segments on opposite sides of the quadrangle. If this
condition is not respected, the algorithm by default (with no condition is not respected, the algorithm by default (without a
hypothesis) creates \b quad-dominant mesh with triangles located near a hypothesis) creates a \b quad-dominant mesh with triangles located near the
side with maximal number of segments. But you can get an side with the maximal number of segments. However, you can get an
\b all-quadrangle mesh in this case by using \b all-quadrangle mesh in this case by using
\ref hypo_quad_params_anchor "Quadrangle Parameters" \ref hypo_quad_params_anchor "Quadrangle Parameters"
hypothesis to specify how to make transition mesh between opposite hypothesis to specify how to make transition mesh between opposite
sides with different number of segments, provided that certain sides with different number of segments, provided that certain
conditions are respected. In any case total number of segments must be conditions are respected. In any case the total number of segments must be
even. To use \a Reduced transition method there must be equal number even. To use \a Reduced transition method, there must be an equal number
of segments on one pair of opposite sides. of segments on one pair of opposite sides.
The following hypotheses help in creation of quadrangle meshes. The following hypotheses help to create quadrangle meshes.
- \ref propagation_anchor "Propagation" additional 1D hypotheses - \ref propagation_anchor "Propagation" additional 1D hypotheses
help to get equal number of segments on opposite sides of the help to get an equal number of segments on the opposite sides of a
quadrilateral face. quadrilateral face.
- \ref a1d_algos_anchor "Composite Side Discretization" algorithm is useful - \ref a1d_algos_anchor "Composite Side Discretization" algorithm is useful
to discretize several C1 continues edges as one quadrangle side. to discretize several C1 continuous edges as one quadrangle side.
*/ */

View File

@ -5,8 +5,8 @@
\n This operation allows fixing the orientation of a set of faces in \n This operation allows fixing the orientation of a set of faces in
the following ways: the following ways:
<ul> <ul>
<li>The desired orientation of a set of neighboring faces can be defined <li>The required orientation of a set of neighboring faces can be defined
by a vector giving a desired direction of a normal of a certain face. <br> by a vector giving the direction of a normal to a certain face. <br>
Since the direction of face normals in the set can be even opposite, Since the direction of face normals in the set can be even opposite,
it is necessary to specify a \a control face, the normal to which it is necessary to specify a \a control face, the normal to which
will be compared with the vector. This face can be either: will be compared with the vector. This face can be either:
@ -41,7 +41,7 @@ The orientation of a face is changed by reverting the order of its nodes.
<li>To reorient by direction of the face normal: <li>To reorient by direction of the face normal:
<ul> <ul>
<li>Specify the coordinates of the \b Point by which the control face <li>Specify the coordinates of the \b Point by which the control face
will be found. You can specify the \b Point by either picking a will be found. You can specify the \b Point by picking a
node in the 3D Viewer or selecting a vertex in the Object node in the 3D Viewer or selecting a vertex in the Object
Browser.</li> Browser.</li>
<li>Set up the \b Direction vector to be compared with the normal of the <li>Set up the \b Direction vector to be compared with the normal of the
@ -61,7 +61,7 @@ The orientation of a face is changed by reverting the order of its nodes.
</li> </li>
<li>In the second mode it is possible to either pick the \b Face by mouse in the 3D Viewer or directly input the \b Face ID in the corresponding field. <li>In the second mode it is possible to pick the \b Face by mouse in the 3D Viewer or directly input the \b Face ID in the corresponding field.
<center> <center>
\image html reorient_2d_face.png "The orientation of adjacent faces is chosen according to a vector. The control face is explicitly given." \image html reorient_2d_face.png "The orientation of adjacent faces is chosen according to a vector. The control face is explicitly given."
@ -81,7 +81,7 @@ The orientation of a face is changed by reverting the order of its nodes.
<br> <br>
<center> <center>
\image html reorient_2d_volume.png "The orientation of faces is chosen with relation to adjacent volumes." \image html reorient_2d_volume.png "The orientation of faces is chosen relatively to adjacent volumes."
</center> </center>
</li> </li>

View File

@ -7,6 +7,8 @@ dimension than the input ones. Boundary elements around generated
mesh of plus one dimension are additionally created. All created mesh of plus one dimension are additionally created. All created
elements can be automatically grouped. Revolution can be used to create elements can be automatically grouped. Revolution can be used to create
a \ref extrusion_struct "structured mesh from scratch". a \ref extrusion_struct "structured mesh from scratch".
See \ref extrusion_page page for general information on Revolution
which can be viewed as extrusion along a circular path.
<em>To apply revolution:</em> <em>To apply revolution:</em>
<ol> <ol>
@ -33,7 +35,7 @@ The following dialog will appear:
of following means: of following means:
<ul> <ul>
<li><b>Select the whole mesh, sub-mesh or group</b> activating this <li><b>Select the whole mesh, sub-mesh or group</b> activating this
checkbox.</li> check-box.</li>
<li>Choose mesh elements with the mouse in the 3D Viewer. It is <li>Choose mesh elements with the mouse in the 3D Viewer. It is
possible to select a whole area with a mouse frame.</li> possible to select a whole area with a mouse frame.</li>
<li>Input the element IDs directly in <b>Node IDs</b>, <b>Edge <li>Input the element IDs directly in <b>Node IDs</b>, <b>Edge
@ -46,14 +48,14 @@ The following dialog will appear:
</li> </li>
<li>Specify the \b Axis of revolution: <li>Specify the \b Axis of revolution:
<ul> <ul>
<li>Specify the cooordinates of the start \b Point of the <li>Specify the coordinates of the start \b Point of the
axis of revolution; either directly or by picking a node axis of revolution; either directly or by picking a node
in the Viewer (selection of nodes is activated as you click in the Viewer (selection of nodes is activated as you click
the \a Selection button).</li> the \a Selection button).</li>
<li>Specify the \b Vector of the axis in either of three ways: <li>Specify the \b Vector of the axis in either of three ways:
<ul> <ul>
<li>directly adjust vector components;</li> <li>directly adjust vector components;</li>
<li>click \a Selection button, chose <em>From Origin to <li>click \a Selection button, choose <em>From Origin to
selected Point</em> in the opened menu and pick a node selected Point</em> in the opened menu and pick a node
in the Viewer; </li> in the Viewer; </li>
<li>click \a Selection button, chose <em>Normal to <li>click \a Selection button, chose <em>Normal to
@ -66,16 +68,16 @@ The following dialog will appear:
<ul> <ul>
<li> <b>Angle by Step</b> - the elements are revolved by the <li> <b>Angle by Step</b> - the elements are revolved by the
specified angle at each step (i.e. for Angle=30 and Number of specified angle at each step (i.e. for Angle=30 and Number of
Steps=2, the elements will be extruded by 30 degrees twice for a Steps=3, the elements will be extruded by 30 degrees twice for a
total of 30*2=60) total of 30*3=90)
\image html revolutionsn2.png "Example of Revolution with Angle by Step" \image html revolutionsn2.png "Example of Revolution with Angle by Step. Angle=30 and Number of Steps=3"
</li> </li>
<li> <b>Total Angle</b> - the elements are revolved by the <li> <b>Total Angle</b> - the elements are revolved by the
specified angle only once and the number of steps defines the specified angle only once and the number of steps defines the
number of iterations (i.e. for Angle=30 and Number of Steps=2, number of iterations (i.e. for Angle=30 and Number of Steps=3,
the elements will be revolved by 30/2=15 degrees twice for a the elements will be revolved by 30/3=10 degrees twice for a
total of 30). total of 30).
\image html revolutionsn1.png "Example of Revolution with Total Angle" \image html revolutionsn1.png "Example of Revolution with Total Angle. Angle=30 and Number of Steps=3"
</li> </li>
</ul> </ul>
</li> </li>

View File

@ -3,15 +3,20 @@
\page segments_around_vertex_algo_page Segments around Vertex \page segments_around_vertex_algo_page Segments around Vertex
\n <b>Segments around Vertex</b> algorithm is considered to be a 0D meshing \n <b>Segments around Vertex</b> algorithm is considered to be a 0D meshing
algorithm, but, of course, it doesn't mesh nodes. It allows to define algorithm, but, of course, it doesn't mesh vertices. It allows to define
the local size of the elements in the neighborhood of a certain the local size of the segments in the neighborhood of a certain
node. If we choose an object of higher dimension, it applies to all vertex. If we assign this algorithm to a geometrical object of higher
its tops, i.e. corners of a box. The 0D algorithm combines with the dimension, it applies to all its vertices.
algorithms of higher dimensions, but it is not necessarily required
for their successful implementation.
This algorithm allows only one hypothesis. Length of segments near vertex is defined by <b> Length Near
Vertex </b> hypothesis.
This hypothesis is used by \ref a1d_algos_anchor "Wire Discretization" or
\ref a1d_algos_anchor "Composite Side Discretization" algorithms as
follows: a geometrical edge is discretized according to a 1D
hypotheses and then nodes near vertices are modified to assure the
segment length required by <b> Length Near Vertex </b> hypothesis.
\image html lengthnearvertex.png \image html lengthnearvertex.png
*/ */

View File

@ -2,9 +2,11 @@
\page selection_filter_library_page Selection filter library \page selection_filter_library_page Selection filter library
\n Selection filter library is a powerful tool enabling to create \n Selection filter library allows creating and storing in files
filters to be used on meshes. You can access to it from the Main Menu filters that can be later loaded and used for operations on meshes. You can
via <b>Tools / Selection filter library</b>. access to it from the Main Menu via <b>Tools / Selection filter library</b>.
It is also possible to save any filter by invoking the filter library
from \a Filter dialog launched from any mesh operation.
\image html selectionfilterlibrary.png \image html selectionfilterlibrary.png
@ -20,21 +22,23 @@ filter. By default it is prefixed with the corresponding entity type.
When we use filters during a group creation or another operation (by When we use filters during a group creation or another operation (by
clicking <b>Set Filter</b> button in the corresponding dialog), the clicking <b>Set Filter</b> button in the corresponding dialog), the
menu for setting filters looks as shown below. dialog for setting filters looks as shown below.
\image html a-filteronfaces.png
The \b Add button creates a new criterion at the end of the list of The \b Add button creates a new criterion at the end of the list of
criteria. The \b Insert button creates a new criterion before the criteria. The \b Insert button creates a new criterion before the
selected criterion. The \b Remove button deletes the selected selected criterion. The \b Remove button deletes the selected
criterion. The \b Clear button deletes all criteria. criterion. The \b Clear button deletes all criteria.
\n Each <b>Entity type</b> has its specific list of criteria, however all \n Each <b>Entity type</b> has its specific list of criteria, however all
filters have common syntax. For each criterion you should specify the filters have common syntax. The <b>Threshold Value</b> should be specified
<b>Threshold Value</b> and for numerical criteria whether we search for most criteria. For numerical criteria it is necessary to indicate if
for the elements that should be \b More, \b Less or \b Equal to this the found elements should be \b More, \b Less or \b Equal to this
\b Value. You can also reverse the sense of a criterion using \b Unary \b Value. You can also reverse the sense of a criterion using \b Unary
operator \a Not and you should specify logical relations between operator \a Not and you should specify logical relations between
criteria using \b Binary operators \a Or and \a And. criteria using \b Binary operators \a Or and \a And.
\n Some criteria have the additional parameter of \b Tolerance.<br> \n Some criteria have the additional parameter of \b Tolerance.<br>
Switching on <b>Insert filter in viewer</b> checkbox limits Switching on <b>Insert filter in viewer</b> check-box limits
selection of elements in the Viewer to the current filter. selection of elements in the Viewer to the current filter.
<br> <br>
In the \b Source field you choose if the filter will be applied to In the \b Source field you choose if the filter will be applied to
@ -56,8 +60,6 @@ in the Library.
is no selected mesh in the Object Browser and the filter can not be is no selected mesh in the Object Browser and the filter can not be
created. You have to select the mesh and the button will be enabled. created. You have to select the mesh and the button will be enabled.
\image html a-filteronfaces.png
Some criteria are applicable to all <b>Entity types</b>: Some criteria are applicable to all <b>Entity types</b>:
<ul><li> <ul><li>
<b>Belong to Geom</b> selects entities whose all nodes lie on the <b>Belong to Geom</b> selects entities whose all nodes lie on the
@ -72,7 +74,7 @@ algorithm works faster, if this is any other
shape, the algorithm works slower. shape, the algorithm works slower.
</li><li> </li><li>
<b>Belong to Mesh Group</b> selects entities included into the mesh group <b>Belong to Mesh Group</b> selects entities included into the mesh group
defined by <b>Threshold Value</b>. defined by the <b>Threshold Value</b>.
</li><li> </li><li>
<b>Range of IDs</b> allows selection of entities with the specified <b>Range of IDs</b> allows selection of entities with the specified
IDs. IDs.
@ -102,7 +104,7 @@ defined by the <b>Threshold Value</b>. The list of available geometric
types depends on the current entity type. types depends on the current entity type.
</li><li> </li><li>
<b>Entity type</b> allows selection of elements by their type defined <b>Entity type</b> allows selection of elements by their type defined
as combination of geometry type + number of nodes. as a combination of geometry type and the number of nodes.
</li> </li>
</ul> </ul>
@ -133,7 +135,7 @@ See also \ref tui_double_nodes_control "Double Nodes quality control".
The following criteria allow selecting mesh <b>Edges</b>: The following criteria allow selecting mesh <b>Edges</b>:
<ul><li> <ul><li>
<b>Free Borders</b> selects free 1D mesh elements, i.e. edges belonging to <b>Free Borders</b> selects free 1D mesh elements, i.e. edges belonging to
one face only. See also a one element (face or volume) only. See also a
\ref free_borders_page "Free Borders quality control". \ref free_borders_page "Free Borders quality control".
</li><li> </li><li>
<b>Double edges</b> selects 1D mesh elements basing on the same set of nodes. <b>Double edges</b> selects 1D mesh elements basing on the same set of nodes.
@ -177,8 +179,8 @@ The following criteria allow selecting mesh <b>Faces</b>:
\ref area_page "Area quality control"), which is more, less or equal (within a given \ref area_page "Area quality control"), which is more, less or equal (within a given
<b>Tolerance</b>) to the predefined <b>Threshold Value</b>. <b>Tolerance</b>) to the predefined <b>Threshold Value</b>.
</li><li> </li><li>
<b>Free edges</b> selects 2D mesh elements consisting of edges belonging to <b>Free edges</b> selects 2D mesh elements having at least one of its
one element of mesh only. See also a edges not shared with other faces. See also a
\ref free_edges_page "Free Edges quality control". \ref free_edges_page "Free Edges quality control".
</li><li> </li><li>
<b>Free faces</b> selects 2D mesh elements, which belong to less than two volumes. <b>Free faces</b> selects 2D mesh elements, which belong to less than two volumes.

View File

@ -20,19 +20,82 @@ and from its sub-menu select the \b Sewing item.</li>
<li>Check in the dialog box one of the radio buttons corresponding to <li>Check in the dialog box one of the radio buttons corresponding to
the type of sewing operation you would like to perform.</li> the type of sewing operation you would like to perform.</li>
<li>Fill the other fields available in the dialog box.</li> <li>Fill the other fields available in the dialog box.</li>
<li>Click the \b Apply or <b>Apply and Close</b> button to perform the operation of sewing.</li> <li>Click the \b Apply or <b>Apply and Close</b> button to perform the
operation of sewing.</li>
</ol> </ol>
<br> <br>
\anchor free_borders_anchor \anchor free_borders_anchor
<h2>Sew free borders</h2> <h2>Sew free borders</h2>
This functionality allows you to unite two free borders of a 2D mesh. This functionality allows you to unite free borders of a 2D mesh.
There are two working modes: \a Automatic and \a Manual. In the \b
Automatic mode, the program finds free borders coincident within a
specified tolerance and sews them. Optionally it is possible to
visually check and correct is necessary the found free borders before
sewing. <br>
In the \b Manual mode you are to define borders to sew by picking
three nodes of each of two borders.
\image html sewing1.png \image html sewing1.png
<center>Default mode is \a Automatic</center>
For sewing free borders you should define three points on each border: To use \b Automatic sewing:
first, second and the last node: <ul>
<li>Specify a mesh you want to sew by selecting it or any its part
(group or sub-mesh) in the Object Browser or in the VTK Viewer.</li>
<li>Specify the \b Tolerance within which free borders are considered
coincident. At the default zero \b Tolerance, the tolerance used by
the search algorithm is defined as one tenth of an average size of
elements adjacent to free borders being compared.</li>
<li>To visually check the coincident free borders found by the
algorithm, switch off <b>Auto Sewing</b> check-box. Then controls
to adjust groups of coincident free borders will become available in
the dialog.</li>
\image html sewing_auto.png
<center>Controls to adjust groups of coincident free borders</center>
<li>\b Detect button launches the algorithm of search of coincident
free borders.</li>
<li>The found groups of <b>Coincident Free Borders</b> are shown in a
list, a group per a line. Each group has its own color which is used
to display the borders of the group in the VTK Viewer. A free border
within a group is designated by IDs of its first, second and last
nodes within parenthesis. All borders present in the list will be
sewn upon \b Apply.</li>
<li>\b Remove button removes selected groups from the list.</li>
<li><b>Select All</b> check-box selects all groups in the list.</li>
<li>When a group is selected, its borders appear in <b>Edit Selected
Group</b> list that allows you to change this group.</li>
<li>
\image html sort.png
<em>Set First</em> button moves the selected border to the
first position in the group, as a result other borders will be moved
to this border during sewing.
</li><li>
\image html remove.png
<em>Remove Border</em> button removes selected borders from the
group. It is active if there are more than two borders in the group.
</li>
<li>Selection of a border in the list allows to change its first and
last nodes whose IDs appear in two fields below the list. \a Arrow
buttons near each field move the corresponding end node by
number of nodes defined by \b Step field.</li>
<li>
\image html swap.png
<em>Swap</em> button swaps the first and last nodes of a
selected border.
</li>
</ul>
For sewing free borders manually you should switch the \b Mode to \b
Manual and define three points on each border: first, second and the
last node:
\image html sewing_manual.png
<ul> <ul>
<li>the first node specifies beginning of the border;</li> <li>the first node specifies beginning of the border;</li>
<li>the second node specifies the part of the border which should be <li>the second node specifies the part of the border which should be
@ -50,6 +113,16 @@ corresponding end nodes of two borders will be merged. Intermediate
nodes of two borders will be either merged or inserted into faces of nodes of two borders will be either merged or inserted into faces of
the opposite border. the opposite border.
In practice the borders to sew often coincide and in this case it is
difficult to specify the first and the last nodes of a border since
they coincide with the first and the last nodes of the other
border. To cope with this,
\ref merging_nodes_page "merge" coincident nodes into one
beforehand. Two figures below illustrate this approach.
\image html sew_using_merge.png "Merge coincident nodes which are difficult to distinguish"
<br>
\image html sew_after_merge.png "After merging nodes it is easy to specify border nodes"
The sewing algorithm is as follows: The sewing algorithm is as follows:
<ol> <ol>
<li>The parameter (U) of each node within a border is computed. So <li>The parameter (U) of each node within a border is computed. So

View File

@ -3,8 +3,11 @@
\page smoothing_page Smoothing \page smoothing_page Smoothing
\n Smoothing is used to improve quality of 2D mesh by adjusting the \n Smoothing is used to improve quality of 2D mesh by adjusting the
locations of element corners (nodes). \note Depending on smoothing locations of element corners (nodes).
method and mesh geometry smoothing can decrease quality of elements.
\note Depending on the chosen method and mesh geometry
the smoothing can actually decrease the quality of elements and even
make some elements inverted.
<em>To apply smoothing to the elements of your mesh:</em> <em>To apply smoothing to the elements of your mesh:</em>
<ol> <ol>

View File

@ -0,0 +1,37 @@
/*!
\page split_biquad_to_linear_page Split bi-quadratic into linear
\n This functionality allows to split bi-quadratic elements into
linear ones without creation of additional nodes.
So that
- bi-quadratic triangle will be split into 3 linear quadrangles;
- bi-quadratic quadrangle will be split into 4 linear quadrangles;
- tri-quadratic hexahedron will be split into 8 linear hexahedra;
- quadratic segments adjacent to the split bi-quadratic element will
be split into 2 liner segments.
\image html split_biquad_to_linear_mesh.png "Mesh before and after splitting"
<em>To split bi-quadratic elements into linear:</em>
<ol>
<li>From the \b Modification menu choose the <b>Split bi-quadratic into linear</b> item or
click <em>"Split bi-quadratic into linear"</em> button in the toolbar.
\image html split_biquad_to_linear_icon.png
<center><em>"Split bi-quadratic into linear" button</em></center>
The following dialog box shall appear:
\image html split_biquad_to_linear_dlg.png
</li>
<li>Select a mesh, groups or sub-meshes in the Object Browser or in the
Viewer.</li>
<li>Click the \b Apply or <b>Apply and Close</b> button.</li>
</ol>
<br><b>See Also</b> a sample TUI Script of a \ref tui_split_biquad "Split bi-quadratic into linear" operation.
*/

View File

@ -7,7 +7,7 @@ tetrahedra or hexahedra into prisms. 2D mesh is modified accordingly.
<em>To split volumes:</em> <em>To split volumes:</em>
<ol> <ol>
<li>Display a mesh, a sub-mesh or a group in the 3D viewer.</li> <li>Select a mesh, a sub-mesh or a group.</li>
<li>In the \b Modification menu select the <b>Split Volumes</b> item or <li>In the \b Modification menu select the <b>Split Volumes</b> item or
click <em>"Split Volumes"</em> button in the toolbar. click <em>"Split Volumes"</em> button in the toolbar.

View File

@ -64,21 +64,21 @@ possible to select a whole area with a mouse frame; or</li>
<li>specify the conditions of symmetry operation: <li>specify the conditions of symmetry operation:
<ul> <ul>
<li>activate <b>Move elements</b> radio button to change location of <li>activate <b>Move elements</b> radio button to change the location of
the selected elements within the current mesh;</li> the selected elements within the current mesh;</li>
<li>activate <b>Copy elements</b> radio button to duplicate the <li>activate <b>Copy elements</b> radio button to duplicate the
selected elements at the new location within the current mesh;</li> selected elements at the new location within the current mesh;</li>
<li>activate <b>Create as new mesh</b> radio button to create new <li>activate <b>Create as new mesh</b> radio button to create a new
element in a new mesh; the new mesh appears in the Object Browser element in a new mesh; the new mesh appears in the Object Browser
with the default name MeshName_mirrored (it is possible to change with the default name \a MeshName_mirrored (it is possible to change
this name in the adjacent box);</li> this name in the adjacent box);</li>
<li>activate <b> Copy groups </b> checkbox to put new mesh enities <li>activate <b> Copy groups </b> check-box to put new mesh entities
into new groups if source entities belongs to some groups. New into new groups if source entities belong to some groups. New
groups are named by pattern "<old group name>_mirrored".</li> groups are named by pattern "<old group name>_mirrored".</li>
</ul> </ul>
</li> </li>
</ul> </ul>
<li>activate <b>Preview</b> checkbox to show the result of <li>activate <b>Preview</b> check-box to show the result of
transformation in the viewer;</li> transformation in the viewer;</li>
<li>click \b Apply or <b> Apply and Close</b> button to confirm the <li>click \b Apply or <b> Apply and Close</b> button to confirm the
operation.</li> operation.</li>

View File

@ -140,4 +140,9 @@
<h2>Convert mesh to/from quadratic</h2> <h2>Convert mesh to/from quadratic</h2>
\tui_script{modifying_meshes_ex26.py} \tui_script{modifying_meshes_ex26.py}
<br>
\anchor tui_split_biquad
<h2>Split bi-quadratic into linear</h2>
\tui_script{split_biquad.py}
*/ */

View File

@ -2,7 +2,7 @@
\page uniting_set_of_triangles_page Uniting a set of triangles \page uniting_set_of_triangles_page Uniting a set of triangles
\n In MESH you can union many neighboring triangles (cells) into \n It is possible to unite many neighboring triangles into
quadrangles by deletion of the common edge. quadrangles by deletion of the common edge.
<em>To union several triangles:</em> <em>To union several triangles:</em>
@ -10,7 +10,7 @@ quadrangles by deletion of the common edge.
<li>Select a mesh (and display it in the 3D Viewer if you are going to <li>Select a mesh (and display it in the 3D Viewer if you are going to
pick elements by mouse).</li> pick elements by mouse).</li>
<li>In the \b Modification menu select the <b>Union of triangles</b> <li>In the \b Modification menu select the <b>Union of triangles</b>
item or click <em>"Union of triangles"</em> button in the toolbar. item or click <em>"Union of triangles"</em> button in the tool-bar.
\image html image80.png \image html image80.png
<center><em>"Union of triangles" button</em></center> <center><em>"Union of triangles" button</em></center>

View File

@ -2,14 +2,14 @@
\page uniting_two_triangles_page Uniting two triangles \page uniting_two_triangles_page Uniting two triangles
\n In MESH you can union two neighboring triangles (cells) by deletion \n In MESH you can union two neighboring triangles by deletion
of the common edge. of the common edge.
<em>To unite two triangles:</em> <em>To unite two triangles:</em>
<ol> <ol>
<li>From the \b Modification menu choose the <b>Union of two <li>From the \b Modification menu choose the <b>Union of two
triangles</b> item or click <em>"Union of two triangles"</em> button triangles</b> item or click <em>"Union of two triangles"</em> button
in the toolbar. in the tool-bar.
\image html image71.png \image html image71.png
<center><em>"Union of two triangles" button</em></center> <center><em>"Union of two triangles" button</em></center>
@ -20,7 +20,7 @@ The following dialog box shall appear:
</li> </li>
<li>Enter IDs of nodes forming the required edge in the \b Edge field <li>Enter IDs of nodes forming the required edge in the \b Edge field
(the node IDs must be separated by a dash) or select this edge in (a couple of node IDs separated by a dash) or select this edge in
the 3D viewer.</li> the 3D viewer.</li>
<li>Click the \b Apply or <b>Apply and Close</b> button.</li> <li>Click the \b Apply or <b>Apply and Close</b> button.</li>
</ol> </ol>

View File

@ -26,7 +26,10 @@ information about the mesh.</li>
<li>\subpage find_element_by_point_page "Find Element by Point" - <li>\subpage find_element_by_point_page "Find Element by Point" -
allows to find all mesh elements, to which belongs a point with the allows to find all mesh elements, to which belongs a point with the
given coordinates.</li> given coordinates.</li>
<li><b>Auto Color</b> - switch on / off auto-assigning colors for the groups.</li> <li><b>Auto Color</b> - switch on / off auto-assigning colors for the
groups. If switched on, a default color of a new group in
\ref creating_groups_page "Create Group" dialog is chosen
randomly. </li>
<li>\subpage numbering_page "Numbering" - allows to display the ID <li>\subpage numbering_page "Numbering" - allows to display the ID
numbers of all meshing elements or nodes composing your mesh in the numbers of all meshing elements or nodes composing your mesh in the
viewer.</li> viewer.</li>

View File

@ -1097,6 +1097,13 @@ module StdMeshers
{ {
}; };
/*!
* StdMeshers_PolygonPerFace_2D: interface of "Polygon Per Face" 2D algorithm
*/
interface StdMeshers_PolygonPerFace_2D : SMESH::SMESH_2D_Algo
{
};
/*! /*!
* StdMeshers_Hexa_3D: interface of "Hexahedron (i,j,k)" algorithm * StdMeshers_Hexa_3D: interface of "Hexahedron (i,j,k)" algorithm
*/ */

View File

@ -439,6 +439,79 @@ module SMESH
in string theLibName, in string theLibName,
in GEOM::GEOM_Object theShapeObject, in GEOM::GEOM_Object theShapeObject,
in boolean toCheckAll ); in boolean toCheckAll );
/*!
* Return indices of elements, which are located inside the sphere
* \param theSource - mesh, sub-mesh or group
* \param theElemType - mesh element type
* \param theX - x cooridate of the center of the sphere
* \param theY - y cooridate of the center of the sphere
* \param theZ - y cooridate of the center of the sphere
* \param theR - radius of the sphere
*/
long_array GetInsideSphere( in SMESH_IDSource theSource,
in ElementType theElemType,
in double theX,
in double theY,
in double theZ,
in double theR );
/*!
* Return indices of elements, which are located inside the box
* \param theSource - mesh, sub-mesh or group
* \param theElemType - mesh element type
* \param theX1 - x cooridate of the first opposite point
* \param theY1 - y cooridate of the first opposite point
* \param theZ1 - y cooridate of the first opposite point
* \param theX2 - x cooridate of the second opposite point
* \param theY2 - y cooridate of the second opposite point
* \param theZ2 - y cooridate of the second opposite point
*/
long_array GetInsideBox( in SMESH_IDSource theSource,
in ElementType theElemType,
in double theX1,
in double theY1,
in double theZ1,
in double theX2,
in double theY2,
in double theZ2);
/*!
* Return indices of elements, which are located inside the box
* \param theSource - mesh, sub-mesh or group
* \param theElemType - mesh element type
* \param theX - x cooridate of the cented of the bottom face
* \param theY - y cooridate of the cented of the bottom face
* \param theZ - y cooridate of the cented of the bottom face
* \param theDX - x cooridate of the cented of the base vector
* \param theDY - y cooridate of the cented of the base vector
* \param theDZ - z cooridate of the cented of the base vector
* \param theH - height of the cylinder
* \param theR - radius of the cylinder
*/
long_array GetInsideCylinder( in SMESH_IDSource theSource,
in ElementType theElemType,
in double theX,
in double theY,
in double theZ,
in double theDX,
in double theDY,
in double theDZ,
in double theH,
in double theR );
/*!
* Return indices of elements, which are located inside the geometry
* \param theSource - mesh, sub-mesh or group
* \param theElemType - mesh element type
* \param theGeom - geometrical object
* \param theTolerance - tolerance for selection.
*/
long_array GetInside( in SMESH_IDSource theSource,
in ElementType theElemType,
in GEOM::GEOM_Object theGeom,
in double theTolerance );
}; };
}; };

View File

@ -66,6 +66,7 @@ module SMESH
ADD_QUADEDGE, ADD_QUADEDGE,
ADD_QUADTRIANGLE, ADD_QUADTRIANGLE,
ADD_QUADQUADRANGLE, ADD_QUADQUADRANGLE,
ADD_QUADPOLYGON,
ADD_QUADTETRAHEDRON, ADD_QUADTETRAHEDRON,
ADD_QUADPYRAMID, ADD_QUADPYRAMID,
ADD_QUADPENTAHEDRON, ADD_QUADPENTAHEDRON,
@ -89,18 +90,18 @@ module SMESH
struct PointStruct { double x; struct PointStruct { double x;
double y; double y;
double z; } ; double z; };
typedef sequence<PointStruct> nodes_array; typedef sequence<PointStruct> nodes_array;
struct DirStruct { PointStruct PS ; } ; // analog to OCCT gp_Vec struct DirStruct { PointStruct PS; }; // analog to OCCT gp_Vec
struct AxisStruct { double x; struct AxisStruct { double x;
double y; double y;
double z; double z;
double vx; double vx;
double vy; double vy;
double vz; } ; double vz; };
/*! /*!
* Node location on a shape * Node location on a shape
*/ */
@ -132,7 +133,7 @@ module SMESH
BALL, BALL,
NB_ELEMENT_TYPES NB_ELEMENT_TYPES
}; };
typedef sequence<ElementType> array_of_ElementType ; typedef sequence<ElementType> array_of_ElementType;
/*! /*!
* Enumeration for element geometry type, like SMDSAbs_GeometryType in SMDSAbs_ElementType.hxx * Enumeration for element geometry type, like SMDSAbs_GeometryType in SMDSAbs_ElementType.hxx
@ -778,6 +779,9 @@ module SMESH
long NbPolygons() long NbPolygons()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbPolygonsOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception);
long NbVolumes() long NbVolumes()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
@ -1040,7 +1044,7 @@ module SMESH
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
* Return type of submesh element * Returns type of mesh element (same as SMESH_Mesh::GetElementType() )
*/ */
ElementType GetElementType( in long id, in boolean iselem ) ElementType GetElementType( in long id, in boolean iselem )
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);

View File

@ -29,13 +29,37 @@
module SMESH module SMESH
{ {
interface NumericalFunctor;
enum Bnd_Dimension { BND_2DFROM3D, BND_1DFROM3D, BND_1DFROM2D }; enum Bnd_Dimension { BND_2DFROM3D, BND_1DFROM3D, BND_1DFROM2D };
struct FreeBorder
{
SMESH::long_array nodeIDs; // all nodes defining a free border
// 1st and last node is same in a closed border
};
struct FreeBorderPart
{
short border; // border index within a sequence<FreeBorder>
long node1; // node index within the border-th FreeBorder
long node2;
long nodeLast;
};
typedef sequence<FreeBorder> ListOfFreeBorders;
typedef sequence<FreeBorderPart> FreeBordersGroup;
typedef sequence<FreeBordersGroup> ListOfFreeBorderGroups;
struct CoincidentFreeBorders
{
ListOfFreeBorders borders; // nodes of all free borders
ListOfFreeBorderGroups coincidentGroups; // groups of coincident parts of borders
};
/*! /*!
* This interface makes modifications on the Mesh - removing elements and nodes etc. * This interface makes modifications on the Mesh - removing elements and nodes etc.
*/ */
interface NumericalFunctor;
interface SMESH_MeshEditor interface SMESH_MeshEditor
{ {
/*! /*!
@ -143,6 +167,13 @@ module SMESH
long AddPolygonalFace(in long_array IdsOfNodes) raises (SALOME::SALOME_Exception); long AddPolygonalFace(in long_array IdsOfNodes) raises (SALOME::SALOME_Exception);
/*!
* Create a quadratic polygonal face
* \param IdsOfNodes - nodes of the polygon; corner nodes follow first
* \return long - ID of a new polygon
*/
long AddQuadPolygonalFace(in long_array IdsOfNodes) raises (SALOME::SALOME_Exception);
/*! /*!
* Create volume, either linear and quadratic (this is determed * Create volume, either linear and quadratic (this is determed
* by number of given nodes). * by number of given nodes).
@ -360,6 +391,18 @@ module SMESH
in boolean allDomains) in boolean allDomains)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*!
* \brief Split bi-quadratic elements into linear ones without creation of additional nodes.
* - bi-quadratic triangle will be split into 3 linear quadrangles;
* - bi-quadratic quadrangle will be split into 4 linear quadrangles;
* - tri-quadratic hexahedron will be split into 8 linear hexahedra;
* Quadratic elements of lower dimension adjacent to the split bi-quadratic element
* will be split in order to keep the mesh conformal.
* \param elems - elements to split
*/
void SplitBiQuadraticIntoLinear(in ListOfIDSources elems)
raises (SALOME::SALOME_Exception);
enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH }; enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
@ -622,21 +665,25 @@ module SMESH
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
void FindCoincidentNodes (in double Tolerance, void FindCoincidentNodes (in double Tolerance,
out array_of_long_array GroupsOfNodes) out array_of_long_array GroupsOfNodes,
in boolean SeparateCornersAndMedium)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
void FindCoincidentNodesOnPart (in SMESH_IDSource SubMeshOrGroup, void FindCoincidentNodesOnPart (in SMESH_IDSource SubMeshOrGroup,
in double Tolerance, in double Tolerance,
out array_of_long_array GroupsOfNodes) out array_of_long_array GroupsOfNodes,
in boolean SeparateCornersAndMedium)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
void FindCoincidentNodesOnPartBut (in SMESH_IDSource SubMeshOrGroup, void FindCoincidentNodesOnPartBut (in SMESH_IDSource SubMeshOrGroup,
in double Tolerance, in double Tolerance,
out array_of_long_array GroupsOfNodes, out array_of_long_array GroupsOfNodes,
in ListOfIDSources ExceptSubMeshOrGroups) in ListOfIDSources ExceptSubMeshOrGroups,
in boolean SeparateCornersAndMedium)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
void MergeNodes (in array_of_long_array GroupsOfNodes) void MergeNodes (in array_of_long_array GroupsOfNodes,
in SMESH::ListOfIDSources NodesToKeep)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
@ -700,6 +747,21 @@ module SMESH
short GetPointState(in double x, in double y, in double z) short GetPointState(in double x, in double y, in double z)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*!
* Returns groups of FreeBorder's coincident within the given tolerance.
* If the tolerance <= 0.0 then one tenth of an average size of elements adjacent
* to free borders being compared is used.
*/
CoincidentFreeBorders FindCoincidentFreeBorders(in double tolerance);
/*!
* Sew FreeBorder's of each group
*/
short SewCoincidentFreeBorders (in CoincidentFreeBorders freeBorders,
in boolean createPolygons,
in boolean createPolyedrs)
raises (SALOME::SALOME_Exception);
enum Sew_Error { enum Sew_Error {
SEW_OK, SEW_OK,
SEW_BORDER1_NOT_FOUND, SEW_BORDER1_NOT_FOUND,

View File

@ -98,6 +98,7 @@ SET(SMESH_RESOURCES_FILES
mesh_tetra.png mesh_tetra.png
mesh_tree_algo_hexa.png mesh_tree_algo_hexa.png
mesh_tree_algo_mefisto.png mesh_tree_algo_mefisto.png
mesh_tree_algo_polygon.png
mesh_tree_algo.png mesh_tree_algo.png
mesh_tree_algo_0D.png mesh_tree_algo_0D.png
mesh_tree_algo_quad.png mesh_tree_algo_quad.png
@ -170,6 +171,7 @@ SET(SMESH_RESOURCES_FILES
mesh_quad_edge.png mesh_quad_edge.png
mesh_quad_triangle.png mesh_quad_triangle.png
mesh_quad_quadrangle.png mesh_quad_quadrangle.png
mesh_quad_polygon.png
mesh_quad_tetrahedron.png mesh_quad_tetrahedron.png
mesh_quad_pyramid.png mesh_quad_pyramid.png
mesh_quad_pentahedron.png mesh_quad_pentahedron.png
@ -201,6 +203,7 @@ SET(SMESH_RESOURCES_FILES
scale.png scale.png
scale_along_axes.png scale_along_axes.png
split_into_tetra.png split_into_tetra.png
split_biquad.png
mesh_duplicate_nodes.png mesh_duplicate_nodes.png
mesh_duplicate_nodes_with_elem.png mesh_duplicate_nodes_with_elem.png
mesh_duplicate_elem_only.png mesh_duplicate_elem_only.png

View File

@ -314,6 +314,7 @@
<algorithm type ="QuadFromMedialAxis_1D2D" <algorithm type ="QuadFromMedialAxis_1D2D"
label-id ="Quadrangle (Medial Axis Projection)" label-id ="Quadrangle (Medial Axis Projection)"
icon-id ="mesh_algo_quad.png" icon-id ="mesh_algo_quad.png"
hypos ="NumberOfLayers2D, LayerDistribution2D"
opt-hypos="ViscousLayers2D" opt-hypos="ViscousLayers2D"
input ="EDGE" input ="EDGE"
output ="QUAD" output ="QUAD"
@ -321,6 +322,20 @@
<python-wrap> <python-wrap>
<algo>QuadFromMedialAxis_1D2D=Quadrangle(algo=smeshBuilder.QUAD_MA_PROJ)</algo> <algo>QuadFromMedialAxis_1D2D=Quadrangle(algo=smeshBuilder.QUAD_MA_PROJ)</algo>
<hypo>ViscousLayers2D=ViscousLayers2D(SetTotalThickness(),SetNumberLayers(),SetStretchFactor(),SetIgnoreEdges())</hypo> <hypo>ViscousLayers2D=ViscousLayers2D(SetTotalThickness(),SetNumberLayers(),SetStretchFactor(),SetIgnoreEdges())</hypo>
<hypo>NumberOfLayers2D=NumberOfLayers(SetNumberOfLayers())</hypo>
</python-wrap>
</algorithm>
<algorithm type ="PolygonPerFace_2D"
label-id ="Polygon per Face"
icon-id ="mesh_algo_polygon.png"
opt-hypos="ViscousLayers2D"
input ="EDGE"
output ="POLYGON,QUAD,TRIA"
dim ="2">
<python-wrap>
<algo>PolygonPerFace_2D=Polygon()</algo>
<hypo>ViscousLayers2D=ViscousLayers2D(SetTotalThickness(),SetNumberLayers(),SetStretchFactor(),SetIgnoreEdges())</hypo>
</python-wrap> </python-wrap>
</algorithm> </algorithm>

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

BIN
resources/split_biquad.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 945 B

View File

@ -31,9 +31,10 @@
#include "SMDS_QuadraticFaceOfNodes.hxx" #include "SMDS_QuadraticFaceOfNodes.hxx"
#include "SMDS_VolumeTool.hxx" #include "SMDS_VolumeTool.hxx"
#include "SMESHDS_GroupBase.hxx" #include "SMESHDS_GroupBase.hxx"
#include "SMESHDS_GroupOnFilter.hxx"
#include "SMESHDS_Mesh.hxx" #include "SMESHDS_Mesh.hxx"
#include "SMESH_OctreeNode.hxx"
#include "SMESH_MeshAlgos.hxx" #include "SMESH_MeshAlgos.hxx"
#include "SMESH_OctreeNode.hxx"
#include <Basics_Utils.hxx> #include <Basics_Utils.hxx>
@ -68,7 +69,6 @@
#include <set> #include <set>
#include <limits> #include <limits>
#include <TopTools_MapOfShape.hxx>
/* /*
AUXILIARY METHODS AUXILIARY METHODS
@ -159,29 +159,6 @@ namespace {
} }
int aResult = std::max ( aResult0, aResult1 ); int aResult = std::max ( aResult0, aResult1 );
// TColStd_MapOfInteger aMap;
// SMDS_ElemIteratorPtr anIter = anEdge->nodesIterator();
// if ( anIter != 0 ) {
// while( anIter->more() ) {
// const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next();
// if ( aNode == 0 )
// return 0;
// SMDS_ElemIteratorPtr anElemIter = aNode->GetInverseElementIterator();
// while( anElemIter->more() ) {
// const SMDS_MeshElement* anElem = anElemIter->next();
// if ( anElem != 0 && anElem->GetType() != SMDSAbs_Edge ) {
// int anId = anElem->GetID();
// if ( anIter->more() ) // i.e. first node
// aMap.Add( anId );
// else if ( aMap.Contains( anId ) )
// aResult++;
// }
// }
// }
// }
return aResult; return aResult;
} }
@ -257,6 +234,7 @@ bool NumericalFunctor::GetPoints(const SMDS_MeshElement* anElem,
return false; return false;
theRes.reserve( anElem->NbNodes() ); theRes.reserve( anElem->NbNodes() );
theRes.setElement( anElem );
// Get nodes of the element // Get nodes of the element
SMDS_ElemIteratorPtr anIter; SMDS_ElemIteratorPtr anIter;
@ -273,7 +251,6 @@ bool NumericalFunctor::GetPoints(const SMDS_MeshElement* anElem,
break; break;
default: default:
anIter = anElem->nodesIterator(); anIter = anElem->nodesIterator();
//return false;
} }
} }
else { else {
@ -281,9 +258,13 @@ bool NumericalFunctor::GetPoints(const SMDS_MeshElement* anElem,
} }
if ( anIter ) { if ( anIter ) {
double xyz[3];
while( anIter->more() ) { while( anIter->more() ) {
if ( const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>( anIter->next() )) if ( const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>( anIter->next() ))
theRes.push_back( gp_XYZ( aNode->X(), aNode->Y(), aNode->Z() ) ); {
aNode->GetXYZ( xyz );
theRes.push_back( gp_XYZ( xyz[0], xyz[1], xyz[2] ));
}
} }
} }
@ -348,7 +329,7 @@ void NumericalFunctor::GetHistogram(int nbIntervals,
std::multiset< double > values; std::multiset< double > values;
if ( elements.empty() ) if ( elements.empty() )
{ {
SMDS_ElemIteratorPtr elemIt = myMesh->elementsIterator(GetType()); SMDS_ElemIteratorPtr elemIt = myMesh->elementsIterator( GetType() );
while ( elemIt->more() ) while ( elemIt->more() )
values.insert( GetValue( elemIt->next()->GetID() )); values.insert( GetValue( elemIt->next()->GetID() ));
} }
@ -481,6 +462,27 @@ double MaxElementLength2D::GetValue( const TSequenceOfXYZ& P )
double D2 = getDistance(P( 3 ),P( 7 )); double D2 = getDistance(P( 3 ),P( 7 ));
aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(D1,D2)); aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(D1,D2));
} }
// Diagonals are undefined for concave polygons
// else if ( P.getElementEntity() == SMDSEntity_Quad_Polygon && P.size() > 2 ) // quad polygon
// {
// // sides
// aVal = getDistance( P( 1 ), P( P.size() )) + getDistance( P( P.size() ), P( P.size()-1 ));
// for ( size_t i = 1; i < P.size()-1; i += 2 )
// {
// double L = getDistance( P( i ), P( i+1 )) + getDistance( P( i+1 ), P( i+2 ));
// aVal = Max( aVal, L );
// }
// // diagonals
// for ( int i = P.size()-5; i > 0; i -= 2 )
// for ( int j = i + 4; j < P.size() + i - 2; i += 2 )
// {
// double D = getDistance( P( i ), P( j ));
// aVal = Max( aVal, D );
// }
// }
// { // polygons
// }
if( myPrecision >= 0 ) if( myPrecision >= 0 )
{ {
@ -699,7 +701,8 @@ double MinimumAngle::GetValue( const TSequenceOfXYZ& P )
aMin = getAngle(P( P.size() ), P( 1 ), P( 2 )); aMin = getAngle(P( P.size() ), P( 1 ), P( 2 ));
aMin = Min(aMin,getAngle(P( P.size()-1 ), P( P.size() ), P( 1 ))); aMin = Min(aMin,getAngle(P( P.size()-1 ), P( P.size() ), P( 1 )));
for (int i=2; i<P.size();i++){ for ( int i = 2; i < P.size(); i++ )
{
double A0 = getAngle( P( i-1 ), P( i ), P( i+1 ) ); double A0 = getAngle( P( i-1 ), P( i ), P( i+1 ) );
aMin = Min(aMin,A0); aMin = Min(aMin,A0);
} }
@ -1467,11 +1470,14 @@ SMDSAbs_ElementType Skew::GetType() const
double Area::GetValue( const TSequenceOfXYZ& P ) double Area::GetValue( const TSequenceOfXYZ& P )
{ {
double val = 0.0; double val = 0.0;
if ( P.size() > 2 ) { if ( P.size() > 2 )
{
gp_Vec aVec1( P(2) - P(1) ); gp_Vec aVec1( P(2) - P(1) );
gp_Vec aVec2( P(3) - P(1) ); gp_Vec aVec2( P(3) - P(1) );
gp_Vec SumVec = aVec1 ^ aVec2; gp_Vec SumVec = aVec1 ^ aVec2;
for (int i=4; i<=P.size(); i++) {
for (int i=4; i<=P.size(); i++)
{
gp_Vec aVec1( P(i-1) - P(1) ); gp_Vec aVec1( P(i-1) - P(1) );
gp_Vec aVec2( P(i) - P(1) ); gp_Vec aVec2( P(i) - P(1) );
gp_Vec tmp = aVec1 ^ aVec2; gp_Vec tmp = aVec1 ^ aVec2;
@ -1523,7 +1529,7 @@ SMDSAbs_ElementType Length::GetType() const
//================================================================================ //================================================================================
/* /*
Class : Length2D Class : Length2D
Description : Functor for calculating length of edge Description : Functor for calculating minimal length of edge
*/ */
//================================================================================ //================================================================================
@ -1531,63 +1537,59 @@ double Length2D::GetValue( long theElementId )
{ {
TSequenceOfXYZ P; TSequenceOfXYZ P;
//cout<<"Length2D::GetValue"<<endl; if ( GetPoints( theElementId, P ))
if (GetPoints(theElementId,P)){ {
//for(int jj=1; jj<=P.size(); jj++) double aVal = 0;
// cout<<"jj="<<jj<<" P("<<P(jj).X()<<","<<P(jj).Y()<<","<<P(jj).Z()<<")"<<endl;
double aVal;// = GetValue( P );
const SMDS_MeshElement* aElem = myMesh->FindElement( theElementId );
SMDSAbs_ElementType aType = aElem->GetType();
int len = P.size(); int len = P.size();
SMDSAbs_EntityType aType = P.getElementEntity();
switch (aType){ switch (aType) {
case SMDSAbs_All: case SMDSEntity_Edge:
case SMDSAbs_Node: if (len == 2)
case SMDSAbs_Edge:
if (len == 2){
aVal = getDistance( P( 1 ), P( 2 ) ); aVal = getDistance( P( 1 ), P( 2 ) );
break; break;
} case SMDSEntity_Quad_Edge:
else if (len == 3){ // quadratic edge if (len == 3) // quadratic edge
aVal = getDistance(P( 1 ),P( 3 )) + getDistance(P( 3 ),P( 2 )); aVal = getDistance(P( 1 ),P( 3 )) + getDistance(P( 3 ),P( 2 ));
break; break;
} case SMDSEntity_Triangle:
case SMDSAbs_Face:
if (len == 3){ // triangles if (len == 3){ // triangles
double L1 = getDistance(P( 1 ),P( 2 )); double L1 = getDistance(P( 1 ),P( 2 ));
double L2 = getDistance(P( 2 ),P( 3 )); double L2 = getDistance(P( 2 ),P( 3 ));
double L3 = getDistance(P( 3 ),P( 1 )); double L3 = getDistance(P( 3 ),P( 1 ));
aVal = Min(L1,Min(L2,L3)); aVal = Min(L1,Min(L2,L3));
break;
} }
else if (len == 4){ // quadrangles break;
case SMDSEntity_Quadrangle:
if (len == 4){ // quadrangles
double L1 = getDistance(P( 1 ),P( 2 )); double L1 = getDistance(P( 1 ),P( 2 ));
double L2 = getDistance(P( 2 ),P( 3 )); double L2 = getDistance(P( 2 ),P( 3 ));
double L3 = getDistance(P( 3 ),P( 4 )); double L3 = getDistance(P( 3 ),P( 4 ));
double L4 = getDistance(P( 4 ),P( 1 )); double L4 = getDistance(P( 4 ),P( 1 ));
aVal = Min(Min(L1,L2),Min(L3,L4)); aVal = Min(Min(L1,L2),Min(L3,L4));
break;
} }
if (len == 6){ // quadratic triangles break;
case SMDSEntity_Quad_Triangle:
case SMDSEntity_BiQuad_Triangle:
if (len >= 6){ // quadratic triangles
double L1 = getDistance(P( 1 ),P( 2 )) + getDistance(P( 2 ),P( 3 )); double L1 = getDistance(P( 1 ),P( 2 )) + getDistance(P( 2 ),P( 3 ));
double L2 = getDistance(P( 3 ),P( 4 )) + getDistance(P( 4 ),P( 5 )); double L2 = getDistance(P( 3 ),P( 4 )) + getDistance(P( 4 ),P( 5 ));
double L3 = getDistance(P( 5 ),P( 6 )) + getDistance(P( 6 ),P( 1 )); double L3 = getDistance(P( 5 ),P( 6 )) + getDistance(P( 6 ),P( 1 ));
aVal = Min(L1,Min(L2,L3)); aVal = Min(L1,Min(L2,L3));
//cout<<"L1="<<L1<<" L2="<<L2<<"L3="<<L3<<" aVal="<<aVal<<endl;
break;
} }
else if (len == 8){ // quadratic quadrangles break;
case SMDSEntity_Quad_Quadrangle:
case SMDSEntity_BiQuad_Quadrangle:
if (len >= 8){ // quadratic quadrangles
double L1 = getDistance(P( 1 ),P( 2 )) + getDistance(P( 2 ),P( 3 )); double L1 = getDistance(P( 1 ),P( 2 )) + getDistance(P( 2 ),P( 3 ));
double L2 = getDistance(P( 3 ),P( 4 )) + getDistance(P( 4 ),P( 5 )); double L2 = getDistance(P( 3 ),P( 4 )) + getDistance(P( 4 ),P( 5 ));
double L3 = getDistance(P( 5 ),P( 6 )) + getDistance(P( 6 ),P( 7 )); double L3 = getDistance(P( 5 ),P( 6 )) + getDistance(P( 6 ),P( 7 ));
double L4 = getDistance(P( 7 ),P( 8 )) + getDistance(P( 8 ),P( 1 )); double L4 = getDistance(P( 7 ),P( 8 )) + getDistance(P( 8 ),P( 1 ));
aVal = Min(Min(L1,L2),Min(L3,L4)); aVal = Min(Min(L1,L2),Min(L3,L4));
break;
} }
case SMDSAbs_Volume: break;
if (len == 4){ // tetraidrs case SMDSEntity_Tetra:
if (len == 4){ // tetrahedra
double L1 = getDistance(P( 1 ),P( 2 )); double L1 = getDistance(P( 1 ),P( 2 ));
double L2 = getDistance(P( 2 ),P( 3 )); double L2 = getDistance(P( 2 ),P( 3 ));
double L3 = getDistance(P( 3 ),P( 1 )); double L3 = getDistance(P( 3 ),P( 1 ));
@ -1595,9 +1597,10 @@ double Length2D::GetValue( long theElementId )
double L5 = getDistance(P( 2 ),P( 4 )); double L5 = getDistance(P( 2 ),P( 4 ));
double L6 = getDistance(P( 3 ),P( 4 )); double L6 = getDistance(P( 3 ),P( 4 ));
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6)); aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
break;
} }
else if (len == 5){ // piramids break;
case SMDSEntity_Pyramid:
if (len == 5){ // piramids
double L1 = getDistance(P( 1 ),P( 2 )); double L1 = getDistance(P( 1 ),P( 2 ));
double L2 = getDistance(P( 2 ),P( 3 )); double L2 = getDistance(P( 2 ),P( 3 ));
double L3 = getDistance(P( 3 ),P( 4 )); double L3 = getDistance(P( 3 ),P( 4 ));
@ -1609,9 +1612,10 @@ double Length2D::GetValue( long theElementId )
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6)); aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
aVal = Min(aVal,Min(L7,L8)); aVal = Min(aVal,Min(L7,L8));
break;
} }
else if (len == 6){ // pentaidres break;
case SMDSEntity_Penta:
if (len == 6) { // pentaidres
double L1 = getDistance(P( 1 ),P( 2 )); double L1 = getDistance(P( 1 ),P( 2 ));
double L2 = getDistance(P( 2 ),P( 3 )); double L2 = getDistance(P( 2 ),P( 3 ));
double L3 = getDistance(P( 3 ),P( 1 )); double L3 = getDistance(P( 3 ),P( 1 ));
@ -1624,9 +1628,10 @@ double Length2D::GetValue( long theElementId )
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6)); aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
aVal = Min(aVal,Min(Min(L7,L8),L9)); aVal = Min(aVal,Min(Min(L7,L8),L9));
break;
} }
else if (len == 8){ // hexaider break;
case SMDSEntity_Hexa:
if (len == 8){ // hexahedron
double L1 = getDistance(P( 1 ),P( 2 )); double L1 = getDistance(P( 1 ),P( 2 ));
double L2 = getDistance(P( 2 ),P( 3 )); double L2 = getDistance(P( 2 ),P( 3 ));
double L3 = getDistance(P( 3 ),P( 4 )); double L3 = getDistance(P( 3 ),P( 4 ));
@ -1643,10 +1648,9 @@ double Length2D::GetValue( long theElementId )
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6)); aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
aVal = Min(aVal,Min(Min(L7,L8),Min(L9,L10))); aVal = Min(aVal,Min(Min(L7,L8),Min(L9,L10)));
aVal = Min(aVal,Min(L11,L12)); aVal = Min(aVal,Min(L11,L12));
break;
} }
break;
case SMDSEntity_Quad_Tetra:
if (len == 10){ // quadratic tetraidrs if (len == 10){ // quadratic tetraidrs
double L1 = getDistance(P( 1 ),P( 5 )) + getDistance(P( 5 ),P( 2 )); double L1 = getDistance(P( 1 ),P( 5 )) + getDistance(P( 5 ),P( 2 ));
double L2 = getDistance(P( 2 ),P( 6 )) + getDistance(P( 6 ),P( 3 )); double L2 = getDistance(P( 2 ),P( 6 )) + getDistance(P( 6 ),P( 3 ));
@ -1655,9 +1659,10 @@ double Length2D::GetValue( long theElementId )
double L5 = getDistance(P( 2 ),P( 9 )) + getDistance(P( 9 ),P( 4 )); double L5 = getDistance(P( 2 ),P( 9 )) + getDistance(P( 9 ),P( 4 ));
double L6 = getDistance(P( 3 ),P( 10 )) + getDistance(P( 10 ),P( 4 )); double L6 = getDistance(P( 3 ),P( 10 )) + getDistance(P( 10 ),P( 4 ));
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6)); aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
break;
} }
else if (len == 13){ // quadratic piramids break;
case SMDSEntity_Quad_Pyramid:
if (len == 13){ // quadratic piramids
double L1 = getDistance(P( 1 ),P( 6 )) + getDistance(P( 6 ),P( 2 )); double L1 = getDistance(P( 1 ),P( 6 )) + getDistance(P( 6 ),P( 2 ));
double L2 = getDistance(P( 2 ),P( 7 )) + getDistance(P( 7 ),P( 3 )); double L2 = getDistance(P( 2 ),P( 7 )) + getDistance(P( 7 ),P( 3 ));
double L3 = getDistance(P( 3 ),P( 8 )) + getDistance(P( 8 ),P( 4 )); double L3 = getDistance(P( 3 ),P( 8 )) + getDistance(P( 8 ),P( 4 ));
@ -1668,9 +1673,10 @@ double Length2D::GetValue( long theElementId )
double L8 = getDistance(P( 4 ),P( 13 )) + getDistance(P( 13 ),P( 5 )); double L8 = getDistance(P( 4 ),P( 13 )) + getDistance(P( 13 ),P( 5 ));
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6)); aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
aVal = Min(aVal,Min(L7,L8)); aVal = Min(aVal,Min(L7,L8));
break;
} }
else if (len == 15){ // quadratic pentaidres break;
case SMDSEntity_Quad_Penta:
if (len == 15){ // quadratic pentaidres
double L1 = getDistance(P( 1 ),P( 7 )) + getDistance(P( 7 ),P( 2 )); double L1 = getDistance(P( 1 ),P( 7 )) + getDistance(P( 7 ),P( 2 ));
double L2 = getDistance(P( 2 ),P( 8 )) + getDistance(P( 8 ),P( 3 )); double L2 = getDistance(P( 2 ),P( 8 )) + getDistance(P( 8 ),P( 3 ));
double L3 = getDistance(P( 3 ),P( 9 )) + getDistance(P( 9 ),P( 1 )); double L3 = getDistance(P( 3 ),P( 9 )) + getDistance(P( 9 ),P( 1 ));
@ -1682,9 +1688,11 @@ double Length2D::GetValue( long theElementId )
double L9 = getDistance(P( 3 ),P( 15 )) + getDistance(P( 15 ),P( 6 )); double L9 = getDistance(P( 3 ),P( 15 )) + getDistance(P( 15 ),P( 6 ));
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6)); aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
aVal = Min(aVal,Min(Min(L7,L8),L9)); aVal = Min(aVal,Min(Min(L7,L8),L9));
break;
} }
else if (len == 20){ // quadratic hexaider break;
case SMDSEntity_Quad_Hexa:
case SMDSEntity_TriQuad_Hexa:
if (len >= 20) { // quadratic hexaider
double L1 = getDistance(P( 1 ),P( 9 )) + getDistance(P( 9 ),P( 2 )); double L1 = getDistance(P( 1 ),P( 9 )) + getDistance(P( 9 ),P( 2 ));
double L2 = getDistance(P( 2 ),P( 10 )) + getDistance(P( 10 ),P( 3 )); double L2 = getDistance(P( 2 ),P( 10 )) + getDistance(P( 10 ),P( 3 ));
double L3 = getDistance(P( 3 ),P( 11 )) + getDistance(P( 11 ),P( 4 )); double L3 = getDistance(P( 3 ),P( 11 )) + getDistance(P( 11 ),P( 4 ));
@ -1700,11 +1708,55 @@ double Length2D::GetValue( long theElementId )
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6)); aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
aVal = Min(aVal,Min(Min(L7,L8),Min(L9,L10))); aVal = Min(aVal,Min(Min(L7,L8),Min(L9,L10)));
aVal = Min(aVal,Min(L11,L12)); aVal = Min(aVal,Min(L11,L12));
break;
} }
break;
case SMDSEntity_Polygon:
if ( len > 1 ) {
aVal = getDistance( P(1), P( P.size() ));
for ( size_t i = 1; i < P.size(); ++i )
aVal = Min( aVal, getDistance( P( i ), P( i+1 )));
}
break;
case SMDSEntity_Quad_Polygon:
if ( len > 2 ) {
aVal = getDistance( P(1), P( P.size() )) + getDistance( P(P.size()), P( P.size()-1 ));
for ( size_t i = 1; i < P.size()-1; i += 2 )
aVal = Min( aVal, getDistance( P( i ), P( i+1 )) + getDistance( P( i+1 ), P( i+2 )));
}
break;
case SMDSEntity_Hexagonal_Prism:
if (len == 12) { // hexagonal prism
double L1 = getDistance(P( 1 ),P( 2 ));
double L2 = getDistance(P( 2 ),P( 3 ));
double L3 = getDistance(P( 3 ),P( 4 ));
double L4 = getDistance(P( 4 ),P( 5 ));
double L5 = getDistance(P( 5 ),P( 6 ));
double L6 = getDistance(P( 6 ),P( 1 ));
default: aVal=-1; double L7 = getDistance(P( 7 ), P( 8 ));
double L8 = getDistance(P( 8 ), P( 9 ));
double L9 = getDistance(P( 9 ), P( 10 ));
double L10= getDistance(P( 10 ),P( 11 ));
double L11= getDistance(P( 11 ),P( 12 ));
double L12= getDistance(P( 12 ),P( 7 ));
double L13 = getDistance(P( 1 ),P( 7 ));
double L14 = getDistance(P( 2 ),P( 8 ));
double L15 = getDistance(P( 3 ),P( 9 ));
double L16 = getDistance(P( 4 ),P( 10 ));
double L17 = getDistance(P( 5 ),P( 11 ));
double L18 = getDistance(P( 6 ),P( 12 ));
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
aVal = Min(aVal, Min(Min(Min(L7,L8),Min(L9,L10)),Min(L11,L12)));
aVal = Min(aVal, Min(Min(Min(L13,L14),Min(L15,L16)),Min(L17,L18)));
}
break;
case SMDSEntity_Polyhedra:
{
}
break;
default:
return 0;
} }
if (aVal < 0 ) { if (aVal < 0 ) {
@ -1743,14 +1795,16 @@ Length2D::Value::Value(double theLength,long thePntId1, long thePntId2):
} }
} }
bool Length2D::Value::operator<(const Length2D::Value& x) const{ bool Length2D::Value::operator<(const Length2D::Value& x) const
{
if(myPntId[0] < x.myPntId[0]) return true; if(myPntId[0] < x.myPntId[0]) return true;
if(myPntId[0] == x.myPntId[0]) if(myPntId[0] == x.myPntId[0])
if(myPntId[1] < x.myPntId[1]) return true; if(myPntId[1] < x.myPntId[1]) return true;
return false; return false;
} }
void Length2D::GetValues(TValues& theValues){ void Length2D::GetValues(TValues& theValues)
{
TValues aValues; TValues aValues;
SMDS_FaceIteratorPtr anIter = myMesh->facesIterator(); SMDS_FaceIteratorPtr anIter = myMesh->facesIterator();
for(; anIter->more(); ){ for(; anIter->more(); ){
@ -1947,14 +2001,16 @@ MultiConnection2D::Value::Value(long thePntId1, long thePntId2)
} }
} }
bool MultiConnection2D::Value::operator<(const MultiConnection2D::Value& x) const{ bool MultiConnection2D::Value::operator<(const MultiConnection2D::Value& x) const
{
if(myPntId[0] < x.myPntId[0]) return true; if(myPntId[0] < x.myPntId[0]) return true;
if(myPntId[0] == x.myPntId[0]) if(myPntId[0] == x.myPntId[0])
if(myPntId[1] < x.myPntId[1]) return true; if(myPntId[1] < x.myPntId[1]) return true;
return false; return false;
} }
void MultiConnection2D::GetValues(MValues& theValues){ void MultiConnection2D::GetValues(MValues& theValues)
{
if ( !myMesh ) return; if ( !myMesh ) return;
SMDS_FaceIteratorPtr anIter = myMesh->facesIterator(); SMDS_FaceIteratorPtr anIter = myMesh->facesIterator();
for(; anIter->more(); ){ for(; anIter->more(); ){
@ -2374,26 +2430,15 @@ bool FreeEdges::IsSatisfy( long theId )
if ( aFace == 0 || aFace->GetType() != SMDSAbs_Face || aFace->NbNodes() < 3 ) if ( aFace == 0 || aFace->GetType() != SMDSAbs_Face || aFace->NbNodes() < 3 )
return false; return false;
SMDS_ElemIteratorPtr anIter; SMDS_NodeIteratorPtr anIter = aFace->interlacedNodesIterator();
if ( aFace->IsQuadratic() ) {
anIter = dynamic_cast<const SMDS_VtkFace*>
(aFace)->interlacedNodesElemIterator();
}
else {
anIter = aFace->nodesIterator();
}
if ( !anIter ) if ( !anIter )
return false; return false;
int i = 0, nbNodes = aFace->NbNodes(); int i = 0, nbNodes = aFace->NbNodes();
std::vector <const SMDS_MeshNode*> aNodes( nbNodes+1 ); std::vector <const SMDS_MeshNode*> aNodes( nbNodes+1 );
while( anIter->more() ) while( anIter->more() )
{ if ( ! ( aNodes[ i++ ] = anIter->next() ))
const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next();
if ( aNode == 0 )
return false; return false;
aNodes[ i++ ] = aNode;
}
aNodes[ nbNodes ] = aNodes[ 0 ]; aNodes[ nbNodes ] = aNodes[ 0 ];
for ( i = 0; i < nbNodes; i++ ) for ( i = 0; i < nbNodes; i++ )
@ -2526,7 +2571,7 @@ bool FreeFaces::IsSatisfy( long theId )
int nbNode = aFace->NbNodes(); int nbNode = aFace->NbNodes();
// collect volumes check that number of volumss with count equal nbNode not less than 2 // collect volumes to check that number of volumes with count equal nbNode not less than 2
typedef map< SMDS_MeshElement*, int > TMapOfVolume; // map of volume counters typedef map< SMDS_MeshElement*, int > TMapOfVolume; // map of volume counters
typedef map< SMDS_MeshElement*, int >::iterator TItrMapOfVolume; // iterator typedef map< SMDS_MeshElement*, int >::iterator TItrMapOfVolume; // iterator
TMapOfVolume mapOfVol; TMapOfVolume mapOfVol;
@ -2606,7 +2651,7 @@ GroupColor::GroupColor()
bool GroupColor::IsSatisfy( long theId ) bool GroupColor::IsSatisfy( long theId )
{ {
return (myIDs.find( theId ) != myIDs.end()); return myIDs.count( theId );
} }
void GroupColor::SetType( SMDSAbs_ElementType theType ) void GroupColor::SetType( SMDSAbs_ElementType theType )
@ -2629,7 +2674,6 @@ static bool isEqual( const Quantity_Color& theColor1,
fabs( theColor1.Blue() - theColor2.Blue() ) < tol ); fabs( theColor1.Blue() - theColor2.Blue() ) < tol );
} }
void GroupColor::SetMesh( const SMDS_Mesh* theMesh ) void GroupColor::SetMesh( const SMDS_Mesh* theMesh )
{ {
myIDs.clear(); myIDs.clear();
@ -2645,14 +2689,18 @@ void GroupColor::SetMesh( const SMDS_Mesh* theMesh )
// iterates on groups and find necessary elements ids // iterates on groups and find necessary elements ids
const std::set<SMESHDS_GroupBase*>& aGroups = aMesh->GetGroups(); const std::set<SMESHDS_GroupBase*>& aGroups = aMesh->GetGroups();
set<SMESHDS_GroupBase*>::const_iterator GrIt = aGroups.begin(); set<SMESHDS_GroupBase*>::const_iterator GrIt = aGroups.begin();
for (; GrIt != aGroups.end(); GrIt++) { for (; GrIt != aGroups.end(); GrIt++)
{
SMESHDS_GroupBase* aGrp = (*GrIt); SMESHDS_GroupBase* aGrp = (*GrIt);
if ( !aGrp ) if ( !aGrp )
continue; continue;
// check type and color of group // check type and color of group
if ( !isEqual( myColor, aGrp->GetColor() ) ) if ( !isEqual( myColor, aGrp->GetColor() ))
continue; continue;
if ( myType != SMDSAbs_All && myType != (SMDSAbs_ElementType)aGrp->GetType() )
// IPAL52867 (prevent infinite recursion via GroupOnFilter)
if ( SMESHDS_GroupOnFilter * gof = dynamic_cast< SMESHDS_GroupOnFilter* >( aGrp ))
if ( gof->GetPredicate().get() == this )
continue; continue;
SMDSAbs_ElementType aGrpElType = (SMDSAbs_ElementType)aGrp->GetType(); SMDSAbs_ElementType aGrpElType = (SMDSAbs_ElementType)aGrp->GetType();
@ -4634,20 +4682,20 @@ bool LyingOnGeom::Contains( const SMESHDS_Mesh* theMeshDS,
return false; return false;
} }
TSequenceOfXYZ::TSequenceOfXYZ() TSequenceOfXYZ::TSequenceOfXYZ(): myElem(0)
{} {}
TSequenceOfXYZ::TSequenceOfXYZ(size_type n) : myArray(n) TSequenceOfXYZ::TSequenceOfXYZ(size_type n) : myArray(n), myElem(0)
{} {}
TSequenceOfXYZ::TSequenceOfXYZ(size_type n, const gp_XYZ& t) : myArray(n,t) TSequenceOfXYZ::TSequenceOfXYZ(size_type n, const gp_XYZ& t) : myArray(n,t), myElem(0)
{} {}
TSequenceOfXYZ::TSequenceOfXYZ(const TSequenceOfXYZ& theSequenceOfXYZ) : myArray(theSequenceOfXYZ.myArray) TSequenceOfXYZ::TSequenceOfXYZ(const TSequenceOfXYZ& theSequenceOfXYZ) : myArray(theSequenceOfXYZ.myArray), myElem(theSequenceOfXYZ.myElem)
{} {}
template <class InputIterator> template <class InputIterator>
TSequenceOfXYZ::TSequenceOfXYZ(InputIterator theBegin, InputIterator theEnd): myArray(theBegin,theEnd) TSequenceOfXYZ::TSequenceOfXYZ(InputIterator theBegin, InputIterator theEnd): myArray(theBegin,theEnd), myElem(0)
{} {}
TSequenceOfXYZ::~TSequenceOfXYZ() TSequenceOfXYZ::~TSequenceOfXYZ()
@ -4656,6 +4704,7 @@ TSequenceOfXYZ::~TSequenceOfXYZ()
TSequenceOfXYZ& TSequenceOfXYZ::operator=(const TSequenceOfXYZ& theSequenceOfXYZ) TSequenceOfXYZ& TSequenceOfXYZ::operator=(const TSequenceOfXYZ& theSequenceOfXYZ)
{ {
myArray = theSequenceOfXYZ.myArray; myArray = theSequenceOfXYZ.myArray;
myElem = theSequenceOfXYZ.myElem;
return *this; return *this;
} }
@ -4689,6 +4738,11 @@ TSequenceOfXYZ::size_type TSequenceOfXYZ::size() const
return myArray.size(); return myArray.size();
} }
SMDSAbs_EntityType TSequenceOfXYZ::getElementEntity() const
{
return myElem ? myElem->GetEntityType() : SMDSEntity_Last;
}
TMeshModifTracer::TMeshModifTracer(): TMeshModifTracer::TMeshModifTracer():
myMeshModifTime(0), myMesh(0) myMeshModifTime(0), myMesh(0)
{ {

View File

@ -67,7 +67,7 @@ namespace SMESH{
public: public:
TSequenceOfXYZ(); TSequenceOfXYZ();
TSequenceOfXYZ(size_type n); explicit TSequenceOfXYZ(size_type n);
TSequenceOfXYZ(size_type n, const gp_XYZ& t); TSequenceOfXYZ(size_type n, const gp_XYZ& t);
@ -92,8 +92,16 @@ namespace SMESH{
size_type size() const; size_type size() const;
void setElement(const SMDS_MeshElement* e) { myElem = e; }
const SMDS_MeshElement* getElement() const { return myElem; }
SMDSAbs_EntityType getElementEntity() const;
private: private:
std::vector<gp_XYZ> myArray; std::vector<gp_XYZ> myArray;
const SMDS_MeshElement* myElem;
}; };
/*! /*!

View File

@ -147,6 +147,7 @@ namespace
} }
{ {
cgTypes[SMDSEntity_Polygon] = CGNS_ENUMV( NGON_n ); cgTypes[SMDSEntity_Polygon] = CGNS_ENUMV( NGON_n );
cgTypes[SMDSEntity_Quad_Polygon] = CGNS_ENUMV( NGON_n );
cgTypes[SMDSEntity_Polyhedra] = CGNS_ENUMV( NFACE_n ); cgTypes[SMDSEntity_Polyhedra] = CGNS_ENUMV( NFACE_n );
cgTypes[SMDSEntity_Hexagonal_Prism] = CGNS_ENUMV( NFACE_n ); cgTypes[SMDSEntity_Hexagonal_Prism] = CGNS_ENUMV( NFACE_n );
} }
@ -370,6 +371,21 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
} }
while ( elem && elem->GetEntityType() == elemType ); while ( elem && elem->GetEntityType() == elemType );
else if ( elemType == SMDSEntity_Quad_Polygon ) // QUADRATIC POLYGONS
do // write as linear NGON_n
{
elemData.push_back( elem->NbNodes() );
interlace = & SMDS_MeshCell::interlacedSmdsOrder( SMDSEntity_Quad_Polygon,
elem->NbNodes() )[0];
for ( int i = 0, nb = elem->NbNodes(); i < nb; ++i )
elemData.push_back( cgnsID( elem->GetNode( interlace[i] ), n2cgID ));
if ( elem->GetID() != cgID )
elem2cgID.insert( elem2cgID.end(), make_pair( elem, cgID ));
++cgID;
elem = elemIt->more() ? elemIt->next() : 0;
}
while ( elem && elem->GetEntityType() == elemType );
else if ( elemType == SMDSEntity_Polyhedra || else if ( elemType == SMDSEntity_Polyhedra ||
elemType == SMDSEntity_Hexagonal_Prism) // POLYHEDRA elemType == SMDSEntity_Hexagonal_Prism) // POLYHEDRA
{ {

View File

@ -38,7 +38,6 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
Status aResult = DRS_OK; Status aResult = DRS_OK;
int nbNodes, nbCells; int nbNodes, nbCells;
//int i;
char *file2Read = (char *)myFile.c_str(); char *file2Read = (char *)myFile.c_str();
FILE* aFileId = fopen(file2Read, "w+"); FILE* aFileId = fopen(file2Read, "w+");
@ -55,7 +54,7 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
nbNodes = myMesh->NbNodes(); nbNodes = myMesh->NbNodes();
/* Combien de mailles, faces ou aretes ? */ /* Combien de mailles, faces ou aretes ? */
int /*nb_of_nodes,*/ nb_of_edges, nb_of_faces, nb_of_volumes; int nb_of_edges, nb_of_faces, nb_of_volumes;
nb_of_edges = myMesh->NbEdges(); nb_of_edges = myMesh->NbEdges();
nb_of_faces = myMesh->NbFaces(); nb_of_faces = myMesh->NbFaces();
nb_of_volumes = myMesh->NbVolumes(); nb_of_volumes = myMesh->NbVolumes();
@ -64,7 +63,7 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
SCRUTE(nb_of_faces); SCRUTE(nb_of_faces);
SCRUTE(nb_of_volumes); SCRUTE(nb_of_volumes);
fprintf(stdout, "%d %d\n", nbNodes, nbCells); //fprintf(stdout, "%d %d\n", nbNodes, nbCells);
fprintf(aFileId, "%d %d\n", nbNodes, nbCells); fprintf(aFileId, "%d %d\n", nbNodes, nbCells);
/**************************************************************************** /****************************************************************************
@ -74,7 +73,7 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
SMDS_NodeIteratorPtr itNodes=myMesh->nodesIterator(); SMDS_NodeIteratorPtr itNodes=myMesh->nodesIterator();
while(itNodes->more()){ while(itNodes->more()){
const SMDS_MeshNode * node = itNodes->next(); const SMDS_MeshNode * node = itNodes->next();
fprintf(aFileId, "%d %e %e %e\n", node->GetID(), node->X(), node->Y(), node->Z()); fprintf(aFileId, "%d %.14e %.14e %.14e\n", node->GetID(), node->X(), node->Y(), node->Z());
} }
/**************************************************************************** /****************************************************************************

View File

@ -25,20 +25,21 @@
// Module : SMESH // Module : SMESH
#include "DriverMED_R_SMESHDS_Mesh.h" #include "DriverMED_R_SMESHDS_Mesh.h"
#include "SMESHDS_Mesh.hxx"
#include "utilities.h"
#include "DriverMED_Family.h" #include "DriverMED_Family.h"
#include "SMESHDS_Group.hxx" #include "SMESHDS_Group.hxx"
#include "SMESHDS_Mesh.hxx"
#include "SMESH_Comment.hxx"
#include "MED_Factory.hxx"
#include "MED_CoordUtils.hxx" #include "MED_CoordUtils.hxx"
#include "MED_Factory.hxx"
#include "MED_Utilities.hxx" #include "MED_Utilities.hxx"
#include <NCollection_Map.hxx> #include <NCollection_Map.hxx>
#include <stdlib.h> #include "utilities.h"
//#include <stdlib.h>
#ifdef _DEBUG_ #ifdef _DEBUG_
static int MYDEBUG = 1; static int MYDEBUG = 1;
@ -70,54 +71,61 @@ namespace DriverMED
bool checkFamilyID(DriverMED_FamilyPtr & aFamily, bool checkFamilyID(DriverMED_FamilyPtr & aFamily,
int anID, int anID,
const TID2FamilyMap& myFamilies); const TID2FamilyMap& myFamilies);
const SMDS_MeshNode* FindNode(const SMDS_Mesh* theMesh, TInt theId)
{
const SMDS_MeshNode* aNode = theMesh->FindNode(theId);
if(aNode) return aNode;
EXCEPTION(runtime_error,"SMDS_Mesh::FindNode - cannot find a SMDS_MeshNode for ID = "<<theId);
}
} }
void //================================================================================
DriverMED_R_SMESHDS_Mesh /*!
::SetMeshName(string theMeshName) * \brief Stores a mesh name
*/
//================================================================================
void DriverMED_R_SMESHDS_Mesh::SetMeshName(string theMeshName)
{ {
myMeshName = theMeshName; myMeshName = theMeshName;
} }
static const SMDS_MeshNode* //================================================================================
FindNode(const SMDS_Mesh* theMesh, TInt theId) /*!
{ * \brief Reads a med file
const SMDS_MeshNode* aNode = theMesh->FindNode(theId); */
if(aNode) return aNode; //================================================================================
EXCEPTION(runtime_error,"SMDS_Mesh::FindNode - cannot find a SMDS_MeshNode for ID = "<<theId);
}
Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
Driver_Mesh::Status
DriverMED_R_SMESHDS_Mesh
::Perform()
{ {
using namespace DriverMED;
Status aResult = DRS_FAIL; Status aResult = DRS_FAIL;
bool isDescConn = false; // Mantis issue 0020483 bool isDescConn = false; // Mantis issue 0020483
#ifndef _DEXCEPT_ #ifndef _DEXCEPT_
try{ try {
#endif #endif
myFamilies.clear(); myFamilies.clear();
if(MYDEBUG) MESSAGE("Perform - myFile : "<<myFile); if(MYDEBUG) MESSAGE("Perform - myFile : "<<myFile);
PWrapper aMed = CrWrapper(myFile,true); PWrapper aMed = CrWrapper(myFile,true);
aResult = DRS_EMPTY; aResult = DRS_EMPTY;
if(TInt aNbMeshes = aMed->GetNbMeshes()){ TInt aNbMeshes = aMed->GetNbMeshes();
for(int iMesh = 0; iMesh < aNbMeshes; iMesh++){ for (int iMesh = 0; iMesh < aNbMeshes; iMesh++)
{
// Reading the MED mesh // Reading the MED mesh
//--------------------- //---------------------
PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh+1); PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh+1);
string aMeshName; string aMeshName;
if (myMeshId != -1) { if (myMeshId != -1) aMeshName = SMESH_Comment( myMeshId );
ostringstream aMeshNameStr; else aMeshName = myMeshName;
aMeshNameStr<<myMeshId;
aMeshName = aMeshNameStr.str();
} else {
aMeshName = myMeshName;
}
if(MYDEBUG) MESSAGE("Perform - aMeshName : "<<aMeshName<<"; "<<aMeshInfo->GetName()); if(MYDEBUG) MESSAGE("Perform - aMeshName : "<<aMeshName<<"; "<<aMeshInfo->GetName());
if(aMeshName != aMeshInfo->GetName()) continue; if ( aMeshName != aMeshInfo->GetName() ) continue;
aResult = DRS_OK; aResult = DRS_OK;
// Reading MED families to the temporary structure // Reading MED families to the temporary structure
@ -125,7 +133,8 @@ DriverMED_R_SMESHDS_Mesh
TErr anErr; TErr anErr;
TInt aNbFams = aMed->GetNbFamilies(aMeshInfo); TInt aNbFams = aMed->GetNbFamilies(aMeshInfo);
if(MYDEBUG) MESSAGE("Read " << aNbFams << " families"); if(MYDEBUG) MESSAGE("Read " << aNbFams << " families");
for (TInt iFam = 0; iFam < aNbFams; iFam++) { for (TInt iFam = 0; iFam < aNbFams; iFam++)
{
PFamilyInfo aFamilyInfo = aMed->GetPFamilyInfo(aMeshInfo,iFam+1,&anErr); PFamilyInfo aFamilyInfo = aMed->GetPFamilyInfo(aMeshInfo,iFam+1,&anErr);
if(anErr >= 0){ if(anErr >= 0){
TInt aFamId = aFamilyInfo->GetId(); TInt aFamId = aFamilyInfo->GetId();
@ -138,23 +147,23 @@ DriverMED_R_SMESHDS_Mesh
bool isAttrOk = false; bool isAttrOk = false;
if(aFamilyInfo->GetNbAttr() == aNbGrp) if(aFamilyInfo->GetNbAttr() == aNbGrp)
isAttrOk = true; isAttrOk = true;
for (TInt iGr = 0; iGr < aNbGrp; iGr++) { for (TInt iGr = 0; iGr < aNbGrp; iGr++)
{
string aGroupName = aFamilyInfo->GetGroupName(iGr); string aGroupName = aFamilyInfo->GetGroupName(iGr);
if(isAttrOk){ if ( isAttrOk ) {
TInt anAttrVal = aFamilyInfo->GetAttrVal(iGr); TInt anAttrVal = aFamilyInfo->GetAttrVal(iGr);
aFamily->SetGroupAttributVal(anAttrVal); aFamily->SetGroupAttributVal(anAttrVal);
} }
if(MYDEBUG) MESSAGE(aGroupName); if(MYDEBUG) MESSAGE(aGroupName);
aFamily->AddGroupName(aGroupName); aFamily->AddGroupName(aGroupName);
} }
aFamily->SetId( aFamId ); aFamily->SetId( aFamId );
myFamilies[aFamId] = aFamily; myFamilies[aFamId] = aFamily;
} }
} }
if (aMeshInfo->GetType() == MED::eSTRUCTURE){ if (aMeshInfo->GetType() == MED::eSTRUCTURE)
{
/*bool aRes = */DriverMED::buildMeshGrille(aMed,aMeshInfo,myMesh,myFamilies); /*bool aRes = */DriverMED::buildMeshGrille(aMed,aMeshInfo,myMesh,myFamilies);
continue; continue;
} }
@ -173,16 +182,18 @@ DriverMED_R_SMESHDS_Mesh
TInt aNbElems = aNodeInfo->GetNbElem(); TInt aNbElems = aNodeInfo->GetNbElem();
if(MYDEBUG) MESSAGE("Perform - aNodeInfo->GetNbElem() = "<<aNbElems<<"; anIsNodeNum = "<<anIsNodeNum); if(MYDEBUG) MESSAGE("Perform - aNodeInfo->GetNbElem() = "<<aNbElems<<"; anIsNodeNum = "<<anIsNodeNum);
DriverMED_FamilyPtr aFamily; DriverMED_FamilyPtr aFamily;
for(TInt iElem = 0; iElem < aNbElems; iElem++){ for ( TInt iElem = 0; iElem < aNbElems; iElem++ )
{
TCCoordSlice aCoordSlice = aNodeInfo->GetCoordSlice(iElem); TCCoordSlice aCoordSlice = aNodeInfo->GetCoordSlice(iElem);
double aCoords[3] = {0.0, 0.0, 0.0}; double aCoords[3] = {0.0, 0.0, 0.0};
for(TInt iDim = 0; iDim < 3; iDim++) for(TInt iDim = 0; iDim < 3; iDim++)
aCoords[iDim] = aCoordHelper->GetCoord(aCoordSlice,iDim); aCoords[iDim] = aCoordHelper->GetCoord(aCoordSlice,iDim);
const SMDS_MeshNode* aNode; const SMDS_MeshNode* aNode;
if(anIsNodeNum) { if ( anIsNodeNum ) {
aNode = myMesh->AddNodeWithID aNode = myMesh->AddNodeWithID
(aCoords[0],aCoords[1],aCoords[2],aNodeInfo->GetElemNum(iElem)); (aCoords[0],aCoords[1],aCoords[2],aNodeInfo->GetElemNum(iElem));
} else { }
else {
aNode = myMesh->AddNodeWithID aNode = myMesh->AddNodeWithID
(aCoords[0],aCoords[1],aCoords[2], iElem+1); (aCoords[0],aCoords[1],aCoords[2], iElem+1);
} }
@ -217,15 +228,19 @@ DriverMED_R_SMESHDS_Mesh
bool takeNumbers = true; // initially we trust the numbers from file bool takeNumbers = true; // initially we trust the numbers from file
MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo, eNOD); MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo, eNOD);
MED::TEntityInfo::iterator anEntityIter = aEntityInfo.begin(); MED::TEntityInfo::iterator anEntityIter = aEntityInfo.begin();
for (; anEntityIter != aEntityInfo.end(); anEntityIter++) {
for (; anEntityIter != aEntityInfo.end(); anEntityIter++)
{
const EEntiteMaillage& anEntity = anEntityIter->first; const EEntiteMaillage& anEntity = anEntityIter->first;
aDescendingEntitiesMap.Remove(anEntity); // Mantis issue 0020483 aDescendingEntitiesMap.Remove(anEntity); // Mantis issue 0020483
if (anEntity == eNOEUD) continue; if (anEntity == eNOEUD) continue;
// Reading MED cells to the corresponding SMDS structure // Reading MED cells to the corresponding SMDS structure
//------------------------------------------------------ //------------------------------------------------------
const MED::TGeom2Size& aGeom2Size = anEntityIter->second; const MED::TGeom2Size& aGeom2Size = anEntityIter->second;
MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin(); MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){ for ( ; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++)
{
const EGeometrieElement& aGeom = aGeom2SizeIter->first; const EGeometrieElement& aGeom = aGeom2SizeIter->first;
if ( anEntity == eSTRUCT_ELEMENT ) // MED_BALL (issue 0021459) if ( anEntity == eSTRUCT_ELEMENT ) // MED_BALL (issue 0021459)
@ -293,17 +308,33 @@ DriverMED_R_SMESHDS_Mesh
} // MED_BALL } // MED_BALL
switch(aGeom) { switch(aGeom) {
// case ePOINT1: ## PAL16410 // case ePOINT1: ## PAL16410
// break; // break;
case ePOLYGONE: { case ePOLYGONE:
case ePOLYGON2:
{
PPolygoneInfo aPolygoneInfo = aMed->GetPPolygoneInfo(aMeshInfo,anEntity,aGeom); PPolygoneInfo aPolygoneInfo = aMed->GetPPolygoneInfo(aMeshInfo,anEntity,aGeom);
EBooleen anIsElemNum = takeNumbers ? aPolygoneInfo->IsElemNum() : eFAUX; EBooleen anIsElemNum = takeNumbers ? aPolygoneInfo->IsElemNum() : eFAUX;
TInt aNbElem = aPolygoneInfo->GetNbElem(); typedef SMDS_MeshFace* (SMESHDS_Mesh::* FAddPolyWithID)
for(TInt iElem = 0; iElem < aNbElem; iElem++){ (const std::vector<int> & nodes_ids, const int ID);
typedef SMDS_MeshFace* (SMESHDS_Mesh::* FAddPolygon)
(const std::vector<const SMDS_MeshNode*> & nodes);
FAddPolyWithID addPolyWithID = & SMESHDS_Mesh::AddPolygonalFaceWithID;
FAddPolygon addPolygon = & SMESHDS_Mesh::AddPolygonalFace;
if ( aGeom == ePOLYGON2 ) {
addPolyWithID = & SMESHDS_Mesh::AddQuadPolygonalFaceWithID;
addPolygon = & SMESHDS_Mesh::AddQuadPolygonalFace;
}
TNodeIds aNodeIds;
vector<const SMDS_MeshNode*> aNodes;
const TInt aNbElem = aPolygoneInfo->GetNbElem();
for ( TInt iElem = 0; iElem < aNbElem; iElem++ )
{
MED::TCConnSlice aConnSlice = aPolygoneInfo->GetConnSlice(iElem); MED::TCConnSlice aConnSlice = aPolygoneInfo->GetConnSlice(iElem);
TInt aNbConn = aPolygoneInfo->GetNbConn(iElem); TInt aNbConn = aPolygoneInfo->GetNbConn(iElem);
TNodeIds aNodeIds(aNbConn); aNodeIds.resize( aNbConn );
#ifdef _EDF_NODE_IDS_ #ifdef _EDF_NODE_IDS_
if(anIsNodeNum) if(anIsNodeNum)
for(TInt iConn = 0; iConn < aNbConn; iConn++) for(TInt iConn = 0; iConn < aNbConn; iConn++)
@ -318,32 +349,32 @@ DriverMED_R_SMESHDS_Mesh
bool isRenum = false; bool isRenum = false;
SMDS_MeshElement* anElement = NULL; SMDS_MeshElement* anElement = NULL;
TInt aFamNum = aPolygoneInfo->GetFamNum(iElem); TInt aFamNum = aPolygoneInfo->GetFamNum(iElem);
#ifndef _DEXCEPT_ #ifndef _DEXCEPT_
try{ try {
#endif #endif
if(anIsElemNum){ if ( anIsElemNum ) {
TInt anElemId = aPolygoneInfo->GetElemNum(iElem); TInt anElemId = aPolygoneInfo->GetElemNum( iElem );
anElement = myMesh->AddPolygonalFaceWithID(aNodeIds,anElemId); anElement = (myMesh->*addPolyWithID)( aNodeIds, anElemId );
} }
if(!anElement){ if ( !anElement ) {
vector<const SMDS_MeshNode*> aNodes(aNbConn); aNodes.resize( aNbConn );
for(TInt iConn = 0; iConn < aNbConn; iConn++) for ( TInt iConn = 0; iConn < aNbConn; iConn++ )
aNodes[iConn] = FindNode(myMesh,aNodeIds[iConn]); aNodes[iConn] = FindNode( myMesh, aNodeIds[iConn] );
anElement = myMesh->AddPolygonalFace(aNodes); anElement = (myMesh->*addPolygon)( aNodes );
isRenum = anIsElemNum; isRenum = anIsElemNum;
} }
#ifndef _DEXCEPT_ #ifndef _DEXCEPT_
}catch(const std::exception& exc){ } catch(const std::exception& exc) {
aResult = DRS_FAIL; aResult = DRS_FAIL;
}catch (...){ } catch (...) {
aResult = DRS_FAIL; aResult = DRS_FAIL;
} }
#endif #endif
if(!anElement){ if ( !anElement ) {
aResult = DRS_WARN_SKIP_ELEM; aResult = DRS_WARN_SKIP_ELEM;
}else{ }
if(isRenum){ else {
if ( isRenum ) {
anIsElemNum = eFAUX; anIsElemNum = eFAUX;
takeNumbers = false; takeNumbers = false;
if(aResult < DRS_WARN_RENUMBER) if(aResult < DRS_WARN_RENUMBER)
@ -952,12 +983,15 @@ DriverMED_R_SMESHDS_Mesh
} }
if (aDescendingEntitiesMap.Extent()) isDescConn = true; // Mantis issue 0020483 if (aDescendingEntitiesMap.Extent()) isDescConn = true; // Mantis issue 0020483
} // for(int iMesh = 0; iMesh < aNbMeshes; iMesh++) } // for(int iMesh = 0; iMesh < aNbMeshes; iMesh++)
} // if aNbMeshes
#ifndef _DEXCEPT_ #ifndef _DEXCEPT_
}catch(const std::exception& exc){ }
catch(const std::exception& exc)
{
INFOS("The following exception was caught:\n\t"<<exc.what()); INFOS("The following exception was caught:\n\t"<<exc.what());
aResult = DRS_FAIL; aResult = DRS_FAIL;
}catch(...){ }
catch(...)
{
INFOS("Unknown exception was caught !!!"); INFOS("Unknown exception was caught !!!");
aResult = DRS_FAIL; aResult = DRS_FAIL;
} }

View File

@ -56,7 +56,8 @@ DriverMED_W_SMESHDS_Mesh::DriverMED_W_SMESHDS_Mesh():
myDoGroupOfVolumes (false), myDoGroupOfVolumes (false),
myDoGroupOf0DElems(false), myDoGroupOf0DElems(false),
myDoGroupOfBalls(false), myDoGroupOfBalls(false),
myAutoDimension(true) myAutoDimension(true),
myAddODOnVertices(false)
{} {}
void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName, void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName,
@ -605,12 +606,21 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
if ( polyTypesSupported ) { if ( polyTypesSupported ) {
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYGONE, ePOLYGONE,
nbElemInfo.NbPolygons(), nbElemInfo.NbPolygons( ORDER_LINEAR ),
SMDSAbs_Face)); SMDSAbs_Face));
// we need one more loop on poly elements to count nb of their nodes // we need one more loop on poly elements to count nb of their nodes
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYGONE, ePOLYGONE,
nbElemInfo.NbPolygons(), nbElemInfo.NbPolygons( ORDER_LINEAR ),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYGON2,
nbElemInfo.NbPolygons( ORDER_QUADRATIC ),
SMDSAbs_Face));
// we need one more loop on QUAD poly elements to count nb of their nodes
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYGON2,
nbElemInfo.NbPolygons( ORDER_QUADRATIC ),
SMDSAbs_Face)); SMDSAbs_Face));
} }
#ifdef _ELEMENTS_BY_DIM_ #ifdef _ELEMENTS_BY_DIM_
@ -706,9 +716,14 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
// Treat POLYGONs // Treat POLYGONs
// --------------- // ---------------
if ( aElemTypeData->_geomType == ePOLYGONE ) if ( aElemTypeData->_geomType == ePOLYGONE ||
aElemTypeData->_geomType == ePOLYGON2 )
{ {
elemIterator = myMesh->elementGeomIterator( SMDSGeom_POLYGON ); if ( aElemTypeData->_geomType == ePOLYGONE )
elemIterator = myMesh->elementEntityIterator( SMDSEntity_Polygon );
else
elemIterator = myMesh->elementEntityIterator( SMDSEntity_Quad_Polygon );
if ( nbPolygonNodes == 0 ) { if ( nbPolygonNodes == 0 ) {
// Count nb of nodes // Count nb of nodes
while ( elemIterator->more() ) { while ( elemIterator->more() ) {
@ -758,8 +773,9 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
break; break;
} }
myMed->SetPolygoneInfo(aPolygoneInfo); myMed->SetPolygoneInfo(aPolygoneInfo);
}
nbPolygonNodes = 0; // to treat next polygon type
}
} }
// Treat POLYEDREs // Treat POLYEDREs

View File

@ -33,12 +33,15 @@
#include "SMDS_Mesh.hxx" #include "SMDS_Mesh.hxx"
#include "SMDS_MeshElement.hxx" #include "SMDS_MeshElement.hxx"
#include "SMDS_MeshNode.hxx" #include "SMDS_MeshNode.hxx"
#include "SMDS_PolygonalFaceOfNodes.hxx"
#include "SMDS_SetIterator.hxx" #include "SMDS_SetIterator.hxx"
#include "SMDS_VolumeTool.hxx" #include "SMDS_VolumeTool.hxx"
#include "SMESH_File.hxx" #include "SMESH_File.hxx"
#include "SMESH_TypeDefs.hxx" #include "SMESH_TypeDefs.hxx"
//#include "utilities.h" #include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <gp_Ax2.hxx>
#include <limits> #include <limits>
@ -74,6 +77,7 @@ Driver_Mesh::Status DriverSTL_W_SMDS_Mesh::Perform()
return aResult; return aResult;
} }
//================================================================================ //================================================================================
/*! /*!
* \brief Destructor deletes temporary faces * \brief Destructor deletes temporary faces
@ -82,8 +86,8 @@ Driver_Mesh::Status DriverSTL_W_SMDS_Mesh::Perform()
DriverSTL_W_SMDS_Mesh::~DriverSTL_W_SMDS_Mesh() DriverSTL_W_SMDS_Mesh::~DriverSTL_W_SMDS_Mesh()
{ {
for ( unsigned i = 0; i < myVolumeTrias.size(); ++i ) for ( unsigned i = 0; i < myVolumeFacets.size(); ++i )
delete myVolumeTrias[i]; delete myVolumeFacets[i];
} }
//================================================================================ //================================================================================
@ -94,6 +98,8 @@ DriverSTL_W_SMDS_Mesh::~DriverSTL_W_SMDS_Mesh()
void DriverSTL_W_SMDS_Mesh::findVolumeTriangles() void DriverSTL_W_SMDS_Mesh::findVolumeTriangles()
{ {
myNbVolumeTrias = 0;
SMDS_VolumeTool theVolume; SMDS_VolumeTool theVolume;
SMDS_VolumeIteratorPtr vIt = myMesh->volumesIterator(); SMDS_VolumeIteratorPtr vIt = myMesh->volumesIterator();
std::vector< const SMDS_MeshNode*> nodes; std::vector< const SMDS_MeshNode*> nodes;
@ -106,19 +112,20 @@ void DriverSTL_W_SMDS_Mesh::findVolumeTriangles()
const SMDS_MeshNode** n = theVolume.GetFaceNodes(iF); const SMDS_MeshNode** n = theVolume.GetFaceNodes(iF);
int nbN = theVolume.NbFaceNodes(iF); int nbN = theVolume.NbFaceNodes(iF);
nodes.assign( n, n+nbN ); nodes.assign( n, n+nbN );
if ( !myMesh->FindElement( nodes, SMDSAbs_Face, /*Nomedium=*/false)) if ( !myMesh->FindElement( nodes, SMDSAbs_Face, /*noMedium=*/false))
{ {
if ( nbN == 9 && !theVolume.IsPoly() ) // facet is SMDSEntity_BiQuad_Quadrangle if (( nbN == 9 || nbN == 7 ) &&
( !theVolume.IsPoly() )) // facet is bi-quaratic
{ {
int nbTria = nbN - 1; int nbTria = nbN - 1;
for ( int iT = 0; iT < nbTria; ++iT ) for ( int iT = 0; iT < nbTria; ++iT )
myVolumeTrias.push_back( new SMDS_FaceOfNodes( n[8], n[0+iT], n[1+iT] )); myVolumeFacets.push_back( new SMDS_FaceOfNodes( n[8], n[0+iT], n[1+iT] ));
myNbVolumeTrias += nbTria;
} }
else else
{ {
int nbTria = nbN - 2; myVolumeFacets.push_back( new SMDS_PolygonalFaceOfNodes( nodes ));
for ( int iT = 0; iT < nbTria; ++iT ) myNbVolumeTrias += nbN - 2;
myVolumeTrias.push_back( new SMDS_FaceOfNodes( n[0], n[1+iT], n[2+iT] ));
} }
} }
} }
@ -134,8 +141,8 @@ void DriverSTL_W_SMDS_Mesh::findVolumeTriangles()
SMDS_ElemIteratorPtr DriverSTL_W_SMDS_Mesh::getFaces() const SMDS_ElemIteratorPtr DriverSTL_W_SMDS_Mesh::getFaces() const
{ {
SMDS_ElemIteratorPtr facesIter = myMesh->elementsIterator(SMDSAbs_Face); SMDS_ElemIteratorPtr facesIter = myMesh->elementsIterator(SMDSAbs_Face);
SMDS_ElemIteratorPtr tmpTriaIter( new SMDS_ElementVectorIterator( myVolumeTrias.begin(), SMDS_ElemIteratorPtr tmpTriaIter( new SMDS_ElementVectorIterator( myVolumeFacets.begin(),
myVolumeTrias.end())); myVolumeFacets.end()));
typedef std::vector< SMDS_ElemIteratorPtr > TElemIterVector; typedef std::vector< SMDS_ElemIteratorPtr > TElemIterVector;
TElemIterVector iters(2); TElemIterVector iters(2);
iters[0] = facesIter; iters[0] = facesIter;
@ -201,6 +208,177 @@ static gp_XYZ getNormale( const SMDS_MeshNode* n1,
return n; return n;
} }
namespace
{
/*!
* \brief Vertex of a polygon. Together with 2 neighbor Vertices represents a triangle
*/
struct PolyVertex
{
SMESH_TNodeXYZ _nxyz;
gp_XY _xy;
PolyVertex* _prev;
PolyVertex* _next;
void SetNodeAndNext( const SMDS_MeshNode* n, PolyVertex& v )
{
_nxyz.Set( n );
_next = &v;
v._prev = this;
}
PolyVertex* Delete()
{
_prev->_next = _next;
_next->_prev = _prev;
return _next;
}
void GetTriaNodes( const SMDS_MeshNode** nodes) const
{
nodes[0] = _prev->_nxyz._node;
nodes[1] = this->_nxyz._node;
nodes[2] = _next->_nxyz._node;
}
inline static double Area( const PolyVertex* v0, const PolyVertex* v1, const PolyVertex* v2 )
{
gp_XY vPrev = v0->_xy - v1->_xy;
gp_XY vNext = v2->_xy - v1->_xy;
return vNext ^ vPrev;
}
double TriaArea() const { return Area( _prev, this, _next ); }
bool IsInsideTria( const PolyVertex* v )
{
gp_XY p = _prev->_xy - v->_xy;
gp_XY t = this->_xy - v->_xy;
gp_XY n = _next->_xy - v->_xy;
const double tol = -1e-12;
return (( p ^ t ) >= tol &&
( t ^ n ) >= tol &&
( n ^ p ) >= tol );
// return ( Area( _prev, this, v ) > 0 &&
// Area( this, _next, v ) > 0 &&
// Area( _next, _prev, v ) > 0 );
}
};
//================================================================================
/*!
* \brief Triangulate a polygon. Assure correct orientation for concave polygons
*/
//================================================================================
bool triangulate( std::vector< const SMDS_MeshNode*>& nodes, const size_t nbNodes )
{
// connect nodes into a ring
std::vector< PolyVertex > pv( nbNodes );
for ( size_t i = 1; i < nbNodes; ++i )
pv[i-1].SetNodeAndNext( nodes[i-1], pv[i] );
pv[ nbNodes-1 ].SetNodeAndNext( nodes[ nbNodes-1 ], pv[0] );
// get a polygon normal
gp_XYZ normal(0,0,0), p0,v01,v02;
p0 = pv[0]._nxyz;
v01 = pv[1]._nxyz - p0;
for ( size_t i = 2; i < nbNodes; ++i )
{
v02 = pv[i]._nxyz - p0;
normal += v01 ^ v02;
v01 = v02;
}
// project nodes to the found plane
gp_Ax2 axes;
try {
axes = gp_Ax2( p0, normal, v01 );
}
catch ( Standard_Failure ) {
return false;
}
for ( size_t i = 0; i < nbNodes; ++i )
{
gp_XYZ p = pv[i]._nxyz - p0;
pv[i]._xy.SetX( axes.XDirection().XYZ() * p );
pv[i]._xy.SetY( axes.YDirection().XYZ() * p );
}
// in a loop, find triangles with positive area and having no vertices inside
int iN = 0, nbTria = nbNodes - 2;
nodes.reserve( nbTria * 3 );
const double minArea = 1e-6;
PolyVertex* v = &pv[0], *vi;
int nbVertices = nbNodes, nbBadTria = 0, isGoodTria;
while ( nbBadTria < nbVertices )
{
if (( isGoodTria = v->TriaArea() > minArea ))
{
for ( vi = v->_next->_next;
vi != v->_prev;
vi = vi->_next )
{
if ( v->IsInsideTria( vi ))
break;
}
isGoodTria = ( vi == v->_prev );
}
if ( isGoodTria )
{
v->GetTriaNodes( &nodes[ iN ] );
iN += 3;
v = v->Delete();
if ( --nbVertices == 3 )
{
// last triangle remains
v->GetTriaNodes( &nodes[ iN ] );
return true;
}
nbBadTria = 0;
}
else
{
v = v->_next;
++nbBadTria;
}
}
// the polygon is invalid; add triangles with positive area
nbBadTria = 0;
while ( nbBadTria < nbVertices )
{
isGoodTria = v->TriaArea() > minArea;
if ( isGoodTria )
{
v->GetTriaNodes( &nodes[ iN ] );
iN += 3;
v = v->Delete();
if ( --nbVertices == 3 )
{
// last triangle remains
v->GetTriaNodes( &nodes[ iN ] );
return true;
}
nbBadTria = 0;
}
else
{
v = v->_next;
++nbBadTria;
}
}
// add all the rest triangles
while ( nbVertices >= 3 )
{
v->GetTriaNodes( &nodes[ iN ] );
iN += 3;
v = v->Delete();
--nbVertices;
}
return true;
} // triangulate()
} // namespace
//================================================================================ //================================================================================
/*! /*!
* \brief Return nb triangles in a decomposed mesh face * \brief Return nb triangles in a decomposed mesh face
@ -236,11 +414,12 @@ static int getNbTriangles( const SMDS_MeshElement* face)
//================================================================================ //================================================================================
static int getTriangles( const SMDS_MeshElement* face, static int getTriangles( const SMDS_MeshElement* face,
const SMDS_MeshNode** nodes) std::vector< const SMDS_MeshNode*>& nodes)
{ {
// WARNING: decomposing into triangles must be coherent with getNbTriangles() // WARNING: decomposing into triangles must be coherent with getNbTriangles()
int nbTria, i = 0; int nbTria, i = 0, nbNodes = face->NbNodes();
SMDS_NodeIteratorPtr nIt = face->interlacedNodesIterator(); SMDS_NodeIteratorPtr nIt = face->interlacedNodesIterator();
nodes.resize( nbNodes * 3 );
nodes[ i++ ] = nIt->next(); nodes[ i++ ] = nIt->next();
nodes[ i++ ] = nIt->next(); nodes[ i++ ] = nIt->next();
@ -251,30 +430,42 @@ static int getTriangles( const SMDS_MeshElement* face,
case SMDSEntity_BiQuad_Quadrangle: case SMDSEntity_BiQuad_Quadrangle:
nbTria = ( type == SMDSEntity_BiQuad_Triangle ) ? 6 : 8; nbTria = ( type == SMDSEntity_BiQuad_Triangle ) ? 6 : 8;
nodes[ i++ ] = face->GetNode( nbTria ); nodes[ i++ ] = face->GetNode( nbTria );
while ( i < 3*(nbTria-1) ) for ( i = 3; i < 3*(nbTria-1); i += 3 )
{ {
nodes[ i++ ] = nodes[ i-2 ]; nodes[ i+0 ] = nodes[ i-2 ];
nodes[ i++ ] = nIt->next(); nodes[ i+1 ] = nIt->next();
nodes[ i++ ] = nodes[ 2 ]; nodes[ i+2 ] = nodes[ 2 ];
} }
nodes[ i++ ] = nodes[ i-2 ]; nodes[ i+0 ] = nodes[ i-2 ];
nodes[ i++ ] = nodes[ 0 ]; nodes[ i+1 ] = nodes[ 0 ];
nodes[ i++ ] = nodes[ 2 ]; nodes[ i+2 ] = nodes[ 2 ];
break;
case SMDSEntity_Triangle:
nbTria = 1;
nodes[ i++ ] = nIt->next();
break; break;
default: default:
// case SMDSEntity_Triangle:
// case SMDSEntity_Quad_Triangle: // case SMDSEntity_Quad_Triangle:
// case SMDSEntity_Quadrangle: // case SMDSEntity_Quadrangle:
// case SMDSEntity_Quad_Quadrangle: // case SMDSEntity_Quad_Quadrangle:
// case SMDSEntity_Polygon: // case SMDSEntity_Polygon:
// case SMDSEntity_Quad_Polygon: // case SMDSEntity_Quad_Polygon:
nbTria = face->NbNodes() - 2; nbTria = nbNodes - 2;
while ( nIt->more() )
nodes[ i++ ] = nIt->next(); nodes[ i++ ] = nIt->next();
while ( i < 3*nbTria )
if ( !triangulate( nodes, nbNodes ))
{ {
nodes[ i++ ] = nodes[ 0 ]; nIt = face->interlacedNodesIterator();
nodes[ i++ ] = nodes[ i-2 ]; nodes[ 0 ] = nIt->next();
nodes[ i++ ] = nIt->next(); nodes[ 1 ] = nIt->next();
nodes[ 2 ] = nIt->next();
for ( i = 3; i < 3*nbTria; i += 3 )
{
nodes[ i+0 ] = nodes[ 0 ];
nodes[ i+1 ] = nodes[ i-1 ];
nodes[ i+2 ] = nIt->next();
}
} }
break; break;
} }
@ -298,7 +489,7 @@ Driver_Mesh::Status DriverSTL_W_SMDS_Mesh::writeAscii() const
aFile.writeRaw( buf.c_str(), buf.size() ); aFile.writeRaw( buf.c_str(), buf.size() );
char sval[128]; char sval[128];
const SMDS_MeshNode* triaNodes[2048]; std::vector< const SMDS_MeshNode* > triaNodes;
SMDS_ElemIteratorPtr itFaces = getFaces(); SMDS_ElemIteratorPtr itFaces = getFaces();
while ( itFaces->more() ) while ( itFaces->more() )
@ -354,7 +545,7 @@ Driver_Mesh::Status DriverSTL_W_SMDS_Mesh::writeBinary() const
aFile.openForWriting(); aFile.openForWriting();
// we first count the number of triangles // we first count the number of triangles
int nbTri = myVolumeTrias.size(); int nbTri = myNbVolumeTrias;
{ {
SMDS_FaceIteratorPtr itFaces = myMesh->facesIterator(); SMDS_FaceIteratorPtr itFaces = myMesh->facesIterator();
while ( itFaces->more() ) { while ( itFaces->more() ) {
@ -372,7 +563,7 @@ Driver_Mesh::Status DriverSTL_W_SMDS_Mesh::writeBinary() const
int dum=0; int dum=0;
const SMDS_MeshNode* triaNodes[2048]; std::vector< const SMDS_MeshNode* > triaNodes;
SMDS_ElemIteratorPtr itFaces = getFaces(); SMDS_ElemIteratorPtr itFaces = getFaces();
while ( itFaces->more() ) while ( itFaces->more() )

Some files were not shown because too many files have changed in this diff Show More