X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=doc%2Fsalome%2Fgui%2FSMESH%2Finput%2Ftui_creating_meshes.doc;h=53ad3f8a44dd61dbe5bb2cb6a46b57ff326a54fc;hp=f174e863ff0527f4acb00e93d6e02ab7a83d7d16;hb=62336a394b80b503991ff801f2ebf7feff47e7f0;hpb=79b1ac2b6df9117f16f11d444b1f165d477a1813 diff --git a/doc/salome/gui/SMESH/input/tui_creating_meshes.doc b/doc/salome/gui/SMESH/input/tui_creating_meshes.doc index f174e863f..53ad3f8a4 100644 --- a/doc/salome/gui/SMESH/input/tui_creating_meshes.doc +++ b/doc/salome/gui/SMESH/input/tui_creating_meshes.doc @@ -2,183 +2,50 @@ \page tui_creating_meshes_page Creating Meshes -\n First of all see \ref introduction_to_mesh_python_page "Example of 3d mesh generation", +\tableofcontents + +\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.
-

Construction of a Mesh

- -\code -import geompy -import smesh - -# create a box -box = geompy.MakeBox(0., 0., 0., 100., 200., 300.) -idbox = geompy.addToStudy(box, "box") - -# create a mesh -tetra = smesh.Mesh(box, "MeshBox") - -algo1D = tetra.Segment() -algo1D.NumberOfSegments(7) - -algo2D = tetra.Triangle() -algo2D.MaxElementArea(800.) - -algo3D = tetra.Tetrahedron(smesh.NETGEN) -algo3D.MaxElementVolume(900.) - -# compute the mesh -ret = tetra.Compute() -if ret == 0: - print "problem when computing the mesh" -else: - print "mesh computed" - pass -\endcode +\section construction_of_a_mesh Construction of a mesh +\tui_script{creating_meshes_ex01.py}
-\anchor tui_construction_submesh -

Construction of a Submesh

- -\code -from geompy import * -import smesh - -# create a box -box = MakeBoxDXDYDZ(10., 10., 10.) -addToStudy(box, "Box") - -# select one edge of the box for definition of a local hypothesis -p5 = MakeVertex(5., 0., 0.) -EdgeX = GetEdgeNearPoint(box, p5) -addToStudyInFather(box, EdgeX, "Edge [0,0,0 - 10,0,0]") - -# create a hexahedral mesh on the box -quadra = smesh.Mesh(box, "Box : quadrangle 2D mesh") - -# create a regular 1D algorithm for the faces -algo1D = quadra.Segment() - -# define "NumberOfSegments" hypothesis to cut -# all the edges in a fixed number of segments -algo1D.NumberOfSegments(4) - -# create a quadrangle 2D algorithm for the faces -quadra.Quadrangle() - -# construct a submesh on the edge with a local hypothesis -algo_local = quadra.Segment(EdgeX) - -# define "Arithmetic1D" hypothesis to cut the edge in several segments with increasing arithmetic length -algo_local.Arithmetic1D(1, 4) - -# define "Propagation" hypothesis that propagates all other hypotheses -# on all edges of the opposite side in case of quadrangular faces -algo_local.Propagation() - -# compute the mesh -quadra.Compute() - -\endcode +\section tui_construction_submesh Construction of a sub-mesh +\tui_script{creating_meshes_ex02.py}
-\anchor tui_editing_mesh -

Editing of a mesh

- -\code -import geompy -import smesh - -def PrintMeshInfo(theMesh): - aMesh = theMesh.GetMesh() - print "Information about mesh:" - print "Number of nodes : ", aMesh.NbNodes() - print "Number of edges : ", aMesh.NbEdges() - print "Number of faces : ", aMesh.NbFaces() - print "Number of volumes : ", aMesh.NbVolumes() - pass - -# create a box -box = geompy.MakeBox(0., 0., 0., 20., 20., 20.) -geompy.addToStudy(box, "box") - -# select one edge of the box for definition of a local hypothesis -subShapeList = geompy.SubShapeAll(box, geompy.ShapeType["EDGE"]) -edge = subShapeList[0] -name = geompy.SubShapeName(edge, box) -geompy.addToStudyInFather(box, edge, name) - -# create a mesh -tria = smesh.Mesh(box, "Mesh 2D") -algo1D = tria.Segment() -hyp1 = algo1D.NumberOfSegments(3) -algo2D = tria.Triangle() -hyp2 = algo2D.MaxElementArea(10.) - -# create a sub-mesh -algo_local = tria.Segment(edge) -hyp3 = algo_local.Arithmetic1D(1, 6) -hyp4 = algo_local.Propagation() - -# compute the mesh -tria.Compute() -PrintMeshInfo(tria) - -# remove a local hypothesis -mesh = tria.GetMesh() -mesh.RemoveHypothesis(edge, hyp4) - -# compute the mesh -tria.Compute() -PrintMeshInfo(tria) - -# change the value of the 2D hypothesis -hyp2.SetMaxElementArea(2.) - -# compute the mesh -tria.Compute() -PrintMeshInfo(tria) -\endcode +\section change_priority_of_submeshes_in_mesh Change priority of sub-meshes in mesh +\tui_script{creating_meshes_ex03.py}
-\anchor tui_export_mesh -

Export of a Mesh

- -\code -import geompy -import smesh - -# create a box -box = geompy.MakeBox(0., 0., 0., 100., 200., 300.) -idbox = geompy.addToStudy(box, "box") +\section tui_editing_while_meshing Intermediate edition while meshing +\tui_script{a3DmeshOnModified2Dmesh.py} -# create a mesh -tetra = smesh.Mesh(box, "MeshBox") - -algo1D = tetra.Segment() -algo1D.NumberOfSegments(7) - -algo2D = tetra.Triangle() -algo2D.MaxElementArea(800.) - -algo3D = tetra.Tetrahedron(smesh.NETGEN) -algo3D.MaxElementVolume(900.) - -# compute the mesh -tetra.Compute() +
+\section tui_editing_mesh Editing a mesh (i.e. changing hypotheses) +\tui_script{creating_meshes_ex04.py} -# export the mesh in a MED file -tetra.ExportMED("/tmp/meshMED.med", 0) -\endcode +
+\section tui_export_mesh Export of a Mesh +\tui_script{creating_meshes_ex05.py}
-

How to mesh a cylinder with hexahedrons?

+\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 -mesh on a cylinder. And a picture below the source code of the script, -demonstrating the resulting mesh. -\include ex24_cylinder.py +mesh on a cylinder. A picture below the source code of the script +demonstrates the resulting mesh. +\tui_script{creating_meshes_ex06.py} \image html mesh_cylinder_hexa.png +
+\section tui_building_compound Building a compound of meshes +\tui_script{creating_meshes_ex07.py} + +
+\section tui_copy_mesh Mesh Copying +\tui_script{creating_meshes_ex08.py} + */