mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-26 09:20:34 +05:00
53103: Mesh visualization performance problem
Optimize visualization and mesh loading. + fix docs
This commit is contained in:
parent
0224364ee2
commit
a1a6d5ddc1
@ -2,17 +2,16 @@
|
|||||||
|
|
||||||
import salome
|
import salome
|
||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
import GEOM
|
|
||||||
from salome.geom import geomBuilder
|
from salome.geom import geomBuilder
|
||||||
geompy = geomBuilder.New(salome.myStudy)
|
geompy = geomBuilder.New(salome.myStudy)
|
||||||
|
|
||||||
import SMESH, SALOMEDS
|
import SMESH
|
||||||
from salome.smesh import smeshBuilder
|
from salome.smesh import smeshBuilder
|
||||||
smesh = smeshBuilder.New(salome.myStudy)
|
smesh = smeshBuilder.New(salome.myStudy)
|
||||||
|
|
||||||
###
|
###
|
||||||
# Geometry: an assembly of a box, a cylinder and a truncated cone
|
# Geometry: an assembly of a box, a cylinder and a truncated cone
|
||||||
# meshed with tetrahedral
|
# to be meshed with tetrahedra
|
||||||
###
|
###
|
||||||
|
|
||||||
# Define values
|
# Define values
|
||||||
@ -44,14 +43,14 @@ piece = geompy.MakeFuse(box_cyl, cone)
|
|||||||
geompy.addToStudy(piece, name)
|
geompy.addToStudy(piece, name)
|
||||||
|
|
||||||
# Create a group of faces
|
# Create a group of faces
|
||||||
group = geompy.CreateGroup(piece, geompy.ShapeType["FACE"])
|
faces_group = geompy.CreateGroup(piece, geompy.ShapeType["FACE"])
|
||||||
group_name = name + "_grp"
|
group_name = name + "_grp"
|
||||||
geompy.addToStudy(group, group_name)
|
geompy.addToStudy(faces_group, group_name)
|
||||||
group.SetName(group_name)
|
faces_group.SetName(group_name)
|
||||||
|
|
||||||
# Add faces to the group
|
# Add faces to the group
|
||||||
faces = geompy.SubShapeAllIDs(piece, geompy.ShapeType["FACE"])
|
faces = geompy.SubShapeAllIDs(piece, geompy.ShapeType["FACE"])
|
||||||
geompy.UnionIDs(group, faces)
|
geompy.UnionIDs(faces_group, faces)
|
||||||
|
|
||||||
###
|
###
|
||||||
# Create a mesh
|
# Create a mesh
|
||||||
@ -60,20 +59,20 @@ geompy.UnionIDs(group, faces)
|
|||||||
# Define a mesh on a geometry
|
# Define a mesh on a geometry
|
||||||
tetra = smesh.Mesh(piece, name)
|
tetra = smesh.Mesh(piece, name)
|
||||||
|
|
||||||
# Define 1D hypothesis
|
# Define 1D algorithm and hypothesis
|
||||||
algo1d = tetra.Segment()
|
algo1d = tetra.Segment()
|
||||||
algo1d.LocalLength(10)
|
algo1d.LocalLength(10)
|
||||||
|
|
||||||
# Define 2D hypothesis
|
# Define 2D algorithm and hypothesis
|
||||||
algo2d = tetra.Triangle()
|
algo2d = tetra.Triangle()
|
||||||
algo2d.LengthFromEdges()
|
algo2d.LengthFromEdges()
|
||||||
|
|
||||||
# Define 3D hypothesis
|
# Define 3D algorithm and hypothesis
|
||||||
algo3d = tetra.Tetrahedron()
|
algo3d = tetra.Tetrahedron()
|
||||||
algo3d.MaxElementVolume(100)
|
algo3d.MaxElementVolume(100)
|
||||||
|
|
||||||
# Compute the mesh
|
# Compute the mesh
|
||||||
tetra.Compute()
|
tetra.Compute()
|
||||||
|
|
||||||
# Create a groupe of faces
|
# Create a mesh group of all triangles generated on geom faces present in faces_group
|
||||||
tetra.Group(group)
|
group = tetra.Group(faces_group)
|
||||||
|
@ -19,4 +19,62 @@ aGroup1 = mesh.MakeGroupByIds("Area > 100", SMESH.FACE, anIds)
|
|||||||
aGroup2 = mesh.CreateEmptyGroup(SMESH.NODE, "all nodes")
|
aGroup2 = mesh.CreateEmptyGroup(SMESH.NODE, "all nodes")
|
||||||
aGroup2.AddFrom(mesh.mesh)
|
aGroup2.AddFrom(mesh.mesh)
|
||||||
|
|
||||||
|
|
||||||
|
# ====================================
|
||||||
|
# Various methods of the Group object
|
||||||
|
# ====================================
|
||||||
|
|
||||||
|
aGroup = mesh.CreateEmptyGroup(SMESH.NODE, "aGroup")
|
||||||
|
|
||||||
|
# set/get group name
|
||||||
|
aGroup.SetName( "new name" )
|
||||||
|
print "name", aGroup.GetName()
|
||||||
|
|
||||||
|
# get group type (type of entities in the group, SMESH.NODE in our case)
|
||||||
|
print "type", aGroup.GetType()
|
||||||
|
|
||||||
|
# get number of entities (nodes in our case) in the group
|
||||||
|
print "size", aGroup.Size()
|
||||||
|
|
||||||
|
# check of emptiness
|
||||||
|
print "is empty", aGroup.IsEmpty()
|
||||||
|
|
||||||
|
# check of presence of an entity in the group
|
||||||
|
aGroup.Add([1,2]) # method specific to the standalone group
|
||||||
|
print "contains node 2", aGroup.Contains(2)
|
||||||
|
|
||||||
|
# get an entity by index
|
||||||
|
print "1st node", aGroup.GetID(1)
|
||||||
|
|
||||||
|
# get all entities
|
||||||
|
print "all", aGroup.GetIDs()
|
||||||
|
|
||||||
|
# get number of nodes (actual for groups of elements)
|
||||||
|
print "nb nodes", aGroup.GetNumberOfNodes()
|
||||||
|
|
||||||
|
# get underlying nodes (actual for groups of elements)
|
||||||
|
print "nodes", aGroup.GetNodeIDs()
|
||||||
|
|
||||||
|
# set/get color
|
||||||
|
import SALOMEDS
|
||||||
|
aGroup.SetColor( SALOMEDS.Color(1.,1.,0.));
|
||||||
|
print "color", aGroup.GetColor()
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# methods specific to the standalone group and not present in GroupOnGeometry
|
||||||
|
# and GroupOnFilter
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# clear the group's contents
|
||||||
|
aGroup.Clear()
|
||||||
|
|
||||||
|
# add contents of other object (group, sub-mesh, filter)
|
||||||
|
aGroup.AddFrom( aGroup2 )
|
||||||
|
|
||||||
|
# removes entities
|
||||||
|
aGroup.Remove( [2,3,4] )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
salome.sg.updateObjBrowser(1)
|
salome.sg.updateObjBrowser(1)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Use 3D extrusion meshing algorithm
|
# Usage of 3D Extrusion meshing algorithm
|
||||||
|
|
||||||
import salome
|
import salome
|
||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
@ -58,7 +58,7 @@ mesh = smesh.Mesh( prisms )
|
|||||||
|
|
||||||
# assign Global hypotheses
|
# assign Global hypotheses
|
||||||
|
|
||||||
# 1D algorithm and hypothesis for vertical division
|
# 1D algorithm and hypothesis for division along the pipe
|
||||||
mesh.Segment().NumberOfSegments(15)
|
mesh.Segment().NumberOfSegments(15)
|
||||||
|
|
||||||
# Extrusion 3D algo
|
# Extrusion 3D algo
|
||||||
|
@ -30,8 +30,8 @@ SET(kernel_file "${KERNEL_ROOT_DIR}/bin/salome/prepare_generating_doc.py")
|
|||||||
|
|
||||||
SALOME_ACCUMULATE_ENVIRONMENT(SMESH_MeshersList NOCHECK ${DOC_SMESH_MeshersList})
|
SALOME_ACCUMULATE_ENVIRONMENT(SMESH_MeshersList NOCHECK ${DOC_SMESH_MeshersList})
|
||||||
|
|
||||||
SET(_cmd_options ${smesh_file} -d -o tmp1/smeshBuilder.py StdMeshers)
|
SET(_cmd_options ${smesh_file} -o tmp1/smeshBuilder.py StdMeshers)
|
||||||
SALOME_GENERATE_ENVIRONMENT_SCRIPT(_cmd env_script "${PYTHON_EXECUTABLE}" "${_cmd_options}")
|
SALOME_GENERATE_ENVIRONMENT_SCRIPT(_cmd env_script "${PYTHON_EXECUTABLE}" "${_cmd_options}")
|
||||||
|
|
||||||
ADD_CUSTOM_TARGET(usr_docs ${CMAKE_COMMAND} -E make_directory tmp1
|
ADD_CUSTOM_TARGET(usr_docs ${CMAKE_COMMAND} -E make_directory tmp1
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory tmp2
|
COMMAND ${CMAKE_COMMAND} -E make_directory tmp2
|
||||||
|
@ -7,49 +7,66 @@ be used for easy mesh creation and edition.
|
|||||||
|
|
||||||
Documentation for SALOME %Mesh module Python API is available in two forms:
|
Documentation for SALOME %Mesh module Python API is available in two forms:
|
||||||
- <a href="smeshpy_doc/modules.html">Structured documentation</a>, where all methods and
|
- <a href="smeshpy_doc/modules.html">Structured documentation</a>, where all methods and
|
||||||
classes are grouped by their functionality, like it is done in the GUI documentation
|
classes are grouped by their functionality.
|
||||||
- <a href="smeshpy_doc/namespaces.html">Linear documentation</a> grouped only by classes, declared
|
- <a href="smeshpy_doc/namespaces.html">Linear documentation</a> grouped only by classes, declared
|
||||||
in the \ref smeshBuilder and \ref StdMeshersBuilder Python packages.
|
in the \ref smeshBuilder and \ref StdMeshersBuilder Python packages.
|
||||||
|
|
||||||
\n With SALOME 7.2, the Python interface for %Mesh has been slightly modified to offer new functionality,
|
\n With SALOME 7.2, the Python interface for %Mesh has been slightly modified to offer new functionality.
|
||||||
\n You may have to modify your scripts generated with SALOME 6 or older versions.
|
\n You may have to modify your scripts generated with SALOME 6 or older versions.
|
||||||
\n Please see \ref smesh_migration_page
|
\n Please see \ref smesh_migration_page.
|
||||||
|
|
||||||
The SMESH python package contains helper functions to manipulate mesh elements and
|
|
||||||
interact with these elements.
|
|
||||||
|
|
||||||
Note that these functions either encapsulate the python programming interface of SMESH core
|
|
||||||
(the CORBA or SWIG interface for example) or extend existing utilities as the smesh.py module.
|
|
||||||
|
|
||||||
The functions are distributed in the python package \b salome.smesh.
|
|
||||||
|
|
||||||
\note
|
|
||||||
The main package \b salome contains other sub-packages that are distributed with the other
|
|
||||||
SALOME modules. For example, the KERNEL module provides the python package \b salome.kernel
|
|
||||||
and GEOM the package \b salome.geom.
|
|
||||||
|
|
||||||
Class \ref smeshBuilder.smeshBuilder "smeshBuilder" provides an interface to create and handle
|
Class \ref smeshBuilder.smeshBuilder "smeshBuilder" provides an interface to create and handle
|
||||||
meshes. It can be used to create an empty mesh or to import mesh from the data file.
|
meshes. It can be used to create an empty mesh or to import mesh from the data file.
|
||||||
|
|
||||||
Class \ref smeshstudytools.SMeshStudyTools "SMeshStudyTools" provides several methods to manipulate mesh objects in Salome study.
|
|
||||||
|
|
||||||
As soon as mesh is created, it is possible to manage it via its own
|
As soon as mesh is created, it is possible to manage it via its own
|
||||||
methods, described in class \ref smeshBuilder.Mesh "Mesh" documentation.
|
methods, described in class \ref smeshBuilder.Mesh "Mesh" documentation.
|
||||||
|
|
||||||
Class \ref smeshBuilder.Mesh "Mesh" allows assigning algorithms to a mesh.
|
Class \ref smeshstudytools.SMeshStudyTools "SMeshStudyTools" provides several methods to manipulate mesh objects in Salome study.
|
||||||
Please note that some algorithms, included in the standard SALOME
|
|
||||||
distribution are always available. Python package \ref StdMeshersBuilder "StdMeshersBuilder"
|
|
||||||
provides an interface for standard meshing algorithms included into
|
|
||||||
the SALOME %Mesh module distribution, like:
|
|
||||||
- REGULAR (1D)
|
|
||||||
- COMPOSITE (1D)
|
|
||||||
- MEFISTO (2D)
|
|
||||||
- Quadrangle (2D)
|
|
||||||
- Hexa(3D)
|
|
||||||
- etc ...
|
|
||||||
|
|
||||||
To add meshing hypotheses, it is possible to use the functions provided by the
|
A usual workflow to generate a mesh on geometry is following:
|
||||||
algorithms interfaces.
|
<ol>
|
||||||
|
<li>Create an instance of \ref smeshBuilder.smeshBuilder "smeshBuilder":
|
||||||
|
<pre>
|
||||||
|
from salome.smesh import smeshBuilder
|
||||||
|
smesh = smeshBuilder.New( salome.myStudy )
|
||||||
|
</pre></li>
|
||||||
|
<li>Create a \ref smeshBuilder.Mesh "mesh" object:
|
||||||
|
<pre>
|
||||||
|
mesh = \ref smeshBuilder.smeshBuilder.Mesh "smesh.Mesh( geometry )"
|
||||||
|
</pre></li>
|
||||||
|
<li> Create and assign \ref basic_meshing_algos_page "algorithms" by
|
||||||
|
calling corresponding methods of the mesh. If a sub-shape is
|
||||||
|
provided as an argument, a \ref constructing_submeshes_page "sub-mesh"
|
||||||
|
is implicitly created on this sub-shape:
|
||||||
|
<pre>
|
||||||
|
regular1D = \ref smeshBuilder.Mesh.Segment "mesh.Segment"()
|
||||||
|
mefisto = \ref smeshBuilder.Mesh.Triangle "mesh.Triangle"( smeshBuilder.MEFISTO )
|
||||||
|
# use other triangle algorithm on a face -- a sub-mesh appears in the mesh
|
||||||
|
netgen = \ref smeshBuilder.Mesh.Triangle "mesh.Triangle"( smeshBuilder.NETGEN_1D2D, face )
|
||||||
|
</pre></li>
|
||||||
|
<li> Create and assign \ref about_hypo_page "hypotheses" by calling
|
||||||
|
corresponding methods of algorithms:
|
||||||
|
<pre>
|
||||||
|
segLen10 = \ref StdMeshersBuilder.StdMeshersBuilder_Segment.LocalLength "regular1D.LocalLength"( 10. )
|
||||||
|
maxArea = \ref StdMeshersBuilder.StdMeshersBuilder_Segment.LocalLength "mefisto.MaxElementArea"( 100. )
|
||||||
|
netgen.SetMaxSize( 20. )
|
||||||
|
netgen.SetFineness( smeshBuilder.VeryCoarse )
|
||||||
|
</pre>
|
||||||
|
</li>
|
||||||
|
<li> \ref compute_anchor "Compute" the mesh (generate mesh nodes and elements):
|
||||||
|
<pre>
|
||||||
|
\ref Mesh.Compute "mesh.Compute"()
|
||||||
|
</pre>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
An easiest way to start with Python scripting is to do something in
|
||||||
|
GUI and then to get a corresponding Python script via
|
||||||
|
<b> File > Dump Study </b> menu item. Don't forget that you can get
|
||||||
|
all methods of any object in hand (e.g. a mesh group or a hypothesis)
|
||||||
|
by calling \a dir() Python built-in function.
|
||||||
|
|
||||||
|
All methods of the Mesh Group can be found in \ref tui_create_standalone_group sample script.
|
||||||
|
|
||||||
An example below demonstrates usage of the Python API for 3d mesh generation.
|
An example below demonstrates usage of the Python API for 3d mesh generation.
|
||||||
|
|
||||||
@ -61,19 +78,19 @@ Examples of Python scripts for Mesh operations are available by
|
|||||||
the following links:
|
the following links:
|
||||||
|
|
||||||
- \subpage tui_creating_meshes_page
|
- \subpage tui_creating_meshes_page
|
||||||
- \subpage tui_cartesian_algo
|
|
||||||
- \subpage tui_use_existing_faces
|
|
||||||
- \subpage tui_viewing_meshes_page
|
|
||||||
- \subpage tui_defining_hypotheses_page
|
- \subpage tui_defining_hypotheses_page
|
||||||
- \subpage tui_quality_controls_page
|
|
||||||
- \subpage tui_filters_page
|
|
||||||
- \subpage tui_grouping_elements_page
|
- \subpage tui_grouping_elements_page
|
||||||
|
- \subpage tui_filters_page
|
||||||
- \subpage tui_modifying_meshes_page
|
- \subpage tui_modifying_meshes_page
|
||||||
- \subpage tui_transforming_meshes_page
|
- \subpage tui_transforming_meshes_page
|
||||||
- \subpage tui_notebook_smesh_page
|
- \subpage tui_viewing_meshes_page
|
||||||
|
- \subpage tui_quality_controls_page
|
||||||
- \subpage tui_measurements_page
|
- \subpage tui_measurements_page
|
||||||
- \subpage tui_generate_flat_elements_page
|
|
||||||
- \subpage tui_work_on_objects_from_gui
|
- \subpage tui_work_on_objects_from_gui
|
||||||
|
- \subpage tui_notebook_smesh_page
|
||||||
|
- \subpage tui_cartesian_algo
|
||||||
|
- \subpage tui_use_existing_faces
|
||||||
- \subpage tui_prism_3d_algo
|
- \subpage tui_prism_3d_algo
|
||||||
|
- \subpage tui_generate_flat_elements_page
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -2,54 +2,50 @@
|
|||||||
|
|
||||||
\page tui_creating_meshes_page Creating Meshes
|
\page tui_creating_meshes_page Creating Meshes
|
||||||
|
|
||||||
|
\tableofcontents
|
||||||
|
|
||||||
\n First of all see \ref example_3d_mesh "Example of 3d mesh generation",
|
\n First of all see \ref example_3d_mesh "Example of 3d mesh generation",
|
||||||
which is an example of good python script style for Mesh module.
|
which is an example of good python script style for Mesh module.
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<h2>Construction of a Mesh</h2>
|
\section construction_of_a_mesh Construction of a mesh
|
||||||
\tui_script{creating_meshes_ex01.py}
|
\tui_script{creating_meshes_ex01.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_construction_submesh
|
\section tui_construction_submesh Construction of a sub-mesh
|
||||||
<h2>Construction of a Submesh</h2>
|
|
||||||
\tui_script{creating_meshes_ex02.py}
|
\tui_script{creating_meshes_ex02.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<h2>Change priority of submeshes in Mesh</h2>
|
\section change_priority_of_submeshes_in_mesh Change priority of sub-meshes in mesh
|
||||||
\tui_script{creating_meshes_ex03.py}
|
\tui_script{creating_meshes_ex03.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_editing_while_meshing
|
\section tui_editing_while_meshing Intermediate edition while meshing
|
||||||
<h2>Intermediate edition while meshing</h2>
|
|
||||||
\tui_script{a3DmeshOnModified2Dmesh.py}
|
\tui_script{a3DmeshOnModified2Dmesh.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_editing_mesh
|
\section tui_editing_mesh Editing a mesh
|
||||||
<h2>Editing a mesh</h2>
|
|
||||||
\tui_script{creating_meshes_ex04.py}
|
\tui_script{creating_meshes_ex04.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_export_mesh
|
\section tui_export_mesh Export of a Mesh
|
||||||
<h2>Export of a Mesh</h2>
|
|
||||||
\tui_script{creating_meshes_ex05.py}
|
\tui_script{creating_meshes_ex05.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<h2>How to mesh a cylinder with hexahedrons?</h2>
|
\section how_to_mesh_a_cylinder_with_hexahedrons How to mesh a cylinder with hexahedrons?
|
||||||
Here you can see an example of python script, creating a hexahedral
|
Here you can see an example of python script, creating a hexahedral
|
||||||
mesh on a cylinder. And a picture below the source code of the script,
|
mesh on a cylinder. A picture below the source code of the script
|
||||||
demonstrating the resulting mesh.
|
demonstrates the resulting mesh.
|
||||||
\tui_script{creating_meshes_ex06.py}
|
\tui_script{creating_meshes_ex06.py}
|
||||||
|
|
||||||
\image html mesh_cylinder_hexa.png
|
\image html mesh_cylinder_hexa.png
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_building_compound
|
\section tui_building_compound Building a compound of meshes
|
||||||
<h2>Building a compound of meshes</h2>
|
|
||||||
\tui_script{creating_meshes_ex07.py}
|
\tui_script{creating_meshes_ex07.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_copy_mesh
|
\section tui_copy_mesh Mesh Copying
|
||||||
<h2>Mesh Copying</h2>
|
|
||||||
\tui_script{creating_meshes_ex08.py}
|
\tui_script{creating_meshes_ex08.py}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -2,27 +2,24 @@
|
|||||||
|
|
||||||
\page tui_grouping_elements_page Grouping Elements
|
\page tui_grouping_elements_page Grouping Elements
|
||||||
|
|
||||||
|
\tableofcontents
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_create_standalone_group
|
\section tui_create_standalone_group Create a Standalone Group
|
||||||
<h2>Create a Standalone Group</h2>
|
|
||||||
\tui_script{grouping_elements_ex01.py}
|
\tui_script{grouping_elements_ex01.py}
|
||||||
|
|
||||||
\image html create_group.png
|
\image html create_group.png
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_create_group_on_geometry
|
\section tui_create_group_on_geometry Create a Group on Geometry
|
||||||
<h2>Create a Group on Geometry</h2>
|
|
||||||
\tui_script{grouping_elements_ex02.py}
|
\tui_script{grouping_elements_ex02.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_create_group_on_filter
|
\section tui_create_group_on_filter Create a Group on Filter
|
||||||
|
|
||||||
<h2>Create a Group on Filter</h2>
|
|
||||||
\tui_script{grouping_elements_ex03.py}
|
\tui_script{grouping_elements_ex03.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_edit_group
|
\section tui_edit_group Edit a Group
|
||||||
<h2>Edit a Group</h2>
|
|
||||||
\tui_script{grouping_elements_ex04.py}
|
\tui_script{grouping_elements_ex04.py}
|
||||||
|
|
||||||
\image html editing_groups1.png
|
\image html editing_groups1.png
|
||||||
@ -30,8 +27,7 @@
|
|||||||
\image html editing_groups2.png
|
\image html editing_groups2.png
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_union_of_groups
|
\section tui_union_of_groups Union of groups
|
||||||
<h2>Union of groups</h2>
|
|
||||||
\tui_script{grouping_elements_ex05.py}
|
\tui_script{grouping_elements_ex05.py}
|
||||||
|
|
||||||
\image html union_groups1.png
|
\image html union_groups1.png
|
||||||
@ -41,8 +37,7 @@
|
|||||||
\image html union_groups3.png
|
\image html union_groups3.png
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_intersection_of_groups
|
\section tui_intersection_of_groups Intersection of groups
|
||||||
<h2>Intersection of groups</h2>
|
|
||||||
\tui_script{grouping_elements_ex06.py}
|
\tui_script{grouping_elements_ex06.py}
|
||||||
|
|
||||||
\image html intersect_groups1.png
|
\image html intersect_groups1.png
|
||||||
@ -52,8 +47,7 @@
|
|||||||
\image html intersect_groups3.png
|
\image html intersect_groups3.png
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_cut_of_groups
|
\section tui_cut_of_groups Cut of groups
|
||||||
<h2>Cut of groups</h2>
|
|
||||||
\tui_script{grouping_elements_ex07.py}
|
\tui_script{grouping_elements_ex07.py}
|
||||||
|
|
||||||
\image html cut_groups1.png
|
\image html cut_groups1.png
|
||||||
@ -63,8 +57,7 @@
|
|||||||
\image html cut_groups3.png
|
\image html cut_groups3.png
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_create_dim_group
|
\section tui_create_dim_group Creating groups of entities from existing groups of superior dimensions
|
||||||
<h2>Creating groups of entities from existing groups of superior dimensions</h2>
|
|
||||||
\tui_script{grouping_elements_ex08.py}
|
\tui_script{grouping_elements_ex08.py}
|
||||||
|
|
||||||
\image html dimgroup_tui1.png
|
\image html dimgroup_tui1.png
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
|
|
||||||
\page tui_modifying_meshes_page Modifying Meshes
|
\page tui_modifying_meshes_page Modifying Meshes
|
||||||
|
|
||||||
|
\tableofcontents
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_adding_nodes_and_elements
|
\section tui_adding_nodes_and_elements Adding Nodes and Elements
|
||||||
<h2>Adding Nodes and Elements</h2>
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_add_node
|
\anchor tui_add_node
|
||||||
@ -57,8 +58,7 @@
|
|||||||
\tui_script{modifying_meshes_ex10.py}
|
\tui_script{modifying_meshes_ex10.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_removing_nodes_and_elements
|
\section tui_removing_nodes_and_elements Removing Nodes and Elements
|
||||||
<h2>Removing Nodes and Elements</h2>
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_removing_nodes
|
\anchor tui_removing_nodes
|
||||||
@ -76,73 +76,59 @@
|
|||||||
\tui_script{modifying_meshes_ex13.py}
|
\tui_script{modifying_meshes_ex13.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_renumbering_nodes_and_elements
|
\section tui_renumbering_nodes_and_elements Renumbering Nodes and Elements
|
||||||
<h2>Renumbering Nodes and Elements</h2>
|
|
||||||
\tui_script{modifying_meshes_ex14.py}
|
\tui_script{modifying_meshes_ex14.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_moving_nodes
|
\section tui_moving_nodes Moving Nodes
|
||||||
<h2>Moving Nodes</h2>
|
|
||||||
\tui_script{modifying_meshes_ex15.py}
|
\tui_script{modifying_meshes_ex15.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_diagonal_inversion
|
\section tui_diagonal_inversion Diagonal Inversion
|
||||||
<h2>Diagonal Inversion</h2>
|
|
||||||
\tui_script{modifying_meshes_ex16.py}
|
\tui_script{modifying_meshes_ex16.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_uniting_two_triangles
|
\section tui_uniting_two_triangles Uniting two Triangles
|
||||||
<h2>Uniting two Triangles</h2>
|
|
||||||
\tui_script{modifying_meshes_ex17.py}
|
\tui_script{modifying_meshes_ex17.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_uniting_set_of_triangles
|
\section tui_uniting_set_of_triangles Uniting a Set of Triangles
|
||||||
<h2>Uniting a Set of Triangles</h2>
|
|
||||||
\tui_script{modifying_meshes_ex18.py}
|
\tui_script{modifying_meshes_ex18.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_orientation
|
\section tui_orientation Orientation
|
||||||
<h2>Orientation</h2>
|
|
||||||
\tui_script{modifying_meshes_ex19.py}
|
\tui_script{modifying_meshes_ex19.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_cutting_quadrangles
|
\section tui_cutting_quadrangles Cutting Quadrangles
|
||||||
<h2>Cutting Quadrangles</h2>
|
|
||||||
\tui_script{modifying_meshes_ex20.py}
|
\tui_script{modifying_meshes_ex20.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_smoothing
|
\section tui_smoothing Smoothing
|
||||||
<h2>Smoothing</h2>
|
|
||||||
\tui_script{modifying_meshes_ex21.py}
|
\tui_script{modifying_meshes_ex21.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_extrusion
|
\section tui_extrusion Extrusion
|
||||||
<h2>Extrusion</h2>
|
|
||||||
\tui_script{modifying_meshes_ex22.py}
|
\tui_script{modifying_meshes_ex22.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_extrusion_along_path
|
\section tui_extrusion_along_path Extrusion along a Path
|
||||||
<h2>Extrusion along a Path</h2>
|
|
||||||
\tui_script{modifying_meshes_ex23.py}
|
\tui_script{modifying_meshes_ex23.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_revolution
|
\section tui_revolution Revolution
|
||||||
<h2>Revolution</h2>
|
|
||||||
\tui_script{modifying_meshes_ex24.py}
|
\tui_script{modifying_meshes_ex24.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_pattern_mapping
|
\section tui_pattern_mapping Pattern Mapping
|
||||||
<h2>Pattern Mapping</h2>
|
|
||||||
\tui_script{modifying_meshes_ex25.py}
|
\tui_script{modifying_meshes_ex25.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_quadratic
|
\section tui_quadratic Convert mesh to/from quadratic
|
||||||
<h2>Convert mesh to/from quadratic</h2>
|
|
||||||
\tui_script{modifying_meshes_ex26.py}
|
\tui_script{modifying_meshes_ex26.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_split_biquad
|
\section tui_split_biquad Split bi-quadratic into linear
|
||||||
<h2>Split bi-quadratic into linear</h2>
|
|
||||||
\tui_script{split_biquad.py}
|
\tui_script{split_biquad.py}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
\page tui_quality_controls_page Quality Controls
|
\page tui_quality_controls_page Quality Controls
|
||||||
|
|
||||||
|
\tableofcontents
|
||||||
|
|
||||||
\section tui_free_borders Free Borders
|
\section tui_free_borders Free Borders
|
||||||
\tui_script{quality_controls_ex01.py}
|
\tui_script{quality_controls_ex01.py}
|
||||||
|
|
||||||
|
@ -2,73 +2,58 @@
|
|||||||
|
|
||||||
\page tui_transforming_meshes_page Transforming Meshes
|
\page tui_transforming_meshes_page Transforming Meshes
|
||||||
|
|
||||||
<br><h2>Transforming Meshes</h2>
|
\tableofcontents
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_translation
|
\section tui_translation Translation
|
||||||
<h3>Translation</h3>
|
|
||||||
\tui_script{transforming_meshes_ex01.py}
|
\tui_script{transforming_meshes_ex01.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_rotation
|
\section tui_rotation Rotation
|
||||||
<h3>Rotation</h3>
|
|
||||||
\tui_script{transforming_meshes_ex02.py}
|
\tui_script{transforming_meshes_ex02.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_scale
|
\section tui_scale Scale
|
||||||
<h3>Scale</h3>
|
|
||||||
\tui_script{transforming_meshes_ex03.py}
|
\tui_script{transforming_meshes_ex03.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_symmetry
|
\section tui_symmetry Symmetry
|
||||||
<h3>Symmetry</h3>
|
|
||||||
\tui_script{transforming_meshes_ex04.py}
|
\tui_script{transforming_meshes_ex04.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_merging_nodes
|
\section tui_merging_nodes Merging Nodes
|
||||||
<h3>Merging Nodes</h3>
|
|
||||||
\tui_script{transforming_meshes_ex05.py}
|
\tui_script{transforming_meshes_ex05.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_merging_elements
|
\section tui_merging_elements Merging Elements
|
||||||
<h3>Merging Elements</h3>
|
|
||||||
\tui_script{transforming_meshes_ex06.py}
|
\tui_script{transforming_meshes_ex06.py}
|
||||||
|
|
||||||
<br><h2>Sewing Meshes</h2>
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_sew_meshes_border_to_side
|
\section tui_sew_meshes_border_to_side Sew Meshes Border to Side
|
||||||
<h3>Sew Meshes Border to Side</h3>
|
|
||||||
\tui_script{transforming_meshes_ex07.py}
|
\tui_script{transforming_meshes_ex07.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_sew_conform_free_borders
|
\section tui_sew_conform_free_borders Sew Conform Free Borders
|
||||||
<h3>Sew Conform Free Borders</h3>
|
|
||||||
\tui_script{transforming_meshes_ex08.py}
|
\tui_script{transforming_meshes_ex08.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_sew_free_borders
|
\section tui_sew_free_borders Sew Free Borders
|
||||||
<h3>Sew Free Borders</h3>
|
|
||||||
\tui_script{transforming_meshes_ex09.py}
|
\tui_script{transforming_meshes_ex09.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_sew_side_elements
|
\section tui_sew_side_elements Sew Side Elements
|
||||||
<h3>Sew Side Elements</h3>
|
|
||||||
\tui_script{transforming_meshes_ex10.py}
|
\tui_script{transforming_meshes_ex10.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_duplicate_nodes
|
\section tui_duplicate_nodes Duplicate nodes or/and elements
|
||||||
<h3>Duplicate nodes or/and elements</h3>
|
|
||||||
\tui_script{transforming_meshes_ex11.py}
|
\tui_script{transforming_meshes_ex11.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_make_2dmesh_from_3d
|
\section tui_make_2dmesh_from_3d Create boundary elements
|
||||||
<h3>Create boundary elements</h3>
|
|
||||||
\tui_script{transforming_meshes_ex12.py}
|
\tui_script{transforming_meshes_ex12.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_reorient_faces
|
\section tui_reorient_faces Reorient faces
|
||||||
<h3>Reorient faces</h3>
|
|
||||||
\tui_script{transforming_meshes_ex13.py}
|
\tui_script{transforming_meshes_ex13.py}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -6,7 +6,7 @@ It is sometimes useful to work alternatively in the GUI of SALOME and in the Pyt
|
|||||||
|
|
||||||
\code
|
\code
|
||||||
myMesh_ref = salome.IDToObject("ID")
|
myMesh_ref = salome.IDToObject("ID")
|
||||||
// were ID is the number that appears in the object browser in the Entry column
|
// were ID is the string looking like "0:1:2:3" that appears in the object browser in the Entry column
|
||||||
// ( If hidden show it by right clicking and checking the checkbox Entry)
|
// ( If hidden show it by right clicking and checking the checkbox Entry)
|
||||||
myMesh = smesh.Mesh(myMesh_ref)
|
myMesh = smesh.Mesh(myMesh_ref)
|
||||||
\endcode
|
\endcode
|
||||||
|
@ -74,7 +74,7 @@ module SMESH
|
|||||||
boolean Contains( in long elem_id );
|
boolean Contains( in long elem_id );
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Returns ID of an element at position <elem_index>
|
* Returns ID of an element at position <elem_index> counted from 1
|
||||||
*/
|
*/
|
||||||
long GetID( in long elem_index );
|
long GetID( in long elem_index );
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ void
|
|||||||
DriverMED_Family
|
DriverMED_Family
|
||||||
::AddElement(const SMDS_MeshElement* theElement)
|
::AddElement(const SMDS_MeshElement* theElement)
|
||||||
{
|
{
|
||||||
myElements.insert(theElement);
|
myElements.insert( myElements.end(), theElement );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -414,7 +414,7 @@ void DriverMED_Family::Init (SMESHDS_GroupBase* theGroup)
|
|||||||
SMDS_ElemIteratorPtr elemIt = theGroup->GetElements();
|
SMDS_ElemIteratorPtr elemIt = theGroup->GetElements();
|
||||||
while (elemIt->more())
|
while (elemIt->more())
|
||||||
{
|
{
|
||||||
myElements.insert(elemIt->next());
|
myElements.insert( myElements.end(), elemIt->next() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
|
@ -49,10 +49,10 @@
|
|||||||
#define REST_BALL_FAMILY -5
|
#define REST_BALL_FAMILY -5
|
||||||
#define FIRST_ELEM_FAMILY -6
|
#define FIRST_ELEM_FAMILY -6
|
||||||
|
|
||||||
typedef std::list<DriverMED_FamilyPtr > DriverMED_FamilyPtrList;
|
typedef std::list<DriverMED_FamilyPtr > DriverMED_FamilyPtrList;
|
||||||
typedef std::map<int,SMESHDS_SubMesh* > SMESHDS_SubMeshPtrMap;
|
typedef std::map<int,SMESHDS_SubMesh* > SMESHDS_SubMeshPtrMap;
|
||||||
typedef std::list<SMESHDS_GroupBase* > SMESHDS_GroupBasePtrList;
|
typedef std::list<SMESHDS_GroupBase* > SMESHDS_GroupBasePtrList;
|
||||||
typedef std::set<const SMDS_MeshElement* > ElementsSet;
|
typedef std::set<const SMDS_MeshElement*,TIDCompare > ElementsSet;
|
||||||
|
|
||||||
class MESHDRIVERMED_EXPORT DriverMED_Family
|
class MESHDRIVERMED_EXPORT DriverMED_Family
|
||||||
{
|
{
|
||||||
|
@ -976,8 +976,8 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
|
|||||||
}
|
}
|
||||||
if ( DriverMED::checkFamilyID ( aFamily, aFamNum, myFamilies )) {
|
if ( DriverMED::checkFamilyID ( aFamily, aFamNum, myFamilies )) {
|
||||||
// Save reference to this element from its family
|
// Save reference to this element from its family
|
||||||
myFamilies[aFamNum]->AddElement(anElement);
|
aFamily->AddElement(anElement);
|
||||||
myFamilies[aFamNum]->SetType(anElement->GetType());
|
aFamily->SetType(anElement->GetType());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // loop on aNbElems
|
} // loop on aNbElems
|
||||||
@ -1081,8 +1081,8 @@ void DriverMED_R_SMESHDS_Mesh::GetGroup(SMESHDS_Group* theGroup)
|
|||||||
DriverMED_FamilyPtr aFamily = (*aFamsIter).second;
|
DriverMED_FamilyPtr aFamily = (*aFamsIter).second;
|
||||||
if (aFamily->GetTypes().count( theGroup->GetType() ) && aFamily->MemberOf(aGroupName))
|
if (aFamily->GetTypes().count( theGroup->GetType() ) && aFamily->MemberOf(aGroupName))
|
||||||
{
|
{
|
||||||
const set<const SMDS_MeshElement *>& anElements = aFamily->GetElements();
|
const ElementsSet& anElements = aFamily->GetElements();
|
||||||
set<const SMDS_MeshElement *>::const_iterator anElemsIter = anElements.begin();
|
ElementsSet::const_iterator anElemsIter = anElements.begin();
|
||||||
for (; anElemsIter != anElements.end(); anElemsIter++)
|
for (; anElemsIter != anElements.end(); anElemsIter++)
|
||||||
{
|
{
|
||||||
const SMDS_MeshElement * element = *anElemsIter;
|
const SMDS_MeshElement * element = *anElemsIter;
|
||||||
@ -1110,8 +1110,8 @@ void DriverMED_R_SMESHDS_Mesh::GetSubMesh (SMESHDS_SubMesh* theSubMesh,
|
|||||||
DriverMED_FamilyPtr aFamily = (*aFamsIter).second;
|
DriverMED_FamilyPtr aFamily = (*aFamsIter).second;
|
||||||
if (aFamily->MemberOf(aName))
|
if (aFamily->MemberOf(aName))
|
||||||
{
|
{
|
||||||
const set<const SMDS_MeshElement *>& anElements = aFamily->GetElements();
|
const ElementsSet& anElements = aFamily->GetElements();
|
||||||
set<const SMDS_MeshElement *>::const_iterator anElemsIter = anElements.begin();
|
ElementsSet::const_iterator anElemsIter = anElements.begin();
|
||||||
if (aFamily->GetType() == SMDSAbs_Node)
|
if (aFamily->GetType() == SMDSAbs_Node)
|
||||||
{
|
{
|
||||||
for (; anElemsIter != anElements.end(); anElemsIter++)
|
for (; anElemsIter != anElements.end(); anElemsIter++)
|
||||||
@ -1146,14 +1146,13 @@ void DriverMED_R_SMESHDS_Mesh::CreateAllSubMeshes ()
|
|||||||
if (aName.substr(0, 7) == string("SubMesh"))
|
if (aName.substr(0, 7) == string("SubMesh"))
|
||||||
{
|
{
|
||||||
int Id = atoi(string(aName).substr(7).c_str());
|
int Id = atoi(string(aName).substr(7).c_str());
|
||||||
set<const SMDS_MeshElement *> anElements = aFamily->GetElements();
|
const ElementsSet& anElements = aFamily->GetElements();
|
||||||
set<const SMDS_MeshElement *>::iterator anElemsIter = anElements.begin();
|
ElementsSet::const_iterator anElemsIter = anElements.begin();
|
||||||
if (aFamily->GetType() == SMDSAbs_Node)
|
if (aFamily->GetType() == SMDSAbs_Node)
|
||||||
{
|
{
|
||||||
for (; anElemsIter != anElements.end(); anElemsIter++)
|
for (; anElemsIter != anElements.end(); anElemsIter++)
|
||||||
{
|
{
|
||||||
SMDS_MeshNode* node = const_cast<SMDS_MeshNode*>
|
const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( *anElemsIter );
|
||||||
( static_cast<const SMDS_MeshNode*>( *anElemsIter ));
|
|
||||||
// find out a shape type
|
// find out a shape type
|
||||||
TopoDS_Shape aShape = myMesh->IndexToShape( Id );
|
TopoDS_Shape aShape = myMesh->IndexToShape( Id );
|
||||||
int aShapeType = ( aShape.IsNull() ? -1 : aShape.ShapeType() );
|
int aShapeType = ( aShape.IsNull() ? -1 : aShape.ShapeType() );
|
||||||
|
@ -254,7 +254,6 @@ namespace
|
|||||||
const SMDSAbs_ElementType anElemType)
|
const SMDSAbs_ElementType anElemType)
|
||||||
{
|
{
|
||||||
anElemFamMap.Clear();
|
anElemFamMap.Clear();
|
||||||
//anElemFamMap.clear();
|
|
||||||
list<DriverMED_FamilyPtr>::iterator aFamsIter = aFamilies.begin();
|
list<DriverMED_FamilyPtr>::iterator aFamsIter = aFamilies.begin();
|
||||||
while ( aFamsIter != aFamilies.end() )
|
while ( aFamsIter != aFamilies.end() )
|
||||||
{
|
{
|
||||||
@ -263,12 +262,11 @@ namespace
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int aFamId = (*aFamsIter)->GetId();
|
int aFamId = (*aFamsIter)->GetId();
|
||||||
const set<const SMDS_MeshElement *>& anElems = (*aFamsIter)->GetElements();
|
const ElementsSet& anElems = (*aFamsIter)->GetElements();
|
||||||
set<const SMDS_MeshElement *>::const_iterator anElemsIter = anElems.begin();
|
ElementsSet::const_iterator anElemsIter = anElems.begin();
|
||||||
for (; anElemsIter != anElems.end(); anElemsIter++)
|
for (; anElemsIter != anElems.end(); anElemsIter++)
|
||||||
{
|
{
|
||||||
anElemFamMap.Bind( (Standard_Address)*anElemsIter, aFamId );
|
anElemFamMap.Bind( (Standard_Address)*anElemsIter, aFamId );
|
||||||
//anElemFamMap[*anElemsIter] = aFamId;
|
|
||||||
}
|
}
|
||||||
// remove a family from the list
|
// remove a family from the list
|
||||||
aFamilies.erase( aFamsIter++ );
|
aFamilies.erase( aFamsIter++ );
|
||||||
@ -288,9 +286,7 @@ namespace
|
|||||||
{
|
{
|
||||||
if ( anElemFamMap.IsBound( (Standard_Address) anElement ))
|
if ( anElemFamMap.IsBound( (Standard_Address) anElement ))
|
||||||
return anElemFamMap( (Standard_Address) anElement );
|
return anElemFamMap( (Standard_Address) anElement );
|
||||||
// TElemFamilyMap::iterator elem_famNum = anElemFamMap.find( anElement );
|
|
||||||
// if ( elem_famNum != anElemFamMap.end() )
|
|
||||||
// return elem_famNum->second;
|
|
||||||
return aDefaultFamilyId;
|
return aDefaultFamilyId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,8 +232,8 @@ void SMESH_VisualObjDef::createPoints( vtkPoints* thePoints )
|
|||||||
{
|
{
|
||||||
thePoints->SetPoint( nbPoints, aNode->X(), aNode->Y(), aNode->Z() );
|
thePoints->SetPoint( nbPoints, aNode->X(), aNode->Y(), aNode->Z() );
|
||||||
int anId = aNode->GetID();
|
int anId = aNode->GetID();
|
||||||
mySMDS2VTKNodes.insert( TMapOfIds::value_type( anId, nbPoints ) );
|
mySMDS2VTKNodes.insert( mySMDS2VTKNodes.end(), std::make_pair( anId, nbPoints ));
|
||||||
myVTK2SMDSNodes.insert( TMapOfIds::value_type( nbPoints, anId ) );
|
myVTK2SMDSNodes.insert( myVTK2SMDSNodes.end(), std::make_pair( nbPoints, anId ));
|
||||||
nbPoints++;
|
nbPoints++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -251,48 +251,48 @@ void SMESH_VisualObjDef::buildPrs(bool buildGrid)
|
|||||||
MESSAGE("----------------------------------------------------------SMESH_VisualObjDef::buildPrs " << buildGrid);
|
MESSAGE("----------------------------------------------------------SMESH_VisualObjDef::buildPrs " << buildGrid);
|
||||||
if (buildGrid)
|
if (buildGrid)
|
||||||
{
|
{
|
||||||
myLocalGrid = true;
|
myLocalGrid = true;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
mySMDS2VTKNodes.clear();
|
mySMDS2VTKNodes.clear();
|
||||||
myVTK2SMDSNodes.clear();
|
myVTK2SMDSNodes.clear();
|
||||||
mySMDS2VTKElems.clear();
|
mySMDS2VTKElems.clear();
|
||||||
myVTK2SMDSElems.clear();
|
myVTK2SMDSElems.clear();
|
||||||
|
|
||||||
if ( IsNodePrs() )
|
if ( IsNodePrs() )
|
||||||
buildNodePrs();
|
buildNodePrs();
|
||||||
else
|
else
|
||||||
buildElemPrs();
|
buildElemPrs();
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
mySMDS2VTKNodes.clear();
|
mySMDS2VTKNodes.clear();
|
||||||
myVTK2SMDSNodes.clear();
|
myVTK2SMDSNodes.clear();
|
||||||
mySMDS2VTKElems.clear();
|
mySMDS2VTKElems.clear();
|
||||||
myVTK2SMDSElems.clear();
|
myVTK2SMDSElems.clear();
|
||||||
|
|
||||||
myGrid->SetPoints( 0 );
|
myGrid->SetPoints( 0 );
|
||||||
myGrid->SetCells( 0, 0, 0, 0, 0 );
|
myGrid->SetCells( 0, 0, 0, 0, 0 );
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
myLocalGrid = false;
|
myLocalGrid = false;
|
||||||
if (!GetMesh()->isCompacted())
|
if (!GetMesh()->isCompacted())
|
||||||
{
|
{
|
||||||
MESSAGE("*** buildPrs ==> compactMesh!");
|
MESSAGE("*** buildPrs ==> compactMesh!");
|
||||||
GetMesh()->compactMesh();
|
GetMesh()->compactMesh();
|
||||||
}
|
}
|
||||||
vtkUnstructuredGrid *theGrid = GetMesh()->getGrid();
|
vtkUnstructuredGrid *theGrid = GetMesh()->getGrid();
|
||||||
updateEntitiesFlags();
|
updateEntitiesFlags();
|
||||||
myGrid->ShallowCopy(theGrid);
|
myGrid->ShallowCopy(theGrid);
|
||||||
//MESSAGE(myGrid->GetReferenceCount());
|
//MESSAGE(myGrid->GetReferenceCount());
|
||||||
//MESSAGE( "Update - myGrid->GetNumberOfCells() = "<<myGrid->GetNumberOfCells() );
|
//MESSAGE( "Update - myGrid->GetNumberOfCells() = "<<myGrid->GetNumberOfCells() );
|
||||||
//MESSAGE( "Update - myGrid->GetNumberOfPoints() = "<<myGrid->GetNumberOfPoints() );
|
//MESSAGE( "Update - myGrid->GetNumberOfPoints() = "<<myGrid->GetNumberOfPoints() );
|
||||||
if( MYDEBUGWITHFILES ) {
|
if( MYDEBUGWITHFILES ) {
|
||||||
SMESH::WriteUnstructuredGrid( myGrid,"myPrs.vtu" );
|
SMESH::WriteUnstructuredGrid( myGrid,"myPrs.vtu" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -454,8 +454,8 @@ void SMESH_VisualObjDef::buildElemPrs()
|
|||||||
|
|
||||||
int anId = anElem->GetID();
|
int anId = anElem->GetID();
|
||||||
|
|
||||||
mySMDS2VTKElems.insert( TMapOfIds::value_type( anId, iElem ) );
|
mySMDS2VTKElems.insert( mySMDS2VTKElems.end(), std::make_pair( anId, iElem ));
|
||||||
myVTK2SMDSElems.insert( TMapOfIds::value_type( iElem, anId ) );
|
myVTK2SMDSElems.insert( myVTK2SMDSElems.end(), std::make_pair( iElem, anId ));
|
||||||
|
|
||||||
SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
|
SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
|
||||||
{
|
{
|
||||||
@ -986,7 +986,7 @@ static int getNodesFromElems( SMESH::long_array_var& theElemIds,
|
|||||||
// function : getPointers
|
// function : getPointers
|
||||||
// purpose : Get std::list<const SMDS_MeshElement*> from list of IDs
|
// purpose : Get std::list<const SMDS_MeshElement*> from list of IDs
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
static int getPointers( const SMDSAbs_ElementType theRequestType,
|
static int getPointers( const SMDSAbs_ElementType theRequestType,
|
||||||
SMESH::long_array_var& theElemIds,
|
SMESH::long_array_var& theElemIds,
|
||||||
const SMDS_Mesh* theMesh,
|
const SMDS_Mesh* theMesh,
|
||||||
std::list<const SMDS_MeshElement*>& theResList )
|
std::list<const SMDS_MeshElement*>& theResList )
|
||||||
|
@ -2275,7 +2275,7 @@ void SMESHDS_Mesh::compactMesh()
|
|||||||
int newSmdsId = 0;
|
int newSmdsId = 0;
|
||||||
for (int i = 0; i < myCellsSize; i++)
|
for (int i = 0; i < myCellsSize; i++)
|
||||||
{
|
{
|
||||||
if (myCells[i])
|
if ( myCells[i] )
|
||||||
{
|
{
|
||||||
newSmdsId++; // SMDS id start to 1
|
newSmdsId++; // SMDS id start to 1
|
||||||
assert(newSmdsId <= newCellSize);
|
assert(newSmdsId <= newCellSize);
|
||||||
|
@ -2320,6 +2320,7 @@ GrpComputor::GrpComputor( SMESH::SMESH_GroupBase_ptr grp,
|
|||||||
void GrpComputor::compute()
|
void GrpComputor::compute()
|
||||||
{
|
{
|
||||||
if ( !CORBA::is_nil( myGroup ) && myItem ) {
|
if ( !CORBA::is_nil( myGroup ) && myItem ) {
|
||||||
|
SUIT_OverrideCursor wc;
|
||||||
QTreeWidgetItem* item = myItem;
|
QTreeWidgetItem* item = myItem;
|
||||||
myItem = 0;
|
myItem = 0;
|
||||||
int nb = myToComputeSize ? myGroup->Size() : myGroup->GetNumberOfNodes();
|
int nb = myToComputeSize ? myGroup->Size() : myGroup->GetNumberOfNodes();
|
||||||
|
@ -920,7 +920,7 @@ void SMESH_PreMeshInfo::readSubMeshes(DriverMED_R_SMESHDS_Mesh* reader) const
|
|||||||
#endif
|
#endif
|
||||||
nbElems = elemSet.size();
|
nbElems = elemSet.size();
|
||||||
}
|
}
|
||||||
// add elements to submeshes
|
// add elements to sub-meshes
|
||||||
TIDSortedElemSet::iterator iE = elemSet.begin();
|
TIDSortedElemSet::iterator iE = elemSet.begin();
|
||||||
for ( size_t i = 0; i < nbElems; ++i, ++iE )
|
for ( size_t i = 0; i < nbElems; ++i, ++iE )
|
||||||
{
|
{
|
||||||
|
@ -1100,7 +1100,7 @@ class StdMeshersBuilder_Prism3D(Mesh_Algorithm):
|
|||||||
|
|
||||||
pass # end of StdMeshersBuilder_Prism3D class
|
pass # end of StdMeshersBuilder_Prism3D class
|
||||||
|
|
||||||
## Defines a Prism 3D algorithm
|
## Defines Radial Prism 3D algorithm
|
||||||
#
|
#
|
||||||
# It is created by calling smeshBuilder.Mesh.Prism(geom=0)
|
# It is created by calling smeshBuilder.Mesh.Prism(geom=0)
|
||||||
#
|
#
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
## @{
|
## @{
|
||||||
## @defgroup l3_algos_basic Basic meshing algorithms
|
## @defgroup l3_algos_basic Basic meshing algorithms
|
||||||
## @defgroup l3_algos_proj Projection Algorithms
|
## @defgroup l3_algos_proj Projection Algorithms
|
||||||
## @defgroup l3_algos_radialp Radial Prism
|
|
||||||
## @defgroup l3_algos_segmarv Segments around Vertex
|
## @defgroup l3_algos_segmarv Segments around Vertex
|
||||||
## @defgroup l3_algos_3dextr 3D extrusion meshing algorithm
|
## @defgroup l3_algos_3dextr 3D extrusion meshing algorithm
|
||||||
|
|
||||||
@ -70,10 +69,9 @@
|
|||||||
## @defgroup l2_modif_trsf Transforming meshes (Translation, Rotation, Symmetry, Sewing, Merging)
|
## @defgroup l2_modif_trsf Transforming meshes (Translation, Rotation, Symmetry, Sewing, Merging)
|
||||||
## @defgroup l2_modif_movenode Moving nodes
|
## @defgroup l2_modif_movenode Moving nodes
|
||||||
## @defgroup l2_modif_throughp Mesh through point
|
## @defgroup l2_modif_throughp Mesh through point
|
||||||
## @defgroup l2_modif_invdiag Diagonal inversion of elements
|
|
||||||
## @defgroup l2_modif_unitetri Uniting triangles
|
## @defgroup l2_modif_unitetri Uniting triangles
|
||||||
## @defgroup l2_modif_changori Changing orientation of elements
|
|
||||||
## @defgroup l2_modif_cutquadr Cutting elements
|
## @defgroup l2_modif_cutquadr Cutting elements
|
||||||
|
## @defgroup l2_modif_changori Changing orientation of elements
|
||||||
## @defgroup l2_modif_smooth Smoothing
|
## @defgroup l2_modif_smooth Smoothing
|
||||||
## @defgroup l2_modif_extrurev Extrusion and Revolution
|
## @defgroup l2_modif_extrurev Extrusion and Revolution
|
||||||
## @defgroup l2_modif_patterns Pattern mapping
|
## @defgroup l2_modif_patterns Pattern mapping
|
||||||
@ -310,9 +308,9 @@ engine = None
|
|||||||
doLcc = False
|
doLcc = False
|
||||||
created = False
|
created = False
|
||||||
|
|
||||||
## This class allows to create, load or manipulate meshes
|
## This class allows to create, load or manipulate meshes.
|
||||||
# It has a set of methods to create load or copy meshes, to combine several meshes.
|
# It has a set of methods to create, load or copy meshes, to combine several meshes, etc.
|
||||||
# It also has methods to get infos on meshes.
|
# It also has methods to get infos and measure meshes.
|
||||||
class smeshBuilder(object, SMESH._objref_SMESH_Gen):
|
class smeshBuilder(object, SMESH._objref_SMESH_Gen):
|
||||||
|
|
||||||
# MirrorType enumeration
|
# MirrorType enumeration
|
||||||
@ -614,6 +612,7 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen):
|
|||||||
# @param allGroups forces creation of groups corresponding to every input mesh
|
# @param allGroups forces creation of groups corresponding to every input mesh
|
||||||
# @param name name of a new mesh
|
# @param name name of a new mesh
|
||||||
# @return an instance of Mesh class
|
# @return an instance of Mesh class
|
||||||
|
# @ingroup l2_compounds
|
||||||
def Concatenate( self, meshes, uniteIdenticalGroups,
|
def Concatenate( self, meshes, uniteIdenticalGroups,
|
||||||
mergeNodesAndElements = False, mergeTolerance = 1e-5, allGroups = False,
|
mergeNodesAndElements = False, mergeTolerance = 1e-5, allGroups = False,
|
||||||
name = ""):
|
name = ""):
|
||||||
@ -1162,7 +1161,7 @@ omniORB.registerObjref(SMESH._objref_SMESH_Gen._NP_RepositoryId, smeshBuilder)
|
|||||||
# import salome
|
# import salome
|
||||||
# salome.salome_init()
|
# salome.salome_init()
|
||||||
# from salome.smesh import smeshBuilder
|
# from salome.smesh import smeshBuilder
|
||||||
# smesh = smeshBuilder.New(theStudy)
|
# smesh = smeshBuilder.New(salome.myStudy)
|
||||||
# \endcode
|
# \endcode
|
||||||
# @param study SALOME study, generally obtained by salome.myStudy.
|
# @param study SALOME study, generally obtained by salome.myStudy.
|
||||||
# @param instance CORBA proxy of SMESH Engine. If None, the default Engine is used.
|
# @param instance CORBA proxy of SMESH Engine. If None, the default Engine is used.
|
||||||
@ -1177,7 +1176,7 @@ def New( study, instance=None):
|
|||||||
import salome
|
import salome
|
||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
from salome.smesh import smeshBuilder
|
from salome.smesh import smeshBuilder
|
||||||
smesh = smeshBuilder.New(theStudy)
|
smesh = smeshBuilder.New(salome.myStudy)
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
study SALOME study, generally obtained by salome.myStudy.
|
study SALOME study, generally obtained by salome.myStudy.
|
||||||
@ -2153,7 +2152,7 @@ class Mesh:
|
|||||||
|
|
||||||
##
|
##
|
||||||
# Create a standalone group of entities basing on nodes of other groups.
|
# Create a standalone group of entities basing on nodes of other groups.
|
||||||
# \param groups - list of groups, sub-meshes or filters, of any type.
|
# \param groups - list of reference groups, sub-meshes or filters, of any type.
|
||||||
# \param elemType - a type of elements to include to the new group; either of
|
# \param elemType - a type of elements to include to the new group; either of
|
||||||
# (SMESH.NODE, SMESH.EDGE, SMESH.FACE, SMESH.VOLUME).
|
# (SMESH.NODE, SMESH.EDGE, SMESH.FACE, SMESH.VOLUME).
|
||||||
# \param name - a name of the new group.
|
# \param name - a name of the new group.
|
||||||
@ -2165,7 +2164,10 @@ class Mesh:
|
|||||||
# - SMESH.AT_LEAST_ONE - include if one or more node is common,
|
# - SMESH.AT_LEAST_ONE - include if one or more node is common,
|
||||||
# - SMEHS.MAJORITY - include if half of nodes or more are common.
|
# - SMEHS.MAJORITY - include if half of nodes or more are common.
|
||||||
# \param underlyingOnly - if \c True (default), an element is included to the
|
# \param underlyingOnly - if \c True (default), an element is included to the
|
||||||
# new group provided that it is based on nodes of one element of \a groups.
|
# new group provided that it is based on nodes of an element of \a groups;
|
||||||
|
# in this case the reference \a groups are supposed to be of higher dimension
|
||||||
|
# than \a elemType, which can be useful for example to get all faces lying on
|
||||||
|
# volumes of the reference \a groups.
|
||||||
# @return an instance of SMESH_Group
|
# @return an instance of SMESH_Group
|
||||||
# @ingroup l2_grps_operon
|
# @ingroup l2_grps_operon
|
||||||
def CreateDimGroup(self, groups, elemType, name,
|
def CreateDimGroup(self, groups, elemType, name,
|
||||||
@ -2176,7 +2178,7 @@ class Mesh:
|
|||||||
|
|
||||||
|
|
||||||
## Convert group on geom into standalone group
|
## Convert group on geom into standalone group
|
||||||
# @ingroup l2_grps_delete
|
# @ingroup l2_grps_edit
|
||||||
def ConvertToStandalone(self, group):
|
def ConvertToStandalone(self, group):
|
||||||
return self.mesh.ConvertToStandalone(group)
|
return self.mesh.ConvertToStandalone(group)
|
||||||
|
|
||||||
@ -3073,7 +3075,7 @@ class Mesh:
|
|||||||
# @param NodeID1 the ID of the first node
|
# @param NodeID1 the ID of the first node
|
||||||
# @param NodeID2 the ID of the second node
|
# @param NodeID2 the ID of the second node
|
||||||
# @return false if proper faces were not found
|
# @return false if proper faces were not found
|
||||||
# @ingroup l2_modif_invdiag
|
# @ingroup l2_modif_cutquadr
|
||||||
def InverseDiag(self, NodeID1, NodeID2):
|
def InverseDiag(self, NodeID1, NodeID2):
|
||||||
return self.editor.InverseDiag(NodeID1, NodeID2)
|
return self.editor.InverseDiag(NodeID1, NodeID2)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user